2006-04-04 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2
3         * constant.cs (Constant.IsDefaultInitializer): New method.
4
5         * class.cs: Updated.
6
7         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8         re-initialize default values. It saves KBs almost for every assembly.
9         Thanks Zoltan for the idea.
10         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
11         (ArrayCreation.DoResolve): Resolve only once.
12         (ArrayCreation.Emit): Emit static initializer only when it is faster.
13         (ArrayCreation.GetAttributableValue): Cope with optimized values.
14
15 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
16
17         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
18         From #77961.
19
20 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
21
22         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
23         in an embedded statement too.
24
25 2006-04-01  Raja R Harinath  <rharinath@novell.com>
26
27         Fix #77929
28         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
29         testing.
30
31         Fix #77958
32         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
33
34         Fix #77962
35         * report.cs (SymbolRelatedToPreviousError): Drop generic type
36         arguments before checking whether a type is reflected or not.
37
38         Fix #77954
39         * expression.cs (Invocation.IsApplicable): Ensure a generic method
40         definition doesn't take part in overload resolution.
41         (Invocation.IsParamsMethodApplicable): Likewise.
42         (Invocation.OverloadResolve): When replacing a reflected override
43         method with its base definition, ensure that type arguments are
44         applied.
45
46 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
47
48         A fix for #77966.
49
50         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
51         was not specified.
52
53         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
54
55 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
56
57         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
58         phase.
59
60         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
61         LocalTemporary change.
62
63         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
64         TypeContainer.
65         (ClassOrStruct.DefineFieldInitializers): Implemented static field
66         initializers optimization.
67         (ClassOrStruct.TypeAttr): Moved from modifiers.
68         (Constructor.CheckBase): Don't crash when static ctor has parameters.
69         (FieldBase.ResolveInitializer): Resolves initializer.
70         (FieldBase.HasDefaultInitializer): New property.
71
72         * cs-parser.jay: Removed message.
73
74         * expression.cs (CompilerGeneratedThis): New specialization.
75
76         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
77
78 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
79
80         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
81
82 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
83
84         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
85         be now EnumConstants only.
86
87 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
88
89         * attribute.cs, driver.cs: Reset more caches.
90
91 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
92
93         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
94
95 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
96
97         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
98         for easier reuse. Updated all overrides.
99         (IntegralConstant): New base class for all integral constants.
100         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
101         of the constant range, report custom error.
102         (UIntConstant.Reduce): Fixed uint conversion.
103
104         * ecore.cs, literal.cs: Reduce updates.
105
106 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
107
108         A fix for #75813.
109
110         * class.cs (Constructor.Define): Removed extra if for default ctors.
111         A patch from Atsushi Enomoto.
112
113 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
114
115         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
116         GetAttributableValue.
117
118         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
119         when required.
120
121         * convert.cs (ImplicitConversionRequired): Error message moved to
122         DoubleLiteral.
123
124         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
125         automatic implicit conversion of an output value.
126         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
127
128         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
129         conversion.
130         (TypeOf.GetAttributableValue): Add extra handling for object type.
131
132         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
133         special error message.
134
135 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
136
137         * class.cs (Constructor.Emit): Don't crash when struct ctor is
138         InternalCall.
139         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
140         compatible with MS runtime.
141
142 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
143
144         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
145         attribute arguments here.
146
147         * class.cs (Indexer.Define): The check was moved to attribute class.
148
149 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
150
151         * expression.cs (StringConcat.Append): Reverted back to no warning state.
152
153 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
154
155         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
156
157         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
158         the blocks too.
159
160 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
161
162         * doc-bootstrap.cs : fix build.
163
164 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
165
166         * expression.cs (StringConcat.Append): Issue a warning when empty string
167         is going to append.
168
169 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
170
171         * assign.cs (CompoundAssign.ResolveSource): Removed.
172
173         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
174         clean up.
175
176         * class.cs (TypeContainer.FindMethods): Removed.
177         (TypeContainer.CheckMemberUsage): Made static.
178
179         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
180
181         * constant.cs (CheckRange): Removed unused type argument.
182         (CheckUnsigned): Removed unused type argument.
183
184         * cs-parser.jay: Updated after MemberAccess clean up.
185         Uses Length for empty string test.
186
187         * cs-tokenizer.cs: Uses Length for empty string test.
188         (IsCastToken): Made static.
189         (is_hex): Made static.
190         (real_type_suffix): Made static.
191
192         * decl.cs (SetupCache): Made static.
193         (OnGenerateDocComment): Removed unused ds argument.
194
195         * delegate.cs (VerifyDelegate): Removed unused argument.
196
197         * doc.cs: Uses Length for empty string test.
198
199         * driver.cs: Uses Length for empty string test.
200
201         * enum.cs (IsValidEnumType): Made static
202
203         * expression.cs (EnumLiftUp): Removed unused argument.
204         (ResolveMethodGroup): Ditto.
205         (BetterConversion): Ditto.
206         (GetVarargsTypes): Ditto.
207         (UpdateIndices): Ditto.
208         (ValidateInitializers): Ditto.
209         (MemberAccess.ctor): Ditto.
210         (GetIndexersForType): Ditto.
211
212         * flowanalysis.cs: (MergeFinally): Removed unused argument.
213
214         * iterators.cs: Updated after MemberAccess clean up.
215
216         * location.cs: Uses Length for empty string test.
217
218         * namespace.cs: Uses Length for empty string test.
219
220          * report.cs (CheckWarningCode): Made static.
221
222         * statement.cs (LabeledStatement): Removed unused argument.
223
224         * typemanager.cs (FilterNone): Removed.
225
226 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
227
228         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
229         obsolete.
230
231         * class.cs: Updated.
232
233 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
234
235         * cs-parser.jay.cs: __arglist is not allowed for delegates.
236
237 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
238
239         A fix for #77816.
240
241         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
242         host container.
243         (AnonymousMethod.ImplicitStandardConversionExists): New method.
244         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
245         Add more error reporting; Fixed issue with params.
246
247         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
248
249         * cs-parser.jay: AnonymousMethod requires host container.
250
251         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
252
253 2006-03-18  Raja R Harinath  <harinath@gmail.com>
254
255         * class.cs: Change 'TypeContainer ds' constructor argument to
256         'DeclSpace parent'.  Some classes were missed below due to
257         different naming convention.
258
259         * class.cs (MemberCore.Parent): Delete.  This makes the
260         ParentContainer changes below enforceable by the compiler.
261
262         Treat pointers to enclosing declaration space as 'DeclSpace', not
263         'TypeContainer'.
264         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
265         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
266
267         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
268         of TypeContainer.
269         (Block.AddThisVariable): Likewise.
270         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
271         (AbstractPropertyEventMethod.Emit): Likewise.
272         (AbstractPropertyEventMethod.EmitMethod): Likewise.
273         (GetMethod.Define, SetMethod.Define): Likewise.
274         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
275         (DelegateMethod.EmitMethod): Likewise.
276
277         Fix regression test-partial-13.cs.
278         Rationalize use of PartialContainer.  Ensure that the partial
279         class semantics can be tied to type-correctness, i.e., any
280         violation will cause a compile error.
281         * class.cs, const.cs: Access all fields that belong to class
282         TypeContainer via ParentContainer.  Arguments of EmitContexts and
283         Resolve()-like functions still use 'Parent'.
284
285         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
286         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
287         (PropertyMethod.CheckModifiers): Remove unused argument.
288         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
289         DeclSpace.
290
291 2006-03-28  Raja R Harinath  <rharinath@novell.com>
292
293         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
294
295 2006-03-17  Raja R Harinath  <harinath@gmail.com>
296
297         Make semantics of PartialContainer simpler.
298         * decl.cs (DeclSpace.IsPartial): Remove.
299         * class.cs (TypeContainer.IsPartial): Likewise.
300         (TypeContainer..ctor): Set PartialContainer to point to self.
301         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
302         (TypeContainer.FindNestedType): Likewise.
303         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
304
305 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
306
307         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
308
309 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
310
311         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
312         classes.
313
314 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
315
316         * class.cs (Operator.Define): An error for base conversion was not
317         reported correctly.
318
319 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
320
321         A fix for #77593, #77574.
322
323         * class.cs (MethodCore.CheckBase): Another if for operator.
324
325 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
326
327         A fix for #77822.
328
329         * expression.cs (VerifyArgumentsCompat): Reverted to double error
330         reporting, it's more tricky than I thought.
331
332 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
333
334         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
335         were not resolved
336
337         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
338         (DelegateCreation.ImplicitStandardConversionExists): New method for just
339         conversion test.
340         
341         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
342         not needed.
343
344 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
345
346         A fix for #77353.
347
348         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
349         (Event.Define): ditto
350         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
351
352         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
353         Removed redundant code and set NewSlot for Invoke method too.
354
355         * parameter.cs (Parameters.ctor): Add custom, type ctor.
356         (Parameters.MergeGenerated): New method. Use this method when you merge
357         compiler generated argument with user arguments.
358
359 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
360
361         * attribute.cs (ResolveAsTypeTerminal): Removed.
362
363         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
364         specialization for predefined types; 30% speed up.
365         Finally placed obsolete check to right place.
366         (Expression.ResolveType): Removed.
367
368         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
369         Updated after ResolveType was removed.
370
371         * expression.cs (Cast.ctor): Check void cast.
372         (Binary.ResolveAsTypeTerminal): Is never type.
373         (Conditional.ResolveAsTypeTerminal): Is never type.
374
375         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
376
377 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
378
379         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
380
381 2006-03-23  Martin Baulig  <martin@ximian.com>
382
383         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
384         type check if either of the types is an open generic type.
385
386 2006-03-23  Martin Baulig  <martin@ximian.com>
387
388         * convert.cs
389         (Convert.ExplicitTypeParameterConversion): New method; implement
390         explicit type parameter conversions.
391
392 2006-03-23  Martin Baulig  <martin@ximian.com>
393
394         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
395         blindly allow all conversions if we do not have any constraints.
396
397 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
398
399         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
400         these two separated members to simplify the code.
401         (Attribute.Resolve): Refactored to use new fields and methods.
402         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
403         implemented obsolete attribute checking.
404         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
405         implemented obsolete checking again. It look line never ending quest ;-)
406         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
407
408         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
409
410         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
411
412         *class.cs (Property.Define): Add RegisterProperty call.
413
414         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
415         argument groups (only 2).
416
417         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
418         encoding expression to arguments.
419         (Expression.ExprClassToResolveFlags): Just turned to property.
420
421         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
422         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
423         optimized as well as implemented support for zero-length attributes.
424
425         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
426         Add caching of PropertyInfo's.
427
428 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
429
430         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
431         error multiple times.
432
433 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
434
435         New partial class implementation.
436         A fix for #77027, #77029, #77403
437
438         * attribute.cs (Attributable): Made attributes protected.
439
440         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
441         the replacements of ClassPart and PartialContainer.
442         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
443         (TypeContainer.AddInterface): Ditto.
444         (TypeContainer.AddPartial): The main method for partial classes. It checks
445         for errors and merges ModFlags and attributes. At the end class is added to
446         partial_parts list.
447         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
448         required here.
449         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
450         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
451         from the rest of partial classes.
452         (TypeContainer.GetClassBases): Simplified.
453         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
454         DefineType.
455         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
456         (TypeContainer.HasExplicitLayout): Uses Flags now.
457         (PartialContainer): Removed.
458         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
459         (StaticClass): Was merged with Class.
460         (Class.GetClassBases): class and static class bases are verified here.
461         (Class.TypeAttr): Added static attributes when class is static.
462         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
463         (MemberBase): In some cases we need to call parent container for partial
464         class. It should be eliminated but it's not easy now.
465
466         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
467
468         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
469         partial classed to accumulate class comments.
470         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
471
472         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
473
474         * driver.cs (MainDriver): Tree.GetDecl was removed.
475
476         * modifiers.cs (Modifiers): Add partial modifier.
477
478         * tree.cs (Tree.decl): Removed.
479         (RootTypes): Started to use this class more often for root types
480         specializations.
481
482 2006-03-23  Raja R Harinath  <rharinath@novell.com>
483
484         * generic.cs (TypeParameter.UpdateConstraints): Update
485         'constraints' if null.
486
487 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
488
489         A fix for #77615
490
491         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
492         external interface does not have an attribute.
493
494 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
495
496         Another prerequisites for new partial classs implementation.
497         
498         * attribute.cs (Attribute.Equal): Implemented.
499         (Attribute.Emit): Changed as attributes can be applied more than twice.
500         (Attributes.Emit): Check for duplicate attributes here.
501
502         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
503         as a parameter, clean-up.
504
505 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
506
507         A fix for #77485
508
509         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
510         contains obsolete attribute check which can in some cases look for base
511         type of current class which is not initialized yet.
512         (TypeContainer.BaseType): Replacement of ptype.
513
514         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
515
516 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
517
518         First of prerequisites for new partial classs implemention.
519         
520         * attribute.cs (Attributable): Extended by ResolveContext;
521         Attributes finally have correct context for resolving in all cases.
522         (AttachTo): Attribute owner is assigned here.
523
524         * codegen.cs (IResolveContext): Introduce new interface to hold
525         all information needed in resolving phase.
526         (EmitContext): Implements IResolveContext; more clean-up needed here.
527         
528         * decl.cs (MemberCore): Implemented IResolveContext.
529
530         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
531         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
532         parameter.cs, statement.cs, tree.cs, typemanager.cs:
533         Refactored to use new IResolveContext instead of EmitContext; cleanup
534
535 2006-03-22  Raja R Harinath  <rharinath@novell.com>
536
537         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
538         mcs to keep code differences small.
539         * attribute.cs (Attribute.GetParameterDefaultValue): New.
540         * typemanager.cs (parameter_default_value_attribute_type): New.
541         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
542         CS1908 check.
543
544 2006-03-22  Martin Baulig  <martin@ximian.com>
545
546         * generic.cs
547         (Nullable.NullableLiteral): Derive from `NullLiteral'.
548
549         * convert.cs
550         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
551         instead of the normal `NullLiteral'.
552
553 2006-03-21  Martin Baulig  <martin@ximian.com>
554
555         Fix #77583.
556         * generic.cs (TypeManager.InferType): If `pt' is a generic
557         parameter, don't check whether `pt == at'.
558
559 2006-03-20  Raja R Harinath  <rharinath@novell.com>
560
561         Fix #77852
562         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
563         (TypeParameter.Resolve): Update to change.
564         (ConstraintChecker.CheckConstraints): Resolve type-argument
565         constraints before use.
566
567 2006-03-16  Martin Baulig  <martin@ximian.com>
568
569         * generic.cs
570         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
571         and don't have any instance constructors, also lookup in the base class.
572         (TypeManager.IsNullableValueType): New public method.
573
574         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
575         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
576         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
577
578         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
579         instead of just TypeManager.IsNullableType() to determine whether
580         a lifted operator exists.
581         (UnaryMutator.DoResolve): Likewise.
582         (Conditional.DoResolve): Likewise.
583         (Binary.DoResolve): A lifted operator only exists if both operands
584         are valuetypes and at least one of them is a nullable type.
585
586 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
587
588         * iterator.cs : yield break is allowed in try statement which has
589           catch clauses. Fixed bug #77767.
590
591 2006-03-12  Martin Baulig  <martin@ximian.com>
592
593         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
594         private IsSignatureEqual() to compare types; see the comment in
595         that method; fixes #77674.
596
597 2006-03-10  Raja R Harinath  <rharinath@novell.com>
598
599         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
600         (Expression.ResolveAsTypeTerminal): Likewise.
601         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
602         * expression.cs, generic.cs, iterators.cs: Likewise.
603         * parameter.cs, statement.cs, typemanager.cs: Likewise.
604
605 2006-03-09  Martin Baulig  <martin@ximian.com>
606
607         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
608         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
609
610 2006-03-09  Martin Baulig  <martin@ximian.com>
611
612         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
613         `prepared' flag is set.
614
615         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
616         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
617         issues; see gtest-254.cs.
618
619 2006-03-07  Martin Baulig  <martin@ximian.com>
620
621         * generic.cs (TypeManager.InferType): Allow infering
622         `IEnumerable<T>' with an array of T; see gtest-251.cs.
623
624 2006-03-06  Martin Baulig  <martin@ximian.com>
625
626         * generic.cs
627         (TypeManager.InferType): Fix gtest-250.cs.
628
629         * typemanager.cs
630         (TypeManager.IsSubclassOf): Also check the base class.
631
632         * expression.cs
633         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
634         fixes gtest-249.cs.
635
636 2006-03-01  Raja R Harinath  <rharinath@novell.com>
637
638         Fix #77679.
639         * expression.cs (ParameterReference.DoResolveBase): Change return
640         type to bool.
641         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
642         Update.
643
644         Fix #77628.
645         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
646
647         Fix #77642.
648         * typemanager.cs (GetFullNameSignature): Don't nullref on
649         protected accessors.
650
651 2006-02-16  Martin Baulig  <martin@ximian.com>
652
653         * generic.cs
654         (TypeManager.GetGenericFieldDefinition): New public method; use it
655         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
656
657 2006-02-14  Martin Baulig  <martin@ximian.com>
658
659         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
660
661 2006-02-14  Martin Baulig  <martin@ximian.com>
662
663         * generic.cs
664         (TypeManager.DropGenericMethodArguments): New public method; don't
665         use GetGenericMethodDefinition() on something which is not a
666         generic method.
667
668 2006-02-14  Martin Baulig  <martin@ximian.com>
669
670         * generic.cs
671         (ConstraintChecker.CheckConstraints): If a type parameter has the
672         `struct' constraint, the type must be a non-nullable valuetype.
673
674 2006-02-10  Martin Baulig  <martin@ximian.com>
675
676         * typemanager.cs
677         (TypeManager.IsOverride): Make this work for instantiated methods
678         in a generic class; fixes #77509.
679         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
680         rather than calling it directly; fixes #77488.  
681
682 2006-02-08  Martin Baulig  <martin@ximian.com>
683
684         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
685         reporting into CheckConstraint() so we can use the correctly
686         instantiated type.
687
688 2006-02-08  Martin Baulig  <martin@ximian.com>
689
690         * expression.cs (BaseAccess): Add support for generic methods.
691
692         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
693         the new MethodGroupExpr.
694
695 2006-02-07  Martin Baulig  <martin@ximian.com>
696
697         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
698         also reference types; fixes #77483.
699
700 2006-02-07  Martin Baulig  <martin@ximian.com>
701
702         * generic.cs
703         (TypeManager.IsGenericMethod): We now return whether something is
704         an instantiated generic method (and not a generic method def).
705         (TypeManager.IsGenericMethodDefinition): New public method.
706
707         * typemanager.cs
708         (TypeManager.CSharpSignature): Only include type arguments for
709         "real" generic methods, not for any instantiated method.
710         (TypeManager.GetMethodName): Likewise, but also allow generic
711         method definitions here.
712
713 2006-02-06  Miguel de Icaza  <miguel@novell.com>
714
715         * codegen.cs (EmitScopeInitFromBlock): check here the
716         capture_context, there is no need to make two calls to the
717         EmitContext. 
718
719         * anonymous.cs: Add some debugging messages that might help me
720         track other instances of this problem in the future (the
721         regression of test 467).
722
723         * cs-parser.jay: track the variable block, as we need to initalize
724         any captured variables declared in this block for the "catch"
725         portion of the "Try" statement.
726
727         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
728         scope initialization for captured variables. 
729
730         Also, move the emit for the variables after the block location has
731         been marked.
732
733 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
734
735        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
736         
737 2006-02-06  Martin Baulig  <martin@ximian.com>
738
739         * class.cs (TypeContainer.DefineType): If we're a struct, pass
740         `TypeManager.value_type' as parent type to
741         ModuleBuilder.DefineType().  Fixes #77358.      
742
743 2006-02-02  Miguel de Icaza  <miguel@novell.com>
744
745         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
746         commit yesterday, the initialization for the roots is necessary.
747         What is not necessary is the scope activation.
748
749 2006-02-02  Raja R Harinath  <rharinath@novell.com>
750
751         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
752         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
753         CS0206 checks.
754         (Argument.Resolve): Remove CS0206 checks.
755
756 2006-02-01  Miguel de Icaza  <miguel@novell.com>
757
758         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
759         scopes for all the roots, the scopes will now be emitted when the
760         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
761
762         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
763         code.  This reduces a lot of existing cruft.
764         
765         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
766         that the ScopeInfo is generated as we enter the scope, not at the
767         time of use, which is what we used to do before.
768
769         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
770         every time a Block is about to be emitted if we have a
771         CaptureContext. 
772
773 2006-02-01  Raja R Harinath  <rharinath@novell.com>
774
775         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
776         attribute for mscorlib too.
777
778         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
779         (Reset): Update.
780         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
781
782         * typemanager.cs (cons_param_array_attribute): Make private.
783         (Reset): Set it to null.
784         (InitCoreHelpers): Don't initialize it.
785         (ConsParamArrayAttribute): New.  Initialize it as needed.
786         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
787
788 2006-01-31  Miguel de Icaza  <miguel@novell.com>
789
790         * expression.cs: There might be errors reported during the
791         selection of applicable methods.  If there are errors, do not
792         continue execution as it will lead the compiler to crash.
793
794 2006-01-30  Miguel de Icaza  <miguel@novell.com>
795
796         * expression.cs: Member access is not allowed on anonymous
797         methods.  Fixes #77402.
798
799 2006-01-30  Raja R Harinath  <rharinath@novell.com>
800
801         Fix #77401
802         * cs-parser.jay (VariableDeclaration): Don't set
803         current_array_type to null.
804         (field_declaration, event_declaration, declaration_statement):
805         Set it to null here.
806
807 2006-01-29  Raja R Harinath  <harinath@gmail.com>
808
809         Fix part of #77397
810         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
811
812 2006-01-28  Raja R Harinath  <harinath@gmail.com>
813
814         * typemanager.cs (GenericParameterPosition): New.
815         * doc.cs: Use it.
816
817 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
818
819         * doc.cs : To process "include" elements, first we should create
820           another list than XmlNodeList, because it could result in node
821           removal, which could result in that the XmlNodeList gives up
822           yielding next node.
823
824 2006-01-25  Miguel de Icaza  <miguel@novell.com>
825
826         * expression.cs: Introduce an error report that we were not
827         catching before.   Gonzalo ran into it.
828
829 2006-01-23  Miguel de Icaza  <miguel@novell.com>
830
831         A fix for bug: #76957
832         
833         * iterators.cs (MoveNextMethod.CreateMethodHost): call
834         ComputeMethodHost before creating the method, this is a new
835         requirement. 
836
837         * anonymous.cs (AnonymousContainer): Now we track all the scopes
838         that this method references (RegisterScope).  The actual scope
839         where the method is hosted is computed with the ComputeMethodHost
840         before we create the method.
841
842         Moved the Deepest routine here.
843
844         (AnonymousContainer.ComputeMethodHost): New routine used to
845         compute the proper ScopeInfo that will host the anonymous method.
846
847         (ScopeInfo): Deal with multiple roots.  The problem was that we
848         did not have a unique root where all ScopeInfos could be hanged
849         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
850         of roots.  
851
852         Remove AdjustMethodScope which is now computed at the end.  Remove
853         LinkScope which did a partial link, instead link all ScopeInfos
854         before code generation from the new "LinkScopes" routine. 
855
856         Simplify all the Add* routines as they no longer need to maintain
857         the tree, they just need to record that they are using variables
858         from a ScopeInfo.
859
860         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
861         routines to produce the forest of ScopeInfo trees.
862
863         * class.cs (TypeContainer.AppendMethod): This is just like
864         AddMethod, but ensures that an interface implementation method
865         (IEnumerable.XXX) is not inserted at the beginning of the queue of
866         methods, but at the end.
867
868         We use this functionality to ensure that the generated MoveNext
869         method in the iterator class is resolved/emitted before the
870         enumerator methods created.   
871
872         This is required because the MoveNext method computes the right
873         ScopeInfo for the method.  And the other methods will eventually
874         need to resolve and fetch information computed from the anonymous
875         method. 
876
877         
878 2006-01-23  Raja R Harinath  <rharinath@novell.com>
879
880         Improve implementation of section 14.4.2.2 (Better function member).
881         * expression.cs (Invocation.MoreSpecific): Compare all type
882         arguments before deciding if one type is more specific than
883         another.  Handle array types too.  Return the more specific type.
884         (Invocation.BetterFunction): Add more tie-breaking rules from
885         section 14.4.2.2.  Perform "more specific" check after
886         other tie-breaking rules.  Compare all parameter types before
887         choosing the "more specific" method.
888
889 2006-01-21  Raja R Harinath  <harinath@gmail.com>
890             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
891
892         Fix rest of #76995.
893         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
894         the 'aliases' hash.
895         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
896         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
897
898 2006-01-18  Martin Baulig  <martin@ximian.com>
899
900         * class.cs (TypeContainer.AddToMemberContainer): Use
901         `symbol.MemberName.MethodName' instead of just `symbol.Name';
902         fixes #77124.
903
904 2006-01-18  Martin Baulig  <martin@ximian.com>
905
906         Fix #76417: a generic class may now have methods which may unify
907         for some type parameter substitutions.
908
909         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
910         for methods which may unify anymore.
911
912         * expression.cs (Invocation.MoreSpecific): New private static
913         method; checks whether one method is more specific than another
914         according to 14.4.2.2 of the spec.
915         (Invocation.BetterFunction): Implement the tie-breaking rules from
916         14.4.2.2 of the spec: if two methods unify for some type parameter
917         substitution, we need to pick the more specific one.
918
919 2006-01-18  Raja R Harinath  <rharinath@novell.com>
920
921         Fix #76656, cs0231-2.cs.
922         * cs-parser.jay (formal_parameter_list): Make error case catch
923         more issues.
924         (parenthesized_expression_0): Add CS1026 check.
925         (invocation_expression): Remove unused { $$ = lexer.Location }.
926
927 2006-01-17  Raja R Harinath  <rharinath@novell.com>
928
929         Fix #76824.
930         * cs-parser.jay (statement_expression): Don't list out the
931         individual statement-expressions.  Convert syntax error into
932         CS0201 check.
933
934 2006-01-16  Raja R Harinath  <rharinath@novell.com>
935
936         Fix #76874.
937         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
938         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
939         CheckIntermediateModification.
940         (FieldExpr.DoResolve): Add new two-argument version that
941         allows us to resolve the InstanceExpression as an lvalue.
942         The one-argument variant is now just a wrapper.
943         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
944         Resolve the lhs as an lvalue if the it has a value type.
945         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
946         from Assign.DoResolve.
947         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
948         resolved as an lvalue.
949         (PropertyExpr.DoResolve): Update.
950         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
951         has a value type.  Move CS1612 check here from
952         CheckIntermediateModification.
953         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
954         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
955         'right_side' of a ResolveLValue on an 'out' argument.
956         (EmptyExpression.LValueMemberAccess): New.  Used as the
957         'right_side' of a propagated ResolveLValue on a value type.
958         (LocalVariableReference.DoResolveBase): Recognize
959         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
960         Add CS1654 check.
961         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
962         EmptyExpression.Null.
963
964 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
965
966         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
967           Type.IsGenericParameter(). Fixed bug #77183.
968         * doc.cs : it is now identical to doc.cs in mcs.
969
970 2006-01-16  Martin Baulig  <martin@ximian.com>
971
972         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
973
974 2006-01-16  Martin Baulig  <martin@ximian.com>
975
976         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
977         ctors; fixes #77250.
978
979 2006-01-12  Miguel de Icaza  <miguel@novell.com>
980
981         This fixes the problem where we used ldfld instead of ldflda to
982         load the "THIS" pointer on captured parameters, when THIS is a
983         value type.  See bug #77205.
984         
985         * iterators.cs (CapturedThisReference.Emit): Pass false to
986         EmitThis (we do not need the address).
987
988         * codegen.cs (EmitThis): it needs to know whether we need the
989         address of `this' or not.  This is used by value types.  
990
991         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
992         every other call passes false.
993
994 2006-01-12  Raja R Harinath  <rharinath@novell.com>
995
996         Fix #77221.
997         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
998         GetOverride.
999         * expression.cs (Invocation.OverloadResolve): Update.
1000         (Invocation.DoResolve): Avoid double resolution of invocation.
1001
1002 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1003
1004         Fix #77180.
1005         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1006         unary negation of floating point types as 0-expr; negation cannot
1007         overflow in floating point types.
1008
1009         Fix #77204.
1010         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1011         on operands of 'void' type.
1012
1013         Fix #77200.
1014         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1015         and ExclusiveOr for boolean constants too.
1016
1017 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1018
1019         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1020
1021 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1022
1023         * cs-tokenizer.cs (Position): New class used to save and restore
1024         the position state in the tokenizer.  Before this patch the save
1025         and restore was not complete enough so the line and columns would
1026         start to drift and the debugger and stack traces will get the
1027         wrong data.
1028
1029 2006-01-10  Martin Baulig  <martin@ximian.com>
1030
1031         * generic.cs
1032         (TypeParameter.InflateConstraints): New public method.
1033
1034         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1035         constraints; fixes #77042.
1036
1037 2006-01-10  Martin Baulig  <martin@ximian.com>
1038
1039         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1040         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1041         #77061. 
1042
1043 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1044
1045         Fix #75636.
1046         * expression.cs (Invocation.OverloadResolve): Replace reflected
1047         override methods with their base virtual methods, rather than
1048         skipping over them.
1049         * typemanager.cs (TypeManager.GetOverride): New.
1050
1051 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1052
1053         * driver.cs: Report the case of no source files and no -out:
1054         argument provided.
1055
1056 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1057
1058         Fix #77035.
1059         * expression.cs (ComposedCast.GetSignatureForError): Define.
1060
1061 2006-01-05  Jb Evain  <jbevain@gmail.com>
1062
1063         * class.cs (Property.Define, Indexer.Define): do not tag the
1064         properties as SpecialName | RTSpecialName.
1065
1066 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1067
1068         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1069         doing a low-level comparission of parameter types.  It was lacking
1070         a check for __argslist. 
1071
1072 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1073
1074         * expression.cs (ParameterReference.DoResolveBase): Allow
1075         reference parameters if they are local to this block. 
1076
1077         This allows the ref and out parameters of a delegate to be used in
1078         an anonymous method, for example:
1079
1080         delegate void set (out int x);
1081
1082         set s = delegate (out int x){
1083                 x = 0;
1084         };
1085
1086         This is used by functionality introduced late in the C# language.
1087         
1088         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1089         method that take ref and out parameters. 
1090
1091         Fixes #77119 which was a late change in the spec.
1092
1093 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1094
1095         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1096         parent if its the same scope.  Fixes #77060.
1097
1098 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1099
1100         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1101
1102 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1103
1104         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1105         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1106         that doesn't contain the full public key. This is a update of the
1107         friend assemblies in .Net 2.0 release.
1108         
1109 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1110
1111         Fix #76995
1112
1113         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1114         ListDictionary, to contain the ExternAliasEntry entries (in
1115         addition to the NamespaceEntry.aliases hashtable). This field is
1116         shared between the original entry and its doppelganger (bodyless 
1117         copy of it).
1118         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1119         extern_aliases field.
1120         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1121         lookup in extern_aliases.
1122
1123 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1124
1125         Fix #77006.
1126         * class.cs (TypeContainer.Mark_HasEquals): New.
1127         (TypeContainer.Mark_HasGetHashCode): New.
1128         (ClassPart): Override them.
1129         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1130
1131         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1132         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1133         DeclSpace.
1134
1135         Fix #77008.
1136         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1137         'parent' argument to the base constructor.
1138
1139         Remove all mention of TypeContainer from decl.cs.
1140         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1141         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1142         (DeclSpace.DeclSpace): Likewise.
1143         (DeclSpace.DefineMembers): Remove unused argument.
1144         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1145         debugging check -- we don't care if the debug code throws an
1146         InvalidCastException instead of an InternalErrorException.
1147         * class.cs (TypeContainer.DefineMembers): Update to changes.
1148         (TypeContainer.DoDefineMembers): Likewise.
1149         (TypeContainer.GetMethods): Likewise.
1150         (PropertyMember.Define): Likewise.
1151         (MemberBase.Parent): New property that forwards to
1152         MemberCore.Parent, but ensures that we get a TypeContainer.
1153         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1154         (RootContext.PopulateTypes): Likewise.  Remove special case code
1155         for !RootContext.StdLib: DefineMembers is idempotent.
1156
1157 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1158
1159         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1160
1161 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1162
1163         * doc.cs : The search for referenced namespace was insufficient to
1164           get global one as it used to do. Fixed bug #76965.
1165
1166 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1167
1168         * doc.cs : check name in cref in the last phase that whether it is
1169           namespace or not.
1170
1171 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1172
1173         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1174           Mono.C5.
1175
1176 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1177
1178         * doc.cs : so it turned out that we cannot skip override check for 
1179           interface members. Fixed bug #76954.
1180
1181 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1182
1183         * cs-tokenizer.cs : fixed bug #75984:
1184           - #warning and #error should not be handled when the source line
1185             is disabled.
1186           - #line is not checked strictly when the source line is disabled.
1187           - #define and #undef is on the other hand checked strictly at any
1188             state.
1189
1190 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1191
1192         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1193           CS1027 report.
1194
1195 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1196
1197         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1198
1199         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1200         nested types.
1201
1202 2005-12-14  Martin Baulig  <martin@ximian.com>
1203
1204         * typemanager.cs (TypeManager.GetFullName): Make this public;
1205         `Type.Fullname' now never returns null.
1206
1207         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1208         explicit interface implementations; we're now using the same
1209         naming convention than csc does.
1210
1211 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1212
1213         * convert.cs (ExplicitConversionCore): Check the return value from
1214         ExplicitConversionCore which can return null on failure.  Fixes #76914
1215
1216 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1217
1218         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1219         instead of IsGenericInstance.
1220         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1221         code that's now covered by the more general test.
1222         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1223
1224         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1225         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1226         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1227         * generic.cs, report.cs, typemanager.cs: Likewise.
1228
1229 2005-12-08  Martin Baulig  <martin@ximian.com>
1230
1231         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1232
1233         * typemanager.cs (TypeManager.CSharpSignature): Include type
1234         arguments in the signature of a generic method.
1235
1236 2005-12-07  Martin Baulig  <martin@ximian.com>
1237
1238         Add support for custom attributes on type parameters.
1239
1240         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1241
1242         * generic.cs (TypeParameterName): New public class; we use this
1243         instead of a `string' to store the name of a type parameter, so we
1244         can also have `Attributes'.
1245         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1246         array instead of a `string[]' array.
1247         (TypeParameter.ctor): We now also take an `Attributes' argument.
1248         (TypeParameter.EmitAttributes): New public method; emit our
1249         `OptAttributes' here.
1250         (GenericMethod.EmitAttributes): New public method; emit the custom
1251         attributes on all our type parameters.
1252
1253         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1254         our type parameters.
1255         (MethodData.Define): If we're a generic method, call
1256         EmitAttributes() on it.
1257
1258 2005-12-07  Martin Baulig  <martin@ximian.com>
1259
1260         * generic.cs
1261         (ConstraintChecker): New public abstract class; move the
1262         constraint checking here from `ConstructedType' and also do
1263         constraint checking for generic methods here.
1264
1265         * expression.cs (Invocation.OverloadResolve): Use
1266         ConstraintChecker.CheckConstraints() if we resolved to a generic
1267         method.  Fix #76806.
1268
1269 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1270
1271         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1272
1273         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1274         event initializers.
1275         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1276         (FieldBase.Initializer): Initializer is now optional.
1277         (EventField.Define): Only event field can have initializer.
1278
1279         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1280
1281         * const.cs (Const): Reuse initializer.
1282
1283         * cs-parser.jay: Updated after FieldBase changes.
1284         Added current_array_type to simplify array initializers.
1285
1286         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1287
1288         * expression.cs, iterators.cs: Updated.
1289
1290         * namespace.cs (NamespaceEntry): Made UsingFound private.
1291
1292 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1293
1294         * parameterCollection.cs: Obsolete, removed.
1295         * parser.cs: Obsolete, removed.
1296
1297 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1298
1299         Fix #76849.
1300         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1301
1302         * enum.cs (Enum.Define): Set obsolete context here.
1303
1304 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1305
1306         * doc.cs :
1307           - FindDocumentedMember() now expects 1) paramList as null
1308             when "we don't have to check the number of parameters" and
1309             2) Type.EmptyTypes when "there is no arguments".
1310           - Introduced FoundMember struct to hold the exact type which was
1311             used to find the documented member (the above change broke
1312             test-xml-044; it might be better just to use DeclaringType than
1313             what MS does, like this change does, but it depends on usage.)
1314
1315 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1316
1317         * doc.cs : documented member might be from DeclaringType for nested
1318           types. Fixed bug #76782.
1319
1320 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1321
1322         * anonymous.cs: Have the param code handle leaving copies on the
1323         stack etc. Allows anonymous params to take part in the assignment
1324         code (++, +=, etc). Fixes bug #76550
1325
1326         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1327         it down to the anon code.
1328
1329         * iterators.cs: Use dummy var here
1330
1331         * codegen.cs: Handle new vars
1332
1333 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1334
1335         Fix #76849.
1336         * class.cs (MethodData.Define): Set proper Obsolete context.
1337
1338         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1339         obsolete context.
1340         (FieldExpr.DoResolve): Ditto.
1341
1342 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1343
1344         Fix #76849.
1345         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1346         parent is not obsolete.
1347
1348 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1349
1350         * doc.cs : (FindDocumentedMember) find parameterless members first
1351           and get CS0419 in the early stage. Fixed first case of bug #76727.
1352
1353 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1354
1355         Fix #76859.
1356         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1357         no error was reported.
1358
1359         *expression.cs (Binary.DoResolve): left can be null.
1360
1361 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1362
1363         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1364         abstract method and all overrides.
1365         * support.cs (ParameterData.GenericConstraints): Delete.
1366         (ReflectionParameters.type_params): Delete.
1367         (ReflectionParameters.ReflectionParameters): Make private.
1368         (ReflectionParameters.GetConstaints): New factory method.
1369         * generic.cs (TypeParameterDefineType): Use it.
1370         (TypeManager.GetTypeParameterConstraints): Likewise.
1371
1372 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1373
1374         Fix #76783.
1375         * class.cs (MethodData.Emit): Parameters should be labeled first.
1376
1377 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1378
1379         Fix #76761.
1380         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1381
1382 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1383
1384         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1385
1386         * class.cs (MethodCore): Parameter clean up.
1387         (IMethodData): Added ParameterInfo.
1388         (MethodData): Parameter clean up.
1389         (Indexer.Define): Parameter clean up.
1390
1391         * anonymous.cs,
1392         * codegen.cs,
1393         * cs-parser.jay,
1394         * decl.cs,
1395         * doc.cs,
1396         * ecore.cs,
1397         * flowanalysis.cs,
1398         * iterators.cs,
1399         * pending.cs,
1400         * statement.cs,
1401         * typemanager.cs: Parameter clean up.
1402
1403         * delegate.cs (Define): Get rid of duplicated code.
1404
1405         * expression.cs (ParameterReference): Removed useless parameters
1406         and simplified.
1407         (Invocation): Ditto.
1408
1409         * parameter.cs (ParamsParameter): New class, params specialization.
1410         (ArglistParameter): Attemp to separate arglist.
1411         (Parameter): Refactored to be reusable and faster.
1412         (Parameter.Modifier): Made understandable.
1413         (Parameters): Changed to be used as a class for `this' assembly
1414         parameters. Refactored to use new specialized classes.
1415
1416         * support.cs (ParameterData): Added Types property.
1417         (InternalParameters): Deleted.
1418
1419 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1420
1421         * doc.cs : the previous patch does not actually fix the bug.
1422           PropertyInfo override check is now implemented and really fixed it.
1423         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1424
1425 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1426
1427         * doc.cs : apply "override filter" also to properties.
1428           Fixed bug #76730.
1429
1430 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1431
1432         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1433           no need to check overrides. For classes, omit those results from 
1434           interfaces since they must exist in the class. Fixed bug #76726.
1435
1436 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1437
1438         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1439           with different parameters. Fixed the second problem in #76685.
1440
1441 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1442
1443         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1444           get expected 'protected' access in CheckValidFamilyAccess()).
1445           Fixed bug #76692.
1446
1447 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1448
1449         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1450           Fixed bug #76705.  CS1569 was incorrectly commented out.
1451
1452 2005-11-23  Martin Baulig  <martin@ximian.com>
1453
1454         * generic.cs (Constraints.Define): Removed.
1455         (TypeParameter.DefineConstraints): Removed.
1456         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1457         on the GenericTypeParameterBuilder here.
1458
1459 2005-11-23  Martin Baulig  <martin@ximian.com>
1460
1461         * typemanager.cs (TypeManager.GetProperty): Make this public.
1462
1463         * generic.cs (Nullable.NullableInfo.ctor): Use
1464         TypeManager.GetProperty() rather than using reflection directly.
1465
1466 2005-11-17  Martin Baulig  <martin@ximian.com>
1467
1468         * expression.cs (Indexers.GetIndexersForType): Added support for
1469         generic parameters; fixes #76587.
1470
1471 2005-11-17  Martin Baulig  <martin@ximian.com>
1472
1473         * anonymous.cs
1474         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1475         inherit the scope from our parent.  Fixes #76653.
1476
1477 2005-11-15  Martin Baulig  <martin@ximian.com>
1478
1479         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1480         instead of `ScopeTypeBuilder' to refer to the "current" type.
1481         (AnonymousMethod.CreateScopeType): Correctly create the helper
1482         class if we're inside a generic type definition.
1483
1484 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1485
1486         * doc.cs : use Invocation.IsOverride() to do real override check.
1487         * expression.cs : made Invocation.IsOverride() internal.
1488
1489 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1490
1491         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1492           TypeBuilder.FindMembers() and filter overriden base members out.
1493           Fixed bug #76990.
1494
1495 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1496
1497         * doc.cs : ref/out parameters are represented as '@' (instead of
1498           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1499
1500 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1501
1502         * doc.cs : when there was no '.' in cref to methods in doc comment,
1503           then parameters were missing in the output. Fixed bug #76691.
1504
1505 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1506
1507         * driver.cs : don't output docs when there is an error.
1508           Fixed bug #76693.
1509
1510 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1511
1512         * doc.cs :
1513           Now it should detect indexers. Fixed primary concern in bug #76685.
1514           Fixed CS0419 message to not show the identical member signature in
1515           the message.
1516
1517 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1518
1519         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1520           instead of Type.FindMembers() since it does not handle events.
1521           Fixed bug #71604.
1522
1523 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1524
1525         * codegen.cs: Fixed typo (speficied -> specified).
1526
1527 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1528
1529         Fix #76369.
1530         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1531
1532 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1533
1534         * attribute.cs: Changed error message.
1535
1536         * cs-tokenizer.cs: One more check.
1537
1538 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1539
1540         * statement.cs (Block.Resolve): Ignore empty statement.
1541
1542 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1543
1544         * report.cs: Made error/warning methods more strict to avoid
1545         their misuse.
1546
1547         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1548         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1549         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1550         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1551
1552 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1553
1554         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1555         Use the more explicit AssemblyName.FullName instead of 
1556         AssemblyName.Name to report errors.
1557         
1558 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1559
1560         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1561         with mcs.
1562
1563 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1564
1565         * class.cs,
1566         * convert.cs,
1567         * cs-parser.jay,
1568         * decl.cs,
1569         * enum.cs,
1570         * expression.cs,
1571         * generic.cs,
1572         * pending.cs,
1573         * report.cs: Fixed error reporting and typos.
1574
1575         * generic.cs (TypeParameter.GetSignatureForError): New method.
1576         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1577
1578         * typemanager.cs (GetFullName): Refactored.
1579
1580 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1581
1582         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1583         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1584
1585         * class.cs (TypeContainer.IsComImport): New property.
1586         (Constructor.Define): Create proper ctor for ComImport types.
1587
1588         * expression.cs (New.CheckComImport): Fixed.
1589
1590 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1591
1592         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1593         that a parameter has been captured does not mean that we do not
1594         have to do the rest of the processing.  This fixes the second part
1595         of #76592.  If there was another anonymous method capturing
1596         values in the past, the Scope would never be set for the second
1597         method that captured the same parameter.
1598
1599         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1600         properly manipulate the stack.   Second part of fix for #76592.
1601
1602         * expression.cs (New): Add support for invoking "new" on
1603         interfaces that have been flagged with the ComImport attribute and
1604         the CoClass.  Fixes #76637 
1605
1606         * statement.cs (Try.DoEmit): When a variable is captured, do not
1607         try to emit the vi.LocalBuilder variable as it has been captured.
1608         Create a temporary variable and store the results on the
1609         FieldBuilder.  Fixes #76642
1610
1611 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1612
1613         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1614
1615         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1616
1617         * expression.cs (Binary.DoResolve): Added && optimalization.
1618     
1619         * typemanager.cs (AddUserType): Removed useless argument.
1620
1621 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1622
1623         * statement.cs (Block.variables): Uses ListDictionary.
1624
1625 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1626
1627         Fix #75969.
1628         * class.cs (PartialContainer.EmitType): Customized to emit
1629         security attributes.
1630         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1631         for partial classes.
1632
1633 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1634
1635         Fix #76599.
1636         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1637         access has to be fixed.
1638         
1639         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1640
1641 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1642
1643         Fix #76590.
1644         * ecore.cs (NullCast.Reduce): Implemented.
1645
1646         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1647         constant type.
1648         
1649         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1650         properly.
1651         (Foreach.Resolve): Catch null properly.
1652
1653 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1654  
1655         * cs-tokenizer.cs: Warning text fix.
1656
1657         * driver.cs: AllWarningNumbers exposed on public interface.
1658
1659         * report.cs (): Reviewed warning numbers.
1660         (IsValidWarning): Use binary search.
1661
1662 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1663  
1664         * driver.cs: Implemeted resource visibility.
1665         (Resources): New class for code sharing between /res: and
1666         /linkres:
1667  
1668 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1669
1670         decl.cs (CurrentTypeParameters): Fixed to be public.
1671
1672 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1673
1674         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1675
1676 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1677
1678         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1679
1680 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1681
1682         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1683
1684 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1685
1686         Add friend assembly access support.
1687         * typemanager.cs: assembly_internals_vis_attrs
1688         cache for friend assembly access. 
1689         (TypeManager.IsFriendAssembly): New method for
1690         checking friend assembly access.
1691         (TypeManager.Error_FriendAccessNameNotMatching): New
1692         helper method.
1693         (TypeManager.CompareKeyTokens): Likewise.
1694         (TypeManager.Filter): Handle friend accessible
1695         members.
1696
1697         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1698         friend accessible types.
1699
1700         * ecore.cs (Expression.IsAccessorAccessible): Handle
1701         friend accessible properties.
1702
1703         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1704         accessible types.
1705         
1706 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1707
1708         Fix #76568.
1709         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1710         folding.
1711         
1712         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1713         contants only.
1714         
1715         * ecore.cs (NullCast): Child is contant only.
1716         
1717         * literal.cs (NullLiteral.Reduce): null can be converted to any
1718         reference type.
1719
1720 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1721
1722         * driver.cs: Use Encoding.Default as default code page instead
1723           of ISO-28591.
1724
1725 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1726
1727         Fix #76085.
1728         * expression.cs (Invocation.Error_InvalidArguments): Handle
1729         __arglist parameters.
1730         (Invocation.VerifyArgumentsCompat): Likewise.
1731         * support.cs (ReflectionParameters.GetSignatureForError): Print
1732         __arglist parameters.
1733         (InternalParamters.GetSignatureForError): Likewise.
1734         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1735
1736 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1737
1738         * attribute.cs (GetPropertyValue): Made public.
1739
1740         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1741         Resolve.
1742         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1743         attribute.
1744         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1745         is not defined.
1746         
1747         * driver.cs: Reflect method name change.
1748         
1749         * statement.cs (Try.Resolve): Warn when try has both general
1750         exception handlers.
1751         
1752         * typemanager.cs: runtime_compatibility_attr_type new predefined
1753         type.
1754
1755 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1756
1757         Fix #76419.
1758         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1759         treat it as an empty parameter list.
1760
1761 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1762
1763         Fix #76271.     
1764         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1765         ResolveAsTypeStep silent.
1766         * statement.cs (Block.AddConstant): Mark block as used.
1767         (Block.ResolveMeta): Avoid piling on error messages
1768         if a constant initializer resolution fails.
1769
1770 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1771
1772         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1773         Remove.
1774         (NamespaceEntry.VerifyAllUsing): New.
1775         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1776         behaviour.  Delegates actual resolution of alias to ...
1777         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1778         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1779         Update.
1780         * driver.cs (Driver.MainDriver): Update.
1781         
1782         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1783         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1784         property.
1785         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1786         Remove.
1787         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1788         RootNamespace.DefineNamespacesForAll.
1789
1790 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1791
1792         * typemanager.cs (assemblies, external_aliases, modules)
1793         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1794         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1795         overhead.  Move resposibility ...
1796         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1797         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1798
1799 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1800
1801         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1802         cached_namespaces.  Improve usage.
1803         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1804         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1805         Move from GlobalRootNamespace and simplify.
1806         (RootNamespace.Global): Make instance variable.
1807         (RootNamespace.RootNamespace): Add "alias name" parameter.
1808         (GlobalRootNamespace): Simplify drastically.
1809         (Namespace.Lookup): Don't use GetNamespace.
1810         * typemanager.cs (GetRootNamespace): Rename from
1811         ComputeNamespaceForAlias.
1812         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1813
1814 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1815
1816         * anonymous.cs (AnonymousContainer): Don't crash when container
1817         doesn't exist.
1818
1819 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1820
1821         * expression.cs (Binary.DoResolve): Warn when comparing same
1822         values.
1823
1824 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1825
1826         Fix #76486.
1827         * expression.cs (Binary.DoResolve): It looks like there are no
1828         convetsion rules in enum context.
1829
1830 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1831
1832         Add support for extern alias qualifiers.
1833         * typemanager.cs: Move some LookupTypeReflection code
1834         to namespace.cs, to have cleaner code. Added some methods
1835         to help us keep track of the extern aliased references.
1836         * driver.cs: Add suport for extern alias assemblies on command
1837         line and check for their warnings/errors. Also keep track of the
1838         extern aliased assemblies.
1839         * namespace.cs: Move the global functionality of Namespace
1840         to GlobalRootNamespace/RootNamespace. Now the global namespace
1841         is GlobalRootNamespace.Globa. Also the code moved from 
1842         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1843         Finally added LocalAliasEntry (AliasEntry before) and
1844         ExternAliasEntry, to handle alias statements.
1845         * cs-parser.jay: Add support in the grammar for extern alias
1846         statement.
1847         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1848         Update callings to Namespace (now in GlobalRootNamespace).
1849
1850 2005-10-25  Martin Baulig  <martin@ximian.com>
1851
1852         * convert.cs (ImplicitTypeParameterConversion): Make base
1853         interfaces actually work; fixes #76557.
1854
1855 2005-10-25  Martin Baulig  <martin@ximian.com>
1856
1857         * generic.cs
1858         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1859         all the type parameters; fixes #76551.
1860
1861 2005-10-25  Martin Baulig  <martin@ximian.com>
1862
1863         Fix #76472.
1864
1865         * generic.cs
1866         (GenericMethod.ctor): Added `Expression return_type' and
1867         `Parameters parameters' arguments.
1868         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1869         parameter and return types to check their constraints if they're
1870         generic types.
1871
1872         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1873         boolean field.
1874
1875         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1876         constraints of a generic type if `ec.ResolvingGenericMethod'.
1877
1878         * class.cs (MethodCore.DoDefineParameters): Set
1879         `ec.ResolvingGenericMethod' if we're a generic method.
1880         (MemberBase.MemberType): Likewise.
1881
1882 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1883
1884         * typemanager.cs (TypeManager): Added 
1885         TypeManager.internals_visible_attr_type to cache
1886         S.R.CompilerServices.InternalsVisibleToAttribute.
1887
1888         * codegen.cs (AssemblyClass): Added checks for 
1889         InternalsVisibleToAttribute in new method 
1890         CheckInternalsVisibleAttribute () and also cache the
1891         AssemblyName in AssemblyClass.Name.
1892         
1893 2005-10-24  Martin Baulig  <martin@ximian.com>
1894
1895         * typemanager.cs
1896         (TypeManager.ExpandInterfaces): Added overloaded version which
1897         just takes a `Type[]' array.
1898
1899         * generic.cs
1900         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1901         just use the interfaces which were explicitly specified and not
1902         the interfaces they inherit.  Fixes #76482.
1903         (TypeParameter.FindMembers): Expand the interfaces here.
1904
1905 2005-10-21  Martin Baulig  <martin@ximian.com>
1906
1907         * generic.cs
1908         (Constraints.Resolve): Also resolve the actual types here.
1909         (Constraints.ResolveTypes): Just check the constraints here.
1910         Fixes #76363; see gtest-218.cs.
1911
1912 2005-10-21  Martin Baulig  <martin@ximian.com>
1913
1914         * convert.cs
1915         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1916         instead of a `BoxedCast'; fixes gtest-217.cs.
1917
1918 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1919
1920         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1921           1) "new()" is specified as generic parameter constraint and 2) the
1922           type is TypeBuilder and 3) the type is abstract even if it has a
1923           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1924
1925 2005-10-20  Martin Baulig  <martin@ximian.com>
1926
1927         * generic.cs
1928         (GenericConstraints.TypeParameter): New public property.
1929         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1930         (TypeParameter.DeclSpace): New public property.
1931         (TypeParameter.DefineType): Inflate the constraints if our
1932         `DeclSpace' is an `Iterator'.   
1933
1934 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1935
1936         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1937           GenericMethod argument to compare methods' generic type arguments.
1938           Fixed bug #76382.
1939
1940 2005-10-19  Martin Baulig  <martin@ximian.com>
1941
1942         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1943         not ResolveType() when resolving the base type, so we're not
1944         checking the constraints here.
1945         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1946         if we have any.
1947
1948 2005-10-19  Martin Baulig  <martin@ximian.com>
1949
1950         * generic.cs (ConstructedType.CheckConstraints): Committing
1951         untested fix for #76441.
1952
1953 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1954
1955         Fix #76371.
1956         * class.cs (TypeContainer.DefineType): Move updating of
1957         topological sort earlier in the code.
1958         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1959
1960 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1961
1962         Fix #76273.
1963         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1964         
1965         * constant.cs (Constant.TryReduce): Moved from Cast class.
1966         (Reduce): Made little bit more OO and fixed missing conversions.
1967         
1968         * ecore.cs (Reduce): Implemented.
1969         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1970         
1971         * literal.cs (Reduce): Implemented.
1972         
1973         * class.cs: Reverted Miguel's wrong commit.
1974
1975 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1976
1977         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1978
1979 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1980
1981         * cs-parser.jay, expression.cs : CS0214 was missing error location
1982           for constants. Fixed bug #76404.
1983
1984 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1985
1986         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1987         InstanceExpression.
1988         (PropertyExpr.EmitCall): Likewise.
1989         * expression.cs (Invocation.EmitArguments): Handle case where
1990         arguments == null.
1991         (Invocation.EmitCall): Avoid allocating temporary variable if
1992         there are no arguments.
1993
1994 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1995
1996         Fix #76370.
1997         * convert.cs (ExplicitConversionCore): Fixed object->enum
1998         conversion.
1999
2000 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2001
2002         Fix #76323.
2003         * convert.cs (ImplicitConversionStandard): Move conversion of
2004         void* to arbitrary pointer types ...
2005         (ExplicitConversionStandard): .. here.
2006         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2007         error to always print typenames.
2008
2009 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2010
2011         * convert.cs (GetConversionOperator): Rename from
2012         GetConversionOperators.  Move operator selection code from ...
2013         (UserDefinedConversion): ... here.
2014
2015 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2016
2017         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2018         conversion.
2019
2020 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2021
2022         * assign.cs (Assign.DoResolve): Error method changed.
2023
2024         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2025         
2026         * const.cs (ResolveValue): Reset in_transit immediately.
2027         
2028         * constant.cs: Error method changed.
2029         
2030         * convert.cs: Removed useless location parameter.
2031         (ExplicitNumericConversion): Don't do double enum check.
2032         (ExplicitConversionCore): Renamed from ExplicitConversion.
2033         (ExplicitUnsafe): Extracted from ExplicitConversion.
2034         (ExplicitConversion): Uses for error reporting.
2035         
2036         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2037         error messages.
2038         (ResolveBoolean): Uses common error method.
2039         (CastToDecimal): Get rid of ec.
2040         (CastFromDecimal): Optimized.
2041         (ConvCast): Get rid of ec.
2042         
2043         * enum.cs (ResolveValue): Reset in_transit immediately.
2044         (Emit): Return after first error.
2045         
2046         * expression.cs: Convert changes.
2047         
2048         * literal.cs: Error method changed.
2049         
2050         * statement.cs: Error method changed.
2051
2052 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2053
2054         Fix gtest-131.cs and gtest-211.cs.
2055         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2056         Only emit code for a label if it is used.  Unreachable code can
2057         violate ECMA evaluation stack invariants.
2058
2059 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2060
2061         * anonymous.cs: Implemented ExprClassName.
2062         
2063         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2064         delegate.
2065         
2066         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2067         check.
2068         
2069         * class.cs (StaticClass.DefineContainerMembers): Report protected
2070         members as error.
2071         
2072         * codegen.cs: if(ed) PRODUCTION.
2073         
2074         * convert.cs (Error_CannotImplicitConversion): Better error
2075         distinction.
2076         
2077         * cs-parser.jay: More error checks.
2078         
2079         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2080         
2081         * driver.cs (CSCParseOption): Enabled wrong option check.
2082         
2083         * ecore.cs (Expression.ExprClassName): Turned to property.
2084         (MemberExpr.CheckIntermediateModification): For checking boxed
2085         value types     modification.
2086         
2087         * statement.cs (Fixed.Resolve): Expression type must be
2088         convertible to fixed type.
2089         (CollectionForeach.GetEnumeratorFilter,TryType):
2090         Small refactoring for easier error checking.
2091
2092 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2093
2094         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2095         attributes.
2096         
2097         * class.cs (GeneratedBaseInitializer): New class for customization
2098         compiler generated initializers.
2099         (MemberBase.DoDefine): Check Obsolete attribute here.
2100         (FieldMember.DoDefine): Ditto.
2101         
2102         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2103         constants.
2104         
2105         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2106         (MemberCore.GetObsoleteAttribute): Removed argument.
2107         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2108         (MemberCore.CheckObsoleteType): New helper.
2109         
2110         * delegate.cs,
2111         * enum.cs,
2112         * statement.cs: Updates after MemberCore changes.
2113         
2114         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2115         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2116         
2117         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2118         obsolete attribute for compiler construct.
2119         (As.DoResolve): Cache result.
2120         
2121         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2122
2123 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2124
2125         * expression.cs (Probe): instead of having a "Type probe_type"
2126         keep the extra information as a TypeExpr probe_type_expr since the
2127         "As" operator needs to perform some type checks.
2128
2129         * (As.DoResolve): If the type is a type parameter, ensure that it
2130         is constrained by a class.
2131
2132 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2133
2134         * statement.cs (Lock): Use the TemporaryVariable class instead of
2135         manually using local variables as those do not work when variables
2136         are captured.
2137
2138         * ecore.cs: Moved the TemporaryVariable class from being a nested
2139         class inside Foreach to be a public class that can be employed in
2140         other places. 
2141
2142 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2143
2144         * cs-parser.jay: interface_accessors replaced by
2145         accessor_declarations.
2146
2147         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2148         location.
2149         
2150         * statement.cs (GotoCase.Resolve): Convert null constant to
2151         null case.
2152         (SwitchLabel.ResolveAndReduce): Ditto.
2153         (SwitchLabel.NullStringCase): Custom null stamp.
2154         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2155         
2156         typemanager.cs (CSharpSignature): Don't skip first argument
2157         for full names.
2158
2159 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2160
2161         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2162         expression.cs, iterators.cs, literal.cs: Store constants and
2163         literals location.
2164         
2165         * class.cs (MemberBase.ShortName): Pass location.
2166         
2167         * cs-parser.jay: Some location fixes.
2168         
2169         * ecore.cs (Expression.Location): Made virtual.
2170
2171 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2172
2173         Fix #72930.
2174         * const.cs (Const.ResolveValue): Check for assigning non-null
2175         value to reference type.
2176
2177 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2178
2179         Fix #76133.
2180         * expression.cs (This.VerifyFixed): In a value type T, the type of
2181         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2182         value type R, 'this' is treated as a value parameter.
2183
2184 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2185
2186         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2187         if the underlying types are the same, otherwise we need to produce
2188         code that will do the proper cast.
2189
2190         This was exposed by Marek's constant rewrite which produced
2191         invalid code for the call site:
2192
2193         enum X : long { a }
2194         void Method (X v) {}
2195
2196         Method ((X) 5)
2197
2198         This fixes test-49.cs
2199
2200 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2201
2202         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2203           Type/Object should be allowed as well. Fixed bug #75968.
2204
2205 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2206
2207         * expression.cs : (Binary.DoResolve): when one is enum constant and
2208           another is constant 0, then return enum one *as enum type*.
2209           Fixed bug 74846.
2210
2211 2005-10-04  Martin Baulig  <martin@ximian.com>
2212
2213         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2214         `SetMemberIsUsed()' work for generics, too.
2215
2216 2005-10-04  Martin Baulig  <martin@ximian.com>
2217
2218         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2219         for corlib.  Fixes #75691.
2220
2221 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2222
2223         Fix #76255.
2224         * driver.cs: Fix compilation files with full root path.
2225
2226 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2227
2228         * report.cs (SymbolRelatedToPreviousError): Format the output so
2229         it does not use an open parenthesis that is never closed. 
2230
2231         * driver.cs: Follow coding guidelines
2232
2233 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2234
2235         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2236
2237         * location.cs (InEmacs): in this mode, do not report column
2238         location as it confuses Emacs.
2239
2240 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2241
2242         * support.cs (SeekableStreamReader.Position): Don't error out when
2243         the requested position is just beyond the end of the current
2244         buffered data.
2245
2246 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2247
2248         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2249         try to keep in sync with the byte count of the underlying Stream.
2250         However, this limits us to a window size of 2048 characters: i.e.,
2251         the maximum lookahead of our lexer/parser can be 2048 characters.
2252
2253 2005-09-22  Martin Baulig  <martin@ximian.com>
2254
2255         * driver.cs: Removed a debugging FIXME.
2256
2257 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2258
2259         * cs-parser.jay (type_arguments): Add CS1644 check.
2260         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2261
2262 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2263
2264         * Makefile (PROGRAM): Make profile specific.
2265         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2266         the current directory.
2267
2268         Fix test-455.cs.
2269         * expression.cs (Invocation.EmitCall): Remove optimization on
2270         this_call since it doesn't handle 'this' being a value type.
2271
2272 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2273
2274         * driver.cs: Ensure file handles are closed after parsing
2275
2276 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2277
2278         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2279         if the underlying types are the same, otherwise we need to produce
2280         code that will do the proper cast.
2281
2282         This was exposed by Marek's constant rewrite which produced
2283         invalid code for the call site:
2284
2285         enum X : long { a }
2286         void Method (X v) {}
2287
2288         Method ((X) 5)
2289
2290         This fixes test-49.cs
2291
2292 2005-09-05  Martin Baulig  <martin@ximian.com>
2293
2294         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2295         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2296
2297         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2298
2299 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2300
2301         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2302           to be a pointer type due to the spec 25.2, so check if declaring
2303           type is generic type definition. Fixed bug #75772.
2304
2305 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2306
2307         Fixed bug #75957.
2308         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2309           both types are not defined by methods.
2310         * expression.cs : (Invocation.IsApplicable): it should work when
2311           the argument type is equal to the parameter type, not only when
2312           ImplicitConversionExists() returns true.
2313
2314 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2315
2316         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2317         internal.
2318
2319         Fix #75941.
2320         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2321         flow-branching for LocalVariableReferences in case we were invoked
2322         from a MemberAccess.
2323         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2324         Carved out of ...
2325         (LocalVariableReference.DoResolveBase): ... this.
2326         (MemberAccess.Resolve): Do the check that was disabled during
2327         SimpleNameResolve.
2328
2329 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2330
2331         * class.cs :
2332           (PartialContainer.Create): check abstract/sealed/static strictly
2333           but abstract/sealed can exist only at one side. Fixed bug #75883.
2334
2335 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2336
2337         Fix #75945.
2338         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2339         specified, don't default to UnmanagedType.I4.
2340
2341 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2342
2343         * expression.cs : conditional operator should check possibly
2344           incorrect assign expression. Fixed bug #75946.
2345
2346 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2347
2348         Fix #75934.
2349         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2350         (ScopeInfo.EmitScopeType): Use it to construct field names from
2351         names of captured locals.
2352
2353         Fix #75929.
2354         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2355         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2356         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2357         (ExplicitConversion): Remove enum cases already handled by
2358         implicit conversion.  Move implicit conversion check to the beginning.
2359         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2360         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2361         Don't treat System.Enum as a struct.
2362
2363 2005-08-30  Jb Evain  <jbevain@gmail.com>
2364
2365         * attribute.cs: handles as expression in parameters.
2366
2367 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2368
2369         Fix #75802.
2370         * class.cs (TypeContainer.VerifyClsName): Don't use a
2371         PartialContainer when verifying CLS compliance.
2372         (AbstractPropertyEventMethod): Set Parent here, ...
2373         (PropertyMethod): ... not here.
2374
2375 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2376
2377         * attribute.cs : escaped attribute name should not be allowed to be
2378           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2379
2380 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2381
2382         Fix #75927.
2383         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2384         when converting a long constant to unsigned long.
2385         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2386         detect where IsApplicable and VerifyArgumentsCompat disagree.
2387
2388 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2389         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2390
2391         Fix #75848.
2392         * class.cs (TypeContainer.CanElideInitializer): New helper.
2393         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2394         can safely emitting the initializer of a field.
2395
2396 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2397
2398         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2399           allowed inside a switch (without loop). Fixed bug #75433.
2400
2401 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2402
2403         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2404         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2405
2406 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2407
2408         * driver.cs : kinda reverting the default encoding changes (not exact 
2409           revert since I noticed that "codepage:reset" might not work fine).
2410
2411 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2412
2413         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2414           Location. Now getter and setter store location correctly.
2415           (errors/cs0111-12.cs now reports the expected location.)
2416
2417 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2418
2419         * driver.cs : Use default encoding on the environment.
2420           Removed (now that) extra parameter for SeekableStreamReader.
2421         * support.cs : (SeekableStreamReader) third .ctor() argument for
2422           StreamReader is not required (always true). preamble size could
2423           be acquired in simpler and safe way.
2424
2425 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2426
2427         * cs-parser.jay: report CS0642 at warning level 3
2428           and report CS0642 for an if else statement also
2429           fixes bug #74745. Patch by John Luke (and a bit
2430           modified by me).
2431           Removed extra CS0642 warning check for "while",
2432           "for" and "fixed".
2433         * statement.cs: In Block.Resolve(), CS0642 check
2434           is reimplemented to check a sequence of an empty
2435           statement and a block.
2436
2437           Both fix bug #66777.
2438
2439 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2440
2441         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2442         detection until I fix it.
2443         
2444         * cs-tokenizer.cs: Changed error message.
2445         
2446         * cs-parser.jay: Fixed 2 error locations.
2447         
2448         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2449         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2450         properties.
2451         
2452         * enum.cs (GetSignatureForError): Fixed.
2453         
2454         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2455         method detection.
2456         
2457         * class.cs,
2458         * typemanager.cs (RegisterProperty): Removed.
2459         
2460         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2461
2462 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2463
2464         Fix #75874.
2465         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2466         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2467
2468 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2469
2470         * expression.cs : tiny fix is required for not warning positive ulong.
2471           See test-441.cs.
2472
2473 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2474
2475         * expression.cs : add CS0652 check for constant and integral
2476           expression. Fixed bug #53974.
2477
2478 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2479
2480         * expression.cs : in DoNumericPromotions(), check if there is implicit
2481           conversion overload for string (to check CS0034). Fixed bug #52492.
2482
2483 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2484
2485         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2486
2487 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2488
2489         * ecore.cs : report location when it is *not* Null.
2490
2491 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2492
2493         * codegen.cs,
2494           ecore.cs,
2495           flowanalysis.cs,
2496           expression.cs:
2497           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2498           correctly. Fixed bug #75721.
2499
2500 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2501
2502         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2503         loop that performs 'min (pos, char_count)'.
2504
2505         Fix #75862.
2506         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2507         converted value in Operator.OnesComplement.
2508
2509 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2510
2511         * anonymous.cs: If the anon method is pulled into a helper class,
2512         it needs to be `internal' not `private'. Fixes runtime behavior on
2513         msft. bug #75704
2514
2515 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2516
2517         Fix #75803
2518         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2519         is a partial class.
2520
2521 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2522
2523         The big constants rewrite
2524         Fix #75746, #75685 and more
2525         As a side effect saved 1MB for MWF ;-)
2526         
2527         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2528         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2529         enum based for corlib compilation.
2530         
2531         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2532         subtractions.
2533         
2534         * class.cs (FixedField.Define): Use ResolveAsConstant.
2535         
2536         * const.cs (IConstant): Interface constants and enums.
2537         (Const.ResolveValue): New method for constant resolvning.
2538         (ExternalConstant): Constants from imported assemblies.
2539         
2540         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2541         conversion; like enums.
2542         (Constant.ToType): Converts this constant to different type.
2543         (Constant.Increment): Adds 1.
2544         
2545         * convert.cs (ImplicitConversionRequired): Simplified.
2546         
2547         * cs-parser.jay: Create EnumMember directly.
2548         
2549         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2550         
2551         * doc.cs (GenerateEnumDocComment): Removed.
2552         
2553         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2554         (ConvertIntLiteral): Removed.
2555         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2556         
2557         * enum.cs (EnumMember): Implement IConstant.
2558         (Enum.IsValidEnumConstant): Removed.
2559         (Enum.GetNextDefaultValue): Removed.
2560         (Enum.FindMembers): Updated.
2561         (Enum.GenerateDocComment): Iterate enum members.
2562         
2563         * expression.cs (Cast.TryReduce): Handle enums correctly.
2564         (New.Constantify): Made public.
2565         (MemberAccess.DoResolve): Removed contant specific if(s).
2566         
2567         * literal.cs (NullLiteral): Implement new abstract methods.
2568         
2569         * statement.cs (GotoCase.Resolve): Use new constant methods.
2570         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2571         
2572         * typemanager.cs (LookupEnum): Removed.
2573         (IsEnumType): Fixed to work with corlib.
2574         (RegisterConstant): Removed.
2575         (LookupConstant): Removed.
2576         (GetConstant): Changed to work with IConstant.
2577
2578 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2579
2580         * location.cs : Fixed overflown (>255) column number.
2581
2582 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2583
2584         First cut of the qualified-alias-member feature.
2585         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2586         token.
2587         * cs-parser.jay (DOUBLE_COLON): New token.
2588         (namespace_or_type_name): Add rule for recognizing
2589         qualified-alias-members.
2590         (primary_expression): Likewise.
2591         (element_access): Allow QualifiedAliasMember as a possible
2592         type-bearing expression.
2593         (local_variable_type, local_variable_pointer_type): Likewise.
2594         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2595         aliases in the current and enclosing namespace declarations.
2596         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2597         * decl.cs (MemberName.is_double_colon): New.
2598         (MemberName.MemberName): Add new constructor for alias-member.
2599         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2600         * expression.cs (QualifiedAliasMember): New expression type.
2601
2602 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2603
2604         * location.cs : it borked when no argument was specified.
2605
2606 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2607
2608         * location.cs : tiny ToString() format fix.
2609
2610 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2611
2612         * statement.cs : oops, it was missing.
2613
2614 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2615
2616         A set of fixes for precise line/column location.
2617
2618         * location.cs :
2619           "token" field now holds a file/line "delta", a line number offset 
2620           from the segment, and a column number. See also:
2621           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2622           December/009508.html
2623           Removed static IsNull. Use instance IsNull property instead.
2624         * cs-tokenizer.cs :
2625           For some tokens it stores Location. For Identifier it stores
2626           LocatedToken which is a pair of string name and location.
2627           Column numbers are adjusted only at getChar().
2628         * report.cs :
2629           Use Location.ToString() for reporting (it now contains column).
2630         * cs-parser.jay :
2631           Largely modified to use LocatedToken instead of
2632           string (IDENTIFIER), and to acquire Location from some tokens.
2633         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2634           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2635           codegen.cs :
2636           Now MemberName holds Location. DeclSpace.ctor() receives Location
2637           as a parameter. Removed extra parameters to all derived classes.
2638           Replaced Location.IsNull() with instance property.
2639         * assign.cs, expression.cs :
2640           Added .ctor() overload that omits Location.
2641         * attribute.cs :
2642           Added "nameEscaped" flag that indicates the identifier was escaped
2643           in the source file. This fixes bug #57047.
2644
2645 2005-09-02  Martin Baulig  <martin@ximian.com>
2646
2647         * class.cs: Make CS3005 a warning, not an error.
2648
2649 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2650
2651         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2652         New method, looking for lo-case imported cls type.
2653
2654         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2655         here.
2656
2657         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2658
2659         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2660
2661         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2662         all_imported_types.
2663         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2664
2665         Optimized to save 3.5 MB for SWF compilation.
2666
2667 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2668
2669         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2670         (PartialContainer.Create): Moved logic AddToContainer.
2671         (PartialContainer.MarkForDuplicationCheck): Shares name.
2672         
2673         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2674         place.
2675         
2676         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2677         initialization.
2678         (Namespace.GetSignatureForError): New method.
2679         
2680         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2681         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2682
2683 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2684
2685         Fix #75669.
2686         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2687         member lookup rather than qualifier_type, since qualifier_type can
2688         be null.
2689
2690 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2691
2692         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2693         enum member.
2694
2695 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2696
2697         * statement.cs: Copy the local exception into the exception
2698         captured local.  Fixes 75674
2699
2700 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2701
2702         Fix #75658.
2703         * expression.cs (Invocation.OverloadResolve): Don't report error
2704         CS1501 if error CS1502 has been reported.
2705         (New.DoResolve): Delegate CS1501 reporting to
2706         Invocation.OverloadResolve.
2707
2708         Fix #75656.
2709         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2710         invariant-meaning-in-block property in an enclosing block if
2711         necessary.
2712
2713 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2714
2715         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2716         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2717         (Switch.CheckSwitch): Just save 50kb for SWF.
2718
2719 2005-07-27  Martin Baulig  <martin@ximian.com>
2720
2721         * anonymous.cs (CaptureContext.AddField): Added
2722         `AnonymousContainer am' argument; compute its toplevel scope if
2723         it's not already computed.  Fixes #75649.
2724
2725 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2726
2727         Fix #75628.
2728         * class.cs (Constructor.Emit): Reset block to null if the block
2729         resolve fails.
2730
2731 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2732
2733         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2734
2735 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2736
2737         * class.cs (MethodData.Define): Check whether accessor implementing
2738         interface is public.
2739
2740         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2741
2742 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2743
2744         Fix #57245
2745         * namespace.cs (LookupType): Moved same type check to...
2746         
2747         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2748         with the same name.
2749
2750 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2751
2752         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2753         already found a typebuilder.
2754         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2755         MemberNames, not strings.
2756
2757         * const.cs (Error_ExpressionMustBeConst): 
2758         Rename from Error_EpressionMustBeConst.
2759         * const.cs, class.cs, statement.cd: Update.
2760
2761 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2762
2763         Fix #65573
2764
2765         * const.cs (Const.LookupConstantValue): Report missing contant expression
2766         everytime.
2767         (Error_EpressionMustBeConstant): Only one error method.
2768
2769         * class.cs, statement.c: Updated.
2770
2771 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2772
2773         * statement.cs (Block.Flags): Add back HasVarargs.
2774         (Block.flags): Make protected.
2775         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2776
2777         * typemanager.cs (types, typecontainers, user_types): Remove.
2778         (UserTypes, TypeContainers): Likewise.
2779         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2780         (CleanUp, Reset): Update.
2781         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2782         (GetNestedType): Use Type.GetNestedType.
2783         (CoreLookupType): Take two arguments, the namespace and the
2784         basename of the type.  Update to use the Namespace.Lookup
2785         mechanism.
2786         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2787         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2788         string concatenation and substring matches.
2789         * class.cs, enum.cs, delegate.cs: Update to changes.
2790
2791 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2792
2793         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2794         Expression and made virtual.
2795
2796         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2797         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2798
2799         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2800
2801         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2802         error message.
2803
2804         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2805         change.
2806
2807 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2808
2809         Fix #57707
2810         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2811         AssemblyCultureAttribute is not used on executable.
2812
2813         * rootcontext.cs,
2814         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2815
2816 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2817
2818         Fix #60638.
2819         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2820         New.  Reports CS0252/CS0253.
2821         Mostly taken from preliminary patch by Duncak Mak.
2822         (Binary.DoResolveOperator): Store results of operator lookup.
2823         Use them to detect if we need to warn about unintended reference
2824         comparisons.
2825
2826 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2827
2828         Fix #72969.
2829         * namespace.cs (Namespace.Lookup): Add back location parameter.
2830         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2831         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2832
2833         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2834         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2835         (Namespace.LookupType): ... this.
2836         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2837         of namespaces.
2838         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2839         purported to handle pointers.
2840         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2841         CoreLookupType.
2842
2843 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2844
2845         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2846         type as namespace.
2847
2848 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2849
2850         * namespace.cs (Namespace.Lookup): Drop location parameter.
2851         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2852         (NamespaceEntry.Lookup): ... this.
2853         (NamespaceEntry.Error_AmbiguousTypeReference):
2854         Move here from DeclSpace.
2855         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2856         names ...
2857         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2858         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2859         Move to NamespaceEntry.
2860         * delegate.cs, expression.cs: Update to changes.
2861
2862 2005-08-31  Martin Baulig  <martin@ximian.com>
2863
2864         Committing a patch from Atsushi Enomoto for #75850.
2865
2866         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2867         Prefer a generic enumerator over a non-generic one.
2868
2869 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2870
2871         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2872         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2873
2874 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2875
2876         * driver.cs : reverting default encoding change as well as mcs.
2877
2878 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2879
2880         * driver.cs, support.cs : merged r48826.
2881           Marek Safer wrote:
2882           > could you integrate your mcs changes to gmcs otherwise
2883           > gmcs cannot compile some files.
2884
2885 2005-08-20  Martin Baulig  <martin@ximian.com>
2886
2887         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2888         scope if we don't already have it.
2889
2890         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2891         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2892         fixes #75867.
2893
2894 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2895
2896         * statement.cs: Copy the local exception into the exception
2897         captured local.  Fixes 75674
2898
2899 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2900
2901         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2902         type as namespace.
2903
2904 2005-08-12  Martin Baulig  <martin@ximian.com>
2905
2906         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2907         for nested types here to avoid hitting the cache too early.
2908
2909 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2910
2911         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2912         an error. 
2913
2914 2005-08-03  Martin Baulig  <martin@ximian.com>
2915
2916         Make iterators in generic methods work; see gtest-191.cs.
2917
2918         * generic.cs
2919         (Constraints.Resolve): Protect against being called twice.
2920
2921         * class.cs
2922         (TypeContainer.GetClassBases): Make this `protected virtual'.
2923
2924         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2925         (Iterator.GetClassBases): Override this and compute the base
2926         classes here.
2927         (Iterator.DefineNestedTypes): If we're a generic method, all our
2928         method type parameters become class type parameters on the proxy
2929         class.
2930
2931         * statement.cs
2932         (ToplevelBlock.Parameters): Make this a property, not a field.
2933         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2934
2935 2005-08-03  Martin Baulig  <martin@ximian.com>
2936
2937         * typemanager.cs (TypeManager.IsSubclassOf): Use
2938         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2939         (TypeManager.GetFullName_recursed): Improved.
2940
2941 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2942
2943         Fix #75417
2944         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2945         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2946         invocation_type == mi.DeclaringType, since the first one also checks
2947         other condition used by generic instances.
2948         
2949 2005-07-27  Martin Baulig  <martin@ximian.com>
2950
2951         * anonymous.cs (CaptureContext.AddField): Added
2952         `AnonymousContainer am' argument; compute its toplevel scope if
2953         it's not already computed.  Fixes #75649.
2954
2955 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2956
2957         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2958         CheckAttributeType and refactored.
2959         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2960         ResolveAsTypeTerminal error handling.
2961         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2962         handling.
2963         (GetSignatureForError): Print errors in same way.
2964
2965         * class.cs,
2966         * codegen.cs: Reflect attribute GetSignatureForError change.
2967
2968         * ecore.cs,
2969         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2970
2971         * namespace.cs (UsingEntry): Refactored to make fields private.
2972
2973         * assign.cs,
2974         statement.cs: Error_UnexpectedKind has extra parameter.
2975
2976 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2977
2978         * ecore.cs (IAlias): Remove.
2979         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2980         that implement the interface.
2981         * namespace.cs (Namespace): Likewise.
2982         (Namespace.declspaces): Renamed from 'defined_names'.
2983         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2984         DeclSpace instead of an IAlias.
2985         * tree.cs (Tree.AddDecl): Update.
2986
2987 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2988
2989         * statement.cs (Block.Flags); Remove HasVarargs.
2990         (Block.HasVarargs): Move to ToplevelBlock.
2991         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2992         (Block.Variables): Make protected.  Initialize variable hashtable
2993         if necessary.
2994         (Block.AddVariable): Update.
2995         (Block.Resolve): Update to changes.
2996         (ToplevelBlock.HasVarargs): New boolean.
2997         (ToplevelBlock.ThisVariable): Move here from Block.
2998         (ToplevelBlock.AddThisVariable): Likewise.
2999         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3000         * expression.cs (This.ResolveBase): Update to changes.
3001         (ArglistAccess.DoResolve): Likewise.
3002
3003 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3004
3005         Fix #75321
3006         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3007
3008         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3009         not used and not used & assigned.
3010         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3011
3012 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3013
3014         Fix #75053
3015         * expression.cs (Is.DoResolve): null is never provided type.
3016
3017 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3018
3019         Fix #52496
3020         * cs-parser.jay: Less strict event error rule to catch more errors.
3021
3022 2005-07-11  Martin Baulig  <martin@ximian.com>
3023
3024         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3025         for the constructor constraint: we do not only have to check
3026         whether the class has a public constructor, but also ensure that
3027         it's parameterless.  Fixes #75492.
3028
3029 2005-07-11  Martin Baulig  <martin@ximian.com>
3030
3031         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3032         between type parameters if they either have the reference type
3033         constraint or the class constraint.
3034
3035 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3036
3037         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3038
3039 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3040
3041         Fix #74975
3042         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3043         (ExtractSecurityPermissionSet): Cope with self referencing security
3044         attributes properly.
3045
3046         * driver.cs (SetOutputFile): Made public property OutputFile.
3047
3048 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3049
3050         Fix #75486.
3051         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3052         has_nonstatic_fields.  Make into a FieldBase pointer.
3053         (TypeContainer.AddField): Add CS0282 check.
3054         (TypeContainer.EmitType): Update.
3055
3056 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3057
3058         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3059         compare if they start with __.
3060
3061 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3062
3063         * statement.cs (Switch.SwitchGoverningType): Only look at
3064         UserCasts that don't need implicit standard conversions to one of
3065         the allowed switch types (Fixes test-322.cs).
3066         (LocalInfo.Resolve): Re-enable sanity-test.
3067
3068 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3069
3070         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3071         
3072         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3073         
3074         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3075
3076 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3077
3078         Fix #75472.
3079         * ecore.cs (SimpleName.GetSignatureForError): Add.
3080         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3081         (MemberAccess.GetSignatureForError): Add.
3082
3083 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3084  
3085         The big error and warning messages review.
3086         
3087         * anonymous.cs,
3088         * assign.cs,
3089         * attribute.cs,
3090         * class.cs,
3091         * codegen.cs,
3092         * convert.cs,
3093         * cs-parser.jay,
3094         * cs-tokenizer.cs,
3095         * decl.cs,
3096         * delegate.cs,
3097         * doc.cs,
3098         * driver.cs,
3099         * ecore.cs,
3100         * enum.cs,
3101         * expression.cs,
3102         * flowanalysis.cs,
3103         * iterators.cs,
3104         * literal.cs,
3105         * location.cs,
3106         * modifiers.cs,
3107         * namespace.cs,
3108         * parameter.cs,
3109         * pending.cs,
3110         * report.cs,
3111         * rootcontext.cs,
3112         * statement.cs,
3113         * support.cs,
3114         * tree.cs,
3115         * typemanager.cs: Updated.
3116         
3117         * class.cs: (MethodCore.SetYields): Moved here to share.
3118         (PropertyMethod.Define): Moved iterator setup here.
3119         
3120         * iterators.cs: Add orig_method to have full access to parent
3121         container.
3122
3123 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3124
3125         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3126         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3127         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3128         variable of struct type.
3129         * expression.cs (Unary.ResolveOperator): Update to change.
3130         (Indirection.VerifyFixed): Likewise.
3131         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3132         (ParameterReference.VerifyFixed): Value parameters are fixed.
3133         (This.VerifyFixed): Treat 'this' as a value parameter.
3134         * statement.cs (LocalInfo.IsFixed): Remove.
3135
3136 2005-07-01  Martin Baulig  <martin@ximian.com>
3137
3138         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3139         `ec.EmitThis ()' to get the correct scope.
3140
3141 2005-07-01  Martin Baulig  <martin@ximian.com>
3142
3143         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3144         instance is a ParameterReference; fixes #75299.
3145
3146 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3147
3148         Fix #75412.
3149         * expression.cs (Indexers.map): Remove.
3150         (Indexers.Append): Filter out inaccessible setters and getters.
3151         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3152
3153         Fix #75283.
3154         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3155         Refactored from ...
3156         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3157         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3158         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3159         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3160
3161 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3162
3163         Fix #75322
3164         * class.cs (FieldBase.GetInitializerExpression): One more field
3165         for backup.
3166
3167 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3168
3169         * pending.cs: Do not define a proxy if the base method is virtual,
3170         it will be picked up by the runtime (bug 75270).
3171
3172 2005-07-08  Martin Baulig  <martin@ximian.com>
3173
3174         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3175         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3176
3177 2005-07-07  Martin Baulig  <martin@ximian.com>
3178
3179         * generic.cs (ConstructedType.CheckConstraint): Use
3180         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3181         called recursively; fixes #75329.
3182
3183 2005-07-06  Martin Baulig  <martin@ximian.com>
3184
3185         * generic.cs (TypeManager.InferTypeArguments): Added support for
3186         anonymous methods; fixes #75461.
3187
3188 2005-07-01  Martin Baulig  <martin@ximian.com>
3189
3190         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3191         `ec.EmitThis ()' to get the correct scope.
3192
3193 2005-07-01  Martin Baulig  <martin@ximian.com>
3194
3195         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3196         instance is `This'; fixes #75299.
3197
3198 2005-06-30  Martin Baulig  <martin@ximian.com>
3199
3200         * class.cs (Indexer): Implement IIteratorContainer; added support
3201         for iterators in indexers.
3202
3203         * codegen.cs
3204         (EmitContext.CurrentIterator): Make this a property, not a field.
3205
3206         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3207
3208 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3209
3210         * pending.cs: Do not define a proxy if the base method is virtual,
3211         it will be picked up by the runtime (bug 75270).
3212
3213 2005-06-28  Martin Baulig  <martin@ximian.com>
3214
3215         * cs-parser.jay (interface_method_declaration): Avoid a
3216         reduce/reduce conflict by moving some of the code into a separate
3217         `interface_method_declaration_body' rule; fixes #75368.
3218
3219 2005-06-28  Martin Baulig  <martin@ximian.com>
3220
3221         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3222         array check after the check for TypeBuilder's.
3223
3224 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3225
3226         * convert.cs (FindMostEncompassedType): Add two trivial special
3227         cases (number_of_types == 0 || number_of_types == 1).
3228         (FindMostEncompasingType): Likewise.
3229
3230 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3231
3232         Some cleanups preparing for the fix of #75283.
3233         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3234         error testing.
3235         (EventExpr.InstanceResolve): Likewise.
3236         (EventExpr.DoResolve): Remove redundant checks.
3237
3238 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3239
3240         * class.cs: Small fix.
3241
3242 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3243
3244         Fix #75160.
3245         * class.cs (GetPartialBases): Fix return value check of
3246         part.GetClassBases.
3247
3248 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3249
3250         Ensure that partial classes are registered in their enclosing
3251         namespace.  Initial part of fix of #75160.
3252         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3253         Register declspace with namespace here, not in
3254         DeclSpace.RecordDecl.
3255         * cs-parser.jay: Pass namespace to RecordDecl.
3256         * class.cs (PartialContainer.Create): Likewise.
3257         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3258         called.
3259         * decl.cs (Declspace.RecordDecl): Remove.
3260         * namespace.cs (NamespaceEntry.DefineName): Remove.
3261
3262 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3263
3264         * rootcontext.cs: Reset TargetExt as well.
3265
3266 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3267
3268         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3269         -langversion:ISO-1.
3270
3271 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3272
3273         Fix #75080, cs0119.cs.
3274         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3275         of ...
3276         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3277         allowing ExprClass.Type and ExprClass.Namespace for
3278         ResolveFlags.VariableOrValue.
3279         (Expression.Resolve) [1-argument variant]: Change default resolve
3280         flags based on language version.
3281         (Expression.Error_UnexpectedKind): Use a simple string array
3282         rather than an ArrayList.
3283         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3284         not ExprClass.Type.
3285         (TypeOfVoid.DoResolve): Likewise.
3286         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3287         flags argument -- it always has the same value.
3288
3289 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3290
3291         Fix #75081.
3292         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3293         Use it in the error message.
3294         * assign.cs, expression.cs, statement.cs: Update.
3295
3296 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3297
3298         Fix #75088.
3299         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3300         the "almostMatchedMember" case too.
3301         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3302         that failed the accessibility checks to 'almost_match'.
3303
3304 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3305
3306         * attribute.cs: Use internal MethodBuilder methods to set
3307         ExactSpelling and SetLastError on PInvoke methods, instead
3308         of passing them via charset.  Fixes #75060.
3309
3310 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3311
3312         * parameter.cs (Parameter): Remove TODO comment.
3313         (Parameter.DefineParameter): Remove Location parameter.
3314         (Parameters.LabelParameters): Likewise.
3315         * class.cs (Constructor.Emit): Update to change.
3316         (MethodData.Emit): Likewise.
3317         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3318         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3319
3320 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3321
3322         * parameter.cs,
3323           Removed Parameters.Location and added Parameter.Location instead.
3324           Removed Location parameter from Emit() and GetSignature().
3325         * anonymous.cs,
3326           class.cs,
3327           cs-parser.jay,
3328           delegate.cs,
3329           iterators.cs,
3330           statement.cs :
3331           Modified all related calls.
3332
3333 2005-06-21  Martin Baulig  <martin@ximian.com>
3334
3335         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3336         left-hand side is not a nullable type; fixes #75328.
3337
3338 2005-06-21  Martin Baulig  <martin@ximian.com>
3339
3340         * typemanager.cs
3341         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3342         (TypeManager.GetFullNameSignature): Likewise.
3343
3344         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3345         `source.FullName' and `target.FullName' to check whether there are
3346         two conflicting definitions.
3347
3348 2005-06-21  Martin Baulig  <martin@ximian.com>
3349
3350         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3351         a BoxedCast - also for reference types - to be compatible with csc.
3352
3353 2005-06-21  Martin Baulig  <martin@ximian.com>
3354
3355         * expression.cs (MemberAccess.DoResolve): Add support for nested
3356         types in a generic instance; fixes #75320.
3357
3358 2005-06-20  Martin Baulig  <martin@ximian.com>
3359
3360         * generic.cs (TypeManager.InferType): Also walk the class
3361         hierarchy for generic instances; fixes #75261.
3362
3363 2005-06-17  Martin Baulig  <martin@ximian.com>
3364
3365         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3366         to make things work for corlib.
3367
3368 2005-06-15  Martin Baulig  <martin@ximian.com>
3369
3370         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3371         obsolete `SecurityAction' values.
3372
3373 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3374
3375         * rootcontext.cs: Reset TargetExt as well.
3376         
3377 2005-06-09  Martin Baulig  <martin@ximian.com>
3378
3379         * delegate.cs (Delegate.VerifyMethod): Added
3380         `MethodGroupExpr old_mg' argument; inherit its
3381         `HasTypeParameters'; fix #75085.
3382
3383 2005-06-09  Martin Baulig  <martin@ximian.com>
3384
3385         * expression.cs (Invocation.OverloadResolve): Correctly handle
3386         generic methods for the SetMemberIsUsed(); fix #75064.
3387
3388 2005-06-09  Martin Baulig  <martin@ximian.com>
3389
3390         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3391         fixes #75062.
3392
3393 2005-06-08  Martin Baulig  <martin@ximian.com>
3394
3395         * cs-parser.jay (nullable_type_or_conditional): If we put the
3396         nullable back and our `type' is a `ComposedCast', remove the
3397         nullable from it.  Fixes #75156.
3398
3399         * expression.cs (ComposedCast.RemoveNullable): New public method.
3400
3401 2005-06-08  Martin Baulig  <martin@ximian.com>
3402
3403         The big Iterators rewrite :-)
3404
3405         * iterators.cs: Rewrite this to use the anonymous methods framework.
3406
3407         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3408         before the TypeContainers; see 2test-21.cs.
3409
3410         * class.cs
3411         (TypeContainer.DefineType): Don't create a new EmitContext if we
3412         already have one (this only happens if we're an Iterator).
3413         (TypeContainer.Define): Also call Define() on all our iterators.
3414         (Method.CreateEmitContext): Added support for iterators.
3415
3416         * anonymous.cs
3417         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3418         (AnonymousContainer.CreateMethodHost): Moved here from
3419         AnonymousMethod and made abstract.
3420         (AnonymousContainer.CreateScopeType): New abstract method.
3421         (AnonymousContainer.IsIterator): New public property.
3422         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3423         get the ScopeTypeBuilder rather than manually defining it here. 
3424         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3425         iterators here.
3426
3427         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3428         before RootContext.DefineTypes().
3429
3430         * codegen.cs (EmitContext.RemapToProxy): Removed.
3431         (EmitContext.CurrentAnonymousMethod): Changed type from
3432         AnonymousMethod -> AnonymousContainer.
3433         (EmitContext.ResolveTopBlock): Protect from being called twice.
3434         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3435         (EmitContext.EmitThis): Removed the iterators hacks; use the
3436         anonymous methods framework for that.
3437
3438         * statement.cs
3439         (ToplevelBlock.Container): Make this a property, not a field.
3440         (ToplevelBlock.ReParent): New public method; move the
3441         ToplevelBlock into a new container.
3442         (Foreach.TemporaryVariable): Simplify.
3443
3444 2005-06-05  Martin Baulig  <martin@ximian.com>
3445
3446         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3447         (Block.AddTemporaryVariable): New public method; creates a new
3448         `LocalInfo' for a temporary variable.
3449         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3450         variables here.
3451         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3452         non-iterator variables.
3453
3454 2005-06-05  Martin Baulig  <martin@ximian.com>
3455
3456         * statement.cs (Foreach.TemporaryVariable): Create the
3457         LocalBuilder in the Emit phase and not in Resolve since in some
3458         situations, we don't have an ILGenerator during Resolve; see
3459         2test-19.cs for an example.
3460
3461 2005-06-04  Martin Baulig  <martin@ximian.com>
3462
3463         The big Foreach rewrite - Part II.
3464
3465         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3466         with `PropertyInfo ienumerator_getcurrent'.
3467
3468         * codegen.cs (VariableStorage): Removed.
3469
3470         * statement.cs
3471         (Foreach): Derive from Statement, not ExceptionStatement.
3472         (Foreach.CollectionForeach): New nested class.  Moved all the code
3473         dealing with collection foreach here.
3474         (Foreach.ForeachHelperMethods): Removed.
3475         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3476
3477 2005-05-23  Martin Baulig  <martin@ximian.com>
3478
3479         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3480         don't need to.  Fix #75014.
3481
3482 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3483
3484         Improve user-defined conversion handling.
3485         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3486         applicable operators.
3487         (AddConversionOperators): New.  Helper for GetConversionOperators.
3488         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3489         there is only one most encompassed/encompassing type.
3490         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3491         "applicable operator" handling.
3492         (UserConversion): Move cache here from GetConversionOperators.
3493         Directly cache the chosen operator, rather than the whole
3494         MethodGroup.
3495         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3496         case.  Allow conversion of decimal to sbyte and byte too.
3497         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3498         New static methods.  Used to avoid allocating EmptyExpressions in
3499         convert.cs.
3500
3501 2005-05-24  Duncan Mak  <duncan@novell.com>
3502
3503         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3504         another class, used in Convert.ExplicitNumericConversion.
3505         (CastToDecimal): New class, similar to above, but casts to
3506         System.Decimal, used in Convert.ImplicitNumericConversion and also
3507         in explicit convesion from double/float to decimal.
3508
3509         * convert.cs (ImplicitNumericConversion): Handle implicit
3510         conversions to System.Decimal.
3511         (ExplicitNumericConversion): handle explicit conversions to
3512         System.Decimal.
3513
3514         This fixes #68711.
3515         
3516 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3517
3518         * typemanager.cs: Do not throw an exception in the TypeBuilder
3519         case, we take care of it on the TypeCode.
3520
3521 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3522         
3523         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3524         is back.
3525         
3526         * cs-parser.jay: Catch more lexical errors.
3527         
3528         * report.cs: Add one more Error method.
3529         
3530         * rootcontext.cs,
3531         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3532
3533 2005-05-20  Martin Baulig  <martin@ximian.com>
3534
3535         * class.cs (TypeContainer.CircularDepException): Removed.
3536         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3537         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3538         (CS0146) and interface (CS0529) dependencies here.
3539
3540 2005-05-20  Martin Baulig  <martin@ximian.com>
3541
3542         * expression.cs (New.DoResolve): Move the CS0712 check above the
3543         CS0144 check; otherwise it can never be reached.
3544
3545 2005-05-20  Martin Baulig  <martin@ximian.com>
3546
3547         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3548
3549 2005-05-20  Martin Baulig  <martin@ximian.com>
3550
3551         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3552
3553         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3554
3555 2005-05-19  Martin Baulig  <martin@ximian.com>
3556
3557         * delegate.cs
3558         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3559         to disable error reporting.
3560
3561         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3562         here since we don't want to report an error; see the new test-336.cs.
3563
3564 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3565
3566         * statement.cs (ToplevelBlock.GetParameterReference)
3567         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3568         Move here from class Block.
3569         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3570         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3571
3572 2005-05-18  Martin Baulig  <martin@ximian.com>
3573
3574         Fix #74978.
3575
3576         * flowanalysis.cs
3577         (FlowBranching.Reachability): Add non-static public And() and Or()
3578         methods.
3579         (FlowBranchingSwitch): New class; do the `break_origins' thing
3580         like in FlowBranchingLoop.
3581         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3582         reachability, not just locals and parameters.
3583         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3584         switch; MergeBreakOrigins() now takes care of that.
3585
3586 2005-05-18  Martin Baulig  <martin@ximian.com>
3587
3588         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3589         a loop and may leave it, reset the barrier; fixes #74974.
3590
3591 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3592
3593         Fix test-382.cs.  Emit values of decimal constants.
3594         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3595         Carved out of ...
3596         (TypeContainer.AddField): ... this.
3597         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3598         with initializers to include 'Const's.
3599         (ClassPart.RegisterFieldForInitialization): Forward to
3600         PartialContainer.
3601         * const.cs (Const.Const): Pass initializer to base class.
3602         (Const.Define): In case of decimal constants, register them for
3603         initialization in a static constructor.
3604
3605 2005-05-14  Martin Baulig  <martin@ximian.com>
3606
3607         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3608         do not call ResolveUnreachable() on unreachable statements in
3609         here, see the comment in the source code.
3610
3611 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3612
3613         Fix #74934.
3614         * expression.cs (BinaryResolveOperator): If one of the operands of
3615         an equality comparison is 'null' and the other is a pointer type,
3616         convert the null to a NullPointer.
3617         * convert.cs (ImplicitReferenceConversion): If the expression is a
3618         NullLiteral and the target type is a pointer type, return a
3619         NullPointer instead.
3620         (ImplicitConversionStandard): Likewise.
3621
3622 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3623         
3624         * cs-parser.jay: Set readonly context based on special constructs.
3625         
3626         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3627         readonly variable error handling.
3628         
3629         * rootcontext.cs (EmitCode): Don't verify members when error
3630         occurred.
3631         
3632         * statement.cs (LocalInfo): Add reaodnly context information.
3633         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3634
3635 2005-05-17  Martin Baulig  <martin@ximian.com>
3636
3637         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3638         #70970. 
3639
3640 2005-05-13  Martin Baulig  <martin@ximian.com>
3641
3642         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3643         handle unreachable blocks.
3644
3645 2005-05-13  Martin Baulig  <martin@ximian.com>
3646
3647         * class.cs
3648         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3649         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3650         #74905. 
3651
3652 2005-05-13  Martin Baulig  <martin@ximian.com>
3653
3654         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3655         instance variable, not a local.  Fix #74873.
3656         (Block.ResolveUnreachable): Set it to true here.
3657
3658 2005-05-12  Martin Baulig  <martin@ximian.com>
3659
3660         * cs-parser.jay (property_declaration): Pass the `current_class',
3661         not the `current_container' to Property's .ctor.  Fixes #74912.
3662
3663 2005-05-11  Martin Baulig  <martin@ximian.com>
3664
3665         * typemanager.cs (Closure): Copy this from MCS and merge all the
3666         GMCS-specific changes into it.
3667
3668 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3669
3670         Fix #74920.
3671         * typemanager.cs (unmanaged_enclosing_types): New.
3672         (IsUnmanagedType): Avoid infloops by using
3673         'unmanaged_enclosing_types' to talk with recursive invocations.
3674
3675 2005-05-11  Duncan Mak  <duncan@novell.com>
3676
3677         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3678         continuing to process for 'arg'.
3679         (handle_preprocessing_directive): Check the argument of the #endif
3680         directive and report error CS1025 if there are any trailing
3681         characters.
3682
3683         According to the C# spec, having even whitespace after the #endif
3684         directive is illegal; however, because we call arg.TrimEnd ()
3685         beforehand, we have the same behavior as csc, allowing whitespace
3686         after the directive.
3687
3688         Fixes #74892.
3689
3690 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3691
3692         Fix #74863.
3693         
3694         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3695         (Constructor.GetObsoleteAttribute): Implemented correctly.
3696
3697 2005-05-10  Martin Baulig  <martin@ximian.com>
3698
3699         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3700         resolve the type; fixes #74864.
3701         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3702         in DoResolve(); fixes #74862.
3703
3704 2005-05-10  Martin Baulig  <martin@ximian.com>
3705
3706         * support.cs (ReflectionParameters.ParameterModifier): Use
3707         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3708         and `ParameterAttributes.In'.  Fixes #74884.
3709
3710 2005-05-10  Martin Baulig  <martin@ximian.com>
3711
3712         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3713         the cache if we're just looking for `MemberTypes.NestedType' in a
3714         generic instance.
3715
3716         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3717         constraints if we're still resolving the type tree.
3718         (Expression.MemberLookup): If we're resolving the type tree, only
3719         look for `MemberTypes.NestedType' since we're only interested in
3720         getting types.
3721
3722         * class.cs (TypeContainer.DefineType): Don't resolve the type
3723         parameters here; do this later in ResolveType() after the type
3724         tree has been resolved.
3725         (TypeContainer.ResolveType): New public method; this is called
3726         after the type tree is resolved and before the types are being
3727         populated.  We resolve the generic constraints here.
3728         (TypeContainer.DoDefineMember): Check the constraints on our base
3729         class and interfaces.
3730
3731         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3732         set the `ResolvingTypeTree' flag on the EmitContext.
3733
3734         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3735
3736 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3737
3738         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3739         
3740         * expression.cs (Argument.GetParameterModifier): Turned to property.
3741         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3742         
3743         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3744         its C# equivalent.
3745         
3746 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3747
3748         Fix #74852.
3749         * decl.cs (MemberCache.AddMethods): Register override methods,
3750         rather than non-override methods.
3751         * typemanager.cs (RegisterOverride): New.
3752         (IsOverride): Update.
3753
3754 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3755
3756         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3757
3758 2005-05-06  Martin Baulig  <martin@ximian.com>
3759
3760         * attribute.cs
3761         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3762         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3763
3764 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3765
3766         Fix #73105.
3767         
3768         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3769         recursive declaration.
3770         
3771         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3772         
3773 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3774
3775         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3776         
3777         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3778
3779 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3780
3781         Fix #74797.
3782         * decl.cs (DeclSpace.FamilyAccessible): 
3783         Use TypeManager.IsNestedFamilyAccessible.
3784
3785         Fix reopened #64812.
3786         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3787         internal'.
3788
3789 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3790             Abin Thomas  <projectmonokochi@rediffmail.com>
3791             Anoob V E  <projectmonokochi@rediffmail.com>
3792             Harilal P R  <projectmonokochi@rediffmail.com>
3793
3794         Fix #64812.
3795         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3796         allow access to all static members.
3797
3798 2005-05-04  Martin Baulig  <martin@ximian.com>
3799
3800         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3801
3802 2005-05-04  Martin Baulig  <martin@ximian.com>
3803
3804         Fix #74655.
3805
3806         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3807         section at the end; make things work if `default' is not the last
3808         section.        
3809
3810 2005-05-04  Martin Baulig  <martin@ximian.com>
3811
3812         Fix #70400.
3813
3814         * statement.cs (Switch): Replaced the `got_default' field with a
3815         `default_section' one.
3816         (Switch.CheckSwitch): Set `default_section' here.
3817         (Switch.Resolve): If we're a constant switch and the constant is
3818         not found, use the default section.
3819
3820 2005-05-03  Martin Baulig  <martin@ximian.com>
3821
3822         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3823
3824         * statement.cs (Foreach.ArrayForeach): New nested class.
3825         (Foreach.TemporaryVariable): New nested class.
3826         (Foreach.EmitArrayForeach): Removed; this is now in the new
3827         ArrayForeach class.
3828
3829 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3830
3831         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3832         more conservative.
3833         (VerifyPendingMethods): Revert change below.
3834
3835         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3836         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3837         that used to trigger warning -28.  Remove warning -28.
3838         * expression.cs (Invocation.OverloadResolve): Use
3839         TypeManager.IsOverride to distinguish override methods.
3840
3841         Fix #74773.
3842         * pending.cs (VerifyPendingMethods): If a base type implements the
3843         requested interface, don't bother checking individual methods of
3844         the base type.  As a side-effect, this prevents the creation of
3845         unnecessary proxies.
3846
3847 2005-05-02  Martin Baulig  <martin@ximian.com>
3848
3849         Fix #70182.
3850
3851         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3852         Also `And' the locals if the old vector is null.
3853         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3854         null; in this case we basically reset all the variables.        
3855
3856 2005-05-02  Martin Baulig  <martin@ximian.com>
3857
3858         Fix #74529.
3859
3860         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3861         Added `FlowBranching branching' argument; always `and' the
3862         variables instead of `or'ing them unless we're an infinite loop.
3863
3864         * statement.cs (While.Resolve): Create a new sibling unless we're
3865         infinite.       
3866
3867 2005-05-02  Martin Baulig  <martin@ximian.com>
3868
3869         Fix #70140.
3870
3871         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3872         arguments; use it instead of creating a new TopLevelBlock.
3873         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3874         our ConstructorInitializer.
3875
3876         * statement.cs
3877         (TopLevelBlock.TopLevelBranching): New public property.
3878         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3879         and create our `TopLevelBranching'.
3880
3881         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3882         anonymous method host, use `block.TopLevelBranching' rather than
3883         creating a new branching.
3884
3885 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3886
3887         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3888         a ScopeInfo, if any of the current children is a child of the new
3889         entry, move those children there.
3890
3891 2005-04-30  Martin Baulig  <martin@ximian.com>
3892
3893         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3894         at the beginning of a SwitchSection.  Fix #73335.
3895
3896 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3897
3898         Fix #74378
3899         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3900         
3901         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3902         (FieldExpr.DoResolve): Obsolete members are ignored for field
3903         initializers.
3904         
3905 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3906
3907         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3908         of arrays detection.
3909
3910         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3911         verification.
3912         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3913
3914         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3915         arrays report.
3916
3917 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3918
3919         * cs-parser.jay: Use the prefered version of -unsafe in error
3920         message.
3921
3922 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3923
3924         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3925         circumstances.
3926
3927 2005-04-20  John Luke  <john.luke@gmail.com>
3928
3929         * driver.cs: fix typo in error message, --outout to --output
3930
3931 2005-04-30  Martin Baulig  <martin@ximian.com>
3932
3933         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3934         handle the .NET 2.x security attributes.
3935
3936 2005-04-30  Martin Baulig  <martin@ximian.com>
3937
3938         * typemanager.cs
3939         (TypeManager.ExpandInterfaces): Don't add things twice.
3940
3941         * class.cs
3942         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3943
3944 2005-04-29  Martin Baulig  <martin@ximian.com>
3945
3946         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3947
3948         * anonymous.cs: Added support for anonymous generic methods.
3949
3950 2005-04-29  Martin Baulig  <martin@ximian.com>
3951
3952         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3953         generic instances.
3954
3955 2005-04-29  Martin Baulig  <martin@ximian.com>
3956
3957         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3958
3959         * expression.cs (New.DoResolve): Fix the CS0304 check.
3960
3961 2005-04-29  Martin Baulig  <martin@ximian.com>
3962
3963         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3964         naming schema.
3965
3966         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3967         explicit interface implementation, compare the interface types.
3968         (MethodData.Define): Use the new naming scheme from the latest
3969         .NET 2.x beta2.
3970         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3971
3972         * decl.cs (MemberName.GetMemberName): Removed.
3973         (MemberName.MethodName, FullName): New properties.
3974
3975 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3976
3977         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3978
3979 2005-04-22  Martin Baulig  <martin@ximian.com>
3980
3981         * generic.cs (GenericMethod): Create the EmitContext in the
3982         `Define()'; in `Define(MethodBuilder)', create the type parameters
3983         before calling `Define()'.  Fixes #73933.
3984
3985 2005-04-22  Martin Baulig  <martin@ximian.com>
3986
3987         * generic.cs
3988         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3989         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3990
3991         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3992         ConstructedType, check its constraints.
3993
3994 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3995
3996         * codegen.cs (InRefOutArgumentResolving): New field.
3997         
3998         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3999         fields outside contructor.
4000         
4001         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4002         
4003 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4004
4005         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4006         parameter code was not completed ever, so it was not as up-to-date
4007         as local variables.  Must finish it.
4008
4009         The bug fix was to compare the Toplevel of the block, not the
4010         current block.  Thanks for Ben for pointing this out. 
4011
4012 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4013
4014         * decl.cs (AddMethods): Use the declaring type of the problem
4015         method to determine if we want to squash a warning.
4016
4017 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4018
4019         * attribute.cs: Removed debug output.
4020
4021         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4022         
4023         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4024         Report.Stderr.
4025         
4026 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4027
4028         Fix #74481.
4029         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4030         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4031         all null comparisons against reference types.
4032
4033 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4034
4035         Fix# 74565
4036         * class.cs (TypeContainer.CircularDepException) New nested
4037         exception class.
4038         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4039         (TypeContainer.DefineType): Removed error, reset InTransit before
4040         exit.
4041         (Class.DefineType): Throw exception when is in Transit.
4042         Catch exception and report error.
4043         (Struct.DefineType): Throw exception when is in Transit.
4044         Catch exception and report error.
4045         (Interface.DefineType): Throw exception when is in Transit.
4046         Catch exception and report error.
4047
4048         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4049         handle nested exception handlers.
4050
4051         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4052         a catch.
4053
4054         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4055         InFinally and InCatch storage.
4056
4057         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4058         (Catch.Resolve): Set and Restore ec.InCatch.
4059         (Try.Resolve): Set and Restore ec.InFinally.
4060         (Try.HasCatch): True when try has catch.
4061
4062 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4063
4064         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4065           for the same event member, so exclude such cases from warning 419.
4066           Fixed bug #74633.
4067
4068 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4069
4070         * expression.cs (Binary.ResolveOperator): Apply patch from John
4071         Luke to fix bug 59864: operators &, | and ^ on enumerations
4072         require that the same enum type on both sides.
4073
4074         * driver.cs: Add warnings to old flag usage, this is to assist
4075         people who produce Makefiles and hope that the Makefiles will be
4076         used on Windows.
4077
4078         * class.cs (TypeContainer.EmitType): Moved the definition of the
4079         special $PRIVATE$ field from the resolve phase to the Emit phase.
4080         During resolve we do not know if we are a struct with
4081         HasExplicitLayout, we know this only after the attributes for the
4082         type are emitted.
4083
4084         Set the FieldOffset to zero on the dummy field that we create for
4085         the class.   Fixes 74590.
4086
4087 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4088
4089         Fix #73834.
4090         * ecore.cs (PropertyExpr.resolved): New.
4091         (DoResolve): Use it to handle a case of double resolution here.
4092         Handle a case of identical-name-and-type-name.
4093         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4094         resolution by storing the results of expression resolution back
4095         into the "probes" array.
4096
4097 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4098
4099         Fix cs0208-7.cs and cs0208-8.cs.
4100         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4101         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4102         error reporting to point out the reason a struct is not unmanaged.
4103
4104 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4105
4106         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4107           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4108
4109 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4110
4111         Fix #74528.
4112         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4113         IdenticalNameAndTypeName here.
4114         (EventExpr.InstanceResolve): Likewise.
4115
4116 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4117
4118         C# 2.0 DefaultCharSetAttribute implementation
4119         
4120         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4121         which allows us to set GlobalNamespace for every resolve.
4122         (Attribute.ResolveArguments): Cut from Resolve.
4123         (Attribute.GetCharSetValue): Returns CharSet named argument.
4124         (Attribute.DefinePInvokeMethod): Gets default charset from
4125         module settings.
4126         (GlobalAttribute.ResolveAsTypeStep): Override.
4127         (GlobalAttribute.ResolveArguments): Override.
4128         
4129         * class.cs (TypeAttr): Is protected.
4130         
4131         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4132         (ModuleClass.DefaultCharSetType): New memeber.
4133         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4134         
4135         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4136         charset from module.
4137         
4138         * delegate.cs (TypeAttr): Override.
4139         (Delegate.DefineType): Use this TypeAttr.
4140         
4141         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4142         at very early stage (before types are defined) to resolve model
4143         module attributes. It will probably not work with corlib but it
4144         should be ok.
4145         
4146         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4147         charset from module.
4148         
4149         * typemanager.cs (default_charset_type): New type.
4150
4151 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4152
4153         * decl.cs (MemberCache.AddMethods): Don't warn if
4154         System.Object.Finalize has buggy MethodAttributes.
4155
4156         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4157         removed below.
4158
4159 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4160
4161         * doc.cs : detect ambiguous reference to overloaded members.
4162           Fixed bug #71603. MS 1.1 csc does not detect it.
4163
4164 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4165
4166         * doc.cs : delegates must not be referenced with parameters.
4167           Fixed bug #71605.
4168
4169 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4170
4171         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4172
4173 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4174
4175         * driver.cs (MainDriver): Stop processing if the CLS stage found
4176         errors. 
4177
4178         (CompilerCallableEntryPoint.InvokeCompiler): Always
4179         reset after execution;   Take a TextWriter argument for the
4180         output.
4181
4182         * report.cs: Use the error stream instead of hardcoding stderr. 
4183
4184 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4185
4186         * class.cs: Reduce code paths to test, too small of an
4187         optimization to make it worth the extra testing.  Always perform
4188         it. 
4189
4190 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4191
4192         Fix #74510.
4193         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4194         operators that had errors reported on them.
4195
4196 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4197
4198         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4199         argument types.
4200         (Attribute.Resolve): Add named argument type checking.
4201         
4202         * class.cs (FixedField.Define): Use IsPrimitiveType
4203         
4204         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4205         
4206         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4207         unsafe parameter types.
4208         
4209         * statement.cs (Using.ResolveExpression): Add better error description.
4210         
4211         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4212         
4213 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4214
4215         Fix #74484.
4216         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4217         AttributeUsageAttribute in the emitcontext of the attribute class,
4218         not in the emitcontext of the attributable entity it was attached to.
4219         * cs-parser.jay: Use 'current_class', not 'current_container',
4220         when creating a GlobalAttribute.
4221
4222 2005-04-08  Alp Toker  <alp@atoker.com>
4223
4224         * pending.cs: The fix to #58413 failed to compile methods implementing
4225         interfaces with/without params modifiers and vice versa, even though
4226         params modifiers aren't part of the signature. Make the modifier check
4227         less strict as in csc.
4228
4229 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4230             Anoob V E  <projectmonokochi@rediffmail.com>
4231             Harilal P R  <projectmonokochi@rediffmail.com>
4232
4233         Fix #58413.
4234         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4235         modifiers of pending methods.
4236         (PendingImplementation.PendingImplementation): Initialize it.
4237         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4238         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4239         with ParameterData.  Add check for modifiers.
4240         * class.cs (MethodData.Define): Update to changes.
4241
4242 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4243
4244         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4245
4246 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4247
4248         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4249         property.
4250         
4251         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4252         
4253         * rootcontext.cs,
4254         * typemanager.cs: Registered RequiredAttributeAttribute.
4255         
4256 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4257
4258         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4259         Warning CS0169 is back at level 3.
4260         (IMethodData.SetMemberIsUsed): New method.
4261         
4262         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4263         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4264         
4265         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4266
4267         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4268         contants.
4269         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4270         is used.
4271         
4272         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4273         is used.
4274         
4275         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4276         to avoid the problems with nested types.
4277
4278 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4279             Anoob V.E  <projectmonokochi@rediffmail.com>
4280             Harilal P.R  <projectmonokochi@rediffmail.com>
4281             Raja R Harinath  <rharinath@novell.com>
4282
4283         Fix #73820.
4284         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4285         attribute.
4286         * typemanager (GetConstructor): Make public.
4287
4288 2005-04-05  John Luke  <john.luke@gmail.com>
4289             Raja R Harinath  <rharinath@novell.com>
4290
4291         Fix #62232.
4292         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4293         struct too.  Return false quicker in a few cases.
4294         (VerifyUnManaged): Use it.
4295
4296 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4297
4298         Fix #74041.
4299         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4300         not 'unreachable_seen'.
4301
4302 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4303
4304         * attribute.cs (Attribute.GetValue): Removed unused.
4305         
4306         * codegen.cs (CodeGen.TrimExt): Removed unused.
4307         
4308         * cs-parser.jay (output): Removed unused.
4309         
4310         * cs-tokenizer.cs (hex_digits): Removed unused.
4311         
4312         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4313         
4314         * expression.cs (Indirection.LoadExprValue): Removed unused.
4315         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4316         
4317         * iterators.cs (Iterator.param_types): Removed unused.
4318         
4319         * statement.cs (Goto.block): Removed unused.
4320         (ToplevelBlock.did): Removed unused.
4321         (Switch.ResolveConstantSwitch): Removed unused.
4322
4323 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4324
4325         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4326         resetting thingy.
4327
4328 2005-04-19  Martin Baulig  <martin@ximian.com>
4329
4330         Merged r42462 from MCS and made it work for GMCS.
4331
4332         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4333
4334         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4335
4336 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4337
4338         Fix #74232 and cs0208-3.cs.
4339         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4340         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4341         unmanaged type.  Don't use FieldBuilders when 't' is a
4342         TypeBuilder.  Use ModFlags and MemberType fields.
4343         * class.cs (MemberBase.member_type): Rename from MemberType.
4344         (MemberBase.MemberType): New property.  Determines member_type on
4345         demand.
4346         (MemberBase.DoDefine): Don't initialize MemberType here.
4347         (FieldMember.Define): Likewise.
4348
4349 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4350
4351         Fix #74241
4352         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4353         Attributes are emitted there.
4354         
4355 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4356
4357         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4358         keyword in 'partial enum' too.
4359         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4360         is not allowed).
4361         Report from Kamil Skalski <nazgul@omega.pl>.
4362
4363         Fix #74309.
4364         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4365         have partial containers too.
4366
4367         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4368         in block' checks to Block.CheckInvariantMeaningInBlock.
4369         * statement.cs (Block.GetKnownVariableInfo): Make private.
4370         (Block.IsVariableUsedInChildBlock): Remove.
4371         (Block.IsVariableUsedInBlock): Likewise.
4372         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4373         conflicting declaration.
4374         (Block.AddVariable): Make error messages less long-winded and more
4375         specific.  Show location of conflicting declaration.
4376         * parameter.cs (Parameters.Location): New readonly property.
4377
4378 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4379
4380         Clean up semantics of invoking ResolveMemberAccess.
4381         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4382         can have an instance, ensure that we pass in a non-TypeExpression
4383         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4384         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4385         argument.  Update to changes and simplify.
4386         (FieldExpr.Emitinstance): Remove CS0120 check.
4387         (PropertyExpr.EmitInstance): Likewise.
4388         * expression.cs (Argument.Resolve): Likewise.
4389         (Invocation.DoResolve): Update to changes in semantics of
4390         InstanceExpression.
4391
4392 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4393
4394         Fix #74241
4395         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4396         customization.
4397         
4398         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4399
4400 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4401
4402         Fix difference in behaviour with commandline invocation.
4403         * driver.cs (Driver.Reset): New.
4404         (CompilerCallableEntryPoint): Call it.
4405
4406         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4407         variable" warnings if the boolean expression failed to resolve.
4408
4409 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4410
4411         * attribute.cs: Fix the union of several permissions when some of them
4412         are unrestricted (so the result isn't an unrestricted permission set).
4413         Fix #74036.
4414
4415 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4416
4417         * ecore.cs (MemberExpr): New class.  Convert from interface
4418         IMemberExpr.
4419         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4420         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4421         error checks.
4422         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4423         (MethodGroupExpr.IsExplicitImpl): Remove.
4424         (Expression.GetFieldFromEvent): Remove.
4425         (SimpleName.MemberStaticCheck): Remove.
4426         (SimpleName.DoSimpleNameResolve): Update to changes.
4427         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4428         (MemberAccess.IdenticalNameAndTypeName): Remove.
4429         (MemberAccess.error176): Move to MemberExpr.
4430         (MemberAccess.DoResolve): Update to changes.
4431         (BaseAccess.DoResolve): Likewise.
4432
4433 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4434
4435         C# 2.0 Conditional attribute class implementation
4436         
4437         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4438         Analyzes class whether it has attribute which has ConditionalAttribute
4439         and its condition is not defined.
4440         
4441         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4442         (Class.IsExcluded): New method. Search for at least one defined
4443         condition in ConditionalAttribute of attribute class.
4444
4445 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4446
4447         * ecore.cs (PropertyExpr): Derive from Expression, not
4448         ExpressionStatement.
4449         (PropertyExpr.EmitStatement): Remove.
4450
4451 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4452
4453         Fix #74060.
4454         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4455         internal field "value__" of an enum be private.  The examples for
4456         "value__" that I found on MSDN all used FieldAttributes.Private.
4457
4458         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4459         Don't mention IL method attribute names.
4460
4461         Fix #47991.  Remove a TODO.
4462         * statement.cs (Block.Toplevel): Make into a field.
4463         (Block.Parameters): Move into ToplevelBlock.
4464         (Block.known_variables): Rename from child_variable_names.
4465         (Block.Block): Remove variants that take Parameters.  Initialize
4466         'Toplevel' with the immediately surrounding toplevel block.
4467         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4468         LocalInfo parameter.
4469         (Block.GetKnownVariableInfo): New.
4470         (Block.IsVariableNameUsedInChildBlock): Update.
4471         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4472         the block, even though it may not be in scope.
4473         (Block.AddVariable): Remove Parameters parameter.  Use
4474         Toplevel.Parameters instead.
4475         (Block.AddConstant): Remove Parameters parameter.
4476         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4477         (Block.IsParamaterReference): Likewise.
4478         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4479         (ToplevelBlock.Parameters): New.  Moved from Block.
4480         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4481         initialize Parameters to a non-null value.
4482         * cs-parser.jay: Update to changes.
4483         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4484         simple names that mean different things in the same block.  Use
4485         Block.IsVariableNameUsedInBlock.
4486
4487 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4488
4489         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4490
4491 2005-03-26  Raja R Harinath  <harinath@acm.org>
4492
4493         Fix #73038.
4494         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4495         fails to resolve, ensure that the LHS is still resolved as an
4496         lvalue.
4497
4498 2005-03-25  Raja R Harinath  <harinath@acm.org>
4499
4500         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4501         ec.ContainerType.
4502         (Enum.current_ec): Remove.
4503         (Enum.LookupEnumValue): Remove EmitContext argument.
4504         Just uses the one created during DefineType.
4505         (Enum.FindMembers): Update.
4506         * expression.cs (MemberAccess.DoResolve): Update.
4507
4508 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4509
4510         * assign.cs (Assign.DoResolve): Check for CS1717 when
4511         source and target are same (uses Equals).
4512
4513         * expression.cs (LocalVariableReference, ParameterReference,
4514         This): Implemented Equals, GetHashCode.
4515
4516         * statement.cs (Block.GetParameterReference): Removed useless
4517         local variable.
4518
4519 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4520
4521         Fix cs0128.cs
4522         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4523         blocks before deciding whether the error is cs0136 or cs0128.
4524
4525         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4526         (using_alias_directive, using_namespace_directive): Pass
4527         MemberName, not an expression to Namespace.UsingAlias and
4528         Namespace.Using.
4529         (MakeName): Use the MemberName of the namespace.
4530         * namespace.cs (Namespace.MemberName): New.
4531         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4532         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4533         Likewise.
4534         * decl.cs (MemberName.Name): Make readonly.
4535         (MemberName.FromDotted): New "constructor".
4536         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4537         (MemberCore.Name): Compute from MemberName on demand.
4538         (MemberCore.SetMemberName): Provide a way to change the
4539         MemberName.
4540         (MemberCore.AddToContainer): Don't take a fullname parameter.
4541         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4542         fully qualified name of the container to the member name.
4543         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4544         only if the type is a member of the root container.
4545         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4546         MemberName.Left rather than searching for an embedded ".".
4547         (PartialContainer.CreatePart): Update to changes in RootContext.
4548         (MemberBase.ShortName): Turn into a property.  Use
4549         MemberCore.SetMemberName.
4550         (MemberBase.ExplicitInterfaceName): Remove.
4551         (MemberBase.UpdateMemberName): Remove.
4552         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4553         (PropertyBase.SetMemberName): New override.
4554         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4555         (Tree.GetDecl): New.
4556         (Tree.AllDecls): Rename from Decls.
4557         * attribute.cs, enum.cs, report.cs: Update to changes.
4558         * driver.cs (MainDriver): Use MemberName.FromDotted on
4559         RootContext.MainClass.
4560
4561 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4562
4563         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4564         checks.
4565
4566         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4567
4568 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4569
4570         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4571         property accessor modifiers.
4572
4573         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4574         fixed buffer attribute (CS1716).
4575         (PropertyMethod.HasCustomAccessModifier): When property accessor
4576         has custom modifier.
4577
4578         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4579         modifiers.
4580         (PropertyExpr.DoResolveLValue): Add CS0272.
4581
4582 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4583
4584         * convert.cs: When converting to a pointer, use the proper Conv.U
4585         or Conv.I depending on the source data type.
4586
4587         * cs-tokenizer.cs: Make the size for large decimal constants,
4588         fixes #72957.
4589
4590 2005-03-17  Martin Baulig  <martin@ximian.com>
4591
4592         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4593         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4594
4595 2005-03-17  Martin Baulig  <martin@ximian.com>
4596
4597         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4598         to bool so we can return an error condition.
4599         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4600         returned an error.
4601
4602 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4603
4604         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4605         attributes.
4606
4607 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4608
4609         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4610         Refactor to avoid traversing the list of assemblies, and to avoid
4611         string concatenation.
4612         * typemanager.cs (guid_attr_type): Remove.
4613         (negative_hits, pointers, references): Remove hashes.
4614         (type_hash): New.
4615         (GetConstructedType): New.  Uses type_hash to handle constructed
4616         types (arrays, references, pointers).
4617         (GetReferenceType, GetPointerType): Use it.
4618         (GetNestedType): New.  Uses type_hash to handle nested types of
4619         reflected types.
4620         (LookupType, LookupTypeDirect): Remove.
4621         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4622         'types' hash and LookupTypeReflection directly.
4623         (params_string, params_object): Use GetConstructedType.
4624         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4625         top-level types.
4626         (Namespace.Lookup): Use cached_types.
4627         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4628         provided by old TypeManager.LookupType.
4629         * rootcontext.cs (MakeFQN): Remove.
4630         * decl.cs (DeclSpace.MakeFQN): Likewise.
4631         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4632         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4633         TypeManager.GetConstructedType.
4634         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4635
4636 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4637
4638         * cs-parser.jay: Fix build.
4639
4640 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4641
4642         * class.cs (TypeContainer.CircularDepException) New nested
4643         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4644
4645         * cs-parser.jay: Reports CS1527 for any namespace element.
4646
4647         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4648         Added CS0407.
4649
4650         * expression.cs (ParameterReference.IsAssigned): Changed error to
4651         CS0269.
4652         (Error_WrongNumArguments): Moved CS0245 detection here.
4653
4654         * statement.cs (Return.Resolve): Add CS1622 report.
4655
4656 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4657
4658         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4659
4660 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4661
4662         * attribute.cs expression.cs: Get rid of some allocations.
4663
4664 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4665
4666         * doc.cs : just eliminate the latest change.
4667
4668 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4669
4670         * doc.cs : commented out the latest change. It breaks xml-030.cs
4671
4672 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4673
4674         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4675           fail. So invoke CreateType() in FindDocumentedType().
4676
4677 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4678
4679         * cs-tokenizer.cs : added IsKeyword().
4680         * doc.cs : Detect keyword incorrectly used as identifier.
4681           Allow identifiers prefixed by @.
4682
4683 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4684
4685         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4686         It caused exception in namespace resolving (again!).
4687         
4688         * class.cs (Class.ctor): Removed exit.
4689         (PropertyMethod.ctor): ditto.
4690         
4691         * codegen.cs (Codegen.Reset): Reset static data.
4692         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4693         
4694         * cs-tokenizer.cs (Cleanup): Removed.
4695         
4696         * driver.cs (GetSystemDir): Rewrote to one line command.
4697         It caused problem with unloaded dynamic modules.
4698         (UnixParseOption): Removed Exit.
4699         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4700         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4701         Now can be mcs used as library.
4702         
4703         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4704         empty location.
4705         
4706         * location.cs (Reset): Reset static data.
4707         
4708         * namespace.cs (Reset): Reset static data.
4709         
4710         * report.cs (Report.Reset): Reset static data.
4711         
4712         * rootcontext.cs (RootContext.Reset): Reset static data.
4713         
4714         * tree.cs (RootTypes.ctor): Use Location.Null
4715         
4716         * typemanager.cs (TypeManager.Reset): Reset static data.
4717         (CoreLookupType): Removed Exit.
4718         (TypeHandle.Reset): Reset static data.
4719         
4720 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4721
4722         Fix #73516.
4723         * typemanager.cs (ComputeNamespaces): Import namespaces from
4724         referenced modules too.
4725
4726 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4727
4728         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4729         than '.'.
4730
4731 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4732
4733         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4734         enclosing DeclSpace.  This ensures that a name-lookup populates
4735         more caches and there are fewer 'TypeExpression's.  Carve out
4736         nested type lookup into ...
4737         (LookupNestedTypeInHierarchy): ... this.
4738
4739 2005-04-15  Martin Baulig  <martin@ximian.com>
4740
4741         Merged r41590 from MCS and make it work in the generics land.
4742
4743         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4744         `check' argument.
4745
4746         * class.cs (PartialContainer.UpdateConstraints): Removed.
4747         (PartialContainer.CheckConstraints): Removed.
4748         (PartialContainer.SetParameterInfo): Store the constraints here.
4749         (PartialContainer.DefineTypeParameters): New public method;
4750         resolve the type parameter's constraints here.  Note that the
4751         PartialContainer doesn't have an EmitContext anymore, so we must
4752         do this in the ClassPart.
4753
4754 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4755
4756         Clean up a few partial-class semantics.  
4757         Fixes test-357.cs and cs1618-2.cs.
4758         * cs-parser.jay (struct_declaration): Use 'current_class' as
4759         parent of newly-created struct.  Remove call to Register ().
4760         Use 'pop_current_class' to complete handing the current struct.
4761         (interface_declaration): Likewise.
4762         (class_declaration): Likewise.
4763         (enum_declaration): Use 'current_class' as parent of newly created
4764         enum.
4765         (delegate_declaration): Likewise.
4766         (pop_current_class): New function.  This is used to handle closing
4767         up the 'current_class' and 'current_container', and pointing them
4768         to the enclosing class/container.
4769         (CSharpParser): Initialize 'current_class' too.
4770         * decl.cs (MemberCore): Add check for invariant: a partial
4771         container is not a parsed entity, and thus does not enclose any
4772         parsed members.
4773         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4774         (DeclSpace.BaseTypeExpr): Use it.
4775         (DeclSpace.LookupType): Add check for invariant.
4776         * class.cs (TypeContainer): Add check for invariant: a nested
4777         class should have the same NamespaceEntry as its enclosing class.
4778         (TypeContainer.EmitFieldInitializers): Make virtual.
4779         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4780         MemberCore.
4781         (TypeContainer.Register): Remove.
4782         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4783         null.  Use TypeResolveEmitContext for resolving base types and
4784         interfaces.  Move initialization of Parts.TypeBuilder here from
4785         ...
4786         (TypeContainer.DefineNestedTypes): ... here.
4787         (PartialContainer): Take a Namespace not a NamespaceEntry.
4788         (PartialContainer.Create): Don't use Register.  Call the
4789         appropriate Add... function directly.
4790         (ClassPart): Take both the PartialContainer and the enclosing
4791         class as constructor arguments.
4792         (ClassPart.EmitFieldInitializers): Override.
4793         (ClassPart.PartFindNestedTypes): Remove.
4794         (FieldBase.GetInitializerExpression): Resolve the initializer
4795         expression in the emit context of the enclosing class.
4796         * tree.cs (RootTypes): Remove Register ().
4797         
4798 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4799
4800         * cs-parser.jay: Removed CS0134.
4801         
4802         * driver.cs: Removed CS1901.
4803         
4804         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4805         for predefined types.
4806
4807 2005-03-07  Duncan Mak  <duncan@novell.com>
4808
4809         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4810         well. Fixes bug #73454.
4811
4812 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4813
4814         * cs-tokenizer.cs (xtoken): Add CS1035.
4815         
4816         * class.cs (MethodData.Define): Add CS0683.
4817         (FieldMember.ctor): Add CS0681.
4818
4819 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4820
4821         * ecore.cs (SimpleName.DoResolve): Rename from
4822         SimpleName.DoResolveAllowStatic.
4823         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4824         Pass 'intermediate' flag to MemberStaticCheck.
4825         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4826         of "intermediate" lookups via MemberAccess.
4827         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4828         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4829
4830 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4831
4832         Fix #73394.
4833         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4834         slipped in because of variable names that are identical to a
4835         builtin type's BCL equivalent ('string String;', 'int Int32;').
4836         (PropertyExpr.EmitInstance): Likewise.
4837
4838 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4839
4840         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4841         
4842         * report.cs (warning_ignore_table): Made public.
4843
4844 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4845
4846         Fix #73282.
4847         * class.cs (MethodData.Emit): Pass 'container' to
4848         container.GetObsoleteAttribute instead of 'container.Parent'.
4849
4850 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4851
4852         * cs-parser.jay: Add 1534 error test.
4853
4854         * iterators.cs (Yield.CheckContext): Add error 1629.
4855         (Iterator.ctor): Save unsafe modifier.
4856         (MoveNextMethod.DoEmit): Restore unsafe context.
4857
4858         * namespace.cs (UsingAlias): Better error message.
4859
4860 2005-03-03  Dan Winship  <danw@novell.com>
4861
4862         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4863         the warning message [#73219]
4864
4865 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4866
4867         Fix compile with MCS 1.0.0.0.
4868         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4869         w_restore to not depend on string constant folding.
4870
4871 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4872
4873         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4874         CS0246 check to users who passed 'silent = false'.
4875         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4876         check.
4877         (SimpleName.SimpleNameResolve): Update.
4878         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4879         (MemberAccess.IdenticalNameAndTypeName): Update.
4880         * doc.cs (FindDocumentedTypeNonArray): Update.
4881
4882 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4883
4884         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4885         * parameters.cs (ComputeAndDefineParameters): Remove.
4886         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4887         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4888         Use GetParameterInfo.
4889
4890 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4891
4892         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4893
4894 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4895
4896         Unify DeclSpace.LookupType and DeclSpace.FindType.
4897         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4898         is in charge of defining nested types on demand.
4899         (DeclSpace.LookupType): Use it when the current_type is a
4900         TypeBuilder.  Use LookupTypeDirect for reflected types.
4901         (DeclSpace.FindType): Remove.
4902         (DeclSpace.LookupInterfaceOrClass): Likewise.
4903         (DeclSpace.DefineTypeAndParents): Likewise.
4904         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4905         DeclSpace.LookupType.
4906         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4907         * typemanager.cs (LookupType): Simplify.
4908         (AddUserType): Remove type from negative_hits.
4909         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4910         * class.cs (TypeContainer.FindMembers): Move handling of nested
4911         types ...
4912         (TypeContainer.FindMembers_NestedTypes): ... here.
4913         (TypeContainer.FindNestedType): Implement override.
4914         (ClassPart.FindNestedType): Delegate to PartialContainer.
4915         (ClassPart.PartFindNestedType): Looks up the nested types of the
4916         part alone.
4917
4918 2005-04-14  Martin Baulig  <martin@ximian.com>
4919
4920         * generic.cs (ConstructedType): Moved all the type lookup and
4921         nested class logic into SimpleName.
4922         (ConstructedType.ResolveConstructedType): Our underlying type is
4923         already fully resolved; all the type lookup stuff is in
4924         SimpleName.
4925
4926         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4927         constructed types here instead of in ConstructedType.
4928
4929         * decl.cs (MemberName.GetTypeExpression): Always create a
4930         SimpleName, not a ConstructedType.
4931         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4932
4933 2005-03-02  Martin Baulig  <martin@ximian.com>
4934
4935         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4936         static constructor in static classes.
4937
4938 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4939
4940         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4941         sizeParamIndex is not specified.
4942
4943 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4944
4945         Fix #73117
4946         * report.cs (WarningMessage.IsEnabled): Missing null check.
4947
4948 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4949
4950         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4951         in the fields and not in the properties.
4952
4953 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4954
4955         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4956         fields as well.
4957
4958 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4959
4960         * attribute.cs: Small refactoring (improved robustness).
4961         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4962         (ValidateGuid): Removed.
4963         (Resolve): Removed referenced to above mentioned.
4964         (GetAttributeUsage): Made private and changed to work without
4965         class assistance.
4966         (GetIndexerAttributeValue): Don't crash.
4967         (GetConditionalAttributeValue): Ditto.
4968         (GetClsCompliantAttributeValue): Ditto.
4969         (ExtractSecurityPermissionSet): All attributes exceptions are
4970         error 648.
4971         (GetPropertyValue): New helper.
4972         (GetMethodImplOptions): New method.
4973         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4974         some missing properties.
4975         
4976         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4977         (Method.ApplyAttributeBuilder): Updated.
4978         
4979         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4980         exception.
4981
4982 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4983
4984         Fix #73052.
4985         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4986         non-simple types (array, pointer, reference).
4987
4988 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4989
4990         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4991
4992         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4993         for operators.
4994         (Method.CheckBase): Catch wrong destructor here.
4995         (MethodData.Define): Add errors 550, 668.
4996
4997         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4998
4999         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5000
5001         * pending.cs (VerifyPendingMethods): Add error 551.
5002
5003         * typemanager.cs (CSharpName): Next error report helper.
5004
5005 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5006
5007         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5008         attributes. Removed useless attribute double check.
5009         It saves almost 2MBs for corlib.
5010
5011 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5012
5013         Fix #72924.
5014         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5015         called twice in case of error.
5016
5017 2005-02-23  Chris Toshok  <toshok@ximian.com>
5018
5019         Fix compiler portions of #72827.
5020         * statement.cs (Block.Emit): call Begin/EndScope on the
5021         EmitContext instead of the ILGenerator.
5022
5023         * codegen.cs (EmitContext.BeginScope): new method, call
5024         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5025         we have one.)
5026         (EmitContext.BeginScope): same, but EndScope and CloseScope
5027
5028         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5029         offset and call the superclass's OpenScope(int) with it.
5030         (SymbolWriter.CloseScope): get the current il
5031         offset and call superclass's CloseScope(int) with it.
5032
5033 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5034
5035         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5036         CS1677 for out and ref as well.
5037
5038         * class.cs (Method.Define): Add error CS1599 detection.
5039         
5040         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5041         
5042         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5043         
5044         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5045         
5046         * support.cs.cs (ModifierDesc): New helper method.
5047
5048 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5049             Abin Thomas  <projectmonokochi@rediffmail.com>
5050             Anoob V E  <projectmonokochi@rediffmail.com>
5051             Harilal P R  <projectmonokochi@rediffmail.com>
5052
5053         Fix #57851, #72718.
5054         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5055         MemberLookup (used for error reporting) actually returns a result.
5056         Fix error report number (122, not 112).
5057
5058 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5059             Anoob V E  <projectmonokochi@rediffmail.com>
5060             Harilal P R  <projectmonokochi@rediffmail.com>
5061
5062         Fix #71134.
5063         * pending.cs (PendingImplementation.GetAbstractMethods):
5064         Find NonPublic members too.
5065
5066 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5067
5068         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5069         Fixed error 217.
5070         
5071         * class.cs (MethodCore.CheckMethodAgainstBase):
5072         Add error 239 report.
5073
5074 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5075
5076         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5077         
5078         * class.cs (Operator.Define): Add error 217 report.
5079         
5080 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5081
5082         Fix #68955.
5083         * expression.cs (Invocation.IsApplicable): Make public.
5084         (Invocation.IsParamsMethodApplicable): Likewise.
5085         * delegate.cs (Delegate.VerifyApplicability): Don't use
5086         Invocation.VerifyArgumentCompat for parameter applicability
5087         testing.  Use Invocation.IsApplicable and
5088         Invocation.IsParamsMethodApplicable.
5089
5090 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5091
5092         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5093         
5094         * class.cs (Operator.Define): Add error 217 report.
5095         
5096 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5097
5098         * namespace.cs (UsingEntry.Resolve): Undo change below.
5099
5100 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5101
5102         Fix #72756.
5103         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5104         disable the error message when the extended MemberLookup also
5105         fails.
5106         (Expression.MemberLookupFinal): Update.
5107         (SimpleName.DoSimpleNameResolve): Update.
5108         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5109         Don't use MemberLookupFinal.
5110         (New.DoResolve): Update.
5111         (BaseAccess.CommonResolve): Update.
5112
5113 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5114
5115         Fix #72732.
5116         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5117         occured previously, don't resolve again.
5118
5119 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5120
5121         Fix #69949
5122         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5123         argument. Call ResolveAttributeUsage for unresolved.
5124         when types doesn't match ctor arguments.
5125         
5126         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5127         for nested attribute classes.
5128         (Class.attribute_usage): Removed.
5129         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5130         for attribute class.
5131         
5132         * ecore.cs (IsAttribute): Removed.
5133         
5134         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5135         
5136         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5137         now normal types.
5138         (attribute_types): Removed.
5139         (EmitCode): Global attributes are emited as the latest.
5140
5141 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5142
5143         * class.cs (EmitFieldInitializers): Don't emit field initializer
5144         for default values when optimilization is on.
5145         
5146         * constant.cs (Constant.IsDefaultValue): New property.
5147         
5148         * driver.cs: Add /optimize handling.
5149         
5150         * constant.cs,
5151         * ecore.cs,
5152         * literal.cs: Implement new IsDefaultValue property.
5153         
5154         * rootcontext.cs (Optimize): New field, holds /optimize option.
5155
5156 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5157
5158         Fix crasher in re-opened #72347.
5159         * namespace.cs (Namespace.Lookup): Return null if
5160         DeclSpace.DefineType returns null.
5161
5162         Fix #72678.
5163         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5164
5165 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5166
5167         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5168         now returns null if it cannot resolve to an lvalue.
5169         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5170         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5171         returned null.  Remove check for SimpleName.
5172         (EventExpr.DoResolveLValue): New.
5173         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5174         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5175         error from ...
5176         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5177         avoid CS0131 error.
5178         (Unary.ResolveOperator): Move CS0211 check ...
5179         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5180         CS0131 error.
5181         (Unary.DoResolveLValue): Simplify.
5182         (AddressOf.DoResolveLValue): New.
5183         (ArrayAccess.DoResolveLValue): New.
5184
5185 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5186
5187         * attribute.cs (Attribute.Resolve): Add arguments casting for
5188         when types doesn't match ctor arguments.
5189
5190 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5191
5192         Fix parts of #63202.
5193         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5194         lookup of operator in base type.  Ensure that all checks happen
5195         when the operator resolves to an "op_..." method.
5196
5197 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5198
5199         Fix #71992.
5200         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5201         'ignore_cs0104' parameter.  Pass it to ...
5202         (NamespaceEntry.Lookup): ... this.
5203         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5204         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5205         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5206         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5207         Update.  Request that cs0104 errors be ignored.
5208         (ComposedCast.ResolveAsTypeStep): Update.
5209
5210 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5211
5212         Fix #59209.
5213         * expression.cs (Invocation.BetterFunction): Remove support for
5214         comparing virtual functions and their overrides.
5215         (Invocation.IsOverride): New.
5216         (Invocation.OverloadResolve): Don't consider 'override' functions
5217         during candidate selection.  Store them in a lookaside list.
5218         If the selected method is a 'virtual' function, use the list to
5219         find any overrides that are closer to the LHS type.
5220
5221 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * expression.cs (New.DoResolve): Add complex core type reduction.
5224         (New.Constantify): Converts complex core type syntax like 'new int ()'
5225         to simple constant.
5226         
5227 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5228
5229         * decl.cs (EntryType.EntryType): New constructor to create an
5230         updated copy of a cache entry.
5231         (MemberCache.AddMethods): Use it.
5232         (MemberCache.ClearDeclaredOnly): Remove.
5233         (MemberCache.MemberCache): Update.
5234
5235 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5236
5237         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5238         variable.  This one is represents the actual low-level declaration
5239         of the method, as opposed to the semantic level `IsStatic'.   
5240
5241         An anonymous method which is hosted into a static method might be
5242         actually an instance method.  IsStatic would reflect the
5243         container, while MethodIsStatic represents the actual code
5244         generated.
5245
5246         * expression.cs (ParameterReference): Use the new MethodIsStatic
5247         instead of IsStatic.
5248
5249         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5250         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5251         set on the current EmitContext. 
5252
5253         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5254         resolve our casted expression as an LValue.  This triggers the
5255         proper LValue processing that is later required by Assign.
5256
5257         This fixes 72347.
5258
5259         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5260
5261 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5262
5263         C# 2.0 Fixed buffer implementation
5264
5265         * anonymous.cs: Update after RegisterHelperClass renaming.
5266
5267         * attribute.cs (AttributeTester.fixed_buffer_cache):
5268         Cache of external fixed buffers.
5269         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5270         implementation if field is fixed buffer else null.
5271
5272         * class.cs
5273         (TypeContainer.AddField): Accept FieldMember instead of Field.
5274         (FieldBase.IsFieldClsCompliant): Extracted code from
5275         VerifyClsCompliance descendant customization.
5276         (FixedField): New class handles fixed buffer fields.
5277         (FixedFieldExternal): Keeps information about imported fixed
5278         buffer.
5279         (IFixedField): Make access to internal or external fixed buffer
5280         same.
5281
5282         * cs-parser.jay: Add fixed buffer parsing.
5283
5284         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5285         buffer.
5286
5287         * expression.cs (Indirection): Extended implementation to accept
5288         fixed buffer field.
5289         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5290         (ElementAccess.MakePointerAccess): Get type as parameter.
5291         (DoResolve): Add fixed buffer field expression conversion.
5292         (DoResolveLValue): Ditto.
5293         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5294         (ArrayPtr): Derives from FixedBufferPtr.
5295         (ArrayPtr.Emit): Add extra emit for array elements.
5296
5297         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5298
5299         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5300         for compiler generated types.
5301         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5302
5303         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5304         and consume less memory.
5305         (Fixed.Resolve): Add fixed buffer case.
5306
5307         * typemanager.cs (compiler_generated_attr_ctor,
5308         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5309         (HasElementType): Add our own implementation to work on every
5310         runtime.
5311
5312 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5313
5314         * anonymous.cs (CaptureContext): Track whether `this' has been
5315         referenced.   
5316
5317         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5318         only captured `this' if it was implicitly done (instance
5319         methods/variables were used). 
5320
5321         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5322         `this' must be captured.
5323
5324 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5325  
5326         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5327         is null it means that there has been no need to capture anything,
5328         so we just create a sibling.
5329
5330         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5331
5332         Just a partial fix.  The other half is fairly elusive.
5333         
5334 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5335
5336         Fix #52586, cs0121-4.cs.
5337         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5338         and return a hashtable.
5339         (MemberCache.ClearDeclaredOnly): New.
5340         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5341         the method_hash of a base type too.
5342         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5343         type methods.  Overwrite entries with the same MethodHandle so
5344         that the ReflectedType is correct.  The process leaves in base
5345         virtual functions and their overrides as distinct entries.
5346         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5347         matters since it was boxed in a ArrayList before.
5348         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5349         modifier.
5350         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5351         case of a virtual function and its override (choose the overload
5352         as better).
5353         (Invocation.OverloadResolve): Avoid 'override' members during
5354         'applicable_type' calculation.
5355
5356 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5357
5358         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5359         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5360         GetTypeHandle.  It is possible for a reflected type to derive from
5361         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5362         System.Array during mscorlib compilation).
5363         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5364         contain a method_hash, don't create one either.  Don't create a
5365         deep copy of the base cache's method_hash.
5366         (MemberCache.SetupCache): Rename back from DeepCopy.
5367         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5368         already initialized.  If we see an override function, add its
5369         underlying base virtual function to the member_hash too.
5370
5371 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5372
5373         Combine two near-redundant caches.
5374         * typemanager.cs (method_params): Rename from method_internal_params.
5375         (TypeManager.GetParameterData): New.  Replace
5376         Invocation.GetParameterData.
5377         (TypeManager.LookupParametersByBuilder): Remove.
5378         * expression.cs (Invocation.method_parameter_cache): Remove.
5379         (Invocation.GetParameterData): Remove.
5380         Update to changes.
5381         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5382         Update to changes.
5383
5384 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5385
5386         Fix #72015.
5387         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5388         TypeManager.multicast_delegate_type is null, resolve it by looking
5389         up "System.MulticastDelegate".
5390         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5391
5392 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5393             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5394             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5395
5396         Fix cs0164.cs.
5397         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5398         (LabeledStatement.AddReference): New.  Set 'referenced'.
5399         (Goto.Resolve): Use it.
5400
5401 2005-02-05  John Luke  <john.luke@gmail.com>
5402
5403         * driver.cs: remove duplicate -doc line in Usage ()
5404
5405 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5406
5407         * location.cs (Location.AddFile): Fix CS2002 error report.
5408
5409 2005-02-02  Martin Baulig  <martin@ximian.com>
5410
5411         * delegate.cs (Delegate.DefineType): Report an internal error if
5412         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5413         details.        
5414
5415 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5416
5417         Fix a crasher in a variant of #31984.
5418         * const.cs (Constant.CheckBase): New override that defers the
5419         new-or-override check in case the base type hasn't been populated
5420         yet.
5421         (Constant.Define): Ensure the new-or-override check is performed.
5422
5423 2005-02-01  Duncan Mak  <duncan@ximian.com>
5424
5425         * const.cs (LookupConstantValue): Check that `ce' is not null
5426         before calling GetValue ().
5427
5428 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5429
5430         Fix test-334.cs (#69519).
5431         * cs-parser.jay (using_alias_directive): Pass in an expression to
5432         NamespaceEntry.UsingAlias.
5433         (using_namespace_directive): Pass in an expression to
5434         NamespaceEntry.Using.
5435         (namespace_name): Don't flatten to a string.
5436         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5437         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5438         ResolveAsTypeStep.
5439         (NamespaceEntry.UsingEntry): Likewise.
5440         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5441         changes.
5442         (NamespaceEntry.LookupForUsing): Remove.
5443         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5444         names.
5445         (NamespaceEntry.Lookup): Remove support for dotted names.
5446
5447 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5448
5449         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5450         split into two.
5451         (NamespaceEntry.ImplicitParent): Compute on demand.
5452         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5453         parallels the current.
5454         (NamespaceEntry.LookupForUsing): Use it.
5455         (NamespaceEntry.Lookup): If the current namespace-entry is
5456         implicit, don't search aliases and using tables.
5457
5458 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5459
5460         Fix #31984.
5461         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5462         BaseCache here.
5463         (TypeContainer.BaseCache): Compute on demand.
5464         (TypeContainer.FindMembers): Define constants and types if they're
5465         not already created.
5466         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5467         check.
5468         * const.cs (Constant.Define): Make idempotent.
5469
5470 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5471
5472         * pending.cs: Produce better code (no nops produced by using Ldarg
5473         + value).
5474         
5475         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5476         i - 1' it should be arg + 1.
5477
5478         Fixes bug #71819.
5479
5480 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5481
5482         * attribute.cs (Attribute.CheckAttributeType): Make private
5483         non-virtual.
5484         (Attribute.ResolveType): Make virtual.
5485         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5486         handling of RootContext.Tree.Types.
5487
5488 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5489
5490         Update attribute-handling to use the SimpleName/MemberAccess
5491         mechanisms.
5492         * cs-parser.jay (attribute): Pass in an expression to the
5493         constructors of Attribute and GlobalAttribute.
5494         * attribute.cs (Attribute): Take an expression for the name.
5495         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5496         passed in attribute name expression.
5497         (Attribute.CheckAttributeType): Use it.
5498         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5499         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5500         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5501         argument to prevent error messages if the lookup fails.
5502
5503 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5504
5505         * expression.cs (Indirection): Implemented IVariable interface
5506         to support indirection in AddressOf operator.
5507         (PointerArithmetic.Emit): Add optimalization for case where
5508         result can be precomputed.
5509
5510 2005-01-26  Martin Baulig  <martin@ximian.com>
5511
5512         * class.cs (TypeContainer.AttributeTargets): Return the correct
5513         AttributeTargets depending on our `Kind' instead of throwing an
5514         exception; fixes #71632.
5515
5516 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5517
5518         Fix #71257
5519         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5520         constant members.
5521
5522 2005-03-17  Martin Baulig  <martin@ximian.com>
5523
5524         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5525         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5526
5527 2005-03-17  Martin Baulig  <martin@ximian.com>
5528
5529         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5530         to bool so we can return an error condition.
5531         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5532         returned an error.
5533
5534 2005-03-17  Martin Baulig  <martin@ximian.com>
5535
5536         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5537
5538         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5539         converting from an array-type of T to `IEnumerable<T>'.
5540
5541 2005-03-16  Martin Baulig  <martin@ximian.com>
5542
5543         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5544         (Nullable.LiftedUnaryMutator): New public class.
5545
5546         * expression.cs (UnaryMutator.DoResolve): Added support for
5547         Nullable Types.
5548
5549 2005-03-14  Martin Baulig  <martin@ximian.com>
5550
5551         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5552
5553 2005-03-14  Martin Baulig  <martin@ximian.com>
5554
5555         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5556         the comparision operators `<', `>', `<=' and `>='.
5557
5558 2005-03-13  Martin Baulig  <martin@ximian.com>
5559
5560         * generic.cs
5561         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5562         avoid confusion with the `NullLiteral'.
5563         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5564
5565 2005-03-13  Martin Baulig  <martin@ximian.com>
5566
5567         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5568         comparing arbitrary types with the null literal.
5569
5570 2005-03-13  Martin Baulig  <martin@ximian.com>
5571
5572         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5573         boolean operators '&&', '||', '&' and '|'.
5574         (Nullable.OperatorTrueOrFalse): New public class.
5575
5576         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5577         instead of a `StaticCallExpr'; added support for nullables.
5578
5579 2005-03-10  Martin Baulig  <martin@ximian.com>
5580
5581         * expression.cs
5582         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5583         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5584
5585 2005-03-07  Martin Baulig  <martin@ximian.com>
5586
5587         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5588         it work if `expr' is not an IMemoryLocation.
5589         (Nullable.Lifted): Implement IMemoryLocation.
5590         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5591         target type.
5592
5593 2005-03-05  Martin Baulig  <martin@ximian.com>
5594
5595         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5596         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5597         (Nullable): Added support for lifted unary and binary operators.
5598
5599         * expression.cs (Unary.DoResolve): Added support for nullable types.
5600         (Binary.DoResolve): Likewise.
5601         (Conditional.DoResolve): Likewise.
5602
5603 2005-03-02  Martin Baulig  <martin@ximian.com>
5604
5605         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5606
5607         * class.cs (ClassPart.SetParameterInfo): Override this.
5608         (PartialContainer.SetParameterInfo): Override this.
5609         (TypeContainer.CheckConstraints): New protected method.
5610         (PartialContainer.CheckConstraints): Override this and check
5611         whether the same contraints were specified in all parts of a
5612         partial generic type definition.
5613         (PartialContainer.UpdateConstraints): New public method.
5614
5615         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5616
5617 2005-03-02  Martin Baulig  <martin@ximian.com>
5618
5619         Committing a patch from Carlos Alberto Cortez to fix #72887.
5620
5621         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5622         casts from `T []' to `int []'.
5623
5624 2005-03-02  Martin Baulig  <martin@ximian.com>
5625
5626         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5627
5628         * expression.cs (Binary.ResolveOperator): When resolving a
5629         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5630         `=='.  Fixes #71866.  See gen-127.cs.
5631
5632 2005-03-02  Martin Baulig  <martin@ximian.com>
5633
5634         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5635         static constructor in static classes.
5636
5637 2005-03-02  Martin Baulig  <martin@ximian.com>
5638
5639         * generic.cs
5640         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5641         (Nullable.LiftedConversion): Added support for user-defined
5642         conversions.
5643
5644         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5645
5646         * cs-parser.jay: Use ComposedCast everywhere instead of
5647         NullableType, so we don't need to check for NullableType
5648         everywhere.
5649         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5650         case where we'll be resolved into a `parenthesized_expression_0'
5651         afterwards.
5652
5653         * convert.cs
5654         (Convert.UserDefinedConversion): Added nullable conversions.
5655
5656 2005-02-28  Martin Baulig  <martin@ximian.com>
5657
5658         * generic.cs (TypeManager.IsNullableType): New static method.
5659         (Nullable): New abstract class.
5660         (Nullable.NullLiteral): New public class.
5661         (Nullable.LiftedConversion): New public class.
5662
5663         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5664         `builtin_types opt_nullable'.
5665
5666         * convert.cs
5667         (Convert.ImplicitConversionStandard): Added nullable conversions.
5668         (Convert.ExplicitConversionStandard): Likewise.
5669         (Convert.ExplicitConversion): Likewise.
5670
5671 2005-02-26  Martin Baulig  <martin@ximian.com>
5672
5673         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5674         begin with a "?", for instance "?[]".  Don't do a type lookup if
5675         `dim' is empty.
5676
5677 2005-02-25  Martin Baulig  <martin@ximian.com>
5678
5679         The first part of Nullable Types :-)
5680
5681         * generic.cs (NullableType): New public class.
5682         (NullCoalescingOperator): New public class.
5683         (TypeArguments.Resolve): Add a CS0306 check.
5684
5685         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5686         (opt_nullable): New rule.
5687         (type): Added `opt_nullable' to `namespace_or_type_name',
5688         `builtin_types' and `pointer_type'.
5689         (array_type): Added `opt_nullable'.
5690         (opt_rank_specifier_or_nullable): New rule; this is the
5691         combination of `opt_rank_specifier' and `opt_nullable'.
5692         (opt_error): New rule; catch errors here.
5693         (nullable_type_or_conditional): New rule; we use this to check for
5694         nullable and still detect the conditional operator.
5695         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5696         instead `opt_rank_specifier'.
5697
5698         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5699         for nullables.
5700
5701 2005-02-24  Martin Baulig  <martin@ximian.com>
5702
5703         * README, README.Changes: Removed; they're old and obsolete.
5704
5705 2005-02-22  Martin Baulig  <martin@ximian.com>
5706
5707         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5708         returned an error, set `constraints' to null to avoid a crash
5709         later on.
5710         (TypeParameter.ResolveType): Likewise.
5711
5712 2005-02-22  Martin Baulig  <martin@ximian.com>
5713
5714         * generic.cs
5715         (Constraints.ResolveTypes): Protect against being called twice.
5716         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5717         (TypeParameter.ResolveType): New public method; calls
5718         constraints.ResolveTypes().
5719         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5720         into the new ResolveType().
5721         (GenericMethod.Define): Call ResolveType() on all our
5722         TypeParameter's.        
5723
5724 2005-02-21  Martin Baulig  <martin@ximian.com>
5725
5726         * generic.cs
5727         (TypeManager.generic_nullable_type): New static public field.
5728         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5729
5730         * rootcontext.cs
5731         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5732
5733 2005-02-15  Martin Baulig  <martin@ximian.com>
5734
5735         * generic.cs (ConstructedType.Constraints): Correctly check
5736         constraints if the argument type is a type parameter; fixes
5737         #72326. 
5738
5739 2005-02-02  Martin Baulig  <martin@ximian.com>
5740
5741         * delegate.cs (Delegate.DefineType): Report an internal error if
5742         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5743         details.        
5744
5745 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5746
5747         * pending.cs: Produce better code (no nops produced by using Ldarg
5748         + value).
5749         
5750         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5751         i - 1' it should be arg + 1.
5752
5753         Fixes bug #71819.
5754         
5755 2005-01-26  Martin Baulig  <martin@ximian.com>
5756
5757         * cs-parser.jay (indexer_declarator): Don't report an error if we
5758         have type parameters since we can be an explicit interface
5759         implementation; fixes #71449.
5760
5761 2005-01-26  Martin Baulig  <martin@ximian.com>
5762
5763         * class.cs (TypeContainer.AttributeTargets): Return the correct
5764         AttributeTargets depending on our `Kind' instead of throwing an
5765         exception; fixes #71632.
5766
5767 2005-01-26  Martin Baulig  <martin@ximian.com>
5768
5769         * delegate.cs (Delegate.DefineType): Correctly define our type
5770         parameters.  Fixes #71483.
5771
5772 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5773
5774         Fix #71602.
5775         * expression.cs (MemberAccess.DoResolve): Don't complain with
5776         cs0572 when the LHS of a member access has identical name and type
5777         name.
5778
5779 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5780
5781         Fix #71651, #71675
5782         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5783         CreatePermission.
5784         Create custom PermissionSet only for PermissionSetAttribute.
5785
5786 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5787
5788         Fix #71649
5789         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5790         delegates in static class.
5791
5792 2005-01-24  Martin Baulig  <martin@ximian.com>
5793
5794         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5795         merging an implicit block, just use its reachability.
5796
5797         * statement.cs (Block.Resolve): Make the unreachable code check
5798         work wrt. implicit blocks; see test-337 from #63842.
5799
5800 2005-01-21  Alp Toker  <alp@atoker.com>
5801  
5802         * cs-parser.jay: destructor_declaration's container is PartialContainer
5803         not Class when partial types are used, so use Kind prop instead of
5804         'is'.
5805         
5806 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5807
5808         * cs-parser.jay: Improve error reporting when an interface
5809         declares new types.
5810
5811 2005-01-20  Dick Porter  <dick@ximian.com>
5812
5813         * support.cs: SeekableStreamReader fix from Sandor Dobos
5814         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5815         chars are read.  Fixes bug 70369.
5816
5817 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5818
5819         * cs-parser.jay (catch_clause): Simplify current_block handling
5820         somewhat.
5821
5822 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5823
5824         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5825         code with ImplicitStandardConversion to handle the implicit
5826         conversion of method groups into valid delegate invocations. 
5827
5828         The problem is that in parameter handling we were using this code
5829         path.  Fixes bug #64698
5830
5831 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5832
5833         * cs-parser.jay: Fix several infelicities.
5834         - Avoid assigning to the parser value stack.  Code like 
5835           '$3 = null' is unclean.  Synthesize a value for the code block
5836           instead. 
5837         - Avoid using oob_stack for storing location information.  Use ...
5838         (_mark_): ... this.  New (empty) rule.  Saves the current location
5839         in $$.
5840         (foreach_statement): Avoid using oob_stack for current_block
5841         handling.  Use technique used in for_statement and
5842         using_statement.  Synthesize a value for the code block to store
5843         additional intermediate information.
5844
5845 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5846
5847         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5848         of a different type is only allowed to private fields of a
5849         containing type, not on fields of a base class.
5850
5851         See test-174.cs and error cs0122-9.cs
5852
5853 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5854
5855         Fix test-335.cs (bug #58126).
5856         * cs-parser.jay (argument): Split out non-expression parts of the
5857         rule into 'non_simple_argument'.
5858         (invocation_expression): Support parenthesized invocations with
5859         multiple arguments, and with single non-simple arguments.
5860
5861 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5862
5863         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5864         places.
5865
5866 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5867
5868         Fix cs0038-1.cs, cs1640-6.cs.
5869         * ecore.cs (Expression.Resolve): Remove special-case for
5870         SimpleName in error-handling.
5871         (Expression.almostMatchedMembers): Relax access permission to
5872         protected.
5873         (Expression.MemberLookupFailed): Handle duplicates in
5874         almostMatchedMembers list.
5875         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5876         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5877         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5878         overload if the passed in MemberInfo is a MethodBase.
5879
5880 2005-01-25  Martin Baulig  <martin@ximian.com>
5881
5882         * doc.cs
5883         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5884
5885 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5886
5887         Fix #70749
5888         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5889         for non-CAS & merge permission sets properly.
5890
5891 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5892
5893         Improve standard-compliance of simple name and member access 
5894         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5895         * ecore.cs (FullNamedExpression): New abstract base class 
5896         for Namespaces and TypeExpressions.
5897         (ResolveFlags.SimpleName): Remove.
5898         (SimpleName): Remove support for dotted names.
5899         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5900         DeclSpace.FindType and DeclSpace.LookupType.
5901         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5902         (Expression.ExprClassName): Make member function.
5903         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5904         a namespace.  Remove creation of dotted "SimpleName"s.
5905         (MemberAccess.DoResolve): Likewise.
5906         * decl.cs (DeclSpace.Cache): Make private.
5907         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5908         (DeclSpace.FindType): Update.
5909         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5910         FullNamedExpression.
5911         * namespace.cs (Namespace): Derive from FullNamedExpression
5912         so that it can be part of expression resolution.
5913         (Namespace.Lookup): Return an FullNamedExpression.
5914         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5915         namespace.
5916         * rootcontext.cs (NamespaceLookup): Remove.
5917         (LookupType): Move to DeclSpace.
5918         * attribute.cs (CheckAttributeType): Update.
5919         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5920         (FindDocumentedTypeNonArray): Likewise.
5921
5922 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5923
5924         Fix cs0509.cs, cs1632.cs.
5925         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5926         is the same as IsInterface.
5927         (TypeContainer.GetClassBases): Likewise.
5928         * statement.cs (LabeledStatement.ig): New field.
5929         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5930         label.
5931         (LabeledStatement.DoEmit): Check that the label was created with
5932         the same ILGenerator.
5933
5934 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5935
5936         Fix #71058
5937         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5938         accessors to its properties.
5939
5940         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5941         from accessors to property.
5942         
5943 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5944
5945         Fix #70722
5946         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5947         only for overrides.
5948         
5949 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5950
5951         * attribute.cs: Check for null and empty strings.  
5952
5953         I have lost another battle to Paolo.
5954
5955 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5956
5957         Fix #70942
5958         * class.cs (PropertyMethod): Set Parent field in ctors.
5959         (SetMethod.InternalParameters): Add unsafe switch hack.
5960         Override MarkForDuplicationCheck where it is appropriate.
5961
5962         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5963         It says whether container allows members with the same name.
5964         Base default is no.
5965         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5966         Removed is_method parameter.
5967
5968 2005-01-06  Duncan Mak  <duncan@ximian.com>
5969
5970         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5971         because the previous change led to incorrect reporting of CS1032
5972         ("Cannot define/undefine preprocessor symbols after first token in
5973         file"). Instead of using `tokens_seen' as the only flag that
5974         triggers CS1040, introduce `comments_seen'. This new flag is used
5975         to signify having seen comments on the current line, so it is
5976         unset after a newline.
5977
5978 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5979
5980         * doc.cs : When searching for a type, find nested type too.
5981           This fixes bug #71040.
5982
5983 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5984
5985         * doc.cs :
5986           - Warn missing member comment on those classes which also does not
5987             have doc comments. Fixed bug #71041.
5988           - Don't warn missing doc comment on default constructor.
5989             Fixed bug #71042.
5990
5991 2005-01-06  Duncan Mak  <duncan@ximian.com>
5992
5993         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5994         comments, set `tokens_seen' to true. This allows us to detect
5995         misplaced preprocessor directives (i.e. not at the beginning of
5996         the a line, nor after whitespaces). In that case, report error
5997         CS1040. This fixes bug #56460.
5998
5999         * cs-parser.jay (interface_member_declaration): Add checks for
6000         IsExplicitImpl, and report CS0541 error if an interface member is
6001         defined as an explicit interface declaration.
6002
6003 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6004
6005         Fix #70817
6006         * class.cs (PropertyMethod): Set Parent field in ctors.
6007         (SetMethod.InternalParameters): Add unsafe switch hack.
6008         
6009         * decl.cs (MemberCore.Parent): Cannot be readonly.
6010
6011 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6012
6013         * decl.cs (DeclSpace.ResolveType): Remove.
6014         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6015         Merge in code from ...
6016         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6017         * class.cs, enum.cs: Update to changes.
6018
6019 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6020
6021         * anonymous.cs: Ensure that we init the scope of our parent if it
6022         has not been initialized yet.
6023
6024 2004-12-30  Duncan Mak  <duncan@ximian.com>
6025
6026         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6027         if field.FieldBuilder is null. Fixes #70758.
6028
6029         * convert.cs: Fixed some typos and updated some of the comments.
6030         (ImplicitStandardConversionExists):
6031         (TryImplicitIntConversion): If `target_type' is an interface and
6032         the type of `ic' implements this interface, return true or a new
6033         BoxedCast instead of null. This fixes #70468.
6034
6035 2004-12-29  Duncan Mak  <duncan@ximian.com>
6036
6037         * expression.cs (Argument.Emit): Check that Expr is
6038         IMemoryLocation before casting to it, and report CS1510 otherwise.
6039
6040         This fixes #70402.
6041
6042 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6043
6044         * statement.cs (Block.ThisVariable): remove the recursion here, to
6045         make the --profile more sane.
6046
6047 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6048
6049         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6050         assembly, by JB Evain.
6051
6052 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6053
6054         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6055           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6056         "parent" refers to enclosing type/class.  "base" refers to superclass.
6057
6058 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6059
6060         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6061         Ensure that we only have GlobalAttributes.
6062         * attribute.cs (Attribute.Emit): Make non-virtual.
6063         (GlobalAttribute.Emit): Remove.
6064         (Attribute.Resolve): Make virtual.
6065         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6066         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6067         the argument. Don't create one.
6068         (Attribute.GetObsoleteAttribute): Likewise.
6069         (Attribute.GetClsCompliantAttributeValue): Likewise.
6070         * class.cs, decl.cs: Update to changes.
6071
6072 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6073
6074         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6075         
6076         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6077         
6078         * statement.cs (Foreach.Resolve): Add error 186 report.
6079
6080 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6081
6082         * expression.cs (Conditional.DoResolve): Add warning 429.
6083         
6084         * statement.cs (If.Resolve): Add warning 665.
6085
6086 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6087
6088         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6089         except when in the parser, and in GlobalAttribute.
6090         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6091         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6092         RootContext.Tree.Types.NamespaceEntry once work is done.
6093         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6094         and resets RootContext.Tree.Types.NamespaceEntry.
6095
6096 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6097
6098         * cs-parser.jay: Don't create a block for every variable.
6099
6100 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6101
6102         * location.cs: Provide extra information.
6103
6104         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6105         variables from the captured environment, it is the ldarg_0.
6106
6107 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6108
6109         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6110         find a conclusion.
6111         
6112         * class.cs: Changed warning level for 169 to avoid developer
6113         displeasure from warning flooding. It will be changed back when they
6114         fix most of current BCL warnings.
6115         
6116         * RootContext.cs: Pushed default WarningLevel to 3.
6117         
6118         * statement.cs: Removed unused variable.
6119
6120 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6121
6122         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6123         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6124         Add error 502 report.
6125         (StaticClass.DefineType): Add error 441 report.
6126         (Class.AllowedModifiersProp): New virtual property as temporary
6127         extension to AllowedModifiers.
6128         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6129         to share implementation with StaticClass and don't call virtual
6130         methods from ctor.
6131         
6132         * driver.cs (MainDriver): Add error 1558 test.
6133
6134         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6135         report. Moved error 36 test here.
6136
6137         * statement.cs (Throw.Resolve): Add error 724 report.
6138
6139         * typemanager.cs: Add out_attribute_type core type.
6140         
6141 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6142
6143         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6144         3018 report.
6145         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6146
6147         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6148         3017 report.
6149         
6150         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6151
6152         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6153         Add error 3023 report.
6154         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6155
6156         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6157         implementation.
6158
6159 2004-12-12  John Luke  <john.luke@gmail.com>
6160
6161         * driver.cs (AddArgs): take -- into account when
6162         adding arguments, fixes bug 65710 
6163
6164 2004-12-12  Martin Baulig  <martin@ximian.com>
6165
6166         * expression.cs (Unary.TryReduceNegative): Added support for
6167         SByteConstant and ByteConstant.
6168         (Unary.Reduce): Check error values from TryReduceNegative().
6169
6170 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6171
6172         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6173         and report exception as error 182.
6174
6175 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6176
6177         * driver.cs (Main): Fix message when there are warnings.
6178
6179 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6180
6181         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6182
6183 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6184
6185         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6186         Reduced number of warnings.
6187         
6188         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6189
6190 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6191
6192         * driver.cs: Removed message.
6193
6194         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6195
6196 2004-12-08    <vargaz@freemail.hu>
6197
6198         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6199
6200 2004-12-08  Martin Baulig  <martin@ximian.com>
6201
6202         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6203         instead of a CS3002 for properties and indexer.
6204
6205 2004-12-08  Martin Baulig  <martin@ximian.com>
6206
6207         * decl.cs (MemberName.ToString): Make this work again.
6208
6209 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6210
6211         * attribute.cs (Resolve): Add error 591 detection.
6212
6213         * class.cs (FieldMember.Define): Add error 1547 detection.
6214         (Indexer.Define): Add error 620 detection.
6215         (Operator.Define): Add error 590 detection.
6216
6217         * ecore.cs: Missing argument for error 79.
6218
6219         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6220         detection.
6221
6222 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6223
6224         Fix #70106
6225         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6226         only.
6227
6228 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6229
6230         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6231           Some operator comments were suppressed.
6232         * doc.cs : Implicit/explicit operator name in doc comments are like
6233           "op_Explicit(type)~returnType", so added suffix handling.
6234
6235 2005-01-21  Alp Toker  <alp@atoker.com>
6236
6237         * cs-parser.jay: destructor_declaration's container is PartialContainer
6238         not Class when partial types are used, so use Kind prop instead of 'is'.
6239
6240 2004-12-12  Martin Baulig  <martin@ximian.com>
6241
6242         * expression.cs (Unary.TryReduceNegative): Added support for
6243         SByteConstant and ByteConstant.
6244         (Unary.Reduce): Check error values from TryReduceNegative().
6245
6246 2004-12-11  Martin Baulig  <martin@ximian.com>
6247
6248         * support.cs (ReflectionParameters.ParameterName): If we have a
6249         `gpd', call `ParameterName' on it.
6250
6251         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6252
6253         * pending.cs (PendingImplementation.DefineProxy): Call
6254         DefineParameter() for all of the MethodBuilder's arguments.
6255
6256 2004-12-09  Martin Baulig  <martin@ximian.com>
6257
6258         * doc.cs (DocUtil): Make this a static class.
6259
6260 2004-12-09  Martin Baulig  <martin@ximian.com>
6261
6262         * expression.cs (Invocation.InferType): Moved the type inference
6263         implementation into TypeManager.
6264
6265         * generics.cs (TypeManager): Moved the type inference
6266         implementation here.
6267
6268 2004-12-09  Martin Baulig  <martin@ximian.com>
6269
6270         * typemanager.cs (TypeManager): Make this a partial class.
6271
6272         * generics.cs
6273         (TypeManager): Move the generics part of `TypeManager' here.
6274
6275 2004-12-08  Martin Baulig  <martin@ximian.com>
6276
6277         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6278         instead of a CS3002 for properties and indexer.  Added CS3024
6279         check for generic interfaces.
6280
6281         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6282         instances are not CLS-compliant.
6283
6284 2004-12-08  Martin Baulig  <martin@ximian.com>
6285
6286         * cs-parser.jay
6287         (void_pointer_expression): New rule for `void*', `void**' etc.
6288         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6289
6290 2004-12-08  Martin Baulig  <martin@ximian.com>
6291
6292         * expression.cs (Invocation.InferType): Removed the hack for
6293         MethodCore.MayUnify().  
6294
6295         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6296         this actually work.
6297
6298         * class.cs (MethodCore.MayUnify): Use
6299         TypeManager.MayBecomeEqualGenericTypes().       
6300
6301 2004-12-08  Martin Baulig  <martin@ximian.com>
6302
6303         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6304         parameter, box it.  Fixes #69233.
6305
6306 2004-12-08  Martin Baulig  <martin@ximian.com>
6307
6308         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6309         have the ctor constraint.  Fixes #68326.
6310
6311 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6312
6313         * cs-parser.jay : interface comment was not consumed because of
6314           extra opt_semicolon before doc handling.
6315
6316 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6317
6318         Fix test-327.cs, test-328.cs, and put in early infrastructure
6319         for eventually fixing #52697.
6320         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6321         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6322         from other methods.
6323         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6324         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6325         (VerifyUsing, error246): Update.
6326         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6327         'NamespaceEntry.LookupNamespaceOrType'.
6328
6329 2004-12-07  Martin Baulig  <martin@ximian.com>
6330
6331         * driver.cs: Call it "BETA SOFTWARE" :-)
6332
6333 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6334
6335         Fix crash on cs0657-17.cs.
6336         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6337         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6338         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6339         the case where the NamespaceEntry gets overwritten.
6340
6341 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6342
6343         Fixed #69195, #56821
6344         * ecore.cs (ResolveBoolean): Tiny refactoring.
6345
6346         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6347         of right expression resolving when left is false constant and
6348         operator is LogicalAnd OR true constant and operator is LogicalOr.
6349
6350         * statement.cs (ResolveUnreachable): Always reports warning.
6351
6352 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6353
6354         * class.cs: Distinguish between 1721 and 1722 (just a little help
6355         for the programmer).
6356
6357 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6358
6359         * delegate.cs: Only allow this on new versions of the language. 
6360
6361 2004-12-02  Duncan Mak  <duncan@ximian.com>
6362
6363         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6364         Expression class.
6365         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6366         here as a static method. Take an additional bool out parameter
6367         `must_do_cs1540_check' for signaling to InstanceResolve.
6368         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6369         member field from PropertyExpr class and made it an argument of
6370         the method instead.
6371         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6372         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6373         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6374         and `remove_accessor' as well as InstanceResolve: report CS0122
6375         where applicable.
6376
6377         Fixes #70129.
6378
6379 2004-12-07  Martin Baulig  <martin@ximian.com>
6380
6381         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6382         and CS0692 where appropriate.
6383
6384 2004-12-06  Martin Baulig  <martin@ximian.com>
6385
6386         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6387         IsDuplicateImplementation() and improved it.
6388
6389         * expression.cs (Invocation.InferTypeArguments): Added
6390         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6391         and removed the "ref" modifier from `infered_types'.
6392
6393         * decl.cs (MemberName.ToString): Removed the exception.
6394
6395 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6396
6397         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6398           comments are allowed.
6399
6400 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6401
6402         * delegate.cs: Add checks for subtypes in paramaters and return values
6403         in VerifyMethod () to add support for Covariance/Contravariance
6404         in delegates.
6405         
6406 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6407
6408         * report.cs: Remove extra closing parenthesis.
6409
6410         * convert.cs (Error_CannotImplicitConversion): If the name of the
6411         types are the same, provide some extra information.
6412
6413 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6414
6415         Fix bug #70102
6416         * attribute.cs (Resolve): Improved implementation of params
6417         attribute arguments.
6418
6419         * support.cs (ParameterData): Add HasParams to be faster.
6420
6421 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6422
6423         all things are for /doc support:
6424
6425         * doc.cs: new file that supports XML documentation generation.
6426         * mcs.exe.sources: added doc.cs.
6427         * driver.cs:
6428           Handle /doc command line option.
6429           Report error 2006 instead of 5 for missing file name for /doc.
6430           Generate XML documentation when required, after type resolution.
6431         * cs-tokenizer.cs:
6432           Added support for picking up documentation (/// and /** ... */),
6433           including a new XmlCommentState enumeration.
6434         * cs-parser.jay:
6435           Added lines to fill Documentation element for field, constant,
6436           property, indexer, method, constructor, destructor, operator, event
6437           and class, struct, interface, delegate, enum.
6438           Added lines to warn incorrect comment.
6439         * rootcontext.cs :
6440           Added Documentation field (passed only when /doc was specified).
6441         * decl.cs:
6442           Added DocComment, DocCommentHeader, GenerateDocComment() and
6443           OnGenerateDocComment() and some supporting private members for
6444           /doc feature to MemberCore.
6445         * class.cs:
6446           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6447         * delegate.cs:
6448           Added overriden DocCommentHeader.
6449         * enum.cs:
6450           Added overriden DocCommentHeader and GenerateDocComment().
6451
6452 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6453
6454         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6455         unwrapping the enumeration values, chain to
6456         DoConstantNumericPromotions again, so we can promote things to the
6457         fundamental types (takes care of enums that are bytes, sbytes).
6458
6459         Fixes bug #62054.
6460
6461 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6462
6463         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6464         Fix long-standing bug in type-lookup.  Use FindType instead of
6465         LookupType when ec.ResolvingTypeTree.
6466         (Attribute.ResolveType, Attribute.Resolve)
6467         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6468         Update to changes.
6469         (Attributes.Search): Remove internal version.  Update.
6470         (Attributes.SearchMulti): Update.
6471         (Attributes.GetClsCompliantAttribute): Remove.
6472         (Attributes.GetIndexerNameAttribute): Remove.
6473         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6474         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6475         * class.cs (Indexer.Define): Likewise.
6476
6477 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6478
6479         Fix bug #68790
6480         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6481         MarshallByReference members access.
6482
6483         * expression.cs: Use CheckMarshallByRefAccess;
6484         Better error CS0197 message.
6485
6486         * report.cs: Print whole related error message.
6487
6488 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * class (GetClassBases): Better error 60 report.
6491         (EventProperty): Disabled warning 67 detection.
6492
6493 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6494
6495         Fix bug #60324
6496         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6497
6498         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6499         precise values.
6500
6501 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6502
6503         Fix bug #49488
6504         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6505
6506         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6507
6508 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6509
6510         * attribute.cs (Attribute.Resolve): Refine error reporting and
6511         report a cs0117 if the identifier does not exist, to distinguish
6512         from 0617 which is a miss-use of the actual identifier.
6513
6514         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6515         between cs0070 and cs0079.
6516
6517         * class.cs (MemberBase.DoDefine): When reporting a wrong
6518         accessibility level, we use MethodCore to compare instead of
6519         Method (this was a regression in some refactoring effort).
6520
6521         So now we correctly report cs0056 again.
6522
6523         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6524         testing the target_type (which was known to be object_type) and
6525         not the source type (which is anonymous_method).
6526
6527         Fixed reporting of error cs1660.
6528
6529         * expression.cs (UserCast.Source): Expose the underlying cast.
6530
6531         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6532         allowed types to find a match to int32 first (most common).
6533
6534         In addition, it ignores any ImplicitUserConversions that did an
6535         internal implicit conversion (as the switch statement allows only
6536         one integral conversion to exist).
6537
6538         * class.cs (PartialContainer.Create): rename `name' to
6539         `member_name' for clarity.  Then replace the string calls with a
6540         call to MemberName.GetPartialName, as now using
6541         MemberName.ToString is an error (this is due to the side effects
6542         it had, that were fixed in the past).
6543
6544         This will restore the error reporting on a number of partial class
6545         errors that were missusing this (and getting an exception as a
6546         results, which is now just a plain textual warning, because
6547         yyparse debug output would crash otherwise).
6548
6549 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6550
6551         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6552
6553 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6554
6555         * rootcontext.cs (LookupType): Make sure to cache lookups that
6556         don't give us a negative result. This saves about 5% of corlib
6557         compilation time.
6558
6559 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6560
6561         * report.cs (AbstractMessage.Print): messages are sent to stderr
6562
6563         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6564         non-interface in the list of interfaces (at this point, either
6565         parent was properly set, or a base class is being listed in the
6566         interfaces section).
6567
6568         This flags error 1722, and resolves the crash from bug 69259.
6569
6570 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6571
6572         * statement.cs (Using.EmitExpressionFinally): make this work right
6573         for valuetypes. Fixes 69926.
6574
6575 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6576
6577         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6578         converted to an enum" here, before we try to change the underlying
6579         type.  This code exists, but it is a different code path than the
6580         one used while encoding constants.
6581
6582         (ImplicitReferenceConversionExists): In addition, resynchronized
6583         the code here, so it matches the same code in
6584         ImplicitReferenceConversionExists for the `from any class-type S
6585         to any interface-type T'.       
6586
6587 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6588
6589         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6590
6591 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6592
6593         * cs-parser.jay: Use verbosity accordingly. 
6594
6595 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6596
6597         * expression.cs (Unary.ResolveOperator): Do not report warning;
6598         AddressOf reads from variable.
6599         
6600         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6601
6602 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6603
6604         Fix bug #69462
6605
6606         * attribute.cs (Attributable): Removed CheckTargets.
6607         (Attributes.Emit): Explicit attribute targets are tested here.
6608
6609         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6610         not enabled for interfaces.
6611
6612         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6613         (GetAssemblyName): Ouch next bug there.
6614
6615 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6616
6617         * expression.cs: Error 275 added.
6618         
6619 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6620
6621         Fix bug #69177 (Implemented decimal constant support)
6622
6623         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6624         (BinaryFold): Add DecimalConstant.
6625
6626         * const.cs (Define): Decimal constant 
6627         (is not constant.
6628         (ChangeType): Add decimal type handling.
6629         (LookupConstantValue): Don't set value for decimal type but
6630         emit DecimalConstantAttribute. Needed for constant optimization.
6631
6632         * constant.cs (ToDecimal): New method.
6633         (ConvertToDecimal): New method.
6634         (IntConstant): Implemented ConvertToDecimal.
6635         (DecimalConstant.Emit): Emit optimized version for decimals in
6636         int range.
6637
6638         * expression.cs (ResolveOperator): Changed order of constant
6639         reduction to work correctly with native types which have
6640         overloaded operators.
6641         (ResolveMemberAccess): Extract constant value from attribute
6642         for decimal type.
6643
6644         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6645
6646         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6647         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6648         (ChangeType): Decimal is special.
6649         (TypeToCoreType): Add decimal type.
6650
6651 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6652
6653         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6654         decimal types.
6655
6656 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6657
6658         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6659         test cs1667-5.cs.
6660
6661 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6662
6663         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6664
6665         * pending.cs (PendingImplementation): Grab only interfaces.
6666
6667 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6668
6669         * statement.cs (ForeachHelperMethods): Add location member and
6670         error 202 detection.
6671
6672 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6673
6674         * expression.cs (DoResolveBase): Fixed wrong warning for out
6675         variables.
6676
6677 2004-12-04  Martin Baulig  <martin@ximian.com>
6678
6679         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6680         to check whether the conversion is ok.
6681
6682         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6683         `Type.EmptyTypes' if we're not a generic TypeContainer.
6684
6685 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6686
6687         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6688         old bug: when converting from the null literal to a pointer,
6689         return an EmptyCast, not the NullLiteral.
6690
6691         This fixes #69921, the recent null_type changes probably made this
6692         bug more prominent.
6693
6694 2004-12-03  Martin Baulig  <martin@ximian.com>
6695
6696         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6697         method as our child, call AnonymousMethod.Compatible() on it.
6698
6699 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6700
6701         * class.cs (FieldBase): Use an unused bit field from the field to
6702         encode the `has_offset' property from the FieldMember.  This saves
6703         a couple of Ks on bootstrap compilation.
6704
6705         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6706         method as our child, return the AnonymousMethod resolved
6707         expression.
6708
6709         * expression.cs (New.DoResolve): Allow return values from
6710         NewDelegate to also include AnonymousMethods.
6711
6712         Fixes #70150.
6713
6714 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6715
6716         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6717         cs1648 report.
6718         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6719         System.Runtime.InteropServices._Exception, since it's a base
6720         interface of the core type System.Exception in the net_2_0 profile.
6721
6722 2004-11-27  Martin Baulig  <martin@ximian.com>
6723
6724         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6725
6726 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6727
6728         * Makefile: Convert to use executable.make.
6729         * gmcs.exe.sources: New.
6730
6731 2004-11-25  Martin Baulig  <martin@ximian.com>
6732
6733         * expression.cs (Invocation.InferType): Added support for byref types.
6734
6735 2004-11-25  Martin Baulig  <martin@ximian.com>
6736
6737         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6738         in TypeManager.TypeToCoreType().
6739
6740 2004-11-25  Martin Baulig  <martin@ximian.com>
6741
6742         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6743         "Dispose" method from the `current_type'.
6744         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6745         DoDefineMembers() instead of using the MethodBuilder; this is
6746         required for generic iterators.
6747
6748         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6749
6750 2004-11-24  Martin Baulig  <martin@ximian.com>
6751
6752         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6753
6754 2004-11-20  Martin Baulig  <martin@ximian.com>
6755
6756         * expression.cs (Invocation.InferType): Correctly infer generic
6757         instances; see gen-103.cs.
6758         (Invocation.InferTypeArguments): If a generic method doesn't have
6759         any unbound type parameters, we don't need to infer anything.
6760
6761 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6762
6763         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6764
6765 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6766
6767         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6768         (TypeHandle.GetMemberCache): New.
6769         (TypeHandle.TypeHandle): Update.
6770         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6771         (TypeManager.LookupParentInterfacesCache):
6772         Rename from LookupInterfaceCache.  Optimize slightly.
6773         (TypeManager.MemberLookup_FindMembers): Update.
6774         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6775         multi-type variant.
6776         (AddCacheContents): Rename from AddHashtable.
6777         * class.cs (TypeContainer.parent_container): Remove.
6778         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6779         (TypeContainer.DoDefineMembers): Don't initialize it.
6780         Update to name changes.
6781         
6782 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6783
6784         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6785         that factors the code to check access modifiers on override.  
6786
6787         (PropertyBase): Use the code here.
6788
6789         Patch from Lluis S'anchez, fixes bug #69361.
6790
6791 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6792
6793         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6794         routine that is used to report the use of a captured variable
6795         whose address has been taken.
6796
6797         There are two checks: one when variables are being captured and
6798         the other check is when the address of a variable is taken. 
6799         
6800         (because an anonymous methods might be resolved before *or* after
6801         the address has been taken) and 
6802
6803         * expression.cs (Conditional.DoResolve): Remove the special
6804         casing that Martin added to trueExpr and falseExpr being both
6805         NullLiteral.  We get the right behavior now just by introducing
6806         the null_type into the compiler. 
6807
6808         * convert.cs (ExplicitConversion): Change the code to use
6809         null_type instead of testing `expr is NullLiteral'.
6810         (ImplicitConversionStandard): use null_type too.
6811         (ImplicitReferenceConversionExists): use null_type too.
6812         (ImplicitReferenceConversion): use null_type too.
6813
6814         * literal.cs: The type of `NullLiteral' is now null_type instead
6815         of object_type. 
6816         (Resolve): Set the type here.
6817
6818         * typemanager.cs: Introduce null_type.
6819
6820 2004-11-18  Martin Baulig  <martin@ximian.com>
6821
6822         * rootcontext.cs
6823         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6824
6825 2004-11-18  Martin Baulig  <martin@ximian.com>
6826
6827         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6828
6829 2004-11-18  Martin Baulig  <martin@ximian.com>
6830
6831         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6832         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6833         call ResolveConstructedType() on it to resolve it without checking
6834         constraints.
6835         (Constraints.ResolveTypes): Check them here.
6836         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6837         but don't check constraints.
6838         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6839         check constraints here.
6840         (ConstructedType.ResolveConstructedType): New public method.  This
6841         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6842         resolve ourselves without checking constraints.
6843
6844         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6845
6846 2004-11-18  Martin Baulig  <martin@ximian.com>
6847
6848         * decl.cs
6849         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6850
6851         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6852
6853 2004-11-18  Martin Baulig  <martin@ximian.com>
6854
6855         * ecore.cs (TypeExpr.ResolveType): Removed.
6856         (Expression.ResolveAsTypeTerminal): We always return a fully
6857         resolved `TypeExpr', so we can just access its `Type'.
6858
6859         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6860
6861 2004-11-17  Martin Baulig  <martin@ximian.com>
6862
6863         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6864         sure we don't return any unresolved TypeExpr's.
6865         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6866         a `TypeExpr'.
6867         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6868
6869         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6870         unresolved `ConstructedType's.
6871
6872 2004-11-17  Martin Baulig  <martin@ximian.com>
6873
6874         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6875
6876 2004-11-17  Martin Baulig  <martin@ximian.com>
6877
6878         * ecore.cs
6879         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6880
6881         * decl.cs (DeclSpace.ResolveType): Removed.
6882         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6883
6884 2004-11-17  Martin Baulig  <martin@ximian.com>
6885
6886         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6887         direction, like FindMembers() does.  Fixes #69546, testcase is in
6888         test-315.cs.    
6889
6890 2004-11-16  Martin Baulig  <martin@ximian.com>
6891
6892         This is based on a patch from Marek Safar, see bug #69082.
6893         Fixes bugs #63705 and #67130.
6894
6895         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6896         method; create a MemberCache for an interface type and cache the
6897         result.
6898
6899         * decl.cs (IMemberContainer.ParentContainer): Removed.
6900         (IMemberContainer.ParentCache): New property.
6901         (MemberCache.SetupCacheForInterface): Removed.
6902         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6903         to create a cache for an interface's "parent".
6904
6905         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6906         interfaces too.
6907
6908 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6909
6910         * statement.cs: Avoid adding bools to a hashtable.
6911
6912 2004-11-15  Martin Baulig  <martin@ximian.com>
6913
6914         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6915
6916 2004-11-11  Martin Baulig  <martin@ximian.com>
6917
6918         * typemanager.cs (TypeManager.GetMethodName): New method.
6919
6920         * class.cs (MethodData.Define): Include the generic arity in the
6921         name of an explicit interface; also add it to the method name.
6922
6923         * pending.cs (PendingImplementation.InterfaceMethod): The method
6924         name now includes the generic arity.
6925
6926 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6927
6928         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6929         calling an unsafe method from a safe location.
6930
6931 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6932
6933         Fix #69167
6934         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6935
6936 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6937
6938         * namespace.cs (VerifyUsing): use GetPartialName instead of
6939         ToString. 
6940
6941 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6942
6943         * statement.cs (Return.Resolve): Fix regression in typo: if
6944         `in_exc', we have to request a NeedReturnLabel, this was a typo
6945         introduced in the anonymous method check-in.  Fixes #69131.
6946
6947         * Indexers were using the ShortName when defining themselves,
6948         causing a regression in the compiler bootstrap when applying the
6949         patch from 2004-11-02 (first part), now they use their full name
6950         and the bug is gone.
6951
6952 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6953
6954         * driver.cs: Strip the path from the names of embedded resources. Fixes
6955         #68519.
6956
6957 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6958
6959         Fix error message regression: cs0104-2.cs.
6960         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6961         (AliasEntry.Resolve): Update.
6962         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6963         'silent' flag.
6964         (RootContext.LookupType): Update.
6965
6966 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6967
6968         * cs-parser.jay: Add support for handling accessor modifiers
6969         * class: Add support port accessor modifiers and error checking,
6970         define PropertyMethod.Define as virtual (not abstract anymore)
6971         * ecore.cs: Add checking for proeprties access with access modifiers
6972         * iterators.cs: Modify Accessor constructor call based in the modified
6973         constructor
6974 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6975
6976         * expression.cs (StringConcat): Handle being called twice,
6977         as when we have a concat in a field init with more than two
6978         ctors in the class
6979
6980 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6981
6982         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6983         special case explicit implementations, we should always produce
6984         the .property or .event declaration.
6985         
6986         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6987         since it will not return correct data if people use this
6988         unresolved in the presence of using statements (see test-313).
6989
6990         * class.cs (MethodData.Define): If we are an explicit interface
6991         implementation, set the method name to the full name of the
6992         interface plus the name of the method.  
6993
6994         Notice that using the method.MethodName.GetFullName() does not
6995         work, as it will only contain the name as declared on the source
6996         file (it can be a shorthand in the presence of using statements)
6997         and not the fully qualifed type name, for example:
6998
6999         using System;
7000
7001         class D : ICloneable {
7002                 object ICloneable.Clone ()  {
7003                 }
7004         }
7005
7006         Would produce a method called `ICloneable.Clone' instead of
7007         `System.ICloneable.Clone'.
7008
7009         * namespace.cs (Alias.Resolve): Use GetPartialName.
7010         
7011 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7012
7013         * cs-parser.jay: Add error 1055 report.
7014
7015 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7016
7017         * assign.cs (Assign.DoResolve): Only do the transform of
7018         assignment into a New if the types are compatible, if not, fall
7019         through and let the implicit code deal with the errors and with
7020         the necessary conversions. 
7021
7022 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7023
7024         * cs-parser.jay: Add error 1031 report.
7025
7026         * cs-tokenizer.cs: Add location for error 1038.
7027
7028 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7029
7030         * cs-parser.jay: Add error 1016 report.
7031
7032 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7033
7034         * cs-parser.jay: Add errors 1575,1611 report.
7035
7036 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7037
7038         * cs-parser.jay: Add error 1001 report.
7039
7040 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7041
7042         Fix #68850
7043         * attribute.cs (GetMarshal): Add method argument for
7044         caller identification.
7045
7046         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7047         agument for GetMarshal and RuntimeMissingSupport.
7048
7049 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7050
7051         * attribute.cs (ExtractSecurityPermissionSet): Removed
7052         TypeManager.code_access_permission_type.
7053
7054         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7055
7056 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7057
7058         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7059         for obsolete use of a variable here.   Fixes regression on errors
7060         cs0619-25 and cs0619-26.
7061
7062 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7063
7064         Fix #62358, implemented security attribute encoding.
7065
7066         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7067         Tests permitted SecurityAction for assembly or other types.
7068         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7069         data from SecurityPermissionAttribute to PermisionSet class.
7070
7071         * class.cs (ApplyAttributeBuilder): Added special handling
7072         for System.Security.Permissions.SecurityAttribute based types.
7073
7074         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7075         special handling for System.Security.Permissions.SecurityAttribute
7076         based types.
7077
7078         * enum.cs (ApplyAttributeBuilder): Added special handling
7079         for System.Security.Permissions.SecurityAttribute based types.
7080
7081         * parameter.cs (ApplyAttributeBuilder): Added special handling
7082         for System.Security.Permissions.SecurityAttribute based types.
7083
7084         * rootcontext.cs: Next 2 core types.
7085
7086         * typemanager.cs (TypeManager.security_permission_attr_type):
7087         Built in type for the SecurityPermission Attribute.
7088         (code_access_permission_type): Build in type.
7089
7090 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7091
7092         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7093         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7094         all of this information into
7095         EmitContext.EmitCapturedVariableInstance.
7096         
7097         * codegen.cs (EmitCapturedVariableInstance): move here the
7098         funcionality of emitting an ldarg.0 in the presence of a
7099         remapping.   This centralizes the instance emit code.
7100
7101         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7102         then emit a load of this: it means that we have reached the
7103         topmost ScopeInfo: the one that contains the pointer to the
7104         instance of the class hosting the anonymous method.
7105
7106         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7107         captures to the topmost CaptureContext.
7108
7109 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7110
7111         * expression.cs (LocalVariableReference): Move the knowledge about
7112         the iterators into codegen's EmitCapturedVariableInstance.
7113
7114 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7115
7116         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7117         all code paths return a value from an anonymous method (it is the
7118         same as the 161 error, but for anonymous methods).
7119
7120 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7121
7122         The introduction of anonymous methods in the compiler changed
7123         various ways of doing things in the compiler.  The most
7124         significant one is the hard split between the resolution phase
7125         and the emission phases of the compiler.
7126
7127         For instance, routines that referenced local variables no
7128         longer can safely create temporary variables during the
7129         resolution phase: they must do so from the emission phase,
7130         since the variable might have been "captured", hence access to
7131         it can not be done with the local-variable operations from the runtime.
7132         
7133         * statement.cs 
7134
7135         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7136         is a toplevel block.
7137
7138         (ToplevelBlock): A new kind of Block, these are the blocks that
7139         are created by the parser for all toplevel method bodies.  These
7140         include methods, accessors and anonymous methods.
7141
7142         These contain some extra information not found in regular blocks:
7143         A pointer to an optional CaptureContext (for tracking captured
7144         local variables and parameters).  A pointer to the parent
7145         ToplevelBlock.
7146         
7147         (Return.Resolve): Catch missmatches when returning a value from an
7148         anonymous method (error 1662).
7149         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7150         phase.
7151
7152         (Break.Resolve): ditto.
7153
7154         (SwitchLabel): instead of defining the labels during the
7155         resolution phase, we now turned the public ILLabel and ILLabelCode
7156         labels into methods called GetILLabelCode() and GetILLabel() that
7157         only define the label during the Emit phase.
7158
7159         (GotoCase): Track the SwitchLabel instead of the computed label
7160         (its contained therein).  Emit the code by using
7161         SwitchLabel.GetILLabelCode ().
7162
7163         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7164         whether the Local has been captured or not.
7165
7166         (LocalInfo.IsCaptured): New property, used to tell whether the
7167         local has been captured.
7168         
7169         * anonymous.cs: Vastly updated to contain the anonymous method
7170         support.
7171
7172         The main classes here are: CaptureContext which tracks any
7173         captured information for a toplevel block and ScopeInfo used to
7174         track the activation frames for various local variables.   
7175
7176         Each toplevel block has an optional capture context associated
7177         with it.  When a method contains an anonymous method both the
7178         toplevel method and the anonymous method will create a capture
7179         context.   When variables or parameters are captured, they are
7180         recorded on the CaptureContext that owns them, for example:
7181
7182         void Demo () {
7183              int a;
7184              MyDelegate d = delegate {
7185                  a = 1;
7186              }
7187         }
7188
7189         Here `a' will be recorded as captured on the toplevel
7190         CapturedContext, the inner captured context will not have anything
7191         (it will only have data if local variables or parameters from it
7192         are captured in a nested anonymous method.
7193
7194         The ScopeInfo is used to track the activation frames for local
7195         variables, for example:
7196
7197         for (int i = 0; i < 10; i++)
7198                 for (int j = 0; j < 10; j++){
7199                    MyDelegate d = delegate {
7200                         call (i, j);
7201                    }
7202                 }
7203
7204         At runtime this captures a single captured variable `i', but it
7205         captures 10 different versions of the variable `j'.  The variable
7206         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7207         recorded on a child.  
7208
7209         The toplevel ScopeInfo will also track information like the `this'
7210         pointer if instance variables were referenced (this is necessary
7211         as the anonymous method lives inside a nested class in the host
7212         type of the method). 
7213
7214         (AnonymousMethod): Expanded to track the Toplevel, implement
7215         `AnonymousMethod.Compatible' to tell whether an anonymous method
7216         can be converted to a target delegate type. 
7217
7218         The routine now also produces the anonymous method content
7219
7220         (AnonymousDelegate): A helper class that derives from
7221         DelegateCreation, this is used to generate the code necessary to
7222         produce the delegate for the anonymous method that was created. 
7223
7224         * assign.cs: API adjustments for new changes in
7225         Convert.ImplicitStandardConversionExists.
7226
7227         * class.cs: Adjustments to cope with the fact that now toplevel
7228         blocks are of type `ToplevelBlock'. 
7229
7230         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7231         insteda of standard blocks.
7232
7233         Flag errors if params arguments are passed to anonymous methods.
7234
7235         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7236         `CurrentAnonymousMethod' which points to the current Anonymous
7237         Method.  The variable points to the AnonymousMethod class that
7238         holds the code being compiled.  It is set in the new EmitContext
7239         created for the anonymous method.
7240
7241         (EmitContext.Phase): Introduce a variable and an enumeration to
7242         assist in enforcing some rules about when and where we are allowed
7243         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7244         only one that enfonces this right now).
7245
7246         (EmitContext.HaveCaptureInfo): new helper method that returns
7247         whether we have a CapturedContext initialized.
7248
7249         (EmitContext.CaptureVariable): New method used to register that a
7250         LocalInfo must be flagged for capturing. 
7251
7252         (EmitContext.CapturedParameter): New method used to register that a
7253         parameters must be flagged for capturing. 
7254         
7255         (EmitContext.CapturedField): New method used to register that a
7256         field must be flagged for capturing. 
7257
7258         (EmitContext.HaveCapturedVariables,
7259         EmitContext.HaveCapturedFields): Return whether there are captured
7260         variables or fields. 
7261
7262         (EmitContext.EmitMethodHostInstance): This is used to emit the
7263         instance for the anonymous method.  The instance might be null
7264         (static methods), this (for anonymous methods that capture nothing
7265         and happen to live side-by-side with the current method body) or a
7266         more complicated expression if the method has a CaptureContext.
7267
7268         (EmitContext.EmitTopBlock): Routine that drives the emission of
7269         code: it will first resolve the top block, then emit any metadata
7270         and then emit the code.  The split is done so that we can extract
7271         any anonymous methods and flag any captured variables/parameters.
7272         
7273         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7274         during this phase, the ILGenerator should not be used as labels
7275         and local variables declared here might not be accessible to any
7276         code that is part of an anonymous method.  
7277
7278         Exceptions to this include the temporary variables that are
7279         created by some statements internally for holding temporary
7280         variables. 
7281         
7282         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7283         metadata for a cb
7284
7285         (EmitContext.TemporaryReturn): This method is typically called
7286         from the Emit phase, and its the only place where we allow the
7287         ReturnLabel to be defined other than the EmitMeta.  The reason is
7288         that otherwise we would have to duplicate a lot of logic in the
7289         Resolve phases of various methods that today is on the Emit
7290         phase. 
7291
7292         (EmitContext.NeedReturnLabel): This no longer creates the label,
7293         as the ILGenerator is not valid during the resolve phase.
7294
7295         (EmitContext.EmitThis): Extended the knowledge in this class to
7296         work in anonymous methods in addition to iterators. 
7297
7298         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7299         code is necessary on the stack to access the instance to a local
7300         variable (the variable will be accessed as a field).
7301
7302         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7303         EmitContext.EmitAddressOfParameter): Routines to support
7304         parameters (not completed at this point). 
7305         
7306         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7307         will also remove the parameters.
7308
7309         * convert.cs (Convert): Define a `ConstantEC' which points to a
7310         null.  This is just to prefity some code that uses
7311         ImplicitStandardConversion code and do not have an EmitContext
7312         handy.
7313
7314         The idea is to flag explicitly that at that point in time, it is
7315         known that the conversion will not trigger the delegate checking
7316         code in implicit conversions (which requires a valid
7317         EmitContext). 
7318
7319         Everywhere: pass new EmitContext parameter since
7320         ImplicitStandardConversionExists now requires it to check for
7321         anonymous method conversions. 
7322
7323         (Convert.ImplicitStandardConversionExists): If the type of an
7324         expression is the anonymous_method_type, and the type is a
7325         delegate, we invoke the AnonymousMethod.Compatible method to check
7326         whether an implicit conversion is possible. 
7327
7328         (Convert.ImplicitConversionStandard): Only do implicit method
7329         group conversions if the language level is not ISO_1.
7330
7331         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7332         MethodInfo for the Invoke method.  used by Delegate and
7333         AnonymousDelegate.
7334
7335         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7336         method conversions if the target type is a delegate.
7337
7338         Removed extra debugging nops.
7339
7340         (LocalVariableReference): Turn the `local_info' into a public
7341         field. 
7342
7343         Add `prepared' field, the same hack used for FieldExprs to cope
7344         with composed assignments, as Local variables do not necessarily
7345         operate purely on the stack as they used to: they can be captured
7346         fields. 
7347
7348         Add `temp' for a temporary result, like fields.
7349
7350         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7351
7352         It now copes with Local variables that are captured and emits the
7353         proper instance variable to load it from a field in the captured
7354         case. 
7355
7356         (ParameterReference.DoResolveBase): During the resolve phase,
7357         capture parameters if we are in an anonymous method.
7358
7359         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7360         anonymous method, use the EmitContext helper routines to emit the
7361         parameter reference.
7362
7363         * iterators.cs: Set RemapToProxy to true/false during the
7364         EmitDispose class.
7365
7366         * parameters.cs (GetParameterByName): New helper method. 
7367
7368         * typemanager.cs (anonymous_method_type) a new type that
7369         represents an anonyous method.  This is always an internal type,
7370         used as a fencepost to test against the anonymous-methodness of an
7371         expression. 
7372         
7373 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7374
7375         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7376         561 report.
7377         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7378
7379 2004-11-10  Martin Baulig  <martin@ximian.com>
7380
7381         * expression.cs (Invocation.BetterFunction): If two methods have
7382         equal parameter types, but only one of them is generic, the
7383         non-generic one wins.
7384         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7385         instance; just use `Type.IsValueType' to determine whether
7386         something is a struct or not.
7387         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7388         so we can be called multiple times.
7389
7390 2004-11-10  Martin Baulig  <martin@ximian.com>
7391
7392         * generic.cs (TypeParameter.DefineConstraints): New public method.
7393         (TypeParameter.CheckAccessLevel): Override this and return true.
7394         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7395         override ResolveType() anymore.
7396         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7397
7398 2004-11-10  Martin Baulig  <martin@ximian.com>
7399
7400         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7401         call DeclSpace.ResolveNestedType() on it.
7402
7403 2004-11-10  Martin Baulig  <martin@ximian.com>
7404
7405         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7406         non-null, call ParameterModifier() on it.
7407
7408 2004-11-10  Martin Baulig  <martin@ximian.com>
7409
7410         * iterators.cs
7411         (Iterators): Added `current_type' and `this_type' fields.
7412         (Iterators.DefineIterator): Create a new EmitContext and store it
7413         in `ec'; compute `this_type'.
7414
7415 2004-11-10  Martin Baulig  <martin@ximian.com>
7416
7417         * typemanager.cs
7418         (TypeManager.IsPrivateAccessible): New public method.
7419         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7420
7421 2004-11-10  Martin Baulig  <martin@ximian.com>
7422
7423         * class.cs (TypeContainer.DefineType): Call
7424         TypeBuilder.DefineGenericParameters() before resolving the type
7425         parameters.
7426         (MethodData.parent_method): New protected field.
7427         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7428         (MethodData.Define): Compute `parent_method'.
7429
7430         * decl.cs
7431         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7432         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7433         (DeclSpace.ec): New protected field; store the EmitContext here.
7434         (DeclSpace.EmitContext): New public property.
7435         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7436         (DeclSpace.ResolveNestedType): New public method.
7437         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7438         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7439         (DeclSpace.FamilyAccessible): Likewise.
7440         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7441         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7442         EmitContext.
7443
7444         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7445         field.
7446
7447         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7448         (Enum.Emit): Don't create a new EmitContext.
7449
7450 2004-10-18  Martin Baulig  <martin@ximian.com>
7451
7452         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7453         `Type' directly, but call ResolveType() on it.
7454         (Catch.Resolve): Likewise.
7455         (Foreach.Resolve): Likewise.
7456
7457 2004-10-18  Martin Baulig  <martin@ximian.com>
7458
7459         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7460         `Type' directly, but call ResolveType() on it.
7461         (Probe.DoResolve): Likewise.
7462         (ArrayCreation.LookupType): Likewise.
7463         (TypeOf.DoResolve): Likewise.
7464         (SizeOf.DoResolve): Likewise.
7465
7466 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7467
7468         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7469         the ResolveType.
7470
7471 2004-10-17  John Luke  <john.luke@gmail.com>
7472
7473         * class.cs (Operator.GetSignatureForError): use CSharpName
7474
7475         * parameter.cs (Parameter.GetSignatureForError): Returns
7476         correct name even if was not defined.
7477
7478 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7479
7480         Fix #65816.
7481         * class.cs (TypeContainer.EmitContext): New property.
7482         (DefineNestedTypes): Create an emitcontext for each part.
7483         (MethodCore.DoDefineParameters): Use container's emitcontext.
7484         Pass type array to InternalParameters.
7485         (MemberBase.DoDefine): Use container's emitcontext.
7486         (FieldMember.Define): Likewise.
7487         (Event.Define): Likewise.
7488         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7489         Pass type array to InternalParameters.
7490         (SetIndexerMethod.GetParameterInfo): Likewise.
7491         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7492         * delegate.cs (Define): Pass emitcontext to
7493         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7494         array to InternalParameters.
7495         * expression.cs (ParameterReference.DoResolveBase): Pass
7496         emitcontext to GetParameterInfo.
7497         (ComposedCast.DoResolveAsTypeStep): Remove check on
7498         ec.ResolvingTypeTree.
7499         * parameter.cs (Parameter.Resolve): Change argument to
7500         EmitContext.  Use ResolveAsTypeTerminal.
7501         (Parameter.GetSignature): Change argument to EmitContext.
7502         (Parameters.ComputeSignature): Likewise.
7503         (Parameters.ComputeParameterTypes): Likewise.
7504         (Parameters.GetParameterInfo): Likewise.
7505         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7506         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7507         * support.cs (InternalParameters..ctor): Remove variant that takes
7508         a DeclSpace.
7509         * typemanager.cs (system_intptr_expr): New.
7510         (InitExpressionTypes): Initialize it.
7511
7512 2004-10-12  Chris Toshok  <toshok@ximian.com>
7513
7514         * cs-parser.jay: fix location for try_statement and catch_clause.
7515
7516 2004-10-18  Martin Baulig  <martin@ximian.com>
7517
7518         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7519         `Type' directly, but call ResolveType() on it.
7520         (MemberBase.DoDefine): Likewise.
7521
7522         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7523         `Type' directly, but call ResolveType() on it.
7524         (ComposedCast.DoResolveAsTypeStep): Likewise.
7525
7526         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7527         `Type' directly, but call ResolveType() on it.
7528
7529 2004-10-17  John Luke  <john.luke@gmail.com>
7530
7531         * class.cs (Operator.GetSignatureForError): use CSharpName
7532
7533         * parameter.cs (Parameter.GetSignatureForError): Returns
7534         correct name even if was not defined.
7535
7536 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7537
7538         Fix #65816.
7539         * class.cs (TypeContainer.EmitContext): New property.
7540         (DefineNestedTypes): Create an emitcontext for each part.
7541         (MethodCore.DoDefineParameters): Use container's emitcontext.
7542         Pass type array to InternalParameters.
7543         (MemberBase.DoDefine): Use container's emitcontext.
7544         (FieldMember.Define): Likewise.
7545         (Event.Define): Likewise.
7546         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7547         Pass type array to InternalParameters.
7548         (SetIndexerMethod.GetParameterInfo): Likewise.
7549         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7550         * delegate.cs (Define): Pass emitcontext to
7551         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7552         array to InternalParameters.
7553         * expression.cs (ParameterReference.DoResolveBase): Pass
7554         emitcontext to GetParameterInfo.
7555         (ComposedCast.DoResolveAsTypeStep): Remove check on
7556         ec.ResolvingTypeTree.
7557         * parameter.cs (Parameter.Resolve): Change argument to
7558         EmitContext.  Use ResolveAsTypeTerminal.
7559         (Parameter.GetSignature): Change argument to EmitContext.
7560         (Parameters.ComputeSignature): Likewise.
7561         (Parameters.ComputeParameterTypes): Likewise.
7562         (Parameters.GetParameterInfo): Likewise.
7563         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7564         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7565         * support.cs (InternalParameters..ctor): Remove variant that takes
7566         a DeclSpace.
7567         * typemanager.cs (system_intptr_expr): New.
7568         (InitExpressionTypes): Initialize it.
7569
7570 2004-10-12  Chris Toshok  <toshok@ximian.com>
7571
7572         * cs-parser.jay: fix location for try_statement and catch_clause.
7573
7574 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7575
7576         More DeclSpace.ResolveType avoidance.
7577         * decl.cs (MemberCore.InUnsafe): New property.
7578         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7579         with newly created EmitContext.
7580         (FieldMember.Define): Likewise.
7581         * delegate.cs (Delegate.Define): Likewise.
7582         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7583         only if normal name-lookup fails.
7584         (TypeExpr.DoResolve): Enable error-checking.
7585         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7586         (SizeOf.DoResolve): Likewise.
7587         (ComposedCast.DoResolveAsTypeStep): Likewise.
7588         (StackAlloc.DoResolve): Likewise.
7589         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7590         (Block.Unsafe): New property.
7591         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7592         (Unsafe): Set 'unsafe' flag of contained block.
7593         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7594         (Fixed.Resolve): Likewise.
7595         (Catch.Resolve): Likewise.
7596         (Using.ResolveLocalVariableDecls): Likewise.
7597         (Foreach.Resolve): Likewise.
7598
7599 2004-10-05  John Luke <john.luke@gmail.com>
7600
7601         * cs-parser.jay: add location to error CS0175
7602
7603 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7604
7605         * ecore.cs (Expression.Constantity): Add support for turning null
7606         into a constant.
7607
7608         * const.cs (Const.Define): Allow constants to be reference types
7609         as long as the value is Null.
7610
7611 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7612
7613         * namespace.cs (NamespaceEntry.Using): No matter which warning
7614         level is set, check if this namespace name has already been added.
7615
7616 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7617
7618         * expression.cs: reftype [!=]= null should always use br[true,false].
7619         # 67410
7620
7621 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7622
7623         Fix #67108
7624         * attribute.cs: Enum conversion moved to 
7625         GetAttributeArgumentExpression to be applied to the all
7626         expressions.
7627
7628 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7629
7630         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7631         * class.c (TypeContainer.DefineType): Flag error if
7632         base types aren't accessible due to access permissions.
7633         * decl.cs (DeclSpace.ResolveType): Move logic to
7634         Expression.ResolveAsTypeTerminal.
7635         (DeclSpace.ResolveTypeExpr): Thin layer over
7636         Expression.ResolveAsTypeTerminal.
7637         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7638         Refactor code into NestedAccess.  Use it.
7639         (DeclSpace.NestedAccess): New.
7640         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7641         argument to silence errors.  Check access permissions.
7642         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7643         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7644         (Cast.DoResolve): Likewise.
7645         (New.DoResolve): Likewise.
7646         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7647         (TypeOf.DoResolve): Likewise.
7648
7649         * expression.cs (Invocation.BetterConversion): Return the Type of
7650         the better conversion.  Implement section 14.4.2.3 more faithfully.
7651         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7652         section 14.4.2.2 explicit.
7653         (Invocation.OverloadResolve): Update.
7654         (Invocation): Remove is_base field.
7655         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7656         (Invocation.Emit): Likewise.
7657
7658 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7659
7660         * cs-parser.jay: Reverted 642 warning fix.
7661
7662 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7663
7664         Fix bug #66615
7665         * decl.cs (FindMemberWithSameName): Indexer can have more than
7666         1 argument.
7667
7668 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7669
7670         * expression.cs (LocalVariableReference.DoResolveLValue):
7671         Do not report warning 219 for out values.
7672         (EmptyExpression.Null): New member to avoid extra allocations.
7673
7674 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7675
7676         * cs-parser.jay: Fix wrong warning 642 report.
7677
7678         * cs-tokenizer.cs (CheckNextToken): New helper;
7679         Inspect next character if is same as expected.
7680
7681 2004-09-23  Martin Baulig  <martin@ximian.com>
7682
7683         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7684         (Convert.ImplicitReferenceConversionExists): Likewise.
7685
7686 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7687
7688         * Makefile (DISTFILES): Comment out a few missing files.
7689
7690 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7691
7692         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7693         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7694         (gmcs.exe): Invoke bootstrap-libs.
7695         (clean-local): Clean the net_2_0_bootstrap profile too.
7696         (PROGRAM_INSTALL_DIR): New.
7697         (install-local): Use it.
7698
7699 2004-10-13  Martin Baulig  <martin@ximian.com>
7700
7701         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7702         (TypeParameter.DefineType): If we're a method type parameter and
7703         that method is overriding something, "inflate" its constraints.
7704
7705 2004-10-12  Martin Baulig  <martin@ximian.com>
7706
7707         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7708         and have type arguments, create and resolve a ConstructedType.
7709
7710 2004-10-12  Martin Baulig  <martin@ximian.com>
7711
7712         * decl.cs (MemberCache.FindMemberToOverride): Use
7713         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7714         to compare the invocationType.
7715
7716         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7717         When comparing two type parameters, only do the signature-only
7718         comparision for method type parameters.
7719
7720 2004-10-11  Martin Baulig  <martin@ximian.com>
7721
7722         * report.cs: Don't make --fatal abort on warnings, we have
7723         -warnaserror for that.
7724
7725 2004-10-11  Martin Baulig  <martin@ximian.com>
7726
7727         * typemanager.cs
7728         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7729         (TypeManager.IsEqual): Call ourself recursively instead of using
7730         Type.IsEqual(). 
7731
7732 2004-10-11  Martin Baulig  <martin@ximian.com>
7733
7734         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7735         on our own type parameters, not on the ones we inherit from a containing
7736         class.
7737
7738         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7739         the comparision.
7740
7741         * generic.cs (TypeParameter.Define): We may only be called once.
7742
7743         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7744         instead of TypeManager.IsEqual().
7745
7746 2004-09-28  Martin Baulig  <martin@ximian.com>
7747
7748         * generic.cs
7749         (GenericConstraints.EffectiveBaseClass): New public property.
7750         (TypeParameter.GenericConstraints): New public property.
7751         (ConstructedType.CheckConstraints): Improved.
7752
7753         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7754         (Convert.TypeParameterConversion): New private method; use this in
7755         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7756         for all conversions related to type parameters.
7757
7758 2004-09-24  Martin Baulig  <martin@ximian.com>
7759
7760         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7761         type parameter conversions for type parameters which are known to
7762         be reference types.
7763
7764 2004-09-24  Martin Baulig  <martin@ximian.com>
7765
7766         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7767         `IsValueType' properties.
7768
7769         * support.cs (ReflectionConstraints): Use
7770         Type.GetGenericParameterConstraints() instead of the old hack.
7771
7772 2004-09-24  Martin Baulig  <martin@ximian.com>
7773
7774         * generic.cs (GenericConstraints): Moved here and made it an
7775         abstract class.
7776
7777         * support.cs (GenericConstraints): Moved to generic.cs.
7778
7779 2004-09-24  Martin Baulig  <martin@ximian.com>
7780
7781         * support.cs
7782         (ReflectionConstraints): Un-nested this class and made it public.
7783
7784         * typemanager.cs
7785         (TypeManager.GetTypeParameterConstraints): New public method.
7786         (TypeManager.HasConstructorConstraint): Use the attributes.
7787
7788 2004-09-24  Martin Baulig  <martin@ximian.com>
7789
7790         * support.cs (GenericConstraints): Replaced `HasConstructor',
7791         `IsReferenceType' and `IsValueType' with `Attributes'.
7792         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7793         method and made the .ctor public.
7794
7795         * generic.cs (Constraints.Attributes): New public property.
7796         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7797         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7798         `IsValueType' -> `HasValueTypeConstraint'.
7799
7800 2004-09-23  Martin Baulig  <martin@ximian.com>
7801
7802         * generic.cs (Constraints): Reflect latest runtime changes.
7803
7804 2004-09-23  Martin Baulig  <martin@ximian.com>
7805
7806         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7807         (Convert.ImplicitReferenceConversionExists): Likewise.
7808
7809 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7810
7811         * class.cs (Operator.Define): Add error 448 and 559 report.
7812         
7813 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7814
7815         * class.cs (MemberBase.IsTypePermitted): New protected
7816         method for checking error CS0610.
7817
7818 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7819
7820         * class.cs (TypeContainer.HasExplicitLayout): New property
7821         Returns whether container has StructLayout attribute set Explicit.
7822         (FieldMember): New abstract class for consts and fields.
7823         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7824         (Field): Reuse FieldMember.
7825
7826         * const.cs (Const): Reuse FieldMember.
7827
7828         * rootcontext.cs: EmitConstants call moved to class.
7829
7830 2004-09-22  Martin Baulig  <martin@ximian.com>
7831
7832         Marek and me just fixed one of our oldest bugs: #28562 :-)
7833
7834         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7835
7836         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7837         we're an EnumConstant, just return that.
7838         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7839         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7840         to get the value which'll actually be written into the attribute.
7841         However, we have to use GetValue() to access the attribute's value
7842         in the compiler.        
7843
7844 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7845
7846         * constant.cs (Constant.IsNegative): New abstract property
7847         IsNegative.
7848
7849         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7850         (StackAlloc.DoResolve): Reused IsNegative.
7851
7852 2004-09-22  Martin Baulig  <martin@ximian.com>
7853
7854         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7855         public method; like LookupTypeContainer, but also works for
7856         generic instances.
7857
7858         * report.cs (Report.SymbolRelatedToPreviousError): Use
7859         TypeManager.LookupGenericTypeContainer().       
7860
7861 2004-09-22  Martin Baulig  <martin@ximian.com>
7862
7863         Thanks to Peter Sestoft for this bug report.
7864
7865         * expression.cs (Conditional): If both the `trueExpr' and the
7866         `falseExpr' is a NullLiteral, return a NullLiteral.
7867
7868 2004-09-22  Martin Baulig  <martin@ximian.com>
7869
7870         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7871         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7872         for the "get_Current" call.
7873
7874 2004-09-21  Martin Baulig  <martin@ximian.com>
7875
7876         * convert.cs (Convert.ImplicitReferenceConversion): When
7877         converting to an interface type, first check whether we're
7878         converting from a reference type.
7879
7880 2004-09-14  Martin Baulig  <martin@ximian.com>
7881
7882         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7883
7884 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7885
7886         Fixed bug #61902
7887         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7888         called and is obsolete then this member suppress message
7889         when call is inside next [Obsolete] method or type.
7890
7891         * expression.cs: Use TestObsoleteMethodUsage member.
7892
7893 2004-09-14  Martin Baulig  <martin@ximian.com>
7894
7895         * genericparser.cs: Removed.
7896
7897 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7898
7899         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7900
7901 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7902
7903         * attribute.cs (Attribute.Resolve): Add error 653 report.
7904
7905         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7906         report.
7907         (Method.ApplyAttributeBuilder): Add error 685 report.
7908         (Operator.Define): Add error 564 report.
7909
7910         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7911
7912         * expression.cs (Invocation.DoResolve): Add error
7913         245 and 250 report.
7914
7915         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7916         error 674 report.
7917
7918 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7919
7920         * class.cs (ConstructorInitializer.Resolve):
7921         Wrong error number (515->516).
7922
7923 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7924
7925         * class.cs (Indexer.Define): Add error 631 report.
7926
7927 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7928
7929         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7930
7931 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7932
7933         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7934
7935 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7936
7937         * cs-parser.jay: Added error CS0241 report.
7938
7939 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7940
7941         * cs-parser.jay (fixed_statement): Introduce a scope for the
7942         declaration in the 'fixed' statement.
7943
7944 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * cs-parser.jay: Added CS0230 error report.
7947
7948 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7949
7950         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7951
7952 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7953
7954         * expression.cs (Argument.Resolve): Added error CS0192 and
7955         CS0199 report.
7956
7957 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7958
7959         C# 2.0 #pragma warning feature
7960
7961         * cs-tokenizer.cs (PreProcessPragma): New method; 
7962         Handles #pragma directive.
7963
7964         * report.cs (WarningRegions): New class; Support
7965         class for #pragma warning directive. It tests whether
7966         warning is enabled for a given line.
7967
7968 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7969
7970         * const.cs: Add more descriptive error report, tahnks to
7971         Sebastien. 
7972
7973 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7974
7975         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7976
7977 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7978
7979         * expression.cs: Apply patch from Ben: Remove dead code from
7980         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7981         as that code just threw an exception anwyays.
7982
7983         * const.cs: Remove the call to the turnintoconstant, for details
7984         see bug: #63144
7985         
7986         * literal.cs: The type of the null-literal is the null type;  So
7987         we use a placeholder type (literal.cs:System.Null, defined here)
7988         for it.
7989
7990         * expression.cs (Conditional.DoResolve): Remove some old code that
7991         is no longer needed, conversions have been fixed.
7992
7993         (ArrayCreationExpression.DoResolve): Return false if we fail to
7994         resolve the inner expression.
7995
7996 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7997
7998         Fix test-290.cs.
7999         * cs-parser.jay (delegate_declaration): Record a delegate
8000         declaration as a type declaration.
8001         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8002
8003 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8004
8005         * parameter.cs: Do not crash if the type can not be resolved. 
8006
8007         * expression.cs: Report errors with unsafe pointers, fixes #64896
8008
8009 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8010
8011         * expression.cs: Pointer arith always needs to do a conv.i
8012         if the operand is a long. fix 65320
8013
8014 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8015
8016         Fixed cs0619-37.cs, cs0619-38.cs
8017
8018         * enum.cs (GetObsoleteAttribute): Removed.
8019
8020         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8021         on Enum member is double staged. The first is tested member
8022         and then enum.
8023
8024 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8025
8026         Fixed #56986, #63631, #65231
8027
8028         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8029         adds member to name container.
8030         (TypeContainer.AddToTypeContainer): New method, adds type to
8031         name container.
8032         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8033         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8034         AddOperator): Simplified by reusing AddToMemberContainer.
8035         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8036         instead of field.
8037         (Method.CheckForDuplications): Fixed implementation to test all
8038         possibilities.
8039         (MemberBase): Detection whether member is explicit interface
8040         implementation is now in constructor.
8041         (MemberBase.UpdateMemberName): Handles IndexerName.
8042         (Accessor): Changed to keep also location information.
8043         (AbstractPropertyEventMethod): Is derived from MemberCore.
8044         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8045         will be emited or not.
8046         (PropertyBase.AreAccessorsDuplicateImplementation):
8047         Tests whether accessors are not in collision with some method.
8048         (Operator): Is derived from MethodCore to simplify common
8049         operations.
8050
8051         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8052         must be performed.
8053         (DeclSpace.AddToContainer): Adds the member to defined_names
8054         table. It tests for duplications and enclosing name conflicts.
8055
8056         * enum.cs (EnumMember): Clean up to reuse the base structures
8057
8058 2004-09-03  Martin Baulig  <martin@ximian.com>
8059
8060         Merged latest changes into gmcs.  Please keep this comment in
8061         here, it makes it easier for me to see what changed in MCS since
8062         the last time I merged.
8063
8064 2004-09-03  Martin Baulig  <martin@ximian.com>
8065
8066         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8067         into TypeContainer, to make partial classes work again.
8068
8069 2004-09-03  Martin Baulig  <martin@ximian.com>
8070
8071         * rootcontext.cs (RootContext.V2): Removed.
8072
8073 2004-03-23  Martin Baulig  <martin@ximian.com>
8074
8075         * expression.cs (Invocation.OverloadResolve): Added `bool
8076         may_fail' argument and use it instead of the Location.IsNull() hack.
8077
8078 2004-09-09  Martin Baulig  <martin@ximian.com>
8079
8080         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8081
8082 2004-09-09  Martin Baulig  <martin@ximian.com>
8083
8084         * generic.cs (TypeParameter.DefineType): Added support for
8085         explicit interface methods.
8086
8087 2004-09-09  Martin Baulig  <martin@ximian.com>
8088
8089         * README.Changes: New document.  Started to list important changes
8090         between MCS and GMCS here.
8091
8092 2004-09-08  Martin Baulig  <martin@ximian.com>
8093
8094         * class.cs
8095         (TypeContainer.CheckRecursiveDefinition): New protected method.
8096         (TypeContainer.DefineType): Move the CS0146 check into
8097         CheckRecursiveDefinition().     
8098
8099 2004-09-06  Martin Baulig  <martin@ximian.com>
8100
8101         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8102         types for the constructor constraint.
8103
8104 2004-09-03  Martin Baulig  <martin@ximian.com>
8105
8106         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8107         into TypeContainer, to make partial classes work again.
8108
8109 2004-09-03  Martin Baulig  <martin@ximian.com>
8110
8111         * rootcontext.cs (RootContext.V2): Removed.
8112
8113 2004-03-23  Martin Baulig  <martin@ximian.com>
8114
8115         * expression.cs (Invocation.OverloadResolve): Added `bool
8116         may_fail' argument and use it instead of the Location.IsNull() hack.
8117
8118 2004-09-03  Martin Baulig  <martin@ximian.com>
8119
8120         Merged latest changes into gmcs.  Please keep this comment in
8121         here, it makes it easier for me to see what changed in MCS since
8122         the last time I merged.
8123
8124 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8125
8126         Fix #61128.
8127         * expression.cs (BetterConversion): Don't allow either conversion 
8128         to be null.  Remove redundant implicit conversion test when 'q ==
8129         null' -- when this function is invoked, we already know that the
8130         implicit conversion exists.
8131         (BetterFunction): Assume that 'best' is non-null.  Remove
8132         redundant reimplementation of IsApplicable when 'best' is null.
8133         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8134         number of arguments.
8135         (IsAncestralType): Extract from OverloadResolve.
8136         (OverloadResolve): Make robust to the MethodGroupExpr being
8137         unsorted.  Implement all the logic of Section 14.5.5.1, and
8138         support overloading of methods from multiple applicable types.
8139         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8140
8141         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8142         (RealError, Warning): Append type of report to related symbol.
8143
8144 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8145
8146         * enum.cs: Fixed CLS-Compliance checks for enum members.
8147         Error tests cs3008-8.cs, cs3014-8.cs
8148
8149 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8150
8151         Fixed bug #62342, #63102
8152         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8153         like ImplementMethod.
8154
8155 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8156
8157         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8158         Fixed bug #65170.
8159
8160 2004-09-02  Martin Baulig  <martin@ximian.com>
8161
8162         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8163         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8164         on the MethodBase.
8165
8166 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8167
8168         C# 2.0 Static classes implemented
8169
8170         * class.cs (TypeContainer): instance_constructors,
8171         initialized_fields, initialized_static_fields,
8172         default_constructor, base_inteface_types are protected to be
8173         accessible from StaticClass.
8174         (TypeContainer.DefineDefaultConstructor): New virtual method
8175         for custom default constructor generating
8176         (StaticClass): New class to handle "Static classes" feature.
8177
8178         * cs-parser.jay: Handle static keyword on class like instance
8179         of StaticClass.
8180
8181         * driver.cs: Added "/langversion" command line switch with two
8182         options (iso-1, default).
8183
8184 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8185
8186         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8187
8188 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8189
8190         * delegate.cs: Style.
8191
8192 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8193
8194         * delegate.cs: Add seperate instance expr field for miguel.
8195
8196 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8197
8198         * PointerArithmetic (Resolve): make sure we are not doing
8199         pointer arith on void*. Also, make sure we are resolved
8200         by not setting eclass until resolve.
8201
8202         All callers: Make sure that PointerArithmetic gets resolved.
8203
8204 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8205
8206         * ArrayCreation (LookupType): If the type does not resolve 
8207         to an array, give an error.
8208
8209 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8210
8211         * statement.cs (Try.Resolve): Fixed bug #64222
8212
8213 2004-08-27  Martin Baulig  <martin@ximian.com>
8214
8215         * class.cs
8216         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8217         crash here.     
8218
8219 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8220
8221         * ecore.cs (Constantify): Get underlying type via
8222         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8223         Windows in special cases.
8224
8225 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8226
8227         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8228         for obtaining also private methods.
8229         (GetRemoveMethod): Used GetRemoveMethod (true)
8230         for obtaining also private methods.
8231
8232 2004-09-02  Martin Baulig  <martin@ximian.com>
8233
8234         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8235         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8236         on the MethodBase.
8237
8238 2004-08-27  Martin Baulig  <martin@ximian.com>
8239
8240         * class.cs
8241         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8242         crash here.     
8243
8244 2004-08-25  Martin Baulig  <martin@ximian.com>
8245
8246         * support.cs (ReflectionParameters..ctor): If this is a generic
8247         method, retrieve and store its type parameters.
8248         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8249         (ReflectionParameters.GenericConstraints): The argument specifies
8250         the type parameter, not the method parameter.
8251         (InternalParameters.GenericConstraints): Likewise.
8252
8253         * generic.cs (TypeParameter.DefineType): Correctly handle
8254         constraints wrt. generic methods in interfaces and their
8255         implementations.        
8256
8257 2004-08-24  Martin Baulig  <martin@ximian.com>
8258
8259         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8260         (Constraints.IsSubclassOf): New internal method.
8261
8262         * typemanager.cs (TypeManager.FindMembers): Added special support
8263         for GenericTypeParameterBuilder's.      
8264         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8265         type parameters.
8266
8267 2004-08-24  Martin Baulig  <martin@ximian.com>
8268
8269         * typemanager.cs
8270         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8271         this for accessibility checks.
8272         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8273         IsNestedFamilyAccessible.
8274         (TypeManager.IsSubclassOf): New method, do what the name actually
8275         says.   
8276
8277 2004-08-24  Martin Baulig  <martin@ximian.com>
8278
8279         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8280         as a SimpleName, include the generic arity.
8281
8282 2004-08-24  Martin Baulig  <martin@ximian.com>
8283
8284         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8285         MethodAttributes.HideBySig for operators.
8286
8287 2004-08-23  Martin Baulig  <martin@ximian.com>
8288
8289         Back to the old error reporting system :-)
8290
8291         * report.cs (Message): Removed.
8292         (Report.MessageData, ErrorData, WarningData): Removed.
8293         (Report.Error, Warning): Back to the old system.
8294
8295 2004-08-23  Martin Baulig  <martin@ximian.com>
8296
8297         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8298
8299         * class.cs (TypeContainer.ParentContainer): New public virtual
8300         method; replaces the explicit interface implementation.
8301         (ClassPart.ParentContainer): Override.
8302
8303 2004-08-23  Martin Baulig  <martin@ximian.com>
8304
8305         * statement.cs (Switch): Added support for constant switches; see
8306         #59428 or test-285.cs.
8307
8308 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8309
8310         Fixed bug #62740.
8311         * statement.cs (GetEnumeratorFilter): Removed useless
8312         logic because C# specs is strict. GetEnumerator must be
8313         public.
8314
8315 2004-08-22  Martin Baulig  <martin@ximian.com>
8316
8317         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8318         a switch and may break, reset the barrier.  Fixes #59867.
8319
8320 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8321
8322         CLS-Compliance speed up (~5% for corlib)
8323
8324         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8325         New method. Tests container for CLS-Compliant names
8326
8327         * class.cs (TypeContainer.VerifyClsName): New method.
8328         Checks whether container name is CLS Compliant.
8329         (Constructor): Implements IMethodData.
8330
8331         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8332         low-case table for CLS Compliance test.
8333         (MemberCache.VerifyClsParameterConflict): New method.
8334         Checks method parameters for CS3006 error.
8335
8336         * enum.cs (EnumMember): Is derived from MemberCore.
8337         (Enum.VerifyClsName): Optimized for better performance.
8338
8339 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8340
8341         * report.cs: Renamed Error_T to Error and changed all
8342         references.
8343
8344 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8345
8346         * class.cs (TypeContainer.IndexerArrayList): New inner class
8347         container for indexers.
8348         (TypeContainer.DefaultIndexerName): New constant for default
8349         indexer name. Replaced all "Item" with this constant.
8350         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8351
8352         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8353         DefaultMemberAttribute constructor.
8354
8355 2004-08-05  Martin Baulig  <martin@ximian.com>
8356
8357         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8358         Fix bug #59429.
8359
8360 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8361
8362         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8363         multi platforms problem.
8364
8365         * compiler.csproj: Included shared files.
8366
8367 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8368
8369         Fix bug 60333, 55971 in the more general way
8370         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8371         Added arg_type argument for constant conversion.
8372         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8373
8374 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8375
8376         Fix bug #59760
8377         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8378         OperatorArrayList, MethodCoreArrayList for typecontainer
8379         containers. Changed class member types to these new types.
8380         (MethodArrayList.DefineMembers): Added test for CS0659.
8381
8382 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8383
8384         * cfold.cs: Synchronize the folding with the code in expression.cs
8385         Binary.DoNumericPromotions for uint operands.
8386
8387         * attribute.cs: Revert patch from Raja, it introduced a regression
8388         while building Blam-1.2.1 (hard to isolate a test case).
8389
8390 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8391
8392         Fix for #55382
8393         * class.cs:
8394         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8395         name collision.
8396         (MethodCore.parent_method): New member. The method we're overriding
8397         if this is an override method.
8398         (MethodCore.CheckBase): Moved from Method class and made common.
8399         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8400         private.
8401         (MethodCore.CheckForDuplications): New abstract method. For custom
8402         member duplication search in a container
8403         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8404         method and its return type.
8405         (Event.conflict_symbol): New member. Symbol with same name in the
8406         parent class.
8407
8408         * decl.cs:
8409         (MemberCache.FindMemberWithSameName): New method. The method
8410         is looking for conflict with inherited symbols.
8411
8412 2004-08-04  Martin Baulig  <martin@ximian.com>
8413
8414         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8415
8416         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8417
8418 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8419
8420         * report.cs (Message): New enum for better error, warning reference in
8421         the code.
8422         (MessageData): New inner abstract class. It generally handles printing of
8423         error and warning messages.
8424         Removed unused Error, Warning, Message methods.
8425
8426 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8427
8428         Fix for cs0592-8.cs test
8429         * attribute.cs
8430         (Attributable.ValidAttributeTargets): Made public.
8431         (Attribute.ExplicitTarget): New member for explicit target value.
8432         (Attribute.CheckTargets): Now we translate explicit attribute
8433         target to Target here.
8434
8435 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8436
8437         * ecore.cs (MethodGroupExpr): new IsBase property.
8438
8439         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8440
8441         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8442         rather than an instance expr.
8443
8444         (DelegateCreation.Emit): Use the method group rather than
8445         the instance expression. Also, if you have base.Foo as the
8446         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8447
8448         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8449
8450         (NewDelegate.DoResolve): Only check for the existance of Invoke
8451         if the method is going to be needed. Use MethodGroupExpr.
8452
8453         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8454
8455         * expression.cs: For pointer arith., make sure to use
8456         the size of the type, not the size of the pointer to
8457         the type.
8458
8459 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8460
8461         Fix for #60722
8462         * class.cs (Class): Added error CS0502 test.
8463
8464 2004-08-03  John Luke  <jluke@cfl.rr.com>
8465             Raja R Harinath  <rharinath@novell.com>
8466
8467         Fix for #60997.
8468         * attribute.cs (Attribute.complained_before): New flag.
8469         (Attribute.ResolveType, Attribute.Resolve),
8470         (Attribute.DefinePInvokeMethod): Set it.
8471         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8472         
8473 2004-08-03  Martin Baulig  <martin@ximian.com>
8474
8475         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8476         use a user-defined operator; we still need to do numeric
8477         promotions in case one argument is a builtin type and the other
8478         one has an implicit conversion to that type.  Fixes #62322.
8479
8480 2004-08-18  Martin Baulig  <martin@ximian.com>
8481
8482         * class.cs (Method.Define): Use the correct method name when
8483         creating the MethodBuilder for a generic method.
8484
8485 2004-08-17  Martin Baulig  <martin@ximian.com>
8486
8487         * generic.cs (Constraints): Support type parameter constraints.
8488
8489 2004-08-16  Martin Baulig  <martin@ximian.com>
8490
8491         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8492         (Token.GENERIC_DIMENSION): New token; this is returned if we
8493         encounter an unbound generic type in a typeof() expression.
8494
8495         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8496         this token is only generated while parsing a typeof() expression.
8497         (typeof_expression): Removed the old unbound_type hack.
8498
8499         * generic.cs (TypeArguments.IsUnbound): New public property.
8500
8501         * decl.cs (MemberName): Added support for unbound types.
8502
8503 2004-08-14  Martin Baulig  <martin@ximian.com>
8504
8505         * typemanager.cs
8506         (TypeManager.IsEqualGenericInstance): New static method.
8507         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8508         just used to check accessibility, so follow the rules of 26.1.6.        
8509
8510         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8511         ConstructedType instead of a TypeExpression if we have type arguments.
8512
8513         * cs-parser.jay (typeof_expression): Support unbound generic types.
8514
8515         * ecore.cs (UnboundTypeExpression): New public class.
8516
8517 2004-08-12  Martin Baulig  <martin@ximian.com>
8518
8519         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8520         TypeManager.IsEqual() rather than `=='.
8521
8522         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8523         generic instances as well.
8524
8525 2004-08-12  Martin Baulig  <martin@ximian.com>
8526
8527         * expression.cs (Invocation.InferType): We can only infer method
8528         type parameters.  Fixes #62647.
8529
8530 2004-08-11  Martin Baulig  <martin@ximian.com>
8531
8532         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8533         before resolving the base classes.
8534
8535 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8536
8537         * Makefile: install .mdb file too.
8538
8539 2004-08-05  Martin Baulig  <martin@ximian.com>
8540
8541         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8542         initializer, the current type is just the TypeBuilder, not the
8543         instantiated generic type.
8544         (FieldExpr.IsFieldInitializer): New public property.
8545
8546 2004-08-04  Martin Baulig  <martin@ximian.com>
8547
8548         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8549
8550         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8551
8552 2004-08-03  Martin Baulig  <martin@ximian.com>
8553
8554         * class.cs (MethodData.Define): If we're an explicit
8555         implementation, remove the generic arity from the type name.
8556
8557 2004-08-03  Martin Baulig  <martin@ximian.com>
8558
8559         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8560         use a user-defined operator; we still need to do numeric
8561         promotions in case one argument is a builtin type and the other
8562         one has an implicit conversion to that type.  Fixes #62322.
8563
8564 2004-08-02  Martin Baulig  <martin@ximian.com>
8565
8566         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8567         `TypeExpr[]' array.
8568         (TypeContainer.GetClassBases): Return the unexpanded list of
8569         interfaces; we expand them later.
8570         (TypeContainer.DefineType): After creating the TypeBuilder, call
8571         TypeManager.ExpandInterfaces() to get an expanded and resolved
8572         list of interfaces.
8573
8574         * ecore.cs (TypeExpr.GetInterfaces): Removed
8575
8576         * generics.cs (Constraints.InterfaceConstraints): Remove.
8577         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8578         register the interface constraints.
8579
8580         * typemanager.cs
8581         (TypeManager.AddUserType): Removed the `ifaces' argument.
8582         (TypeManager.AddTypeParameter): Likewise.
8583         (TypeManager.AddUserInterface): Removed, was unused.
8584         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8585         `TypeExpr[]' array for the interfaces.
8586         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8587         has been defined, returns a list of the resolved interfaces types.
8588         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8589         (TypeManager.GetExplicitInterfaces): Likewise.  
8590
8591 2004-08-02  Martin Baulig  <martin@ximian.com>
8592
8593         * expression.cs (Invocation.EmitCall): If we're invoking a method
8594         on a type parameter, use the new `Constrained' prefix opcode.
8595
8596 2004-08-02  Martin Baulig  <martin@ximian.com>
8597
8598         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8599         (LocalInfo.IsThis): New public property.
8600         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8601
8602 2004-08-01  Martin Baulig  <martin@ximian.com>
8603
8604         * class.cs (TypeContainer.GetClassBases): Don't set the default
8605         here since we may get called from GetPartialBases().
8606         (TypeContainer.DefineType): If GetClassBases() didn't return a
8607         parent, use the default one.
8608
8609 2004-07-30  Martin Baulig  <martin@ximian.com>
8610
8611         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8612
8613         * class.cs (SourceMethod): New public class, derive from the
8614         symbol writer's ISourceMethod.
8615         (Method): Use the new symbol writer API.
8616
8617         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8618         as argument and use the new symbol writer.
8619
8620         * location.cs
8621         (SourceFile): Implement the symbol writer's ISourceFile.
8622         (Location.SymbolDocument): Removed.
8623         (Location.SourceFile): New public property.
8624
8625         * symbolwriter.cs: Use the new symbol writer API.
8626
8627 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8628
8629         * Makefile (install-local): Remove.  Functionality moved to
8630         executable.make.
8631
8632 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8633
8634         * Makefile: Install mcs.exe.config file together with mcs.exe.
8635         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8636         correct runtime version.
8637         
8638 2004-07-25  Martin Baulig  <martin@ximian.com>
8639
8640         * class.cs
8641         (TypeContainer.RegisterOrder): Removed, this was unused.
8642         (TypeContainer, interface_order): Removed.
8643         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8644         TypeContainer as argument since we can also be called with a
8645         `PartialContainer' for a partial class/struct/interface.
8646         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8647         of checking whether we're an `Interface' - we could be a
8648         `PartialContainer'.
8649         (PartialContainer.Register): Override; call
8650         AddClass()/AddStruct()/AddInterface() on our parent.
8651
8652         * cs-parser.jay (interface_member_declaration): Add things to the
8653         `current_container', not the `current_class'.
8654
8655         * rootcontext.cs (RegisterOrder): The overloaded version which
8656         takes an `Interface' was unused, removed.
8657
8658         * typemanager.cs (TypeManager.LookupInterface): Return a
8659         `TypeContainer', not an `Interface'.
8660         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8661         contain a `PartialContainer' for an interface, so check it's
8662         `Kind' to figure out what it is.
8663
8664 2004-07-25  Martin Baulig  <martin@ximian.com>
8665
8666         * class.cs (Class.DefaultTypeAttributes): New public constant.
8667         (Struct.DefaultTypeAttributes): Likewise.
8668         (Interface.DefaultTypeAttributes): Likewise.
8669         (PartialContainer.TypeAttr): Override this and add the
8670         DefaultTypeAttributes.
8671
8672 2004-07-25  Martin Baulig  <martin@ximian.com>
8673
8674         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8675         we can just use the `Parent' field instead.
8676
8677 2004-07-25  Martin Baulig  <martin@ximian.com>
8678
8679         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8680
8681 2004-07-25  Martin Baulig  <martin@ximian.com>
8682
8683         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8684         our parts before defining any methods.
8685         (TypeContainer.VerifyImplements): Make this virtual.
8686         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8687         on our PartialContainer.
8688
8689 2004-07-25  Martin Baulig  <martin@ximian.com>
8690
8691         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8692
8693         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8694         argument, we can just use the `Parent' field instead.
8695
8696         * class.cs
8697         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8698         (MemberBase.DoDefine): Likewise.
8699
8700 2004-07-24  Martin Baulig  <martin@ximian.com>
8701
8702         * decl.cs (MemberCore.Parent): New public field.
8703         (DeclSpace.Parent): Moved to MemberCore.
8704
8705         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8706         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8707         parent's .ctor.
8708         (FieldBase, Field, Operator): Likewise.
8709         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8710         (EventField, Event): Likewise.
8711
8712 2004-07-23  Martin Baulig  <martin@ximian.com>
8713
8714         * class.cs (PartialContainer): New public class.
8715         (ClassPart): New public class.
8716         (TypeContainer): Added support for partial classes.
8717         (TypeContainer.GetClassBases): Splitted some of the functionality
8718         out into GetNormalBases() and GetPartialBases().
8719
8720         * cs-tokenizer.cs (Token.PARTIAL): New token.
8721         (Tokenizer.consume_identifier): Added some hacks to recognize
8722         `partial', but only if it's immediately followed by `class',
8723         `struct' or `interface'.
8724
8725         * cs-parser.jay: Added support for partial clases.
8726
8727 2004-07-23  Martin Baulig  <martin@ximian.com>
8728
8729         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8730         a `DeclSpace' and also made it readonly.
8731         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8732         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8733         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8734
8735         * cs-parser.jay: Pass the `current_class', not the
8736         `current_container' (at the moment, this is still the same thing)
8737         to a new Method, Property, Event, Indexer or Constructor.
8738
8739 2004-07-23  Martin Baulig  <martin@ximian.com>
8740
8741         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8742         and removed the `current_interface' one.
8743         (struct_declaration, class_declaration, interface_declaration):
8744         Set `current_class' to the newly created class/struct/interface;
8745         set their `Bases' and call Register() before parsing their body.
8746
8747 2004-07-23  Martin Baulig  <martin@ximian.com>
8748
8749         * class.cs (Kind): New public enum.
8750         (TypeContainer): Made this class abstract.
8751         (TypeContainer.Kind): New public readonly field.
8752         (TypeContainer.CheckDef): New public method; moved here from
8753         cs-parser.jay.
8754         (TypeContainer.Register): New public abstract method.
8755         (TypeContainer.GetPendingImplementations): New public abstract
8756         method.
8757         (TypeContainer.GetClassBases): Removed the `is_class' and
8758         `is_iface' parameters.
8759         (TypeContainer.DefineNestedTypes): Formerly known as
8760         DoDefineType().
8761         (ClassOrStruct): Made this class abstract.
8762
8763         * tree.cs (RootTypes): New public type. 
8764
8765 2004-07-20  Martin Baulig  <martin@ximian.com>
8766
8767         * tree.cs (Tree.RecordNamespace): Removed.
8768         (Tree.Namespaces): Removed.
8769
8770         * rootcontext.cs (RootContext.IsNamespace): Removed.
8771
8772         * cs-parser.jay (namespace_declaration): Just create a new
8773         NamespaceEntry here.
8774
8775 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8776
8777         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8778         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8779         entry to make sure it runs in the correct runtime version.
8780         
8781 2004-07-18  Martin Baulig  <martin@ximian.com>
8782
8783         * generic.cs (ConstructedType.CheckConstraints): Improved
8784         constraints checking.
8785
8786 2004-07-18  Martin Baulig  <martin@ximian.com>
8787
8788         * expression.cs (Invocation.BetterMethod): Call
8789         TypeManager.TypeToCoreType() on all types and removed my previous
8790         hack; we're already doig the right thing here.
8791
8792 2004-07-17  Martin Baulig  <martin@ximian.com>
8793
8794         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8795
8796 2004-07-16  Martin Baulig  <martin@ximian.com>
8797
8798         * iterators.cs: Added generics support.
8799
8800 2004-07-16  Martin Baulig  <martin@ximian.com>
8801
8802         * iterators.cs: Rewrote this.  We're now using one single Proxy
8803         class for both the IEnumerable and the IEnumerator interface and
8804         `Iterator' derives from Class so we can use the high-level API.
8805
8806         * class.cs (TypeContainer.AddIterator): New method.
8807         (TypeContainer.DoDefineType): New protected virtual method, which
8808         is called from DefineType().
8809         (TypeContainer.DoDefineMembers): Call DefineType() and
8810         DefineMembers() on all our iterators.
8811         (TypeContainer.Emit): Call Emit() on all our iterators.
8812         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8813
8814         * codegen.cs (EmitContext.CurrentIterator): New public field.
8815
8816 2004-07-15  Martin Baulig  <martin@ximian.com>
8817
8818         * typemanager.cs
8819         (TypeManager.not_supported_exception_type): New type.   
8820
8821 2004-07-14  Martin Baulig  <martin@ximian.com>
8822
8823         * typemanager.cs
8824         (TypeManager.generic_ienumerable_type): New type.
8825         (TypeManager.generic_ienumerator_type): New type.
8826
8827         * rootcontext.cs
8828         (RootContext.interfaces_first_stage): Added
8829         "System.Collections.Generic.IEnumerator`1" and
8830         "System.Collections.Generic.IEnumerable`1".     
8831
8832 2004-07-14  Martin Baulig  <martin@ximian.com>
8833
8834         * iterators.cs: Use real error numbers.
8835
8836 2004-07-14  Martin Baulig  <martin@ximian.com>
8837
8838         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8839         requires this to be a System.Collection.IEnumerable and not a
8840         class implementing that interface.
8841         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8842
8843 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8844
8845         * class.cs: Fixed previous fix, it broke some error tests.
8846
8847 2004-07-12  Martin Baulig  <martin@ximian.com>
8848
8849         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8850         Fixes #61293.
8851
8852 2004-07-14  Martin Baulig  <martin@ximian.com>
8853
8854         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8855         an exclamation mark (!) for the generic arity to reflect the
8856         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8857
8858 2004-07-13  Martin Baulig  <martin@ximian.com>
8859
8860         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8861         specifiers being part of a type argument.
8862
8863 2004-07-13  Martin Baulig  <martin@ximian.com>
8864
8865         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8866         name for generic types.
8867
8868 2004-07-13  Martin Baulig  <martin@ximian.com>
8869
8870         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8871         bit to fix #60119.
8872
8873 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8874
8875         * assign.cs (LocalTemporary): Add new argument: is_address,If
8876         `is_address' is true, then the value that we store is the address
8877         to the real value, and not the value itself.
8878         
8879         * ecore.cs (PropertyExpr): use the new local temporary
8880         stuff to allow us to handle X.Y += z (where X is a struct)
8881
8882 2004-07-08  Martin Baulig  <martin@ximian.com>
8883
8884         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8885         not always return, just like we're doing in Using.Resolve().
8886
8887 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8888
8889         * cs-parser.jay (fixed_statement): flag this as Pinned.
8890
8891 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8892
8893         * typemanager.cs (TypeManager): Removed MakePinned method, this
8894         mechanism is replaced with the .NET 2.x compatible mechanism of
8895         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8896
8897         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8898         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8899         `IsFixed' property which has a different meaning.
8900
8901 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8902
8903         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8904         visible from inside a nested class, not just the names of the
8905         immediately enclosing class.
8906         Fix for bug #60730.
8907
8908 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8909
8910         * expression.cs (BetterConversion): Remove buggy special-case
8911         handling of "implicit constant expression conversions".  At this
8912         point, we already know that the conversion is possible -- we're
8913         only checking to see which is better.
8914
8915 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8916
8917         * cs-parser.jay: Added error CS0210 test.
8918
8919 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8920
8921         * cs-parser.jay: Added error CS0134 test.
8922
8923 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8924
8925         Fix bug #52507
8926         * cs-parser.jay: Added error CS0145 test.
8927
8928 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8929
8930         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8931
8932 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8933         
8934         * expression.cs (StackAlloc.Resolve): The argument may not
8935         be a constant; deal with this case.
8936         
8937 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8938
8939         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8940         GetIndexerAttributeValue.
8941         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8942
8943         * class.cs (Indexer.Define): Added error tests for CS0415,
8944         CS0609.
8945
8946 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8947
8948         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8949         property code.
8950
8951 2004-06-23  Martin Baulig  <martin@ximian.com>
8952
8953         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8954         neither return nor throw, reset the barrier as well.  Fixes #60457.
8955
8956 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8957
8958         * class.cs : EventAttributes is now set to None by default.
8959           This fixes bug #60459.
8960
8961 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8962
8963         Fix bug #60219
8964         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8965         Don't throw exception but return null (it's sufficient now).
8966
8967 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8968
8969         * typemanager.cs (GetArgumentTypes): Faster implementation.
8970
8971 2004-06-18  Martin Baulig  <martin@ximian.com>
8972
8973         * attribute.cs (Attribute.Resolve): Check whether we're an
8974         EmptyCast which a Constant child.  Fixes #60333.
8975
8976 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8977
8978         * statement.cs (EmitCollectionForeach): Account for the fact that
8979         not all valuetypes are in areas which we can take the address of.
8980         For these variables, we store to a temporary variable. Also, make
8981         sure that we dont emit a `callvirt' on a valuetype method.
8982
8983 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8984
8985         * expression.cs (StackAlloc.DoReSolve): Added test for
8986         negative parameter (CS0247).
8987
8988 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8989
8990         Fix bug #59792
8991         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8992
8993 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8994
8995         Fix bug #59781
8996         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8997         ulong.
8998
8999 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9000
9001         Fix bug #58254 & cs1555.cs, cs1556.cs
9002         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9003
9004 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9005
9006         * cs-parser.jay: Added error CS1669 test for indexers.
9007
9008 2004-06-18  Martin Baulig  <martin@ximian.com>
9009
9010         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9011         argument.  Fixes #60441.
9012
9013 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9014         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9015         The name needs to have the actual name of the method in order
9016         for other tests (such as the one in OverloadResolve for Invoke
9017         on a delegate) to work. As well, it does not really help
9018         error reporting because the method group had multiple methods.
9019         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9020         Make profiling work.
9021         
9022 2004-06-13  Martin Baulig  <martin@ximian.com>
9023
9024         * cs-parser.jay: Don't allow generic attributes.
9025
9026 2004-06-13  Martin Baulig  <martin@ximian.com>
9027
9028         * class.cs (MemberBase.DoDefineBase): New protected method.
9029         (MemberBase.DoDefine): Compute the `flags' in the new
9030         DoDefineBase() which must be called first.
9031         (Method.Define): Call DoDefineBase() first so we have the flags
9032         when defining the generic method.
9033
9034         * cs-parser.jay (interface_method_declaration): Support generic methods.
9035
9036 2004-06-13  Martin Baulig  <martin@ximian.com>
9037
9038         * decl.cs (TypeName): Removed.
9039         (MemberName): Removed TypeName and MemberNow; now we just have
9040         MemberName.
9041
9042         * cs-parser.jay: Don't distinguish between type arguments and type
9043         parameters in the grammar and simplified the rules a bit.  The
9044         reduce/reduce conflicts are now gone (except the one we inherited
9045         from mcs).
9046
9047 2004-06-11  Martin Baulig  <martin@ximian.com>
9048
9049         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9050         call this twice: for params and varargs methods.
9051
9052 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9053
9054         * class.cs:
9055         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9056
9057 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9058
9059         * attribute.cs (Attribute.GetValidTargets): Made public.
9060
9061         * class.cs: 
9062         (AbstractPropertyEventMethod): New class for better code sharing.
9063         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9064         CS1667 report.
9065         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9066
9067 2004-06-09  Martin Baulig  <martin@ximian.com>
9068
9069         * cs-parser.jay: Removed a reduce/reduce conflict.
9070
9071 2004-06-03  Martin Baulig  <martin@ximian.com>
9072
9073         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9074         GetSimpleName() and return a SimpleName.
9075
9076         * ecore.cs (SimpleName.Arguments): New public field.
9077         (SimpleName): Added overloaded ctor which takes an additional
9078         TypeArguments argument.
9079         (SimpleName.SimpleNameResolve): Added support for generic methods.
9080         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9081         formerly in MemberAccess.DoResolve(), but we also need it in
9082         SimpleNameResolve().
9083
9084         * expression.cs (MemberAccess.DoResolve): Use the new
9085         MethodGroupExpr.ResolveGeneric().       
9086
9087 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9088
9089         * decl.cs: If possible, use lookuptypedirect here. We can only do
9090         this if there is no `.' after the namespace. Avoids using
9091         LookupType, which does lots of slow processing.
9092         (FindNestedType) New method, does what it says :-).
9093         * namespace.cs: use LookupTypeDirect.
9094         * rootcontext.cs: use membercache, if possible.
9095         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9096
9097 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9098
9099         * expression.cs:
9100         According to the spec, 
9101
9102         In a member access of the form E.I, if E is a single identifier,
9103         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9104         field, property, localvariable, or parameter with the same type as
9105         the meaning of E as a type-name (§3.8), then both possible
9106         meanings of E are permitted.
9107
9108         We did not check that E as a simple-name had the same type as E as
9109         a type name.
9110
9111         This trivial check gives us 5-7% on bootstrap time.
9112
9113 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9114
9115         * expression.cs (Invocation.OverloadResolve): Avoid the
9116         use of hashtables and boxing here by allocating on demand.
9117
9118 2004-05-30  Martin Baulig  <martin@ximian.com>
9119
9120         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9121         we're doing a silent lookup.  Don't try to lookup nested types in
9122         TypeManager.object_type (thanks to Ben Maurer).
9123
9124 2004-05-30  Martin Baulig  <martin@ximian.com>
9125
9126         Committing a patch from Ben Maurer.
9127
9128         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9129
9130 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9131
9132         * convert.cs: add a trivial cache for overload operator resolution.
9133
9134 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9135
9136         * attribute.cs
9137         (AttributeTester.GetObsoleteAttribute): Returns instance of
9138         ObsoleteAttribute when type is obsolete.
9139
9140         * class.cs
9141         (TypeContainer.VerifyObsoleteAttribute): Override.
9142         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9143         (MethodCode.VerifyObsoleteAttribute): Override.
9144         (MemberBase.VerifyObsoleteAttribute): Override.
9145
9146         * decl.cs
9147         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9148         and report proper error.
9149
9150         *delegate.cs
9151         (Delegate.VerifyObsoleteAttribute): Override.
9152
9153         * ecore.cs
9154         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9155         and report proper error.
9156         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9157
9158         * enum.cs
9159         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9160         and enum member.
9161
9162         * expression.cs
9163         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9164         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9165         Added test for ObsoleteAttribute.
9166
9167         * statement.cs
9168         (Catch): Derived from Statement.
9169
9170 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9171
9172         * decl.cs: If possible, use lookuptypedirect here. We can only do
9173         this if there is no `.' after the namespace. Avoids using
9174         LookupType, which does lots of slow processing.
9175         (FindNestedType) New method, does what it says :-).
9176         * namespace.cs: use LookupTypeDirect.
9177         * rootcontext.cs: use membercache, if possible.
9178         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9179
9180 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9181
9182         * expression.cs:
9183         According to the spec, 
9184
9185         In a member access of the form E.I, if E is a single identifier,
9186         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9187         field, property, localvariable, or parameter with the same type as
9188         the meaning of E as a type-name (§3.8), then both possible
9189         meanings of E are permitted.
9190
9191         We did not check that E as a simple-name had the same type as E as
9192         a type name.
9193
9194         This trivial check gives us 5-7% on bootstrap time.
9195
9196 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9197
9198         Fixed bug #59071 & cs0160.cs
9199         * statement.cs (Try.Resolve): Check here whether order of catch
9200         clauses matches their dependencies.
9201
9202 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9203
9204         Fixed bug #58624
9205         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9206         unsafe type.
9207
9208 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9209
9210         * expression.cs (Invocation.OverloadResolve): Avoid the
9211         use of hashtables and boxing here by allocating on demand.
9212
9213 2004-05-30  Martin Baulig  <martin@ximian.com>
9214
9215         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9216         we're doing a silent lookup.  Don't try to lookup nested types in
9217         TypeManager.object_type (thanks to Ben Maurer).
9218
9219 2004-05-30  Martin Baulig  <martin@ximian.com>
9220
9221         Committing a patch from Ben Maurer.
9222
9223         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9224
9225 2004-05-29  Martin Baulig  <martin@ximian.com>
9226
9227         * class.cs (IMethodData.ShouldIgnore): New method.
9228
9229         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9230         `Location' argument, we don't need it anywhere.  Use
9231         `IMethodData.ShouldIgnore ()' instead of
9232         `MethodData.GetMethodFlags ()'.
9233         (TypeManager.AddMethod): Removed.
9234         (TypeManager.AddMethod2): Renamed to AddMethod.
9235
9236 2004-05-29  Martin Baulig  <martin@ximian.com>
9237
9238         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9239
9240         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9241         converting from a class type S to an interface type and we already
9242         have an object on the stack, don't box it again.  Fixes #52578.
9243
9244 2004-05-29  Martin Baulig  <martin@ximian.com>
9245
9246         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9247         Added support for `params' parameters.  Fixes #59267.
9248
9249 2004-05-29  Martin Baulig  <martin@ximian.com>
9250
9251         * literal.cs (NullPointer): Provide a private .ctor which sets
9252         `type' to TypeManager.object_type.  Fixes #59048.
9253
9254 2004-05-29  Martin Baulig  <martin@ximian.com>
9255
9256         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9257         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9258
9259         * ecore.cs (EventExpr.instance_expr): Make the field private.
9260
9261 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9262
9263         Fixed bug #50080 & cs0214-2.cs
9264         * expression.cs (Cast.DoResolve): Check unsafe context here.
9265         
9266         * statement.cs (Resolve.DoResolve): Likewise.
9267
9268 2004-05-26  Martin Baulig  <martin@ximian.com>
9269
9270         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9271
9272         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9273         (RootContext.LookupType): Pass down the `silent' flag.
9274
9275 2004-05-25  Martin Baulig  <martin@ximian.com>
9276
9277         * expression.cs
9278         (MethodGroupExpr.IdenticalTypeName): New public property.
9279         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9280         expression actually refers to a type.
9281
9282 2004-05-25  Martin Baulig  <martin@ximian.com>
9283
9284         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9285         for #56176 and made it actually work.
9286
9287 2004-05-25  Martin Baulig  <martin@ximian.com>
9288
9289         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9290         (FieldExpr, PropertyExpr): Override and implement
9291         CacheTemporaries.  Fixes #52279.
9292
9293 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9294
9295         * location.cs: In the new compiler listing a file twice is a
9296         warning, not an error.
9297
9298 2004-05-24  Martin Baulig  <martin@ximian.com>
9299
9300         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9301         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9302
9303 2004-05-24  Martin Baulig  <martin@ximian.com>
9304
9305         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9306         walking the `using' list.  Fixes #53921.
9307
9308 2004-05-24  Martin Baulig  <martin@ximian.com>
9309
9310         * const.cs (Const.LookupConstantValue): Added support for
9311         EmptyCast's; fixes #55251.
9312
9313 2004-05-24  Martin Baulig  <martin@ximian.com>
9314
9315         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9316         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9317         which does the CS0135 check.  The reason is that we first need to
9318         check whether the variable actually exists.
9319
9320 2004-05-24  Martin Baulig  <martin@ximian.com>
9321
9322         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9323         than RootContext.LookupType() to find the explicit interface
9324         type.  Fixes #58584.
9325
9326 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9327
9328         * Makefile: Simplify.  Use executable.make.
9329         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9330
9331 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9332
9333         * decl.cs:
9334         * enum.cs:
9335         Use the invariant culture when doing String.Compare for CLS case
9336         sensitivity.
9337         
9338 2004-05-23  Martin Baulig  <martin@ximian.com>
9339
9340         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9341         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9342
9343         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9344
9345 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9346
9347         * class.cs (MemberBase.Define): Reuse MemberType member for 
9348         resolved type. Other methods can use it too.
9349
9350 2004-05-23  Martin Baulig  <martin@ximian.com>
9351
9352         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9353         the variable also exists in the current block (otherwise, we need
9354         to report a CS0103).  Fixes #58670.
9355
9356 2004-05-23  Martin Baulig  <martin@ximian.com>
9357
9358         * flowanalysis.cs (Reachability.Reachable): Compute this
9359         on-the-fly rather than storing it as a field.
9360
9361 2004-05-23  Martin Baulig  <martin@ximian.com>
9362
9363         * flowanalysis.cs (Reachability.And): Manually compute the
9364         resulting `barrier' from the reachability.      
9365        
9366 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9367
9368         Fix bug #57835
9369         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9370         instance of ObsoleteAttribute when symbol is obsolete.
9371
9372         * class.cs
9373         (IMethodData): Extended interface for ObsoleteAttribute support.
9374
9375 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9376
9377         * attribute.cs: Fix bug #55970
9378
9379 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9380
9381         Fix bug #52705
9382         * attribute.cs
9383         (GetObsoleteAttribute): New method. Creates the instance of
9384         ObsoleteAttribute.
9385         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9386         ObsoleteAttribute when member is obsolete.
9387         (AttributeTester.Report_ObsoleteMessage): Common method for
9388         Obsolete error/warning reporting.
9389
9390         * class.cs
9391         (TypeContainer.base_classs_type): New member for storing parent type.
9392
9393         * decl.cs
9394         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9395         for this MemberCore.
9396
9397 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9398
9399         * attribute.cs, const.cs: Fix bug #58590
9400
9401 2004-05-21  Martin Baulig  <martin@ximian.com>
9402
9403         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9404         out parameters if the end of the method is unreachable.  Fixes
9405         #58098. 
9406
9407 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9408
9409         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9410         Hari was right, why extra method.
9411
9412 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9413
9414         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9415
9416 2004-05-20  Martin Baulig  <martin@ximian.com>
9417
9418         * delegate.cs: Convert this file to Unix mode - like the original
9419         version in mcs is.
9420
9421 2004-05-20  Martin Baulig  <martin@ximian.com>
9422
9423         * attribute.cs: Convert this file to Unix mode - like the original
9424         version in mcs is.
9425
9426 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9427
9428        Fix bug #58688 (MCS does not report error when the same attribute
9429        is assigned twice)
9430
9431        * attribute.cs (Attribute.Emit): Distinction between null and default.
9432
9433 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9434
9435        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9436        of a top-level attribute without an attribute target.
9437        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9438        Make non-static.
9439        (Attribute.Conditional_GetConditionName), 
9440        (Attribute.Obsolete_GetObsoleteMessage): Update.
9441        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9442        part of ScanForIndexerName.
9443        (Attribute.CanIgnoreInvalidAttribute): New function.
9444        (Attribute.ScanForIndexerName): Move to ...
9445        (Attributes.ScanForIndexerName): ... here.
9446        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9447        (Attributes.Search): New internal variant that can choose not to
9448        complain if types aren't resolved.  The original signature now
9449        complains.
9450        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9451        complaints suppressed.
9452        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9453        only if it not useful.
9454        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9455        top-level for attributes that are shared between the assembly
9456        and a top-level class.
9457        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9458        * class.cs: Update to reflect changes.
9459        (DefineIndexers): Fuse loops.
9460        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9461        a couple more variants of attribute names.
9462
9463 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9464
9465         Fix bug #52585 (Implemented explicit attribute declaration)
9466
9467         * attribute.cs:
9468         (Attributable.ValidAttributeTargets): New abstract method. It gets
9469         list of valid attribute targets for explicit target declaration.
9470         (Attribute.Target): It holds target itself.
9471         (AttributeSection): Removed.
9472         (Attribute.CheckTargets): New method. It checks whether attribute
9473         target is valid for the current element.
9474
9475         * class.cs:
9476         (EventProperty): New class. For events that are declared like
9477         property (with add and remove accessors).
9478         (EventField): New class. For events that are declared like field.
9479         class.cs
9480
9481         * cs-parser.jay: Implemented explicit attribute target declaration.
9482
9483         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9484         Override ValidAttributeTargets.
9485
9486         * parameter.cs:
9487         (ReturnParameter): Class for applying custom attributes on 
9488         the return type.
9489         (ParameterAtribute): New class. Class for applying custom
9490         attributes on the parameter type.
9491
9492 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9493
9494         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9495         definitions. 
9496
9497         (Method): Allow UNSAFE here.
9498
9499         * modifiers.cs: Support unsafe reporting.
9500
9501 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9502
9503         * decl.cs: Fix bug #58478.
9504
9505 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9506
9507         * statement.cs: When checking for unreachable code on an EmptyStatement,
9508         set the location. Fixes bug #58488.
9509
9510 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9511
9512         * driver.cs: Add -pkg handling.
9513
9514         From Gonzalo: UseShelLExecute=false
9515
9516 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9517
9518         * attribute.cs:
9519         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9520         for attribute.
9521         (Attribute.IsClsCompliaceRequired): Moved to base for better
9522         accesibility.
9523         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9524         when attribute is AttributeUsageAttribute.
9525         (Attribute.GetValidTargets): Simplified.
9526         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9527         attribute for this type.
9528         (Attribute.ApplyAttributes): Method renamed to Emit and make
9529         non-static.
9530         (GlobalAttributeSection): New class for special handling of global
9531         attributes (assembly, module).
9532         (AttributeSection.Emit): New method.
9533
9534         * class.cs: Implemented Attributable abstract methods.
9535         (MethodCore.LabelParameters): Moved to Parameter class.
9536         (Accessor): Is back simple class.
9537         (PropertyMethod): Implemented Attributable abstract class.
9538         (DelegateMethod): Implemented Attributable abstract class.
9539         (Event): New constructor for disctintion between normal Event
9540         and Event with accessors.
9541
9542         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9543
9544         * codegen.cs, const.cs, decl.cs, delegate.cs:
9545         (CommonAssemblyModulClass): Implemented Attributable abstract class
9546         and simplified.
9547
9548         * enum.cs: Implement IAttributeSupport interface.
9549         (EnumMember): New class for emum members. Implemented Attributable
9550         abstract class
9551
9552         * parameter.cs:
9553         (ParameterBase): Is abstract.
9554         (ReturnParameter): New class for easier [return:] attribute handling.
9555
9556         * typemanager.cs: Removed builder_to_attr.
9557
9558 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9559
9560         Fix bug #57151.
9561         * attribute.cs (Attribute.GetPositionalValue): New function.
9562         * class.cs (TypeContainer.VerifyMembers): New function.
9563         (TypeContainer.Emit): Use it.
9564         (ClassOrStruct): New base class for Class and Struct.
9565         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9566         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9567         class.
9568         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9569         then each non-static field should have a FieldOffset attribute.
9570         Otherwise, none of the fields should have a FieldOffset attribute.
9571         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9572         and FieldOffset attributes.
9573         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9574         (TypeManager.field_offset_attribute_type): New core types.
9575         (TypeManager.InitCoreTypes): Initialize them.
9576
9577 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9578
9579         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9580         Return correct type.
9581         From bug #58270.
9582
9583 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9584
9585         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9586         be implicitly converted to ulong.
9587         
9588         * expression.cs: The logic for allowing operator &, | and ^ worked
9589         was wrong, it worked before because we did not report an error in
9590         an else branch.  Fixes 57895.
9591
9592         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9593         allow volatile fields to be reference types.
9594
9595 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9596
9597         * driver.cs: Add support for /debug-
9598
9599 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9600
9601         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9602         Add a 'complain' parameter to silence errors.
9603         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9604         silently overlooked type-resolutions.
9605         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9606         to reflect changes.
9607         (Attributes.Search): New function.
9608         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9609         (Attributes.GetAttributeFullName): Remove hack.
9610         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9611         Update to reflect changes.
9612         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9613         Use Attributes.Search instead of nested loops.
9614
9615 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9616
9617         * decl.cs:
9618         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9619         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9620         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9621
9622         * report.cs: (Report.Warning): Renamed to Warning_T because of
9623         parameter collision.
9624
9625 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9626
9627         * expression.cs (MemberAccess.ResolveMemberAccess):
9628         Exit with non-zero status after Report.Error.
9629         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9630         Likewise.
9631         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9632
9633 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9634
9635         * support.cs: Don't hang when the file is empty.
9636
9637 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9638
9639         * support.cs: In SeekableStreamReader, compute the preamble size of the
9640           underlying stream. Position changes should take into account that initial
9641           count of bytes.
9642
9643 2004-05-03  Todd Berman  <tberman@sevenl.net>
9644
9645         * driver.cs: remove unused GetSysVersion function.
9646
9647 2004-05-03  Todd Berman  <tberman@sevenl.net>
9648
9649         * driver.cs: Remove the hack from saturday, as well as the hack
9650         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9651         link_paths to get that bit proper.
9652
9653 2004-05-01  Todd Berman  <tberman@sevenl.net>
9654
9655         * driver.cs: Try a LoadFrom before a Load, this checks the current
9656         path. This is currently a bug in mono that is be fixed, however, this
9657         provides a workaround for now. This will be removed when the bug
9658         is fixed.
9659
9660 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9661
9662         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9663         incomplete key pairs (#57941).
9664
9665 2004-05-01  Todd Berman  <tberman@sevenl.net>
9666
9667         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9668         from the GAC
9669
9670 2004-04-30  Jackson Harper  <jackson@ximian.com>
9671
9672         * codegen.cs: Open keys readonly.
9673         
9674 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9675
9676         * typemanager.cs: don't report cyclic struct layout when a struct
9677         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9678         which has 2 Pango.Rectangle fields.
9679
9680 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9681
9682         * expression.cs: Handle IntPtr comparisons with IL code
9683         rather than a method call.
9684
9685 2004-04-29  Martin Baulig  <martin@ximian.com>
9686
9687         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9688         the list of PropertyInfo's in class hierarchy and find the
9689         accessor.  Fixes #56013.
9690
9691 2004-04-29  Martin Baulig  <martin@ximian.com>
9692
9693         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9694
9695 2004-04-29  Martin Baulig  <martin@ximian.com>
9696
9697         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9698
9699         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9700
9701 2004-04-29  Martin Baulig  <martin@ximian.com>
9702
9703         * class.cs (ConstructorInitializer.Resolve): Check whether the
9704         parent .ctor is accessible.  Fixes #52146.
9705
9706 2004-04-29  Martin Baulig  <martin@ximian.com>
9707
9708         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9709
9710         * statement.cs (Using.EmitLocalVariableDecls): Use
9711         TypeManager.idisposable_type, not typeof (IDisposable).
9712         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9713
9714 2004-04-29  Martin Baulig  <martin@ximian.com>
9715
9716         * class.cs (Event.Define): Don't emit the field and don't set
9717         RTSpecialName and SpecialName for events on interfaces.  Fixes
9718         #57703. 
9719
9720 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9721
9722         Refactor Attribute.ApplyAttributes.
9723         * attribute.cs (Attributable): New base class for objects that can
9724         have Attributes applied on them.
9725         (Attribute): Make AttributeUsage fields public.
9726         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9727         (Attribute.IsInternalCall): New property.
9728         (Attribute.UsageAttr): Convert to a public read-only property.
9729         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9730         (Attribute.ResolveType, Attribute.Resolve)
9731         (Attribute.ScanForIndexerName): Update to reflect changes.
9732         (Attribute.CheckAttributeTarget): Re-format.
9733         (Attribute.ApplyAttributes): Refactor, to various
9734         Attributable.ApplyAttributeBuilder methods.
9735         * decl.cs (MemberCore): Make Attributable.
9736         * class.cs (Accessor): Make Attributable.
9737         (MethodData.ApplyAttributes): Use proper attribute types, not
9738         attribute names.
9739         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9740         (TypeContainer.ApplyAttributeBuilder)
9741         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9742         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9743         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9744         (Operator.ApplyAttributeBuilder): New factored-out methods.
9745         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9746         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9747         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9748         * parameter.cs (ParameterBase): New Attributable base class
9749         that can also represent Return types.
9750         (Parameter): Update to the changes.
9751
9752 2004-04-29  Jackson Harper  <jackson@ximian.com>
9753
9754         * driver.cs: Prefer the corlib system version when looking for
9755         assemblies in the GAC. This is still a hack, but its a better hack
9756         now.
9757         
9758 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9759
9760         * decl.cs, enum.cs: Improved error 3005 reporting.
9761   
9762         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9763         (related_symbols): New private member for list of symbols
9764         related to reported error/warning.
9765         
9766         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9767
9768 2004-04-29  Martin Baulig  <martin@ximian.com>
9769
9770         * ecore.cs (Expression.Constantify): If we're an enum and
9771         TypeManager.TypeToCoreType() doesn't give us another type, use
9772         t.UnderlyingSystemType.  Fixes #56178.  
9773
9774 2004-04-29  Martin Baulig  <martin@ximian.com>
9775
9776         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9777         interfaces and for each interface, only add members directly
9778         declared in that interface.  Fixes #53255.
9779
9780 2004-04-28  Martin Baulig  <martin@ximian.com>
9781
9782         * expression.cs (ConditionalLogicalOperator): Use a temporary
9783         variable for `left' to avoid that we evaluate it more than once;
9784         bug #52588.
9785
9786 2004-04-28  Martin Baulig  <martin@ximian.com>
9787
9788         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9789         `void[]' (CS1547).
9790
9791 2004-04-28  Martin Baulig  <martin@ximian.com>
9792
9793         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9794         void (CS1547).
9795
9796         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9797         whether the type is not void (CS1547).
9798
9799 2004-04-28  Martin Baulig  <martin@ximian.com>
9800
9801         * expression.cs (Unary.DoResolveLValue): Override this and report
9802         CS0131 for anything but Operator.Indirection.
9803
9804 2004-04-28  Martin Baulig  <martin@ximian.com>
9805
9806         Committing a patch from Ben Maurer; see bug #50820.
9807
9808         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9809         check for classes.
9810
9811         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9812         classes.        
9813
9814 2004-04-28  Martin Baulig  <martin@ximian.com>
9815
9816         Committing a patch from Ben Maurer; see bug #50820.
9817
9818         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9819         check for classes.
9820
9821         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9822         classes.        
9823
9824 2004-04-28  Martin Baulig  <martin@ximian.com>
9825
9826         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9827         (Block.AddLabel): Call DoLookupLabel() to only search in the
9828         current block.
9829
9830 2004-04-28  Martin Baulig  <martin@ximian.com>
9831
9832         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9833         comparing StringConstants and NullLiterals in Equality and Inequality.
9834
9835 2004-04-28  Jackson Harper  <jackson@ximian.com>
9836
9837         * driver.cs: Attempt to load referenced assemblies from the
9838         GAC. This is the quick and dirty version of this method that
9839         doesnt take into account versions and just takes the first
9840         canidate found. Will be good enough for now as we will not have more
9841         then one version installed into the GAC until I update this method.
9842
9843 2004-04-28  Martin Baulig  <martin@ximian.com>
9844
9845         * typemanager.cs (TypeManager.CheckStructCycles): New public
9846         static method to check for cycles in the struct layout.
9847
9848         * rootcontext.cs (RootContext.PopulateTypes): Call
9849         TypeManager.CheckStructCycles() for each TypeContainer.
9850         [Note: We only need to visit each type once.]
9851
9852 2004-04-28  Martin Baulig  <martin@ximian.com>
9853
9854         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9855
9856         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9857         success and added `out object value'.  Use a `bool resolved' field
9858         to check whether we've already been called rather than
9859         `ConstantValue != null' since this breaks for NullLiterals.
9860
9861 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9862
9863         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9864         setting of this flag, since the 'set' method may be non-public.
9865
9866 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9867
9868         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9869         check on current_vector.Block.
9870
9871 2004-04-27  Martin Baulig  <martin@ximian.com>
9872
9873         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9874         a field initializer.  Fixes #56459.
9875
9876 2004-04-27  Martin Baulig  <martin@ximian.com>
9877
9878         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9879         we're not attempting to use an indexer.  Fixes #52154.
9880
9881 2004-04-27  Martin Baulig  <martin@ximian.com>
9882
9883         * statement.cs (Return): Don't create a return label if we don't
9884         need it; reverts my change from January 20th.  Thanks to Ben
9885         Maurer for this.
9886
9887 2004-04-27  Martin Baulig  <martin@ximian.com>
9888
9889         According to the spec, `goto' can only leave a nested scope, but
9890         never enter it.
9891
9892         * statement.cs (Block.LookupLabel): Only lookup in the current
9893         block, don't recurse into parent or child blocks.
9894         (Block.AddLabel): Check in parent and child blocks, report
9895         CS0140/CS0158 if we find a duplicate.
9896         (Block): Removed this indexer for label lookups.
9897         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9898         this already does the error reporting for us.
9899
9900         * flowanalysis.cs
9901         (FlowBranching.UsageVector.Block): New public variable; may be null.
9902         (FlowBranching.CreateSibling): Added `Block' argument.
9903         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9904         label for the target of a `goto' and check whether we're not
9905         leaving a `finally'.
9906
9907 2004-04-27  Martin Baulig  <martin@ximian.com>
9908
9909         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9910         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9911         just for returns).
9912
9913 2004-04-27  Martin Baulig  <martin@ximian.com>
9914
9915         * statement.cs (Block.AddLabel): Also check for implicit blocks
9916         and added a CS0158 check.
9917
9918 2004-04-27  Martin Baulig  <martin@ximian.com>
9919
9920         * flowanalysis.cs (FlowBranchingLoop): New class.
9921         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9922         UsageVector's instead of an ArrayList.
9923         (FlowBranching.Label): Likewise.
9924         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9925         (FlowBranching.AddBreakVector): New method.
9926
9927 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9928
9929         * attribute.cs: Small regression fix: only convert the type if we
9930         the type is different, fixes System.Drawing build.
9931
9932 2004-04-27  Martin Baulig  <martin@ximian.com>
9933
9934         * attribute.cs (Attribute.Resolve): If we have a constant value
9935         for a named field or property, implicity convert it to the correct
9936         type.
9937
9938 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9939
9940         * statement.cs (Block.Block): Implicit blocks share
9941         'child_variable_names' fields with parent blocks.
9942         (Block.AddChildVariableNames): Remove.
9943         (Block.AddVariable): Mark variable as "used by a child block" in
9944         every surrounding block.
9945         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9946         been used in a child block, complain about violation of "Invariant
9947         meaning in blocks" rule.
9948         * cs-parser.jay (declare_local_variables): Don't use
9949         AddChildVariableNames.
9950         (foreach_statement): Don't create an implicit block: 'foreach'
9951         introduces a scope.
9952
9953 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9954
9955         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9956         converting from 0L to ulong.  Fixes 57522.
9957
9958 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9959
9960         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9961         derived class hides via 'new' keyword field from base class (test-242.cs).
9962         TODO: Handle this in the more general way.
9963         
9964         * class.cs (CheckBase): Ditto.
9965
9966 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9967
9968         * decl.cs (caching_flags): New member for storing cached values
9969         as bit flags.
9970         (MemberCore.Flags): New enum where bit flags for caching_flags
9971         are defined.
9972         (MemberCore.cls_compliance): Moved to caching_flags.
9973         (DeclSpace.Created): Moved to caching_flags.
9974
9975         * class.cs: Use caching_flags instead of DeclSpace.Created
9976         
9977 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9978
9979         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9980         if we are only a derived class, not a nested class.
9981
9982         * typemanager.cs: Same as above, but do this at the MemberLookup
9983         level (used by field and methods, properties are handled in
9984         PropertyExpr).   Allow for the qualified access if we are a nested
9985         method. 
9986
9987 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9988
9989         * class.cs: Refactoring.
9990         (IMethodData): New inteface; Holds links to parent members
9991         to avoid member duplication (reduced memory allocation).
9992         (Method): Implemented IMethodData interface.
9993         (PropertyBase): New inner classes for get/set methods.
9994         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9995         (Event): New inner classes for add/remove methods.
9996         (Event.DelegateMethod): Implemented IMethodData interface.
9997
9998         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9999         EmitContext (related to class.cs refactoring).
10000
10001 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10002
10003         * delegate.cs (Delegate.VerifyApplicability): If the number of
10004         arguments are the same as the number of parameters, first try to
10005         verify applicability ignoring  any 'params' modifier on the last
10006         parameter.
10007         Fixes #56442.
10008
10009 2004-04-08  Martin Baulig  <martin@ximian.com>
10010
10011         Merged latest changes into gmcs.  Please keep this comment in
10012         here, it makes it easier for me to see what changed in MCS since
10013         the last time I merged.
10014
10015 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10016
10017         * class.cs (TypeContainer.AddIndexer): Use
10018         'ExplicitInterfaceName' to determine if interface name was
10019         explicitly specified.  'InterfaceType' is not initialized at this time.
10020         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10021         Indexers array is already in the required order.  Initialize
10022         'IndexerName' only if there are normal indexers.
10023         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10024         (TypeContainer.Emit): Emit DefaultMember attribute only if
10025         IndexerName is initialized.
10026         Fixes #56300.
10027
10028 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10029
10030         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10031         Fixes #57007
10032
10033 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10034
10035         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10036         attributes.
10037         Fix for #56456.
10038
10039         * attribute.cs (Attribute.Resolve): Check for duplicate named
10040         attributes.
10041         Fix for #56463.
10042
10043 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10044
10045         * iterators.cs (MarkYield): track whether we are in an exception,
10046         and generate code accordingly.  Use a temporary value to store the
10047         result for our state.
10048
10049         I had ignored a bit the interaction of try/catch with iterators
10050         since their behavior was not entirely obvious, but now it is
10051         possible to verify that our behavior is the same as MS .NET 2.0
10052
10053         Fixes 54814
10054
10055 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10056
10057         * iterators.cs: Avoid creating temporaries if there is no work to
10058         do. 
10059
10060         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10061         Enumerations, use TypeManager.EnumToUnderlying and call
10062         recursively. 
10063
10064         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10065         bug #57013
10066
10067         (This.Emit): Use EmitContext.EmitThis to emit our
10068         instance variable.
10069
10070         (This.EmitAssign): Ditto.
10071
10072         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10073         codepaths, we will move all the functionality into
10074         Mono.CSharp.This 
10075
10076         (FieldExpr.EmitAssign): Ditto.
10077
10078         This fixes several hidden bugs that I uncovered while doing a code
10079         review of this today.
10080
10081         * codegen.cs (EmitThis): reworked so the semantics are more clear
10082         and also support value types "this" instances.
10083
10084         * iterators.cs: Changed so that for iterators in value types, we
10085         do not pass the value type as a parameter.  
10086
10087         Initialization of the enumerator helpers is now done in the caller
10088         instead of passing the parameters to the constructors and having
10089         the constructor set the fields.
10090
10091         The fields have now `assembly' visibility instead of private.
10092
10093 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10094
10095         * expression.cs (Argument.Resolve): Check if fields passed as ref
10096         or out are contained in a MarshalByRefObject.
10097
10098         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10099         another compiler type.
10100
10101 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10102
10103         * class.cs (Indexer.Define): use the new name checking method.
10104         Also, return false on an error.
10105         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10106         (is_identifier_[start/part]_character): make static.
10107
10108 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10109
10110         * expression.cs (Binary.ResolveOperator): Do no append strings
10111         twice: since we can be invoked more than once (array evaluation)
10112         on the same concatenation, take care of this here.  Based on a fix
10113         from Ben (bug #56454)
10114
10115 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10116
10117         * codegen.cs: Fix another case where CS1548 must be reported (when 
10118         delay-sign isn't specified and no private is available #56564). Fix
10119         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10120         error when MCS is used on the MS runtime and we need to delay-sign 
10121         (which seems unsupported by AssemblyBuilder - see #56621).
10122
10123 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10124
10125         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10126         (TypeManager.ComputeNamespaces): Faster implementation for
10127         Microsoft runtime.
10128
10129         * compiler.csproj: Updated AssemblyName to mcs.
10130
10131 2004-05-11  Jackson Harper  <jackson@ximian.com>
10132
10133         * Makefile: Preserve MONO_PATH
10134         
10135 2004-05-11  Jackson Harper  <jackson@ximian.com>
10136
10137         * Makefile: Use mono and mcs to build gmcs
10138         
10139 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10140
10141         * codegen.cs: Add patch from Robert Shade
10142         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10143         sync with mcs.
10144
10145 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10146
10147         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10148         incomplete key pairs (#57941).
10149
10150 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10151
10152         * codegen.cs: Fix another case where CS1548 must be reported (when 
10153         delay-sign isn't specified and no private is available #56564). Fix
10154         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10155         error when MCS is used on the MS runtime and we need to delay-sign 
10156         (which seems unsupported by AssemblyBuilder - see #56621).
10157
10158 2004-04-29  Jackson Harper  <jackson@ximian.com>
10159
10160         * Makefile: Set MONO_PATH to use the bootstrap corlib
10161         * driver.cs: Check the GAC for referenced assemblies.
10162                 
10163 2004-04-29  Martin Baulig  <martin@ximian.com>
10164
10165         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10166
10167 2004-04-07  Martin Baulig  <martin@ximian.com>
10168
10169         * expression.cs (Binary.ResolveOperator): Added special case for
10170         Equality/Inequality between a type parameter and a null literal.
10171
10172 2004-04-07  Martin Baulig  <martin@ximian.com>
10173
10174         * convert.cs: Check null literal -> type parameter conversions.
10175
10176 2004-04-07  Martin Baulig  <martin@ximian.com>
10177
10178         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10179         `class' and `struct' constraints.
10180
10181 2004-04-07  Martin Baulig  <martin@ximian.com>
10182
10183         * generic.cs (SpecialConstraint): New public enum.
10184         (Constraints.Resolve): Added support for the `class' and `struct'
10185         constraints.
10186
10187         * cs-parser.jay (type_parameter_constraint): Added support for the
10188         `class' and `struct' constraints.
10189
10190 2004-04-07  Martin Baulig  <martin@ximian.com>
10191
10192         * support.cs (GenericConstraints): Replaced `Types' by
10193         `ClassConstraint' and `InterfaceConstraints'; added
10194         `HasClassConstraint'.   
10195
10196 2004-04-07  Martin Baulig  <martin@ximian.com>
10197
10198         * generic.cs
10199         (Constraints.InterfaceConstraints): New public property.
10200         (Constraints.Types): Make this property public
10201         (TypeParameter): Implement IMemberContainer.
10202         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10203         instead of a TypeBuilder/MethodBuilder; pass the interface
10204         constraints to TypeManager.AddTypeParameter().
10205         (TypeParameter.DefineType): Just take an EmitContext and no
10206         TypeBuilder/MethodBuilder.  Use the new public API.
10207
10208         * typemanager.cs (TypeManager.AddTypeParameter): Added
10209         `TypeExpr[]' argument; add the interfaces to the
10210         `builder_to_ifaces' hash.
10211         (TypeManager.LookupMemberContainer): For
10212         GenericTypeParameterBuilders, get the TypeParameter from the
10213         `builder_to_type_param'.
10214         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10215         the TypeParameter and call FindMembers on it.
10216
10217 2004-04-07  Martin Baulig  <martin@ximian.com>
10218
10219         * class.cs
10220         (MethodCore.GenericMethod): Moved this field here from Method.
10221         (MethodCore.IsDuplicateImplementation): Take the number of type
10222         parameters into account if we're a generic method.
10223
10224         * expression.cs (Invocation.InferTypeArguments): Don't return true
10225         if `arguments' is null; we still need to check whether we actually
10226         don't need to infer anything in this case.
10227         (MemberAccess): Merged the functionality from GenericMemberAccess
10228         into this class.
10229
10230         * generic.cs (GenericMemberAccess): Removed.
10231
10232 2004-04-05  Martin Baulig  <martin@ximian.com>
10233
10234         * decl.cs (MemberCore): For generic classes, interfaces and
10235         structs, `Name' now includes the number of type parameters
10236         ("Stack!1.Node!1").
10237         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10238         encode the number of type arguments in the type name.
10239
10240         * expression.cs (Expression.MemberLookup): Removed the
10241         `num_type_args' argument; we now encode the number of type
10242         arguments in the type name.
10243
10244         * ecore.cs (SimpleName): Encode the number of type arguments in
10245         the type name itself.
10246
10247         * generic.cs (ConstructedType): Likewise.
10248
10249         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10250         `MemberName'; we now include the number of type parameters in the
10251         type name.
10252
10253         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10254         (TypeManager.MemberLookup): Removed the
10255         `num_type_args' argument; we now encode the number of type
10256         arguments in the type name.     
10257
10258 2004-04-03  Martin Baulig  <martin@ximian.com>
10259
10260         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10261         (MemberCore.MemberName): Moved here from MemberBase.
10262         (DeclSpace.SetParameterInfo): Just take the constraints as an
10263         ArrayList; we already have the type parameters in our
10264         `MemberName'; also do the CS0080 reporting here.
10265
10266         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10267         `IDENTIFIER opt_type_parameter_list'; when constructing our
10268         `MemberName', it'll already include our type parameters.
10269         (class_declaration, interface_declaration): Likewise.
10270         (delegate_declaration): Likewise.
10271         (MakeName): Take a MemberName and return a MemberName.
10272         The following two changes are required to avoid shift/reduce conflicts:
10273         (member_name): Don't include a TypeName anymore; ie. this is now
10274         just 'IDENTIFIER opt_type_parameter_list'.
10275         (property_declaration, event_declaration): Use a
10276         `namespace_or_type_name' instead of a `member_name'.            
10277
10278 2004-04-03  Martin Baulig  <martin@ximian.com>
10279
10280         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10281         `MemberName' class.
10282         (TypeName): Formerly known as MemberName.
10283
10284         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10285         instead of a `MemberName'.
10286
10287         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10288         (member_name): New rule; create a MemberName.
10289
10290 2004-04-02  Martin Baulig  <martin@ximian.com>
10291
10292         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10293         (CS0305 and CS0308).
10294
10295 2004-04-02  Martin Baulig  <martin@ximian.com>
10296
10297         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10298         support for nested types.
10299
10300 2004-04-02  Martin Baulig  <martin@ximian.com>
10301
10302         * ecore.cs (IAlias): New public interface.
10303         (TypeExpr, TypeExpression): Implement IAlias.
10304         (TypeAliasExpression): New public class.
10305
10306         * namespace.cs (Namespace): Implement IAlias.
10307         (Namespace.Lookup): Return an IAlias instead on an object.
10308         (Namespace.DefineName): Take an IAlias instead of an object.
10309         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10310         an object.
10311         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10312         Expression.
10313         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10314         object.
10315         (NamespaceEntry.Lookup): Likewise.
10316
10317         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10318         instead of a Type.      
10319
10320         * decl.cs (DeclSpace): Implement IAlias.
10321         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10322
10323         * generic.cs (ConstructedType): Improved error checking.
10324
10325 2004-04-02  Martin Baulig  <martin@ximian.com>
10326
10327         * convert.cs: Added type parameter conversions.
10328
10329         * ecore.cs
10330         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10331         (ClassCast.Emit): If the source type is a type parameter, box it.
10332         If the target type is a type parameter, emit an `unbox.any'
10333         instead of a `classcast'.1      
10334
10335 2004-04-01  Martin Baulig  <martin@ximian.com>
10336
10337         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10338
10339 2004-04-01  Martin Baulig  <martin@ximian.com>
10340
10341         * generic.cs (ConstructedType.CheckConstraints): Use
10342         Convert.ImplicitStandardConversionExists(); user-defined implicit
10343         conversions are not allowed according to the spec.
10344
10345 2004-03-30  Martin Baulig  <martin@ximian.com>
10346
10347         * expression.cs (New): Added support for type parameters.
10348
10349         * typemanager.cs
10350         (TypeManager.activator_type): New public static field.
10351         (TypeManager.activator_create_instance): Likewise.
10352
10353 2004-03-30  Martin Baulig  <martin@ximian.com>
10354
10355         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10356         public method.
10357
10358 2004-03-30  Martin Baulig  <martin@ximian.com>
10359
10360         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10361         the spec here: the argument type must be convertible to the
10362         constraints.
10363
10364 2004-03-30  Martin Baulig  <martin@ximian.com>
10365
10366         * generic.cs
10367         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10368         TypeManager.AddTypeParameter().
10369         (ConstructedType.CheckConstraints): Re-enable this and actually
10370         check whether we have a constructor constraint.
10371
10372         * typemanager.cs
10373         (TypeManager.builder_to_type_param): New static field.
10374         (TypeManager.AddTypeParameter): New static method.
10375         (TypeManager.LookupTypeParameter): New public method.
10376
10377 2004-03-30  Martin Baulig  <martin@ximian.com>
10378
10379         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10380         the new API to actually define the constructor constraint.
10381
10382         * typemanager.cs
10383         (TypeManager.new_constraint_attr_type): New static field.
10384         (TypeManager.InitCoreTypes): Initialize it.
10385
10386 2004-03-30  Martin Baulig  <martin@ximian.com>
10387
10388         * generic.cs (Constraints): Completed error checking, use correct
10389         error numbers.
10390
10391 2004-03-29  Martin Baulig  <martin@ximian.com>
10392
10393         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10394
10395         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10396         public version which takes a `ParameterData pd' instead of an
10397         `ArrayList args'.
10398
10399 2004-03-29  Martin Baulig  <martin@ximian.com>
10400
10401         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10402         not a MethodInfo.       
10403
10404 2004-03-29  Martin Baulig  <martin@ximian.com>
10405
10406         * expression.cs (Argument.ResolveMethodGroup): If we're a
10407         ConstructedType, call GetMemberAccess() on it.  
10408
10409 2004-03-29  Martin Baulig  <martin@ximian.com>
10410
10411         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10412         (MethodCore.CheckGenericOverride): When overriding a generic
10413         method, check whether the constraints match.
10414
10415         * support.cs (GenericConstraints): New public interface.
10416         (ParameterData.GenericConstraints): New public method.
10417
10418         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10419         method parameter and compute our constraints if appropriate.
10420         (Parameter.GenericConstraints): New public property.
10421
10422         * generic.cs (Constraints): Implement GenericConstraints.
10423
10424 2004-03-29  Martin Baulig  <martin@ximian.com>
10425
10426         * decl.cs (MemberCache.FindMemberToOverride): Use
10427         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10428
10429 2004-03-29  Martin Baulig  <martin@ximian.com>
10430
10431         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10432
10433 2004-03-29  Martin Baulig  <martin@ximian.com>
10434
10435         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10436         not allowed on non-generic declarations").
10437
10438 2004-03-29  Martin Baulig  <martin@ximian.com>
10439
10440         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10441         public version of this method.
10442
10443         * class.cs (MethodCore.IsDuplicateImplementation): Use
10444         Invocation.InferTypeArguments() to check this.
10445
10446 2004-03-29  Martin Baulig  <martin@ximian.com>
10447
10448         * convert.cs: Use TypeManager.IsDelegateType() instead of
10449         comparing types correctly.
10450
10451 2004-03-29  Martin Baulig  <martin@ximian.com>
10452
10453         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10454         types directly to make it work for generic instances.
10455
10456         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10457
10458 2004-03-29  Martin Baulig  <martin@ximian.com>
10459
10460         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10461         support for arrays.     
10462
10463 2004-03-24  Martin Baulig  <martin@ximian.com>
10464
10465         * decl.cs (DeclSpace.FindType): Also use
10466         TypeManager.CheckGeneric() for types from the using clauses.
10467
10468 2004-03-23  Martin Baulig  <martin@ximian.com>
10469
10470         * expression.cs (Invocation.OverloadResolve): Added `bool
10471         may_fail' argument and use it instead of the Location.IsNull() hack.
10472
10473 2004-03-23  Martin Baulig  <martin@ximian.com>
10474
10475         * expression.cs (Invocation.InferType): Use correct type inference
10476         rules here.     
10477
10478 2004-03-23  Martin Baulig  <martin@ximian.com>
10479
10480         * ecore.cs (MethodGroupExpr.Name): Use
10481         TypeManager.CSharpSignature() instead of just the name.
10482
10483         * expression.cs (Invocation.OverloadResolve): Provide better error
10484         reporting.
10485         (Invocation.DoResolve): OverloadResolve() never returns null
10486         without reporting an error, so removed the error -6 reporting here.
10487
10488 2004-03-23  Martin Baulig  <martin@ximian.com>
10489
10490         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10491         generic methods.
10492
10493         * cs-parser.jay (delegate_declaration): Support generic delegates.
10494
10495         * delegate.cs: Support generic delegates.
10496
10497 2004-03-22  Martin Baulig  <martin@ximian.com>
10498
10499         * expression.cs (Invocation.InferParamsTypeArguments): New static
10500         method; does type inference for params arguments.
10501
10502 2004-03-21  Martin Baulig  <martin@ximian.com>
10503
10504         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10505         method; checks whether a method is a generic method.    
10506
10507         * expression.cs (Invocation.InferTypeArguments): New static method;
10508         infer type arguments for generic method invocation.
10509
10510         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10511         property; we set this to true if we're resolving a generic method
10512         invocation and the user specified type arguments, ie. we're not
10513         doing type inference.
10514
10515 2004-03-20  Martin Baulig  <martin@ximian.com>
10516
10517         * class.cs (MethodData.DeclaringType): New public property.
10518         (MethodData.Define): Set DeclaringType here.
10519         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10520         instead of OperatorMethodBuilder.DeclaringType.
10521
10522 2004-03-20  Martin Baulig  <martin@ximian.com>
10523
10524         * cs-tokenizer.cs (xtoken): Return a special
10525         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10526
10527         * cs-parser.jay (default_value_expression): Switch to the new
10528         syntax (14.5.13).
10529
10530 2004-03-19  Martin Baulig  <martin@ximian.com>
10531
10532         * decl.cs (MemberName): New class.  We use this to "construct"
10533         namespace_or_type_name's.
10534
10535         * generics.cs (TypeArguments.GetDeclarations): New public method;
10536         returns the type arguments as a string[] and reports a CS0081 if
10537         one of them is not an identifier.
10538
10539         * class.cs (MemberBase): The .ctor now takes the name as a
10540         MemberName instead of a string.
10541         (MemberBase.ExplicitInterfaceName): Changed type from string to
10542         Expression.
10543         (MemberBase.DoDefine): If we're an explicit implementation, the
10544         InterfaceType may be a generic instance.
10545
10546         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10547         (namespace_name): Call MemberName.GetName () to transform the
10548         MemberName into a string and ensure we don't have any type
10549         arguments.
10550         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10551         MemberName into an expression.
10552         (method_header): Use namespace_or_type_name instead of member_name.     
10553
10554 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10555
10556         * rootcontext.cs: Add new types to the boot resolution.
10557
10558         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10559         MulticastDelegate is not allowed.
10560
10561         * typemanager.cs: Add new types to lookup: System.TypedReference
10562         and ArgIterator.
10563
10564         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10565         check for TypedReference or ArgIterator, they are not allowed. 
10566
10567         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10568         makes us properly catch 1510 in some conditions (see bug 56016 for
10569         details). 
10570
10571 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10572
10573         * CryptoConvert.cs: update from corlib version
10574         with endian fixes.
10575
10576 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10577
10578         * class.cs (Indexer.Define): Check indexername declaration
10579
10580 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10581
10582         * attribute.cs (IsClsCompliant): Fixed problem with handling
10583         all three states (compliant, not-compliant, undetected).
10584
10585 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10586
10587         * attribute.cs (Attribute): Location is now public.
10588         (Resolve): Store resolved arguments (pos_values) in attribute class.
10589         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10590         (GetClsCompliantAttributeValue): New method that gets
10591         CLSCompliantAttribute value.
10592         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10593         if exists else null.
10594         (AttributeTester): New class for CLS-Compliant verification routines.
10595
10596         * class.cs (Emit): Add CLS-Compliant verification.
10597         (Method.GetSignatureForError): Implemented.
10598         (Constructor.GetSignatureForError): Implemented
10599         (Constructor.HasCompliantArgs): Returns if constructor has
10600         CLS-Compliant arguments.
10601         (Constructor.Emit): Override.
10602         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10603         is needed to test only parameters.
10604         (FieldBase.GetSignatureForError): Implemented.
10605         (TypeContainer): New member for storing base interfaces.
10606         (TypeContainer.FindMembers): Search in base interfaces too.
10607
10608         * codegen.cs (GetClsComplianceAttribute): New method that gets
10609         assembly or module CLSCompliantAttribute value.
10610         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10611         for assembly.
10612         (ModuleClass.Emit): Add error 3012 test.
10613
10614         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10615
10616         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10617         state for all decl types.
10618         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10619         if CLS-Compliant tests are required.
10620         (IsClsCompliaceRequired): New method. Analyze whether code
10621         must be CLS-Compliant.
10622         (IsExposedFromAssembly): New method. Returns true when MemberCore
10623         is exposed from assembly.
10624         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10625         value or gets cached value.
10626         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10627         is explicitly marked with CLSCompliantAttribute.
10628         (IsIdentifierClsCompliant): New abstract method. This method is
10629         used to testing error 3005.
10630         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10631         for identifier and parameters CLS-Compliant testing.
10632         (VerifyClsCompliance): New method. The main virtual method for
10633         CLS-Compliant verifications.
10634         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10635         null. I don't know why is null (too many public members !).
10636         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10637         and get value of first CLSCompliantAttribute that found.
10638
10639         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10640         (VerifyClsCompliance): Override and add extra tests.
10641
10642         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10643         clscheck- disable CLS-Compliant verification event if assembly is has
10644         CLSCompliantAttribute(true).
10645
10646         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10647         ApllyAttribute is now called in emit section as in the other cases.
10648         Possible future Emit integration.
10649         (IsIdentifierClsCompliant): New override.
10650         (VerifyClsCompliance): New override.
10651         (GetEnumeratorName): Returns full enum name.
10652
10653         * parameter.cs (GetSignatureForError): Implemented.
10654
10655         * report.cs (WarningData): New struct for Warning message information.
10656         (LocationOfPreviousError): New method.
10657         (Warning): New method. Reports warning based on the warning table.
10658         (Error_T): New method. Reports error based on the error table.
10659
10660         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10661         verifications are done here.
10662
10663         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10664
10665         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10666         CLSCompliantAttribute.
10667         (all_imported_types): New member holds all imported types from other
10668         assemblies.
10669         (LoadAllImportedTypes): New method fills static table with exported types
10670         from all referenced assemblies.
10671         (Modules): New property returns all assembly modules.
10672
10673 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10674
10675         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10676         throwing a parser error.
10677
10678         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10679         which removes the hardcoded get_/set_ prefixes for properties, as
10680         IL allows for the properties to be named something else.  
10681
10682         Bug #56013
10683
10684         * expression.cs: Do not override operand before we know if it is
10685         non-null.  Fix 56207
10686
10687 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10688
10689         * typemanager.cs: support for pinned variables.
10690
10691 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10692
10693         * decl.cs, typemanager.cs: Avoid using an arraylist
10694         as a buffer if there is only one result set.
10695
10696 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10697
10698         * expression.cs: Make sure you cant call a static method
10699         with an instance expression, bug #56174.
10700
10701 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10702
10703         * class.cs (IsDuplicateImplementation): Improve error reporting to
10704         flag 663 (method only differs in parameter modifier).
10705
10706         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10707         in preprocessor directives.
10708
10709         * location.cs (LookupFile): Allow for the empty path.
10710
10711         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10712         better approach for some of that patch, but its failing with the
10713         CharSet enumeration.  For now try/catch will do.
10714
10715         * typemanager.cs: Do not crash if a struct does not have fields.
10716         Fixes 56150.
10717
10718 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10719
10720         * expression.cs: cs0213, cant fix a fixed expression.
10721         fixes 50231.
10722
10723 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10724
10725         * cs-parser.jay: detect invalid embeded statements gracefully.
10726         bug #51113.
10727
10728 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10729
10730         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10731         As a regex:
10732         s/
10733         the invocation type may not be a subclass of the tye of the item/
10734         The type of the item must be a subclass of the invocation item.
10735         /g
10736
10737         Fixes bug #50820.
10738
10739 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10740
10741         * attribute.cs: Added methods to get a string and a bool from an
10742         attribute. Required to information from AssemblyKeyFileAttribute,
10743         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10744         * codegen.cs: Modified AssemblyName creation to include support for
10745         strongnames. Catch additional exceptions to report them as CS1548.
10746         * compiler.csproj: Updated include CryptoConvert.cs.
10747         * compiler.csproj.user: Removed file - user specific configuration.
10748         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10749         Mono.Security assembly. The original class is maintained and tested in
10750         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10751         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10752         like CSC 8.0 (C# v2) supports.
10753         * Makefile: Added CryptoConvert.cs to mcs sources.
10754         * rootcontext.cs: Added new options for strongnames.
10755
10756 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10757
10758         * driver.cs: For --expect-error, report error code `2'
10759         if the program compiled with no errors, error code `1' if
10760         it compiled with an error other than the one expected.
10761
10762 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10763
10764         * compiler.csproj: Updated for Visual Studio .NET 2003.
10765         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10766         * compiler.sln: Updated for Visual Studio .NET 2003.
10767
10768 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10769
10770         * expression.cs: Fix bug #47234. We basically need to apply the
10771         rule that we prefer the conversion of null to a reference type
10772         when faced with a conversion to 'object' (csc behaviour).
10773
10774 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10775
10776         * statement.cs: Shorter form for foreach, eliminates
10777         a local variable. r=Martin.
10778
10779 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10780
10781         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10782         checks if we can use brtrue/brfalse to test for 0.
10783         * expression.cs: use the above in the test for using brtrue/brfalse.
10784         cleanup code a bit.
10785
10786 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10787
10788         * expression.cs: Rewrite string concat stuff. Benefits:
10789
10790         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10791         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10792         rather than a concat chain.
10793
10794         * typemanager.cs: Add lookups for more concat overloads.
10795
10796 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10797
10798         * expression.cs: Emit shorter il code for array init.
10799
10800         newarr
10801         dup
10802         // set 1
10803
10804         // set 2
10805
10806         newarr
10807         stloc.x
10808
10809         ldloc.x
10810         // set 1
10811
10812         ldloc.x
10813         // set 2
10814
10815 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10816
10817         * statement.cs: Before, two switch blocks would be merged if the
10818         total size of the blocks (end_item - begin_item + 1) was less than
10819         two times the combined sizes of the blocks.
10820
10821         Now, it will only merge if after the merge at least half of the
10822         slots are filled.
10823
10824         fixes 55885.
10825
10826 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10827
10828         * class.cs : csc build fix for GetMethods(). See bug #52503.
10829
10830 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10831
10832         * expression.cs: Make sure fp comparisons work with NaN.
10833         This fixes bug #54303. Mig approved this patch a long
10834         time ago, but we were not able to test b/c the runtime
10835         had a related bug.
10836
10837 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10838
10839         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10840
10841 2004-03-19  Martin Baulig  <martin@ximian.com>
10842
10843         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10844         two overloads may unify for some type parameter substitutions and
10845         report a CS0408 if appropriate.
10846
10847 2004-03-19  Martin Baulig  <martin@ximian.com>
10848
10849         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10850         error here and not in our caller.
10851
10852 2004-03-19  Martin Baulig  <martin@ximian.com>
10853
10854         * interface.cs: Completely killed this file.
10855         (Interface): We're now a TypeContainer and live in class.cs.
10856
10857         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10858         argument; we're now also called for interfaces.
10859         (TypeContainer.DefineMembers): Allow this method being called
10860         multiple times.
10861         (TypeContainer.GetMethods): New public method; formerly known as
10862         Interface.GetMethod().  This is used by PendingImplementation.
10863         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10864         it's now private and non-static.
10865         (Interface): Moved this here; it's now implemented similar to
10866         Class and Struct.
10867         (Method, Property, Event, Indexer): Added `bool is_interface'
10868         argument to their .ctor's.
10869         (MemberBase.IsInterface): New public field.
10870
10871         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10872         instances instead of InterfaceMethod, InterfaceProperty, etc.
10873         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10874         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10875
10876 2004-03-19  Martin Baulig  <martin@ximian.com>
10877
10878         * class.cs (MethodCore.IsDuplicateImplementation): New private
10879         method which does the CS0111 checking.
10880         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10881         Use IsDuplicateImplementation().
10882
10883 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10884
10885         * decl.cs (FindMemberToOverride): New method to find the correct
10886         method or property to override in the base class.
10887         * class.cs
10888             - Make Method/Property use the above method to find the
10889               version in the base class.
10890             - Remove the InheritableMemberSignatureCompare as it is now
10891               dead code.
10892
10893         This patch makes large code bases much faster to compile, as it is
10894         O(n) rather than O(n^2) to do this validation.
10895
10896         Also, it fixes bug 52458 which is that nested classes are not
10897         taken into account when finding the base class member.
10898
10899         Reviewed/Approved by Martin.
10900
10901 2004-03-17  Martin Baulig  <martin@ximian.com>
10902
10903         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10904         of type arguments into account; use the `real_num_type_args'
10905         approach like in DoResolveAsTypeStep().
10906
10907         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10908         nested types.
10909
10910 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10911
10912         * interface.cs: In all interface classes removed redundant
10913         member initialization.
10914
10915 2004-03-16  Martin Baulig  <martin@ximian.com>
10916
10917         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10918
10919 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10920
10921         * decl.cs (DefineTypeAndParents): New helper method to define a
10922         type's containers before the type itself is defined;  This is a
10923         bug exposed by the recent changes to Windows.Forms when an
10924         implemented interface was defined inside a class that had not been
10925         built yet.   
10926
10927         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10928
10929         (Check): Loop correctly to report errors modifiers
10930         (UNSAFE was not in the loop, since it was the same as TOP).
10931
10932         * interface.cs: Every interface member now takes a ModFlags,
10933         instead of a "is_new" bool, which we set on the base MemberCore. 
10934
10935         Every place where we called "UnsafeOk" in the interface, now we
10936         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10937         the unsafe settings from the member declaration instead of the
10938         container interface. 
10939
10940         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10941
10942         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10943         `set_indexer_name' to the pending bits (one per type).
10944
10945         We fixed a bug today that was picking the wrong method to
10946         override, since for properties the existing InterfaceMethod code
10947         basically ignored the method name.  Now we make sure that the
10948         method name is one of the valid indexer names.
10949
10950 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10951  
10952         * support.cs (SeekableStreamReader): Keep track of stream byte
10953         positions and don't mix them with character offsets to the buffer.
10954
10955         Patch from Gustavo Giráldez
10956
10957 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10958
10959         * interface.cs (InterfaceSetGetBase): Removed double member
10960         initialization, base class does it as well.
10961
10962 2004-03-13  Martin Baulig  <martin@ximian.com>
10963
10964         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10965         when compiling corlib.
10966
10967 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10968
10969         * convert.cs (ExplicitConversion): We were reporting an error on
10970         certain conversions (object_type source to a value type, when the
10971         expression was `null') before we had a chance to pass it through
10972         the user defined conversions.
10973
10974         * driver.cs: Replace / and \ in resource specifications to dots.
10975         Fixes 50752
10976
10977         * class.cs: Add check for duplicate operators.  Fixes 52477
10978
10979 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10980
10981         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10982         that are in the middle of the statements, not only at the end.
10983         Fixes #54987
10984
10985         * class.cs (TypeContainer.AddField): No longer set the
10986         `HaveStaticConstructor' flag, now we call it
10987         `UserDefineStaticConstructor' to diferentiate the slightly
10988         semantic difference.
10989
10990         The situation is that we were not adding BeforeFieldInit (from
10991         Modifiers.TypeAttr) to classes that could have it.
10992         BeforeFieldInit should be set to classes that have no static
10993         constructor. 
10994
10995         See:
10996
10997         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10998
10999         And most importantly Zoltan's comment:
11000
11001         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11002
11003         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11004          before its static fields are used', i.e. initialization does not need
11005          to be triggered by the first access to the type. Setting this flag
11006          helps the JIT to compile better code, since it can run the static
11007          constructor at JIT time, and does not need to generate code to call it
11008          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11009          this flag for lots of classes like String. 
11010          
11011          csc sets this flag if the type does not have an explicit static 
11012          constructor. The reasoning seems to be that if there are only static
11013          initalizers for a type, and no static constructor, then the programmer
11014          does not care when this initialization happens, so beforefieldinit
11015          can be used.
11016          
11017          This bug prevents the AOT compiler from being usable, since it 
11018          generates so many calls to mono_runtime_class_init that the AOT code
11019          is much slower than the JITted code. The JITted code is faster, 
11020          because it does not generate these calls if the vtable is type is
11021          already initialized, which is true in the majority of cases. But the
11022          AOT compiler can't do this."
11023
11024 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11025
11026         * class.cs (MethodData.Emit): Refactor the code so symbolic
11027         information is generated for destructors;  For some reasons we
11028         were taking a code path that did not generate symbolic information
11029         before. 
11030
11031 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11032
11033         * class.cs: Create a Constructor.CheckBase method that
11034         takes care of all validation type code. The method
11035         contains some code that was moved from Define.
11036
11037         It also includes new code that checks for duplicate ctors.
11038         This fixes bug #55148.
11039
11040 2004-03-09  Joshua Tauberer <tauberer@for.net>
11041
11042         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11043         a { ... }-style array creation invokes EmitStaticInitializers
11044         which is not good for reference-type arrays.  String, decimal
11045         and now null constants (NullCast) are not counted toward
11046         static initializers.
11047
11048 2004-03-05  Martin Baulig  <martin@ximian.com>
11049
11050         * location.cs (SourceFile.HasLineDirective): New public field;
11051         specifies whether the file contains or is referenced by a "#line"
11052         directive.
11053         (Location.DefineSymbolDocuments): Ignore source files which
11054         either contain or are referenced by a "#line" directive.        
11055
11056 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11057
11058         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11059         direct access to our parent, so check the method inline there.
11060
11061 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11062
11063         * expression.cs (Invocation.EmitCall): Miguel's last commit
11064         caused a regression. If you had:
11065
11066             T t = null;
11067             t.Foo ();
11068
11069         In Foo the implict this would be null.
11070
11071 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * expression.cs (Invocation.EmitCall): If the method is not
11074         virtual, do not emit a CallVirt to it, use Call.
11075
11076         * typemanager.cs (GetFullNameSignature): Improve the method to
11077         cope with ".ctor" and replace it with the type name.
11078
11079         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11080         as an argument the ConstructorBuilder where it is being defined,
11081         to catch the recursive constructor invocations.
11082
11083 2004-03-16  Martin Baulig  <martin@ximian.com>
11084
11085         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11086         ConstructedType, call ResolveType() on it to get the type rather
11087         than just using `expr.Type'.
11088
11089 2004-03-16  Martin Baulig  <martin@ximian.com>
11090
11091         * generics.cs (ConstructedType.GetMemberAccess): Take the
11092         EmitContext instead on the TypeExpr and use
11093         ec.TypeContainer.CurrentType/ec.ContainerType.
11094
11095 2004-03-16  Martin Baulig  <martin@ximian.com>
11096
11097         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11098         parameters before aliases.
11099
11100 2004-03-16  Martin Baulig  <martin@ximian.com>
11101
11102         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11103         New oublic function; checks whether two generic instances may become
11104         equal under some instantiations (26.3.1).
11105
11106         * class.cs (TypeContainer.Define): Call
11107         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11108         error.
11109
11110 2004-03-16  Martin Baulig  <martin@ximian.com>
11111
11112         * class.cs (TypeContainer.GetClassBases): Moved
11113         Error_TypeParameterAsBase() here and also check whether the base
11114         class is not an attribute.
11115
11116 2004-03-16  Martin Baulig  <martin@ximian.com>
11117
11118         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11119
11120 2004-03-16  Martin Baulig  <martin@ximian.com>
11121
11122         * class.cs (Error_TypeParameterAsBase): Use correct error number
11123         here (CS0689).  
11124
11125 2004-03-16  Martin Baulig  <martin@ximian.com>
11126
11127         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11128         for generics.
11129
11130         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11131         error reporting.
11132
11133 2004-03-15  Martin Baulig  <martin@ximian.com>
11134
11135         * typemanager.cs (TypeManager.GetFullName): New public method.
11136         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11137         argument; only return members with the correct number of type
11138         arguments.
11139         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11140         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11141         whether the number of type arguments matches.
11142
11143         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11144         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11145
11146         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11147         field; it's set by the protected .ctor when we're actually a
11148         GenericMemberAccess.
11149         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11150         arguments and pass it to MemberLookupFinal ().
11151
11152         * ecore.cs (Expression.MemberLookup): Added `int
11153         num_type_arguments' argument; only return members with the correct
11154         number of type arguments.
11155         (Expression.MemberLookupFailed): Check whether the MemberLookup
11156         failed because we did not have the correct number of type
11157         arguments; report CS0305 in this case.
11158
11159         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11160         `e.ResolveAsTypeTerminal()' already did so.
11161
11162 2004-03-15  Martin Baulig  <martin@ximian.com>
11163
11164         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11165         we're a ConstructedType; in this case, the caller must report an
11166         error (for instance CS0131).
11167
11168         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11169         (TypeArguments.Resolve): Actually report errors here.
11170
11171 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11172
11173         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11174         `set_indexer_name' to the pending bits (one per type).
11175
11176         We fixed a bug today that was picking the wrong method to
11177         override, since for properties the existing InterfaceMethod code
11178         basically ignored the method name.  Now we make sure that the
11179         method name is one of the valid indexer names.
11180
11181 2004-03-15  Martin Baulig  <martin@ximian.com>
11182
11183         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11184         for generic instances.
11185
11186 2004-03-13  Martin Baulig  <martin@ximian.com>
11187
11188         * class.cs (TypeContainer.DefineType): Call
11189         TypeManager.AddUserType() immediately after creating the
11190         TypeBuilder; pass all type parameters when creating the
11191         CurrentType.
11192
11193         * decl.cs (DeclSpace.FindNestedType): New public method.
11194         (DeclSpace.FindType): Added `int num_type_args' argument; only
11195         return types with the correct number of type parameters.
11196         (DeclSpace.CountTypeParams): New public property.
11197
11198         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11199         the number of type parameters; defaults to zero.
11200
11201         * generic.cs (TypeArguments.Count): New public property.
11202         (ConstructedType.DoResolveAsTypeStep): First call
11203         ds.FindNestedType() to find out whether we're nested in the
11204         current generic type; in this case, we inherit all type parameters
11205         from the current class.
11206
11207         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11208         num_type_args' argument.
11209         (RootContext.LookupType): Added overloaded version which takes the
11210         number of type arguments; only return types with the correct
11211         number of type arguments.
11212
11213         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11214         checks whether `Type t' has `int num_type_args'.
11215
11216 2004-03-13  Martin Baulig  <martin@ximian.com>
11217
11218         * generic.cs (GenericMethod.DefineType): New method; calls
11219         DefineType() on all the type parameters.
11220
11221         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11222         (MethodData.Define): If we're a generic method, call
11223         GenericMethod.DefineType() to define the type parameters.       
11224
11225 2004-03-10  Martin Baulig  <martin@ximian.com>
11226
11227         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11228         instead of IsAssignableFrom.    
11229
11230 2004-03-10  Martin Baulig  <martin@ximian.com>
11231
11232         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11233
11234         * support.cs (ParameterData.HasArrayParameter): New property.
11235         (ReflectionParameters.ctor): Take a MethodBase instead of a
11236         ParameterInfo[].  If we have any type parameters, get the generic
11237         method definition and ask it whether we have variable arguments.
11238
11239 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11242         routines to check if a type is an enumerable/enumerator allow
11243         classes that implement the IEnumerable or IEnumerator interfaces.
11244
11245         * class.cs (Property, Operator): Implement IIteratorContainer, and
11246         implement SetYields.
11247
11248         (Property.Define): Do the block swapping for get_methods in the
11249         context of iterators.   We need to check if Properties also
11250         include indexers or not.
11251
11252         (Operator): Assign the Block before invoking the
11253         OperatorMethod.Define, so we can trigger the Iterator code
11254         replacement. 
11255
11256         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11257         Property and Operator classes are not created when we parse the
11258         declarator but until we have the block completed, so we use a
11259         singleton SimpleIteratorContainer.Simple to flag whether the
11260         SetYields has been invoked.
11261
11262         We propagate this setting then to the Property or the Operator to
11263         allow the `yield' to function.
11264
11265 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11266
11267         * codegen.cs: Implemented attribute support for modules.
11268         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11269         Assembly/Module functionality.
11270
11271         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11272         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11273         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11274
11275 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11276
11277         * interface.cs (FindMembers): The operation is performed on all base
11278         interfaces and not only on the first. It is required for future CLS Compliance patch.
11279
11280 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11281
11282         * statement.cs, codegen.cs:
11283         This patch deals with patterns such as:
11284
11285         public class List : IEnumerable {
11286
11287                 public MyEnumerator GetEnumerator () {
11288                         return new MyEnumerator(this);
11289                 }
11290
11291                 IEnumerator IEnumerable.GetEnumerator () {
11292                         ...
11293                 }
11294                 
11295                 public struct MyEnumerator : IEnumerator {
11296                         ...
11297                 }
11298         }
11299
11300         Before, there were a few things we did wrong:
11301         1) we would emit callvirt on a struct, which is illegal
11302         2) we emited ldarg when we needed to emit ldarga
11303         3) we would mistakenly call the interface methods on an enumerator
11304         type that derived from IEnumerator and was in another assembly. For example:
11305
11306         public class MyEnumerator : IEnumerator
11307
11308         Would have the interface methods called, even if there were public impls of the
11309         method. In a struct, this lead to invalid IL code.
11310
11311 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11312
11313         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11314           renamed to Emit.
11315
11316         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11317
11318 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11319
11320         * cs-parser.jay: Fix small regression: we were not testing V2
11321         compiler features correctly.
11322
11323         * interface.cs: If the emit context is null, then create one
11324
11325 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11326
11327         * decl.cs (GetSignatureForError): New virtual method to get full name
11328           for error messages.
11329
11330         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11331           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11332
11333         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11334           Duplicated members and code in these classes has been removed.
11335           Better encapsulation in these classes.
11336
11337 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11338
11339         * assign.cs (Assign.DoResolve): When dealing with compound
11340         assignments, there is a new rule in ECMA C# 2.4 (might have been
11341         there before, but it is documented here) that states that in:
11342
11343         a op= b;
11344
11345         If b is of type int, and the `op' is a shift-operator, then the
11346         above is evaluated as:
11347
11348         a = (int) a op b 
11349
11350         * expression.cs (Binary.ResolveOperator): Instead of testing for
11351         int/uint/long/ulong, try to implicitly convert to any of those
11352         types and use that in pointer arithmetic.
11353
11354         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11355         method to print information for from the type, not from the
11356         null-method we were given.
11357
11358 2004-02-01  Duncan Mak  <duncan@ximian.com>
11359
11360         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11361         parsing for cmd, fixes bug #53694.
11362
11363 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11364
11365         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11366         in the member name duplication tests. Property and operator name duplication
11367         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11368
11369 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11370
11371         * interface.cs (PopulateMethod): Fixed crash when interface method
11372         returns not existing type (error test cs0246-3.cs).
11373
11374 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11375
11376         * cs-parser.jay (interface_accessors): Re-write actions to also
11377         store attributes attached to get and set methods. Fix spelling
11378         while at it.
11379
11380         (inteface_property_declaration): Modify accordingly.
11381
11382         (InterfaceAccessorInfo): New helper class to store information to pass
11383         around between rules that use interface_accessors.
11384
11385         * interface.cs (Emit): Apply attributes on the get and set
11386         accessors of properties and indexers too.
11387
11388         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11389         right MethodBuilder when applying attributes to the get and set accessors.
11390
11391 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11392
11393         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11394
11395 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11396
11397         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11398
11399 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11400
11401         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11402         changes that treat `yield' specially when present before `break'
11403         or `return' tokens.
11404
11405         * cs-tokenizer.cs: yield is no longer a keyword.
11406
11407 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11408
11409         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11410         setting for default constructors.
11411         For default constructors are almost every time set wrong Modifier. The
11412         generated IL code has been alright. But inside mcs this values was
11413         wrong and this was reason why several of my CLS Compliance tests
11414         failed.
11415
11416 2004-02-27  Martin Baulig  <martin@ximian.com>
11417
11418         * generics.cs (ConstructedType.ResolveType): Make the nested type
11419         stuff actually work.
11420
11421 2004-02-25  Martin Baulig  <martin@ximian.com>
11422
11423         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11424         property; returns the type parameters just from the current type,
11425         ie. with the ones from outer classes.
11426         (DeclSpace.LookupGeneric): First search in the current class, then
11427         in outer classes.
11428         (DeclSpace.initialize_type_params): When hiding a type parameter
11429         from an outer class, put it into the `type_param_list' anyways.
11430
11431         * expression.cs (MemberAccess.expr): Made this field protected.
11432
11433         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11434         the type parameters from the current class.
11435
11436         * generic.cs (ConstructedType.ResolveType): Support nested generic
11437         types by taking the type parameters which we inherit from outer
11438         classes into account.
11439         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11440         support for nested generic types.
11441
11442 2004-02-23  Martin Baulig  <martin@ximian.com>
11443
11444         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11445         field and check whether we're nested inside a generic type.
11446         (DeclSpace.ResolveType): If we're resolving to a generic type
11447         definition, create a ConstructedType and return its resolved type.
11448         (DeclSpace.initialize_type_params): New private method;
11449         initializes the `type_param_list' field from the type parameters
11450         from this and all enclosing classes.
11451         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11452         we're already initialized.
11453
11454 2004-02-23  Martin Baulig  <martin@ximian.com>
11455
11456         * class.cs (Method.Define): Create the generic method before
11457         calling DoDefine().
11458         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11459         the TypeContainer one); we use this for generic methods.
11460
11461         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11462         parent's TypeBuilder.
11463
11464 2004-02-18  Martin Baulig  <martin@ximian.com>
11465
11466         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11467         to check for equality.
11468
11469 2004-02-05  Martin Baulig  <martin@ximian.com>
11470
11471         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11472         `ec.TypeContainer.CurrentType', use it instead of
11473         `ec.ContainerType' to check whether we're in the type's ctor.
11474
11475 2004-01-29  Martin Baulig  <martin@ximian.com>
11476
11477         * expression.cs (Invocation.DoResolve): If we're a
11478         `ConstructedType', then we're actually a generic method, so
11479         rewrite the expr as a GenericMemberAccess.
11480
11481         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11482         here; manually parse it into a string.
11483
11484 2004-01-28  Martin Baulig  <martin@ximian.com>
11485
11486         * typemanager.cs (TypeManager.IsEqual): New static method.
11487         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11488         check for equality instead of using `=='.
11489
11490 2004-01-26  Martin Baulig  <martin@ximian.com>
11491
11492         * decl.cs (DeclSpace.CurrentType): New public field.
11493
11494         * expression.cs (This.ResolveBase): If we have an
11495         `ec.TypeContainer.CurrentType', use it instead of
11496         `ec.ContainerType'.
11497
11498         * class.cs (TypeContainer.DefineType): If we're a generic type,
11499         create the `CurrentType' (unresolved).
11500         (TypeContainer.GenericType): New private field.
11501         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11502         it and store it in `GenericType' before creating the MemberCache.
11503         (TypeContainer.GetMembers): If we have a `GenericType', call
11504         TypeManager.FindMembers() on it.
11505
11506         * interface.cs (Interface.GenericType): New private field.
11507         (Interface.DefineType): If we're a generic type, create the
11508         `CurrentType' (unresolved).
11509         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11510         and store it in `GenericType' before creating the MemberCache.
11511         (Interface.GetMembers): If we have a `GenericType', call
11512         TypeManager.FindMembers() on it.
11513
11514 2004-01-22  Martin Baulig  <martin@ximian.com>
11515
11516         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11517         not a QualifiedIdentifier.  This is what `type_name_expression'
11518         was previously doing.
11519         (type_name_expression): Removed; the code is now in
11520         `namespace_or_type_name'.
11521         (qualified_identifier): Removed, use `namespace_or_type_name'
11522         instead.
11523         (QualifiedIdentifier): Removed this class.      
11524
11525 2004-01-22  Martin Baulig  <martin@ximian.com>
11526
11527         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11528         not a string as alias name.
11529
11530 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11531
11532         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11533         #52730 bug, and instead compute correctly the need to use a
11534         temporary variable when requesting an address based on the
11535         static/instace modified of the field and the constructor.
11536  
11537 2004-01-21  Martin Baulig  <martin@ximian.com>
11538
11539         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11540         class and namespace before looking up aliases.  Fixes #52517.
11541
11542 2004-01-21  Martin Baulig  <martin@ximian.com>
11543
11544         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11545         assinged in a 'try'; fixes exception4.cs.
11546
11547 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11548         * class.cs : Implemented parameter-less constructor for TypeContainer
11549
11550         * decl.cs: Attributes are now stored here. New property OptAttributes
11551
11552         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11553
11554         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11555
11556 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11557
11558         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11559           (CSharpSignature): New method for indexer and property signature.
11560
11561 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11562
11563         * pending.cs (IsVirtualFilter): Faster implementation.
11564
11565 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11566
11567         * typemanager.cs: Avoid inclusion of same assembly more than once.
11568
11569 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11570
11571         * cs-parser.jay: Fixed problem where the last assembly attribute
11572           has been applied also to following declaration (class, struct, etc.)
11573           
11574 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11575
11576         * class.cs: Added error CS0538, CS0539 reporting.
11577         Fixed crash on Microsoft runtime when field type is void.
11578
11579         * cs-parser.jay: Added error CS0537 reporting.
11580
11581         * pending.cs: Added error CS0535 reporting.
11582         Improved error report for errors CS0536, CS0534.
11583
11584 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11585
11586         Merge a few bits from the Anonymous Method MCS tree.
11587
11588         * statement.cs (ToplevelBlock): New class for toplevel methods,
11589         will hold anonymous methods, lifted variables.
11590
11591         * cs-parser.jay: Create toplevel blocks for delegates and for
11592         regular blocks of code. 
11593
11594 2004-01-20  Martin Baulig  <martin@ximian.com>
11595
11596         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11597         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11598         and `NeedExplicitReturn'; added `IsLastStatement'.
11599         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11600         have a `ReturnLabel' or we're not unreachable.
11601
11602         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11603         child's reachability; don't just override ours with it.  Fixes
11604         #58058 (lluis's example).
11605         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11606         InFinally(), InLoop(), InSwitch() and
11607         BreakCrossesTryCatchBoundary() methods.
11608
11609         * statement.cs (Return): Do all error checking in Resolve().
11610         Unless we are the last statement in a top-level block, always
11611         create a return label and jump to it.
11612         (Break, Continue): Do all error checking in Resolve(); also make
11613         sure we aren't leaving a `finally'.
11614         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11615         statement in a top-level block.
11616         (Block.Flags): Added `IsDestructor'.
11617         (Block.IsDestructor): New public property.
11618
11619 2004-01-20  Martin Baulig  <martin@ximian.com>
11620
11621         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11622
11623 2004-01-20  Martin Baulig  <martin@ximian.com>
11624
11625         * statement.cs (Statement.ResolveUnreachable): New public method.
11626         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11627         (Block.Resolve): Resolve unreachable statements.
11628
11629 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11630
11631         * expression.cs: We need to fix the case where we do
11632         not have a temp variable here.
11633
11634         * assign.cs: Only expression compound assignments need
11635         temporary variables.
11636
11637 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11638
11639         * flowanalysis.cs: Reduce memory allocation in a few ways:
11640           - A block with no variables should not allocate a bit
11641             vector for itself.
11642           - A method with no out parameters does not need any tracking
11643             for assignment of the parameters, so we need not allocate
11644             any data for it.
11645           - The arrays:
11646                 public readonly Type[] VariableTypes;
11647                 public readonly string[] VariableNames;
11648             Are redundant. The data is already stored in the variable
11649             map, so we need not allocate another array for it.
11650           - We need to add alot of checks for if (params | locals) == null
11651             due to the first two changes.
11652
11653 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11654
11655         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11656         implement IMemoryLocation, we store a copy on a local variable and
11657         take the address of it.  Patch from Benjamin Jemlich
11658
11659         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11660         to use a special "type_name_expression" rule which reduces the
11661         number of "QualifiedIdentifier" classes created, and instead
11662         directly creates MemberAccess expressions.
11663
11664 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11665
11666         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11667         that fixes #52853.  Null literal assignment to ValueType
11668
11669         * class.cs (MethodData.Emit): Instead of checking the name of the
11670         method to determine if its a destructor, create a new derived
11671         class from Method called Destructor, and test for that.  
11672
11673         * cs-parser.jay: Create a Destructor object instead of a Method.  
11674
11675         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11676
11677         Fixes: 52933
11678
11679 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11680
11681         * expression.cs (Binary.ResolveOperator): Perform an implicit
11682         conversion from MethodGroups to their delegate types on the
11683         Addition operation.
11684
11685         * delegate.cs: Introduce a new class DelegateCreation that is the
11686         base class for `NewDelegate' and `ImplicitDelegateCreation',
11687         factor some code in here.
11688
11689         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11690         conversion from MethodGroups to compatible delegate types. 
11691
11692         * ecore.cs (Expression.Resolve): Do not flag error 654
11693         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11694         we allow conversions from MethodGroups to delegate types now.
11695
11696         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11697         assignments in v2 either.
11698
11699 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11700
11701         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11702         static read-only fields in ctors.
11703
11704         Applied patch from Benjamin Jemlich 
11705
11706         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11707
11708 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11709
11710         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11711         here to return true, as they can be used like this:
11712
11713                 (XXX) int.MEMBER ()
11714
11715         Fixed 49836 and all the other dups
11716
11717 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11718
11719         * driver.cs: Implement /win32res and /win32icon.
11720
11721 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11722
11723         * cs-parser.jay: Add a rule to improve error handling for the
11724         common mistake of placing modifiers after the type.
11725
11726 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11727
11728         * cs-parser.jay (interface_event_declaration): Catch
11729         initialization of events on interfaces, and report cs0068
11730
11731         * cs-parser.jay (interface_event_declaration): Catch
11732         initialization of events. 
11733
11734         * ecore.cs: Better report missing constructors.
11735
11736         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11737         the error reporting done in the wrong place.  Fix.
11738
11739         * expression.cs (Binary.ResolveOperator): Catch the 
11740         operator + (E x, E y) error earlier, and later allow for implicit
11741         conversions in operator +/- (E e, U x) from U to the underlying
11742         type of E.
11743
11744         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11745         52596, if the container class is abstract, the default constructor
11746         is protected otherwise its public (before, we were always public).
11747
11748         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11749         fixed statement.
11750
11751         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11752         Jemlich that fixes bug #52597, MCS was generating invalid code for
11753         idisposable structs.   Thanks to Ben for following up with this
11754         bug as well.
11755
11756 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11757
11758         * driver.cs: Allow assemblies without code to be generated, fixes
11759         52230.
11760
11761 2004-01-07  Nick Drochak <ndrochak@gol.com>
11762
11763         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11764
11765 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11766
11767         * cs-parser.jay: Add rules to improve error reporting if fields or
11768         methods are declared at the namespace level (error 116)
11769
11770         * Add rules to catch event add/remove
11771
11772 2004-01-04  David Sheldon <dave-mono@earth.li>
11773
11774   * expression.cs: Added matching ")" to error message for 
11775   CS0077
11776
11777 2004-01-03 Todd Berman <tberman@gentoo.org>
11778
11779         * ecore.cs, attribute.cs:
11780         Applying fix from #52429.
11781
11782 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11783
11784         * ecore.cs, expression.cs, statement.cs:
11785         Total rewrite of how we handle branching. We
11786         now handle complex boolean expressions with fewer
11787         jumps. As well if (x == 0) no longer emits a ceq.
11788
11789         if (x is Foo) is much faster now, because we generate
11790         better code.
11791
11792         Overall, we get a pretty big improvement on our benchmark
11793         tests. The code we generate is smaller and more readable.
11794
11795         I did a full two-stage bootstrap. The patch was reviewed
11796         by Martin and Miguel.
11797
11798 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11799
11800         * cs-parser.jay: Make primary_expression not take a QI.
11801         we dont need this because the member_access rule covers
11802         us here. So we replace the rule with just IDENTIFIER.
11803
11804         This has two good effects. First, we remove a s/r conflict.
11805         Second, we allocate many fewer QualifiedIdentifier objects.
11806
11807 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11808
11809         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11810         set the correct information via SRE. This prevents
11811         hanging on the MS runtime. Fixes #29374.
11812
11813 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11814
11815         * convert.cs: correctly handle conversions to value types
11816         from Enum and ValueType as unboxing conversions.
11817
11818         Fixes bug #52569. Patch by Benjamin Jemlich.
11819
11820 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11821
11822         * expression.cs (BetterConversion): Prefer int -> uint
11823         over int -> ulong (csc's behaviour). This fixed bug #52046.
11824
11825 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11826
11827         * decl.cs (MemberCache.FindMembers): now returns a
11828         MemberInfo [].
11829
11830         * typemanager.cs: In general, go with with ^^.
11831         (CopyNewMethods): take an IList.
11832         (RealMemberLookup): Only allocate an arraylist
11833         if we copy from two sets of methods.
11834
11835         This change basically does two things:
11836         1) Fewer array lists allocated due to CopyNewMethods.
11837         2) the explicit cast in MemberList costed ALOT.
11838
11839 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11840
11841         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11842         a hashtable to avoid needless string allocations when an identifier is
11843         used more than once (the common case).
11844
11845 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11846
11847         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11848         is broken, it will not return anything. So, we
11849         have to use the information we have in mcs to
11850         do the task.
11851
11852         * typemanager.cs: Add a cache for GetInterfaces,
11853         since this will now be used more often (due to ^^)
11854
11855         (GetExplicitInterfaces) New method that gets the
11856         declared, not effective, interfaces on a type
11857         builder (eg, if you have interface IFoo, interface
11858         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11859         { IBar }.
11860
11861         This patch makes MCS able to bootstrap itself on
11862         Windows again.
11863
11864 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11865
11866         * expression.cs: Remove the Nop's that Miguel put
11867         in by mistake.
11868
11869 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11870
11871         * report.cs, codegen.cs: Give the real stack trace to
11872         the error when an exception is thrown.
11873
11874 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11875
11876         * decl.cs: only allocate hashtables for ifaces if 
11877         it is an iface!
11878
11879 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11880
11881         * expression.cs: fix the error from cs0121-2.cs
11882         (a parent interface has two child interfaces that
11883         have a function with the same name and 0 params
11884         and the function is called through the parent).
11885
11886 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11887
11888         * class.cs, rootcontext.cs, typmanager.cs: do not
11889         leak pointers.
11890
11891 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11892
11893         * codegen.cs: remove stack for the ec flow branching.
11894         It is already a linked list, so no need.
11895
11896 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11897
11898         * Makefile: Allow custom profiler here.
11899
11900 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11901
11902         * typemanager.cs (LookupType):
11903           - Use a static char [], because split takes
11904             a param array for args, so it was allocating
11905             every time.
11906           - Do not store true in a hashtable, it boxes.
11907
11908 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11909
11910         * flowanalysis.cs: bytify common enums.
11911
11912 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11913
11914         * modifiers.cs: Add a new set of flags for the
11915         flags allowed on explicit interface impls.
11916         * cs-parser.jay: catch the use of modifiers in
11917         interfaces correctly.
11918         * class.cs: catch private void IFoo.Blah ().
11919
11920         All related to bug #50572.
11921
11922 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11923
11924         * decl.cs: Rewrite the consistant accessability checking.
11925         Accessability is not linear, it must be implemented in
11926         a tableish way. Fixes #49704.
11927
11928 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11929
11930         * expression.cs: Handle negation in a checked context.
11931         We must use subtraction from zero. Fixes #38674.
11932
11933 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11934
11935         * class.cs: Ignore static void main in DLLs.
11936         * rootcontext.cs: Handle the target type here,
11937         since we are have to access it from class.cs
11938         * driver.cs: account for the above.
11939
11940 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11941
11942         * report.cs: Give line numbers and files if available.
11943
11944 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11945
11946         * driver.cs: Implement /addmodule.
11947
11948         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11949         ModuleBuilders.
11950
11951 2003-12-20  Martin Baulig  <martin@ximian.com>
11952
11953         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11954         (FieldBase.IsAssigned): Removed this field.
11955         (FieldBase.SetAssigned): New public method.
11956         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11957
11958 2003-12-20  Martin Baulig  <martin@ximian.com>
11959
11960         * expression.cs (LocalVariableReference.DoResolve): Don't set
11961         `vi.Used' if we're called from DoResolveLValue().
11962
11963         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11964         returns the usage vector it just merged into the current one -
11965         pass this one to UsageWarning().
11966         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11967         of the `EmitContext', don't call this recursively on our children.
11968
11969 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11970
11971         * driver.cs: Implement /target:module.
11972
11973 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11974
11975         * support.cs (CharArrayHashtable): New helper class.
11976
11977         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11978         char arrays, not strings, so we can avoid creating a string in
11979         consume_identifier if the identifier is a keyword.
11980
11981 2003-12-16  Martin Baulig  <martin@ximian.com>
11982
11983         * statement.cs (LocalInfo.Assigned): Removed this property.
11984         (LocalInfo.Flags): Removed `Assigned'.
11985         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11986         and uses flow analysis.
11987         (Block.UsageWarning): Made this method private.
11988         (Block.Resolve): Call UsageWarning() if appropriate.
11989
11990         * expression.cs (LocalVariableReference.DoResolve): Always set
11991         LocalInfo.Used here.
11992
11993 2003-12-13  Martin Baulig  <martin@ximian.com>
11994
11995         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11996         any value here; we're now using flow analysis to figure out
11997         whether a statement/block returns a value.
11998
11999 2003-12-13  Martin Baulig  <martin@ximian.com>
12000
12001         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12002         working again.
12003         (FlowBranching.MergeFinally): Don't call
12004         `branching.CheckOutParameters()' here, this is called in
12005         MergeTopBlock().
12006         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12007         when adding the `finally' vector.       
12008
12009 2003-12-13  Martin Baulig  <martin@ximian.com>
12010
12011         * flowanalysis.cs
12012         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12013         actually work and also fix #48962.
12014
12015 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12016
12017         * decl.cs: Do not check System.Object for nested types,
12018         since we know it does not have any. Big bang for buck:
12019
12020         BEFORE:
12021            Run 1:   8.35 seconds
12022            Run 2:   8.32 seconds
12023            corlib:  17.99 seconds
12024         AFTER:
12025            Run 1:   8.17 seconds
12026            Run 2:   8.17 seconds
12027            corlib:  17.39 seconds
12028
12029 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12030
12031         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12032         time we are returning 0 members, so we save alot here.
12033
12034 2003-12-11  Martin Baulig  <martin@ximian.com>
12035
12036         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12037         `MergeChild()', also just take the `FlowBranching' as argument;
12038         call Merge() on it and return the result.
12039         (FlowBranching.Merge): We don't need to do anything if we just
12040         have one sibling.
12041
12042 2003-12-11  Martin Baulig  <martin@ximian.com>
12043
12044         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12045         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12046         Maurer for this idea.
12047
12048 2003-12-11  Martin Baulig  <martin@ximian.com>
12049
12050         * flowanalysis.cs (MergeResult): This class is now gone; we now
12051         use the `UsageVector' for this.  The reason for this is that if a
12052         branching just has one sibling, we don't need to "merge" them at
12053         all - that's the next step to do.
12054         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12055         `MergeResult'.
12056
12057 2003-12-11  Martin Baulig  <martin@ximian.com>
12058
12059         Reworked flow analyis and made it more precise and bug-free.  The
12060         most important change is that we're now using a special `Reachability'
12061         class instead of having "magic" meanings of `FlowReturns'.  I'll
12062         do some more cleanups and optimizations and also add some more
12063         documentation this week.
12064
12065         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12066         largely reworked this class.
12067         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12068         the new `Reachability' class instead of having "magic" values here.
12069         (FlowBranching): We're now using an instance of `Reachability'
12070         instead of having separate `Returns', `Breaks' etc. fields.
12071
12072         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12073         based on flow analysis; ignore the return value of block.Emit ().
12074
12075 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12076
12077         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12078         if they are private.
12079
12080 2003-12-09  Martin Baulig  <martin@ximian.com>
12081
12082         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12083         call them directly on the UsageVector.
12084
12085 2003-12-09  Martin Baulig  <martin@ximian.com>
12086
12087         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12088         Changed return type from `FlowReturns' to `Reachability'.
12089
12090 2003-12-09  Martin Baulig  <martin@ximian.com>
12091
12092         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12093         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12094         `Reachable' fields with a single `Reachability' one.
12095
12096 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12097
12098         * class.cs (FindMembers): Remove foreach's.
12099
12100         Bootstrap times:
12101
12102         BEFORE
12103                 Run 1:   8.74 seconds
12104                 Run 2:   8.71 seconds
12105
12106         AFTER
12107                 Run 1:   8.64 seconds
12108                 Run 2:   8.58 seconds
12109
12110
12111 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12112
12113         * cs-parser.jay:
12114         * gen-treedump.cs:
12115         * statement.cs:
12116         This patch does a few things:
12117                 1. EmptyStatement is now a singleton, so it is never reallocated.
12118                 2. All blah is EmptyStatement constructs have been changed to
12119                    blah == EmptyStatement.Value, which is much faster and valid
12120                    now that EmptyStatement is a singleton.
12121                 3. When resolving a block, rather than allocating a new array for
12122                    the non-empty statements, empty statements are replaced with
12123                    EmptyStatement.Value
12124                 4. Some recursive functions have been made non-recursive.
12125         Mainly the performance impact is from (3), however (1) and (2) are needed for
12126         this to work. (4) does not make a big difference in normal situations, however
12127         it makes the profile look saner.
12128
12129         Bootstrap times:
12130
12131         BEFORE
12132         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12133         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12134         Total memory allocated: 56397 KB
12135
12136         AFTER
12137         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12138         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12139         Total memory allocated: 55666 KB
12140
12141 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12142
12143         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12144         than the hashtable in a hashtable version
12145
12146         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12147         we always end up concating a string. This results in a huge perf
12148         loss, because many strings have to be tracked by the GC. In this
12149         patch, we first use a hashtable that works with two keys, so that
12150         the strings do not need to be concat'ed.
12151
12152         Bootstrap times:
12153         BEFORE
12154                 Run 1:   8.74 seconds
12155                 Run 2:   8.71 seconds
12156
12157         AFTER
12158                 Run 1:   8.65 seconds
12159                 Run 2:   8.56 seconds
12160
12161 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12162
12163         * Makefile: Add a new target `do-time' that does a quick and simple
12164         profile, leaving easy to parse output.
12165
12166 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12167
12168         * codegen.cs (Init): Create the dynamic assembly with 
12169         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12170
12171 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12172
12173         * support.cs: Make the PtrHashtable use only one
12174         instance of its comparer.
12175
12176 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12177
12178         * typemanager.cs: Fix lookup of GetNamespaces.
12179
12180 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12181
12182         * expression.cs: Removed redundant line.
12183
12184         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12185         ArrayLists, use for loops with bounds.  
12186
12187         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12188         arraylist.
12189
12190         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12191         arraylists, use for loop with bounds.
12192
12193         The above three changes give us a 0.071 second performance
12194         improvement out of 3.294 seconds down to 3.223.  On my machine
12195         the above changes reduced the memory usage by 1,387 KB during
12196         compiler bootstrap.
12197
12198         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12199         QualifiedIdentifiers.  Before we created a new string through
12200         concatenation, and mostly later on, the result would be
12201         manipulated by DecomposeQI through string manipulation.
12202
12203         This reduced the compiler memory usage for bootstrapping from
12204         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12205         compile times in 0.05 seconds.
12206
12207 2003-11-28  Dick Porter  <dick@ximian.com>
12208
12209         * support.cs: Do string compares with the Invariant culture.
12210
12211         * rootcontext.cs: 
12212         * gen-treedump.cs: 
12213         * expression.cs: 
12214         * driver.cs: 
12215         * decl.cs: 
12216         * codegen.cs: 
12217         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12218         the comparison is done with the Invariant culture.
12219
12220 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12221
12222         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12223         GetEnumerator method.
12224
12225         (ProbeCollectionType): Iterate starting at the most specific type
12226         upwards looking for a GetEnumerator
12227
12228         * expression.cs: Shift count can be up to 31 for int/uint and 63
12229         for long/ulong.
12230
12231 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12232
12233         * statement.cs (Block.LookupLabel): Also look for the label on the
12234         children blocks.  Use a hash table to keep track of visited
12235         nodes. 
12236
12237         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12238         we actually did transform the other operand, otherwise fall back
12239         to the common codepath that casts to long.
12240
12241         * cs-tokenizer.cs: Use the same code pattern as the int case.
12242         Maybe I should do the parsing myself, and avoid depending on the
12243         Parse routines to get this done.
12244
12245 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12246
12247         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12248         which fixes bug 51347.  This time test it.
12249
12250         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12251         attributes for example can not tell the difference between these.
12252         The difference was only a syntax feature of the language. 
12253
12254         * attribute.cs: Apply attributes to delegates.
12255
12256         * delegate.cs: Call the apply attributes method.
12257
12258 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12259
12260         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12261         comparing 0 vs Byte.MinValue, not the value
12262
12263         (ImplicitConversionRequired): When reporting a conversion error,
12264         use error 31 to print out the constant error instead of the
12265         simpler 29.
12266
12267         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12268         which fixes bug 51347.
12269
12270 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12271
12272         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12273         which fixes the -warnaserror command line option.
12274
12275 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12276
12277         * cfold.cs (DoNumericPromotions): During constant folding of
12278         additions on UIntConstant, special case intconstants with
12279         IntConstants like we do on the expression binary operator. 
12280
12281 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12282
12283         * convert.cs (ImplicitReferenceConversion): We were missing a case
12284         (System.Enum are not value types or class types, so we need to
12285         classify them separatedly).
12286
12287         * driver.cs: We do not support error 2007.
12288
12289 2003-11-12 Jackson Harper <jackson@ximian.com>
12290
12291         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12292         system directory. Also use the full file name so users can
12293         libraries names mscorlib-o-tron.dll in a non system dir.
12294         
12295 2004-01-04  David Sheldon <dave-mono@earth.li>
12296
12297         * expression.cs: Added matching ")" to error message for CS0077.
12298
12299 2003-12-19  Martin Baulig  <martin@ximian.com>
12300
12301         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12302         static method; see documentation in the method.
12303         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12304
12305         * convert.cs (Convert.ImplicitReferenceConversion,
12306         Convert.ImplicitReferenceConversionExists): Add support for
12307         generic type declarations; see gen-36.cs.
12308
12309 2003-12-19  Martin Baulig  <martin@ximian.com>
12310
12311         * pending.cs (Pending.InterfaceMethod): Use
12312         `Type.IsAssignableFrom()' instead of `=='.
12313
12314 2003-12-18  Martin Baulig  <martin@ximian.com>
12315
12316         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12317         byref types first.
12318
12319         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12320         `expr_type.Equals (target_type)' instead of `=='.
12321
12322 2003-12-08  Martin Baulig  <martin@ximian.com>
12323
12324         * generics.cs (Constraints.Types): Removed.
12325         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12326         to Type's.
12327         (Constraints.ResolveTypes): New public method; resolves the
12328         TypeExpr's to Type's.
12329         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12330         longer takes the constraints.
12331         (TypeParameter.DefineMethod): Likewise.
12332         (TypeParameter.DefineType): New public method.  Calls
12333         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12334         the constraints.
12335
12336 2003-12-08  Martin Baulig  <martin@ximian.com>
12337
12338         * convert.cs (Convert.ImplicitConversionStandard): Use
12339         `expr_type.Equals (target_type)' instead of `=='.
12340
12341 2003-12-08  Martin Baulig  <martin@ximian.com>
12342
12343         * typemanager.cs (TypeManager.GetReferenceType): Call
12344         `Type.MakeByRefType ()'.
12345
12346 2003-12-08  Martin Baulig  <martin@ximian.com>
12347
12348         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12349         just has some special meaning in some situations.  For instance,
12350         it is allowed to use `where' as the name of a variable etc.
12351
12352 2003-12-04  Martin Baulig  <martin@ximian.com>
12353
12354         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12355         `Type.MakeArrayType()' for array types.
12356
12357 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12358
12359         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12360         debugging message.
12361
12362         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12363         corlib to compile.
12364
12365 2003-11-16  Martin Baulig  <martin@ximian.com>
12366
12367         * codegen.cs (EmitContext.IsGeneric): Removed.
12368
12369         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12370         ResolveGeneric() on the DeclSpace.
12371
12372 2003-11-16  Martin Baulig  <martin@ximian.com>
12373
12374         * generic.cs (TypeArguments.Resolve):
12375         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12376         `ResolveType()' on it to get the Type.
12377
12378 2003-11-15  Martin Baulig  <martin@ximian.com>
12379
12380         * generic.cs (ConstructedType.GetInterfaces): Override this.
12381
12382 2003-11-14  Martin Baulig  <martin@ximian.com>
12383
12384         * interface.cs (Interface.DefineType): Define all type parameters
12385         before adding the interfaces we inherit.
12386
12387 2003-11-11  Martin Baulig  <martin@ximian.com>
12388
12389         * generic.cs (ConstructedType.ResolveType): Always call
12390         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12391
12392 2003-11-10  Martin Baulig  <martin@ximian.com>
12393
12394         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12395         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12396         calling `ResolveType()' on them, directly assign their `Type'.
12397
12398 2003-11-08  Martin Baulig  <martin@ximian.com>
12399
12400         * generic.cs (ConstructedType): Override `IsClass' etc.
12401
12402 2003-11-08  Martin Baulig  <martin@ximian.com>
12403
12404         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12405         return value and the `out parent' parameter.
12406         (TypeContainer.DefineType): Moved the CS0644 check into
12407         GetClassBases().  Don't pass the interface types to the
12408         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12409         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12410
12411         * ecore.cs (TypeExpr.IsAttribute): New property.
12412         (TypeExpr.GetInterfaces): New method.
12413
12414         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12415         TypeExpr instead of a Type.
12416         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12417         (Interface.DefineType): Don't pass the interface types to the
12418         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12419         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12420
12421         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12422         instead of a `Type[]'.
12423         (TypeManager.RegisterBuilder): Likewise.
12424         (TypeManager.AddUserInterface): Likewise.
12425         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12426         `Type[]' and also return a `TypeExpr[]'.
12427         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12428
12429 2003-11-08  Martin Baulig  <martin@ximian.com>
12430
12431         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12432         Expression.     
12433
12434 2003-11-08  Martin Baulig  <martin@ximian.com>
12435
12436         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12437         TypeManager.ResolveExpressionTypes().
12438
12439         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12440         instead of an Expression.
12441         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12442         (TypeExpression): New public class; formerly known as `TypeExpr'.
12443
12444         * expression.cs (ComposedCast): Derive from TypeExpr.
12445
12446         * typemanager.cs (TypeManager.system_*_expr): These are now
12447         TypExpr's instead of Expression's.
12448         (TypeManager.ResolveExpressionTypes): New public static function;
12449         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12450         of them.        
12451
12452 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * expression.cs (New.DoResolve): Do not dereference value that
12455         might be a null return.
12456
12457         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12458         sure that the constant value has the right type.  Fixes an
12459         unreported bug, similar to 50425.
12460
12461         * const.cs (Const.LookupConstantValue): Call
12462         ImplicitStandardConversionExists before doing a conversion to
12463         avoid havng the TypeManager.ChangeType do conversions.
12464
12465         Reduced the number of casts used
12466
12467         (Const.ChangeType): New routine to enable reuse of the constant
12468         type changing code from statement.
12469
12470         * typemanager.cs (ChangeType): Move common initialization to
12471         static global variables.
12472
12473         Fixes #50425.
12474
12475         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12476         every value type to go through, even if it was void.  Fix that. 
12477
12478         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12479         character of the define, and the is_identifier_part_character for
12480         the rest of the string.
12481
12482 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12483
12484         * expression.cs (UnaryMutator.EmitCode): When I updated
12485         LocalVariableReference.DoResolve, I overdid it, and dropped an
12486         optimization done on local variable references.
12487
12488 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12489
12490         * ecore.cs: Convert the return from Ldlen into an int.
12491
12492 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12493
12494         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12495         the accessibility, this is a special case for toplevel non-public
12496         classes (internal for instance).
12497
12498 2003-10-20  Nick Drochak <ndrochak@gol.com>
12499
12500         * ecore.cs: Fix typo and build.  Needed another right paren.
12501
12502 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12503
12504         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12505         `internal' case regular and protected, but not allowing protected
12506         to be evaluated later.  Bug 49840
12507
12508 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12509
12510         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12511         to kb.Nlast, and not the kb.nFirst to isolate the switch
12512         statement.
12513
12514         Extract the underlying type, so enumerations of long/ulong are
12515         treated like long/ulong.
12516
12517 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12518
12519         * expression.cs (New): Overload the meaning of RequestedType to
12520         track the possible creation of the NewDelegate type, since
12521         DoResolve is invoked more than once for new constructors on field
12522         initialization.
12523
12524         See bugs: #48800 and #37014
12525
12526         * cs-parser.jay (declare_local_constants): Take an arraylist
12527         instead of a single constant.
12528
12529         (local_constant_declaration): It should take a
12530         constant_declarators, not a constant_declarator.  Fixes 49487
12531
12532         * convert.cs: Fix error report.
12533
12534 2003-10-13 Jackson Harper <jackson@ximian.com>
12535
12536         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12537         bug #49611
12538         
12539 2003-11-03  Martin Baulig  <martin@ximian.com>
12540
12541         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12542         `out bool has_type_arg'; if set, we need to pass the type to
12543         ig.Emit().
12544         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12545         Stelem_Any/Ldelem_Any for generic parameters.   
12546
12547 2003-11-02  Martin Baulig  <martin@ximian.com>
12548
12549         * expression.cs (Invocation.EmitCall): Use
12550         `TypeManager.IsValueType()' to check whether it's a value type.
12551         Don't set `struct_call' when calling a method on a type parameter.
12552
12553 2003-11-02  Martin Baulig  <martin@ximian.com>
12554
12555         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12556         and removed the TypeBuilder argument.
12557
12558         * typemanager.cs (TypeManager.IsValueType): Return
12559         `t.IsGenericParameter || t.IsValueType'.
12560
12561 2003-10-25  Martin Baulig  <martin@ximian.com>
12562
12563         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12564         call ConstructedType.Resolve() on it.
12565
12566         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12567
12568 2003-10-25  Martin Baulig  <martin@ximian.com>
12569
12570         * class.cs (TypeContainer.GetClassBases): Changed
12571         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12572         CS8214 reporting here.
12573         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12574         instead of a `Type' for our parent.  In case of a recursive
12575         declaration (see tests/gen-23.cs for an example), our parent is a
12576         ConstructedType and it doesn't have its type set.  So, first
12577         create our own TypeBuilder, then call constructed.Resolve() to get
12578         the parent's type and finally TypeBuilder.SetParent() it.
12579
12580         * ecore.cs (TypeExpr.Name): New public virtual property.
12581
12582         * generic.cs
12583         (ConstructedType): We're now a TypeExpr and not just an Expression.
12584         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12585         arguments here; this is done later.
12586         (ConstructedType.Resolve): New public method to resolve the type
12587         arguments and bind them.
12588
12589 2003-10-21  Martin Baulig  <martin@ximian.com>
12590
12591         * convert.cs: Use `TypeManager.IsValueType' instead of
12592         'type.IsValueType' everywhere.
12593
12594         * typemanager.cs (TypeManager.IsValueType): Return true for type
12595         parameters.  The reason for this is that we need to box a type
12596         parameter when converting it to a reference type.
12597
12598         * cs-parser.jay: Added support for default value expressions.
12599
12600         * generics.cs (DefaultValueExpression): New public class.       
12601
12602 2003-10-17  Martin Baulig  <martin@ximian.com>
12603
12604         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12605         TypeContainer so we can also use this for Interfaces.
12606         (TypeParameter.Resolve): Likewise.
12607
12608         * interface.cs (Interface.DefineType): Added support for generic
12609         interfaces.
12610
12611         * cs-parser.jay: Added support for generic structs and interfaces.
12612
12613 2003-10-17  Martin Baulig  <martin@ximian.com>
12614
12615         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12616         call generic methods :-)
12617
12618 2003-10-16  Martin Baulig  <martin@ximian.com>
12619
12620         * cs-parser.jay (namespace_or_type_name): Only create a
12621         GenericMemberAccess if we actually have type arguments.
12622
12623 2003-10-13  Martin Baulig  <martin@ximian.com>
12624
12625         * class.cs (Method.Define): If we're a generic method, call
12626         TypeBuilder.DefineGenericMethod () before resolving
12627         the parameters.
12628         (MethodData): Added .ctor which takes an additional MethodBuilder
12629         argument; this is used for generic methods.
12630         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12631         we already have a MethodBuilder.
12632
12633 2003-10-10  Martin Baulig  <martin@ximian.com>
12634
12635         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12636         instead of a `DeclSpace'.  This is used for generic methods.
12637
12638         * cs-parser.jay (method_header): Added support for generic
12639         methods; create a `GenericMethod' instance and pass it to the
12640         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12641         parameters and locals.
12642
12643         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12644         since we already have the location.  Check whether we're a generic
12645         type declaration or a generic method and create the correct type
12646         parameter.
12647
12648         * generic.cs (TypeParameter.DefineMethod): New public method.
12649         (GenericMethod): New public class; derives from DeclSpace and is
12650         used for generic methods.       
12651
12652 2003-10-09  Martin Baulig  <martin@ximian.com>
12653
12654         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12655         to the .ctor.
12656         (MethodCore.DoDefineParameters): Removed the TypeContainer
12657         argument; use the DeclSpace which was passed to the .ctor instead.
12658         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12659         TypeContainer; we only need a DeclSpace here.
12660
12661 2003-10-09  Martin Baulig  <martin@ximian.com>
12662
12663         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12664         to the .ctor.
12665         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12666         EmitContext's .ctor.    
12667
12668 2003-10-09  Martin Baulig  <martin@ximian.com>
12669
12670         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12671         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12672         AsAccessible(), moved them as well.
12673
12674         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12675
12676 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12677
12678         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12679         generation for >=, as spotted by Paolo, bug 48679.  
12680         Patch from David Waite.
12681
12682         * cs-tokenizer.cs: Add handling for #pragma.
12683
12684         * cs-parser.jay: Allow for both yield and yield return in the
12685         syntax.  The anti-cobolization of C# fight will go on!
12686
12687         * class.cs (TypeBuilder.DefineType): Catch error condition here
12688         (Parent.DefineType erroring out and returning null).
12689
12690         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12691         coping with enumerations variables, we were mistakenly processing
12692         them as a regular value type instead of built-in types.  Fixes the
12693         bug #48063
12694
12695         * typemanager.cs (IsBuiltinOrEnum): New method.
12696
12697 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12698
12699         * cs-parser.jay: Upgrade: yield now needs the return clause.
12700
12701 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12702
12703         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12704
12705 2003-09-29  Martin Baulig  <martin@ximian.com>
12706
12707         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12708         inflated generic methods.
12709
12710         * generics.cs (ConstructedType): Distinguish between open and
12711         closed constructed types; correctly resolve the arguments.
12712
12713 2003-09-22  Martin Baulig  <martin@ximian.com>
12714
12715         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12716         all type arguments meet their constraints.
12717
12718 2003-09-19  Martin Baulig  <martin@ximian.com>
12719
12720         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12721         `MemberCache parent' argument.  Normally, an interface doesn't
12722         have a parent type except System.Object, but we use this in gmcs
12723         for generic type parameters.
12724
12725 2003-09-18  Martin Baulig  <martin@ximian.com>
12726
12727         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12728         on `type.IsInterface'; don't check whether the type has a parent
12729         to determine whether it's an interface.
12730
12731 2003-09-17  Martin Baulig  <martin@ximian.com>
12732
12733         * generic.cs (ConstructedType.ToString): Always use `name' as the
12734         type name.
12735
12736 2003-09-15  Martin Baulig  <martin@ximian.com>
12737
12738         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12739
12740         * generic.cs (Constraints.Resolve): New public method; this is
12741         called to resolve the constraint types and to check whether all
12742         the constraints are correct.
12743         (Constraints.Types): New public property.
12744         (TypeParameter.Resolve): New public method; resolves all the
12745         type's constraints.
12746
12747         * class.cs (TypeContainer.DefineType): Call
12748         TypeParameter.Resolve() before actually defining the type.
12749
12750 2003-09-15  Martin Baulig  <martin@ximian.com>
12751
12752         * class.cs (TypeContainer.DefineType): Added an error flag to
12753         avoid reporting duplicate CS0146's ("class definition is
12754         circular.").
12755
12756         * driver.cs (Driver.MainDriver): Abort if
12757         RootContext.ResolveTree() reported any errors.
12758
12759 2003-09-07  Martin Baulig  <martin@ximian.com>
12760
12761         * report.cs (Error, Warning): Added overloaded versions which take
12762         a `params object[] args' and call String.Format().
12763
12764 2003-09-07  Martin Baulig  <martin@ximian.com>
12765
12766         * decl.cs (DeclSpace..ctor): Don't call
12767         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12768         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12769         (DeclSpace.RecordDecl): New method.
12770
12771         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12772
12773 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12774
12775         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12776         value attributes to be applied to ParameterBuilders.
12777
12778         * class.cs (MethodCore.LabelParameters): Make static and more
12779         generic so that it can be used from other places - like interface
12780         methods, for instance.
12781
12782         * interface.cs (Interface.Emit): Call LabelParameters before
12783         emitting attributes on the InterfaceMethod.
12784
12785 2003-09-07  Martin Baulig  <martin@ximian.com>
12786
12787         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12788         if the number of type parameters doesn't match.
12789
12790 2003-09-04  Martin Baulig  <martin@ximian.com>
12791
12792         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12793         for arrays of generic type params (ie. `!0[]').
12794
12795 2003-09-04  Martin Baulig  <martin@ximian.com>
12796
12797         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12798         for the moment.
12799
12800 2003-09-04  Martin Baulig  <martin@ximian.com>
12801
12802         * decl.cs (DeclSpace.LookupGeneric): New method.
12803         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12804         moment.
12805
12806         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12807         argument, not just a string.
12808         (TypeParameter.Define): New public method; this is called to
12809         actually define the generic parameter; after this, you can use the
12810         new `Type' property to get the type.
12811
12812 2003-09-04  Martin Baulig  <martin@ximian.com>
12813
12814         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12815         is now an ArrayList; initialize the result of the `TypeParameters'
12816         property here.
12817         (DeclSpace.GetGenericData): Removed.
12818         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12819         implement this in a different way.
12820         (DeclSpace.GetTypeParameters): Removed; there's now a
12821         `TypeParameters' property.
12822         (DeclSpace.TypeParameters): New public property.
12823
12824         * generic.cs (Constraints): Make this class public.
12825         (TypeParameter): New public class.
12826
12827 2003-09-04  Martin Baulig  <martin@ximian.com>
12828
12829         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12830         generic parameters.
12831
12832         * class.cs (TypeContainer.DefineType): Call
12833         TypeBuilder.DefineGenericParameter () on all generic parameters if
12834         this is a generic type.
12835
12836 2003-08-28  Martin Baulig  <martin@ximian.com>
12837
12838         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12839         sample-stack.il".
12840
12841         * sample-hello.cs: Compile this with gmcs: "gmcs
12842         /r:sample-stack.dll sample-hello.cs".
12843
12844 2003-08-28  Martin Baulig  <martin@ximian.com>
12845
12846         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12847         the parameters to the generic type.
12848
12849 2003-08-28  Martin Baulig  <martin@ximian.com>
12850
12851         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12852
12853 2003-08-28  Martin Baulig  <martin@ximian.com>
12854
12855         * cs-parser.jay (opt_type_argument_list): Use
12856         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12857         (primary_expression): Replace `qualified_identifier' with `type_name'.
12858         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12859
12860         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12861         parser to check whether it is syntactically a type parameter list;
12862         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12863         this case.
12864
12865 2003-08-26  Martin Baulig  <martin@ximian.com>
12866
12867         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12868         resolving aliases; fixes #47927.
12869
12870 2003-08-26  Martin Baulig  <martin@ximian.com>
12871
12872         * statement.cs (Using.DoResolve): This is internally emitting a
12873         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12874         do not always return.  Fixes #47681.
12875
12876 2003-08-26  Martin Baulig  <martin@ximian.com>
12877
12878         * decl.cs (MemberCore): Moved WarningNotHiding(),
12879         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12880         into MemberBase.
12881         (AdditionResult): Make this nested in DeclSpace.
12882         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12883         argument; call NamespaceEntry.Define() unless we're nested in a
12884         class or struct.
12885
12886         * namespace.cs (Namespace.DefineName): New public function.  This
12887         is called from DeclSpace's .ctor to add 
12888         (Namespace.Lookup): Include DeclSpaces in the lookup.
12889
12890         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12891
12892         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12893
12894 2003-08-25  Martin Baulig  <martin@ximian.com>
12895
12896         * convert.cs (Convert.ExplicitReferenceConversion): When
12897         converting from an interface type to a class, unbox if the target
12898         type is a struct type.  Fixes #47822.
12899
12900 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12901
12902         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12903         #47854.
12904
12905 2003-08-22  Martin Baulig  <martin@ximian.com>
12906
12907         * class.cs (TypeManager.DefineType): When defining a nested type,
12908         call DefineType() on our parent; fixes #47801.
12909
12910 2003-08-22  Martin Baulig  <martin@ximian.com>
12911
12912         * class.cs (MethodData.Define): While checking if a method is an
12913         interface implementation, improve the test a bit more to fix #47654.
12914
12915 2003-08-22  Martin Baulig  <martin@ximian.com>
12916
12917         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12918         correctly; fixes #47722.
12919
12920 2003-08-22  Martin Baulig  <martin@ximian.com>
12921
12922         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12923         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12924
12925         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12926
12927 2003-08-22  Martin Baulig  <martin@ximian.com>
12928
12929         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12930         can only be assigned in static constructors.  Fixes #47161.
12931
12932 2003-08-22  Martin Baulig  <martin@ximian.com>
12933
12934         Rewrote and improved the flow analysis code.
12935
12936         * flowbranching.cs (FlowBranching): Make this class abstract.
12937         (FlowBranching.CreateBranching): New static function to create a
12938         new flow branching.
12939         (FlowBranchingBlock, FlowBranchingException): New classes.
12940         (FlowBranching.UsageVector.Type): New public readonly field.
12941         (FlowBranching.UsageVector.Breaks): Removed the setter.
12942         (FlowBranching.UsageVector.Returns): Removed the setter.
12943         (FlowBranching.UsageVector): Added Break(), Return(),
12944         NeverReachable() and Throw() methods to modify the reachability.
12945         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12946         done by FlowBranching.Merge().
12947         (FlowBranching.UsageVector.MergeChild): New method; merges the
12948         merge result into the current vector.
12949         (FlowBranching.Merge): New abstract method to merge a branching.
12950
12951 2003-08-12  Martin Baulig  <martin@ximian.com>
12952
12953         * expression.cs (Indirection.CacheTemporaries): Create the
12954         LocalTemporary with the pointer type, not its element type.
12955
12956 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12957
12958         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12959         token was a keyword or not.
12960
12961         Add `error' options where an IDENTIFIER was expected;  Provide
12962         CheckToken and CheckIdentifierToken convenience error reporting
12963         functions. 
12964
12965         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12966
12967         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12968         NameSpaceEntry NameSpaceEntry.
12969
12970         (LookupInterfaceOrClass): Avoid creating a full qualified name
12971         from namespace and name: avoid doing lookups when we know the
12972         namespace is non-existant.   Use new Tree.LookupByNamespace which
12973         looks up DeclSpaces based on their namespace, name pair.
12974
12975         * driver.cs: Provide a new `parser verbose' to display the
12976         exception thrown during parsing.  This is turned off by default
12977         now, so the output of a failure from mcs is more graceful.
12978
12979         * namespace.cs: Track all the namespaces defined in a hashtable
12980         for quick lookup.
12981
12982         (IsNamespace): New method
12983
12984 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12985
12986         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12987         we know that we need to concatenate (full typename can never be
12988         null). 
12989
12990         * class.cs: ditto.
12991
12992         * statement.cs: Use a bitfield;  Do not initialize to null things
12993         which are done by the constructor by default.
12994
12995         * cs-parser.jay: bug fix, parameter was 4, not 3.
12996
12997         * expression.cs: Just use the property;
12998
12999         * statement.cs: No need for GetVariableInfo method.
13000
13001 2003-08-08  Martin Baulig  <martin@ximian.com>
13002
13003         * flowanalysis.cs (FlowReturns): This is now nested in the
13004         `FlowBranching' class.
13005         (MyBitVector): Moved this here from statement.cs.
13006         (FlowBranching.SiblingType): New enum type.
13007         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13008
13009 2003-08-07  Martin Baulig  <martin@ximian.com>
13010
13011         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13012         `FlowBranching' class and called `BranchingType'.
13013
13014 2003-08-07  Martin Baulig  <martin@ximian.com>
13015
13016         * flowanalysis.cs: Moved all the control flow analysis code into
13017         its own file.
13018
13019 2003-08-07  Martin Baulig  <martin@ximian.com>
13020
13021         * assign.cs (Assign.DoResolve): `target' must either be an
13022         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13023         #37319.
13024
13025 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13026
13027         * expression.cs (BinaryMethod): This kind of expression is created by the
13028         Binary class if it determines that the operator has to be handled
13029         by a method.
13030
13031         (BinaryDelegate): This kind of expression is created if we are
13032         dealing with a + or - operator on delegates.
13033
13034         (Binary): remove method, argumetns, and DelegateOperator: when
13035         dealing with methods, 
13036
13037         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13038
13039         * statement.cs (Block): use bitfields for the three extra booleans
13040         we had in use.   Remove unused topblock parameter.
13041
13042         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13043
13044         * assign.cs: Drop extra unneeded tests.
13045
13046 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13047
13048         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13049
13050         * statement.cs (Foreach): Use VariableStorage instead of
13051         LocalBuilders.   
13052
13053         * codegen.cs (VariableStorage): New class used by clients that
13054         require a variable stored: locals or fields for variables that
13055         need to live across yield.
13056
13057         Maybe provide a convenience api for EmitThis+EmitLoad?
13058
13059         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13060         these bad boys.
13061
13062 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13063
13064         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13065         RemapParameterLValue): New methods that are used to turn a
13066         precomputed FieldInfo into an expression like this:
13067
13068                 instance.FieldInfo
13069
13070         The idea is to use this instead of making LocalVariableReference
13071         have more than one meaning.
13072
13073         * cs-parser.jay: Add error production to BASE.
13074
13075         * ecore.cs: Deal with TypeManager.GetField returning null, which
13076         is now a valid return value.
13077
13078         (FieldExprNoAddress): New expression for Fields whose address can
13079         not be taken.
13080
13081         * expression.cs (LocalVariableReference): During the resolve
13082         phases, create new expressions if we are in a remapping context.
13083         Remove code that dealt with remapping here.
13084
13085         (ParameterReference): same.
13086
13087         (ProxyInstance): New expression, like the `This' expression, but
13088         it is born fully resolved.  We know what we are doing, so remove
13089         the errors that are targeted to user-provided uses of `this'.
13090
13091         * statement.cs (Foreach): our variable is now stored as an
13092         Expression;  During resolution, follow the protocol, dont just
13093         assume it will return this.
13094
13095 2003-08-06  Martin Baulig  <martin@ximian.com>
13096
13097         * support.cs (SeekableStreamReader.cs): New public class.
13098
13099         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13100         SeekableStreamReader instead of the normal StreamReader.
13101
13102 2003-08-04  Martin Baulig  <martin@ximian.com>
13103
13104         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13105         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13106         deambiguate casts and delegate invocations.
13107         (parenthesized_expression): Use the new tokens to ensure this is
13108         not a cast of method invocation.
13109
13110         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13111         when reading a `)' and Deambiguate_CloseParens () was previously
13112         called.
13113
13114         * expression.cs (ParenthesizedExpression): New class.  This is
13115         just used for the CS0075 test.
13116         (Binary.DoResolve): Check for CS0075.   
13117
13118 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13119
13120         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13121         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13122         reference comparison.
13123
13124         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13125         examine the ReturnType for equality - this is necessary in the
13126         cases of implicit and explicit operators whose signature also
13127         includes the return type.
13128
13129 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13130
13131         * namespace.cs: Cache the result of the namespace computation,
13132         instead of computing it every time.
13133
13134 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13135
13136         * decl.cs: Use a global arraylist that we reuse over invocations
13137         to avoid excesive memory consumption.  Reduces memory usage on an
13138         mcs compile by one meg (45 average).
13139
13140         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13141         private, work around that.
13142
13143 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13144
13145         * literal.cs (IntLiteral): Define Zero and One static literals. 
13146
13147         * cs-parser.jay (integer_literal): use static literals to reduce
13148         memory usage for the most used literals (0, 1 and -1).  211kb
13149         reduced in memory usage.
13150
13151         Replace all calls to `new ArrayList' with `new
13152         ArrayList(4)' which is a good average number for most allocations,
13153         and also requires only 16 bytes of memory for its buffer by
13154         default. 
13155
13156         This reduced MCS memory usage in seven megabytes for the RSS after
13157         bootstrapping.
13158
13159 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13160
13161         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13162         handle params methods the correct way by forming only one
13163         applicable set with params and normal methods in them. Earlier we
13164         were looking at params methods only if we found no normal methods
13165         which was not the correct thing to do.
13166
13167         (Invocation.BetterFunction): Take separate arguments indicating
13168         when candidate and the best method are params methods in their
13169         expanded form.
13170
13171         This fixes bugs #43367 and #46199.
13172
13173         * attribute.cs: Documentation updates.
13174
13175         (CheckAttribute): Rename to CheckAttributeTarget.
13176         (GetValidPlaces): Rename to GetValidTargets.
13177
13178         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13179         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13180
13181         Fixes bug #44468.
13182
13183 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * codegen.cs: Compute IsGeneric correctly.
13186
13187         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13188         resolution. 
13189
13190         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13191         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13192         regressions, and I was chasing more bugs than I required.
13193
13194         * interface.cs: Use expressions for base type names (like classes
13195         and structs have been doing for a while now), and resolve that.
13196         This patch should probably go into head as well.
13197
13198         This makes it one less user of FindType.
13199
13200 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13201
13202         This compiler can not self host currently.  Need to fix that.
13203         
13204         * Makefile: compile to `gmcs.exe'
13205
13206         * driver.cs: Turn on v2 by default on gmcs.
13207
13208         * generic.cs (ConstructedType): Does no longer take a container
13209         type argument;  That will be taken care of later.
13210
13211         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13212         Use SimpleName to resolve for now, so we can continue the work on
13213         the parser, until we get Type.GetType that understands generics.
13214
13215         (ConstructedType.ToString): Implement
13216
13217         (TypeArguments.Resolve): Resolve the child expressions as types. 
13218         
13219         * cs-parser.jay: Rename interface_constraints to
13220         type_parameter_constraints
13221
13222         (namespace_or_type_name): Only use constructed types for the basic
13223         construction, we will deal with identifier<...> later.
13224
13225         (type/type_name): No longer call DecomposeQI, as
13226         namespace_or_type_name is always decoded now.
13227         
13228 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13229
13230         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13231         closely: we eliminate methods in base types when we have an
13232         applicable method in a top-level type.
13233
13234         Please see section 14.5.5.1 for an exact description of what goes
13235         on. 
13236
13237         This fixes bug #45127 and a host of other related to corlib compilation.
13238
13239         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13240         array is the method corresponding to the top-level type (this is
13241         because of the changes made to icall.c) so we change this
13242         accordingly.
13243
13244         (MethodGroupExpr.Name): This too.
13245
13246         * typemanager.cs (GetElementType): New method which does the right
13247         thing when compiling corlib. 
13248
13249         * everywhere: Make use of the above in the relevant places.
13250
13251 2003-07-22  Martin Baulig  <martin@ximian.com>
13252
13253         * cs-parser.jay (invocation_expression): Moved
13254         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13255         `cast_expression', but create a InvocationOrCast which later
13256         resolves to either an Invocation or a Cast.
13257
13258         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13259         method; call this before EmitStatement() to make sure that this
13260         expression can be used as a statement.
13261
13262         * expression.cs (InvocationOrCast): New class; resolves to either
13263         an Invocation or a Cast.
13264
13265         * statement.cs (StatementExpression): Call ResolveStatement() on
13266         the ExpressionStatement before emitting it.
13267
13268 2003-07-21  Martin Baulig  <martin@ximian.com>
13269
13270         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13271         `ref' and `out' attributes match; fixes #46220.
13272         (MemberAccess.ResolveMemberAccess): You can't reference a type
13273         through an expression; fixes #33180.
13274         (Indexers.GetIndexersForType): Don't return the indexers from
13275         interfaces the class implements; fixes #46502.
13276
13277 2003-07-21  Martin Baulig  <martin@ximian.com>
13278
13279         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13280         CS0661 checks; fixes bug #30442.
13281
13282 2003-07-21  Martin Baulig  <martin@ximian.com>
13283
13284         * decl.cs (AdditionResult): Added `Error'.
13285
13286         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13287
13288         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13289         cs0031.cs actually work.
13290
13291  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13292  
13293         * cs-parser.jay (namespace_name): do not use
13294         namespace_or_type_name, use qualified_identifier, because
13295         namespace_or_type_name will soon return a composed expression
13296         instead of a string.
13297  
13298         (namespace_or_type_name): Instead of returning a string, now this
13299         production returns an expression.
13300  
13301         * codegen.cs (EmitContext): Setup IsGeneric property based on
13302         whether our DeclSpace is generic, our the method is generic.
13303  
13304         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13305         the method is generic.
13306  
13307         * cs-parser.jay (type_arguments, opt_type_argument_list,
13308         type_parameters, type_parameter_list, opt_type_parameter_list,
13309         type_parameter,, opt_type_parameter_constraints_clauses,
13310         type_parameter_constraints_clauses,
13311         type_parameter_constraint_clause, type_parameter_constraint,
13312         interface_constraints): Add new production
13313  
13314         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13315         DeclSpace is generic or not.
13316  
13317         (DeclSpace.SetParameterInfo): New routine, used to set the
13318         parameter info for a type.
13319  
13320         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13321         returns a GenericTypeExpr
13322  
13323         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13324         generic, lookup the generic argument.
13325  
13326         * attribute.cs: Do not allow TypeParameterExpressions in
13327         Attributes.
13328  
13329         * class.cs: Do not allow the Main method to be defined in a
13330         Generic container.
13331  
13332         * expression.cs (SizeOf): Do not allow generic types to be used as
13333         arguments to sizeof.
13334  
13335         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13336         it: whether a type is generic or not.  Only works for types we are
13337         currently building for now.
13338         
13339 2003-07-20  Martin Baulig  <martin@ximian.com>
13340
13341         * namespace.cs: Fixed that bug which caused a crash when compiling
13342         the debugger's GUI.
13343
13344 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * typemanager.cs (LookupTypeReflection): Never expose types which
13347         are NotPublic, NestedPrivate, NestedAssembly, or
13348         NestedFamANDAssem.  We used to return these, and later do a check
13349         that would report a meaningful error, but the problem is that we
13350         would not get the real match, if there was a name override.
13351
13352 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * namespace.cs (Namespace, Name): Do not compute the namespace
13355         name dynamically, compute it in the constructor.  This reduced
13356         memory usage by 1697 KB.
13357
13358         * driver.cs: Use --pause to pause at the end.
13359
13360 2003-07-17  Peter Williams  <peter@newton.cx>
13361
13362         * Makefile: Change the name of the test target so that it doesn't
13363         conflict with the recursive test target.
13364
13365 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13366
13367         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13368         AddressOf): Do not use EmitThis, that was wrong, use the actual
13369         this pointer.
13370
13371 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * class.cs (MethodData.Define): While checking if a method is an
13374         interface implementation, improve the test: If we are not public
13375         (use new test here: use the computed MethodAttributes directly,
13376         instead of the parsed modifier flags) check if the `implementing'
13377         method comes from an interface or not.
13378
13379         * pending.cs (VerifyPendingMethods): Slightly better error
13380         message.
13381
13382         * makefile: add test target that does the mcs bootstrap.
13383
13384 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13385
13386         * interface.cs (Define): Do nothing here since there are no
13387         members to populate etc. Move the attribute emission out of here
13388         since this was just totally the wrong place to put it. Attribute
13389         application happens during the 'Emit' phase, not in the 'Define'
13390         phase.
13391
13392         (Emit): Add this method and move the attribute emission here
13393
13394         * rootcontext.cs (EmitCode): Call the Emit method on interface
13395         types too.
13396
13397 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13398
13399         * expression.cs (OverloadResolve): Report error only if Location
13400         is not 'Null' which means that there was a probe going on.
13401
13402 2003-07-14  Martin Baulig  <martin@ximian.com>
13403
13404         * expression.cs (ConditionalLogicalOperator): New public class to
13405         implement user defined conditional logical operators.
13406         This is section 14.11.2 in the spec and bug #40505.
13407
13408 2003-07-14  Martin Baulig  <martin@ximian.com>
13409
13410         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13411
13412 2003-07-14  Martin Baulig  <martin@ximian.com>
13413
13414         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13415
13416         * ecore.cs (IVariable.VerifyFixed): New interface method.
13417
13418         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13419         operator, check whether the variable is actually fixed.  Fixes bug
13420         #36055.  Set a variable definitely assigned when taking its
13421         address as required by the spec.
13422
13423         * statement.cs (LocalInfo.IsFixed): New field.
13424         (LocalInfo.MakePinned): Set `IsFixed' to true.
13425
13426 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13427
13428         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13429         for .ctors, ensure that we only ask for members declared in the
13430         attribute type (BindingFlags.DeclaredOnly).
13431
13432         Fixes bug #43632.
13433
13434         * expression.cs (Error_WrongNumArguments): Report error 1501
13435         correctly the way CSC does.
13436
13437 2003-07-13  Martin Baulig  <martin@ximian.com>
13438
13439         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13440         lookup on the fully qualified name, to make things like "X.X" work
13441         where "X.X" is a fully qualified type name, but we also have a
13442         namespace "X" in the using list.  Fixes #41975.
13443
13444 2003-07-13  Martin Baulig  <martin@ximian.com>
13445
13446         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13447         function. If we're a CompoundAssign, we need to create an embedded
13448         CompoundAssign, not an embedded Assign.
13449         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13450         Fixes #45854.
13451
13452 2003-07-13  Martin Baulig  <martin@ximian.com>
13453
13454         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13455         work to fix bug #46088.
13456
13457 2003-07-13  Ravi Pratap <ravi@ximian.com>
13458
13459         * class.cs (Operator.Emit): Do not emit attributes here - it is
13460         taken care of by the Method class that we delegate too. This takes
13461         care of bug #45876.
13462
13463 2003-07-10  Martin Baulig  <martin@ximian.com>
13464
13465         * expression.cs (TypeOfVoid): New class.
13466         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13467
13468 2003-07-10  Martin Baulig  <martin@ximian.com>
13469
13470         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13471         bug #35957.
13472
13473 2003-07-10  Martin Baulig  <martin@ximian.com>
13474
13475         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13476         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13477
13478         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13479
13480         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13481
13482 2003-07-10  Martin Baulig  <martin@ximian.com>
13483
13484         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13485         of decimal.  Fixes #42850.
13486
13487         NOTE: I also fixed the created byte blob, but this doesn't work on
13488         the MS runtime and csc never produces any byte blobs for decimal
13489         arrays.
13490
13491 2003-07-10  Martin Baulig  <martin@ximian.com>
13492
13493         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13494         structs; fixes #32068.
13495         (Block.AddChildVariableNames): Fixed #44302.
13496
13497 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13498
13499         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13500
13501 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13502
13503         * attribute.cs: And this test is onger needed.
13504
13505 2003-07-08  Martin Baulig  <martin@ximian.com>
13506
13507         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13508         inaccessible types.  Fixes #36313.
13509
13510         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13511
13512         * namespace.cs (NamespaceEntry): Create implicit entries for all
13513         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13514         implicit entries for N1.N2 and N1.
13515
13516 2003-07-08  Martin Baulig  <martin@ximian.com>
13517
13518         Rewrote the handling of namespaces to fix a lot of the issues
13519         wrt. `using' aliases etc.
13520
13521         * namespace.cs (Namespace): Splitted this class into a
13522         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13523
13524         * typemanager.cs (TypeManager.IsNamespace): Removed.
13525         (TypeManager.ComputeNamespaces): Only compute namespaces from
13526         loaded assemblies here, not the namespaces from the assembly we're
13527         currently compiling.
13528
13529 2003-07-08  Martin Baulig  <martin@ximian.com>
13530
13531         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13532
13533 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13534
13535         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13536         already fixed it.  
13537
13538         I thought about the memory savings here, but LookupTypeReflection
13539         is used under already very constrained scenarios.  Compiling
13540         corlib or mcs only exposes one hit, so it would not really reduce
13541         any memory consumption.
13542
13543 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13544
13545         * typemanager.cs: fixes bug #45889 by only adding public types from
13546         other assemblies to the list of known types.
13547
13548 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13549
13550         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13551         on the type we resolved.
13552
13553 2003-07-05  Martin Baulig  <martin@ximian.com>
13554
13555         * pending.cs (PendingImplementation.ParentImplements): Don't
13556         create the proxy if the parent is abstract.
13557
13558         * class.cs (TypeContainer.DefineIndexers): Process explicit
13559         interface implementations first.  Fixes #37714.
13560
13561 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13562
13563         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13564         defined recursively;  but since we modify the input parameters
13565         (left is set to `this' temporarily), we reset this value if the
13566         left_is_explicit is false, which gives the original semantics to
13567         the code.  
13568
13569         * literal.cs (NullPointer): new class used to represent a null
13570         literal in a pointer context.
13571
13572         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13573         type is a pointer, use a NullPointer object instead of a
13574         NullLiteral.   Closes 43687
13575
13576         (ExplicitConversion): Convert pointer values using
13577         the conv opcode to the proper type.
13578
13579         * ecore.cs (New): change ValueTypeVariable property into a method,
13580         that returns whether the valuetype is suitable for being used.
13581
13582         * expression.cs (Binary.DoNumericPromotions): Only return if we
13583         the int constant was a valid uint, and we can return both left and
13584         right as uints.  If not, we continue processing, to trigger the
13585         type conversion.  This fixes 39018.
13586
13587         * statement.cs (Block.EmitMeta): During constant resolution, set
13588         the CurrentBlock property on the emitcontext, so that we resolve
13589         constants propertly.
13590
13591 2003-07-02  Martin Baulig  <martin@ximian.com>
13592
13593         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13594         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13595
13596         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13597         than emitting it here.
13598
13599         * statement.cs: Fixed some more flow analysis bugs.
13600
13601 2003-07-02  Martin Baulig  <martin@ximian.com>
13602
13603         * class.cs (MethodData.Define): When implementing interface
13604         methods, set Final unless we're Virtual.
13605
13606         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13607         check work for interface methods.
13608
13609 2003-07-01  Martin Baulig  <martin@ximian.com>
13610
13611         * ecore.cs (EmitContext.This): Replaced this property with a
13612         GetThis() method which takes a Location argument.  This ensures
13613         that we get the correct error location for a CS0188.
13614
13615 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13616
13617         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13618         ImplicitStandardConversion.
13619
13620         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13621
13622 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13623
13624         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13625         optimization.
13626
13627 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13628
13629         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13630         constructors.
13631
13632         (MethodData.Define): Turn off initlocals for unsafe methods.
13633
13634 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13635
13636         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13637         complete;  Fixes #37521.
13638
13639         * delegate.cs: Use Modifiers.TypeAttr to compute the
13640         TypeAttributes, instead of rolling our own.  This makes the flags
13641         correct for the delegates.
13642
13643 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13644
13645         * class.cs (Constructor.Define): Set the private flag for static
13646         constructors as well.
13647
13648         * cs-parser.jay (statement_expression): Set the return value to
13649         null, to avoid a crash when we catch an error.
13650
13651 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13652
13653         * cs-parser.jay: Applied patch from Jackson that adds support for
13654         extern and unsafe modifiers to destructor declarations.
13655
13656         * expression.cs: Report error 21 if the user is trying to index a
13657         System.Array.
13658
13659         * driver.cs: Add an error message, suggested by the bug report.
13660
13661         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13662         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13663
13664 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13665
13666         * namespace.cs: Add some information to reduce FAQs.
13667
13668 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13669
13670         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13671         underlying enumeration types.  Fixes #43915.
13672
13673         * expression.cs: Treat ushort/short as legal values to be used in
13674         bitwise operations.
13675
13676 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13677
13678         * delegate.cs: transfer custom attributes for paramenters from
13679         the delegate declaration to Invoke and BeginInvoke.
13680
13681 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13682
13683         * attribute.cs: handle custom marshalers and emit marshal info
13684         for fields, too.
13685
13686 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13687
13688         * makefile.gnu: Added anonymous.cs to the compiler sources.
13689
13690 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13691
13692         * iterators.cs: Change the name of the proxy class to include two
13693         underscores.
13694
13695         * cs-parser.jay: Update grammar to include anonymous methods.
13696
13697         * anonymous.cs: new file.
13698
13699 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13700
13701         * class.cs (Field.Define): Add missing test for pointers and
13702         safety. 
13703
13704 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13705
13706         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13707         we use the stobj opcode.
13708
13709         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13710         since it wasn't the correct fix. 
13711
13712         It still is puzzling that we are required to use stobj for IntPtr
13713         which seems to be a ValueType.
13714
13715 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13716
13717         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13718         during regular simple name resolution.   Now, the trick is that
13719         instead of returning for processing the simplename, we do a
13720         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13721         contextual lookup type).   If a match is found, return that, if
13722         not, return for further composition.
13723
13724         This fixes long-standing 30485.
13725
13726         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13727         using the address to initialize an object, do an Stobj instead of
13728         using the regular Stelem.
13729
13730         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13731         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13732         Because if we are a BaseIndexerAccess that value will be true.
13733         Fixes 43643.
13734
13735         * statement.cs (GotoCase.Resolve): Return after reporting an
13736         error, do not attempt to continue. 
13737
13738         * expression.cs (PointerArithmetic.Emit): If our operand is a
13739         long, convert our constants to match the operand before
13740         multiplying.  Convert to I type before adding.   Fixes 43670.
13741
13742 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13743
13744         * enum.cs (ImplicitConversionExists) : Rename to
13745         ImplicitEnumConversionExists to remove ambiguity. 
13746
13747         * ecore.cs (NullCast): New type of cast expression class which
13748         basically is very similar to EmptyCast with the difference being
13749         it still is a constant since it is used only to cast a null to
13750         something else
13751         (eg. (string) null)
13752
13753         * convert.cs (ImplicitReferenceConversion): When casting a null
13754         literal, we return a NullCast.
13755
13756         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13757         should be around anymore.
13758
13759         The renaming (reported was slightly wrong). Corrections:
13760
13761         ConvertImplicitStandard -> ImplicitConversionStandard
13762         ConvertExplicitStandard -> ExplicitConversionStandard
13763
13764         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13765         before passing them in !
13766
13767         * convert.cs (ImplicitConversionStandard): When comparing for
13768         equal expr and target types, ensure that expr is not a
13769         NullLiteral.
13770
13771         In general, we must not be checking (expr_type ==
13772         target_type) in the top level conversion methods
13773         (ImplicitConversion, ExplicitConversion etc). This checking is
13774         done in the methods that they delegate to.
13775
13776 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * convert.cs: Move Error_CannotConvertType,
13779         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13780         ImplicitNumericConversion, ImplicitConversionExists,
13781         ImplicitUserConversionExists, StandardConversionExists,
13782         FindMostEncompassedType, FindMostSpecificSource,
13783         FindMostSpecificTarget, ImplicitUserConversion,
13784         ExplicitUserConversion, GetConversionOperators,
13785         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13786         TryImplicitIntConversion, Error_CannotConvertImplicit,
13787         ConvertImplicitRequired, ConvertNumericExplicit,
13788         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13789         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13790         its own file.
13791
13792         Perform the following renames:
13793
13794         StandardConversionExists -> ImplicitStandardConversionExists
13795         ConvertImplicit -> ImplicitConversion
13796         ConvertImplicitStandard -> ImplicitStandardConversion
13797         TryImplicitIntConversion -> ImplicitIntConversion
13798         ConvertImplicitRequired -> ImplicitConversionRequired
13799         ConvertNumericExplicit -> ExplicitNumericConversion
13800         ConvertReferenceExplicit -> ExplicitReferenceConversion
13801         ConvertExplicit -> ExplicitConversion
13802         ConvertExplicitStandard -> ExplicitStandardConversion
13803
13804 2003-05-19  Martin Baulig  <martin@ximian.com>
13805
13806         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13807         (TypeInfo): Added support for structs having structs as fields.
13808
13809         * ecore.cs (FieldExpr): Implement IVariable.
13810         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13811         VariableInfo for the field.
13812
13813 2003-05-18  Martin Baulig  <martin@ximian.com>
13814
13815         * expression.cs (This.DoResolve): Report a CS0027 if we're
13816         emitting a field initializer.
13817
13818 2003-05-18  Martin Baulig  <martin@ximian.com>
13819
13820         * expression.cs (This.ResolveBase): New public function.
13821         (This.DoResolve): Check for CS0188.
13822
13823         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13824         This.Resolve().
13825
13826         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13827         `instance_expression' to null if we don't have any non-static
13828         methods.
13829
13830 2003-05-18  Martin Baulig  <martin@ximian.com>
13831
13832         Reworked the way how local variables and parameters are handled by
13833         the flow analysis code.
13834
13835         * statement.cs (TypeInfo, VariableMap): New public classes.
13836         (VariableInfo): New public class.  This is now responsible for
13837         checking whether a variable has been assigned.  It is used for
13838         parameters and local variables.
13839         (Block.EmitMeta): Take the InternalParameters as argument; compute
13840         the layout of the flow vectors here.
13841         (Block.LocalMap, Block.ParameterMap): New public properties.
13842         (FlowBranching): The .ctor doesn't get the InternalParameters
13843         anymore since Block.EmitMeta() now computes the layout of the flow
13844         vector.
13845         (MyStructInfo): This class is now known as `StructInfo' and nested
13846         in `TypeInfo'; we don't access this directly anymore.
13847
13848         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13849         property and removed IsAssigned(), IsFieldAssigned(),
13850         SetAssigned() and SetFieldAssigned(); we now call them on the
13851         VariableInfo so we don't need to duplicate this code everywhere.
13852
13853         * expression.cs (ParameterReference): Added `Block block' argument
13854         to the .ctor.
13855         (LocalVariableReference, ParameterReference, This): The new
13856         VariableInfo class is now responsible for all the definite
13857         assignment stuff.
13858
13859         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13860         IsParameterAssigned, SetParameterAssigned): Removed.
13861
13862 2003-05-18  Martin Baulig  <martin@ximian.com>
13863
13864         * typemanager.cs (InitCoreTypes): Try calling
13865         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13866         the 3-args-version.  Corlib now also needs our `void_type'.
13867         (GetMethod): Added overloaded version which takes an optional
13868         `bool report_errors' to allow lookups of optional methods.
13869
13870 2003-05-12  Martin Baulig  <martin@ximian.com>
13871
13872         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13873         only used for locals and not for parameters.
13874
13875 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13876
13877         * support.cs (InternalParameters.ParameterType): Return the
13878         ExternalType of the parameter.
13879
13880         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13881         they were unused.
13882
13883 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13884
13885         * class.cs (MethodData.Define): Do not set the `newslot' on
13886         interface members, if they are also flagged as "override".
13887
13888         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13889         better code for ++i and i++.  This only works for static fields
13890         and local variables.
13891
13892         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13893         want to pull the DeclSpace out of the builder_to_declspace instead
13894         of the TypeBuilder (like in TypeContainer.FindMembers).
13895
13896         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13897         instead of LookupTypeContainer.  Fixes the crash on .NET for
13898         looking up interface members.
13899
13900         * const.cs: Create our own emit context during the Definition
13901         stage, so that constants are evaluated in the proper context, when
13902         a recursive definition happens.
13903
13904 2003-05-11  Martin Baulig  <martin@ximian.com>
13905
13906         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13907         new block for a switch section.
13908         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13909         the adding/lookup in the switch block.  Fixes #39828.
13910
13911 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13914         functionality: I needed to convert the data after I had performed
13915         the add/sub operation into the operands type size.
13916
13917         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13918         pass the type for the box operation, otherwise the resulting
13919         object would have been of type object.
13920
13921         (BoxedCast): Add constructor to specify the type to box as.
13922
13923 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13924
13925         * iterators.cs: I was reusing the `count' variable inadvertently,
13926         take steps to not allow this to happen.
13927
13928 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13929
13930         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13931         by creating an array at the point where the params starts and
13932         putting all those arguments there, then adjusting the size of the
13933         array.
13934
13935 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13936
13937         * expression.cs (New.AddressOf): Implement interface
13938         IMemoryLocation.  This is used when the `new' operator is used in
13939         the context of an invocation to a method on a value type.
13940
13941         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13942         example. 
13943
13944         * namespace.cs: Also check the using aliases here.
13945
13946         * driver.cs: Move the test for using validity after the types have
13947         been entered, so we do a single pass that also includes the using
13948         aliases. 
13949
13950         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13951         in the regular case.   CreateSiblingForFinally is doing extra
13952         error checking.
13953
13954         * attribute.cs (GetAttributeArgumentExpression): Store the result
13955         on an out value, and use the return value to indicate failure
13956         instead of using null (which is a valid return for Constant.GetValue).
13957
13958         * statement.cs: Perform the analysis flow for the increment
13959         portion after the statement, because this will be the real flow of
13960         execution.  Fixes #42385
13961
13962         * codegen.cs (EmitContext.EmitArgument,
13963         EmitContext.EmitStoreArgument): New helper functions when the
13964         RemapToProxy flag is set.
13965
13966         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13967         function.
13968
13969         Add support for remapping parameters. 
13970
13971         * iterators.cs: Propagate parameter values;  Store parameter
13972         values in the proxy classes.
13973
13974 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13977         need a proxy reference;  I do not know what I was thinking
13978
13979         * cs-parser.jay (constructor_initializer): catch another error,
13980         and display nice message.
13981
13982         (field_declaration): catch void field declaration
13983         to flag a better error. 
13984
13985         * class.cs (MemberBase.CheckBase): Report an error instead of a
13986         warning if a new protected member is declared in a struct. 
13987         (Field.Define): catch the error of readonly/volatile.
13988
13989         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13990
13991         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13992         volatile variable is taken
13993
13994 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13995
13996         * statement.cs (Fixed.Resolve): Report an error if we are not in
13997         an unsafe context.
13998
13999 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14000
14001         * typemanager.cs: reuse the code that handles type clashes for
14002         delegates and enumerations.
14003
14004         * class.cs (Report28): Always report.
14005
14006         * expression.cs (EncodeAsAttribute): Allow nulls here.
14007
14008 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14009
14010         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14011         the functionality for testing whether an expression is valid for
14012         an attribute here.  Also handle the case of arrays of elements
14013         being stored. 
14014
14015         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14016         encoding a linear array into an array of objects that are suitable
14017         to be passed to an CustomAttributeBuilder.
14018
14019         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14020
14021         * ecore.cs: (FieldExpr): Handle field remapping here.
14022
14023         * iteratators.cs: Pass the instance variable (if the method is an
14024         instance method) to the constructors, so we can access the field
14025         variables on the class.
14026
14027         TODO: Test this with structs.  I think the THIS variable on
14028         structs might have to be a pointer, and not a refenrece
14029
14030 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14031
14032         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14033         local variables to fields in a proxy class.
14034
14035         * iterators.cs (PopulateProxy): Rename our internal fields to
14036         <XXX>.  
14037         Create a <THIS> field if we are an instance method, so we can
14038         reference our parent container variables.
14039         (MapVariable): Called back from the EmitContext code to enter a
14040         new variable to field mapping into the proxy class (we just create
14041         a FieldBuilder).
14042
14043         * expression.cs
14044         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14045         for using the remapped locals to fields.
14046
14047         I placed the code here, because that gives the same semantics to
14048         local variables, and only changes the Emit code.
14049
14050         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14051         statements inside iterators.
14052         (VariableInfo): Add a FieldBuilder for the cases when we are
14053         remapping local variables to fields in a proxy class
14054
14055         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14056         current_block != null.
14057
14058         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14059         not cope with strings, as it has been moved to the
14060         TableSwitchEmit.  Fixed bug in switch generation.
14061
14062         * expression.cs (New.DoResolve): Provide more context for the user
14063         when reporting an error.
14064
14065         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14066         pointers. 
14067
14068         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14069         check the permissions for it.  Note than in a type-resolution
14070         context the check was already present in DeclSpace.ResolveType,
14071         but was missing from the MemberAccess.
14072
14073         (ArrayCreation.CheckIndices): warn if the user has
14074         more nested levels of expressions, but there are no more
14075         dimensions specified.  Avoids crash on bug 41906.
14076
14077 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14078
14079         * statement.cs (Block): replace Implicit bool, for a generic
14080         flags.   
14081         New flag: `Unchecked'.  This is used during the EmitMeta phase
14082         (which is out-of-line with the regular Resolve/Emit process for a
14083         statement, as this is done ahead of time, but still gets a chance
14084         to call constant resolve).
14085
14086         (Block.Flags): new enum for adding a new flag.
14087
14088         (Block.EmitMeta): track the state of unchecked.
14089
14090         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14091         to enable constant resolution to work there as well.
14092
14093 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * typemanager.cs (ienumerable_type): Also look up
14096         System.Collections.IEnumerable. 
14097
14098 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14099
14100         TODO: Test more than one conditional per method.
14101
14102         * class.cs (Indexer.Define): Report the location where the user is
14103         referencing the unsupported feature.
14104
14105         (MethodData): Overload the use of `conditionals' to
14106         minimize the creation of needless ArrayLists.   This saves roughly
14107         212kb on my machine.
14108
14109         (Method): Implement the new IIteratorContainer interface.
14110         (Method.SetYields): Implement the method by setting the ModFlags
14111         to contain METHOD_YIELDS.
14112
14113         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14114         which just got set to null.
14115
14116         * iterators.cs: New file.
14117
14118         (Yield, YieldBreak): New statements.
14119
14120         * statement.cs (Return.Resolve): Flag an error if we are used in
14121         an iterator method.
14122
14123         * codegen.cs (InIterator): New flag set if the code is being
14124         compiled in an iterator method.
14125
14126         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14127         internal modifier, and we just use it to avoid adding extra
14128         fields, as this is seldom used.  
14129
14130         * cs-parser.jay: Add yield_statement (yield and yield break).
14131
14132         * driver.cs: New flag -v2 to turn on version 2 features. 
14133
14134         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14135         hashtable when v2 is enabled.
14136
14137 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14140         there is already a namespace defined with this name.
14141
14142         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14143         people upgraded their corlibs.
14144
14145         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14146         always use fully qualified types, no need to use the compiler
14147         front end.
14148
14149         (TypeManager.IsNamespace): Use binarysearch.
14150
14151         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14152         AddDelegate): I did not quite use the new IsValid API properly: I
14153         have to pass the short-name and the fullname.  I was passing only
14154         the basename instead of the fullname sometimes. 
14155
14156         (TypeContainer.DefineType): call NamespaceClash.
14157
14158         * interface.cs (Interface.DefineType): use NamespaceClash before
14159         defining the type.
14160
14161         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14162         defining the type.
14163
14164         * enum.cs: (Enum.DefineType): use NamespaceClash before
14165         defining the type.
14166
14167         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14168         speed increase.  First, use the negative_hits cache when we get a
14169         negative.  Second, add the type with its full original name
14170         instead of the new . and + encoded name (reflection uses + to
14171         separate type from a nested type).  Use LookupTypeReflection
14172         directly which bypasses the type->name hashtable (that we already
14173         know does not contain the type.
14174
14175         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14176         location/container type. 
14177
14178         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14179
14180 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14183
14184         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14185         method is being referenced in the method group from a static
14186         context, and report error 120 if so.
14187
14188         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14189         Error118. 
14190
14191         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14192         is created, we create the A namespace).
14193
14194         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14195         Fixes #41591
14196
14197 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14198
14199         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14200         invocation to ModuleBuilder.GetType with the same values will
14201         return a new type instance, so we need to cache its return
14202         values. 
14203
14204         * expression.cs (Binary.ResolveOperator): Only allow the compare
14205         operators on enums if they are of the same type.
14206
14207         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14208         types of ValueType on their own case.  Before we were giving them
14209         the same treatment as objects.
14210
14211         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14212         fullname.  Short name is used to compare against container name.
14213         Fullname is used to check against defined namespace names.
14214
14215         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14216         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14217
14218         (Method.CheckBase): Call parent.
14219         (MemberBase.CheckBase): Check for protected members on sealed
14220         classes.
14221         (PropertyBase.CheckBase): Call parent.
14222         (Field.Define): Call parent.
14223
14224         * report.cs: Negative error codes are now mapped to 8000 - code,
14225         so that the display is render more nicely.
14226
14227         * typemanager.cs: Do not use try/catch, instead report a regular
14228         error. 
14229
14230         (GetPointerType, GetReferenceType): These methods provide
14231         mechanisms to obtain the T* and T& from a T.  We had the code
14232         previously scattered around the code base, and it also used
14233         TypeManager.LookupType that would go through plenty of caches.
14234         This one goes directly to the type source.
14235
14236         In some places we did the Type.GetType followed by
14237         ModuleBuilder.GetType, but not in others, so this unifies the
14238         processing as well.
14239
14240         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14241         statements now that we have namespace information.
14242
14243         * typemanager.cs (IsNamespace): New method, returns whether the
14244         string presented is a namespace or not.
14245
14246         (ComputeNamespaces): New public entry point, computes the list of
14247         available namespaces, using the GetNamespaces API call in Mono, or
14248         the slower version in MS.NET.   
14249
14250         Now before we start the semantic analysis phase, we have a
14251         complete list of namespaces including everything that the user has
14252         provided.
14253
14254         Deleted old code to cache namespaces in .nsc files.
14255
14256 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14257
14258         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14259         class/struct location definition Location for the implicit
14260         constructor location.
14261
14262         (Operator.Define): Use the location of the operator for the
14263         implicit Method definition.
14264
14265         (Constructor.Emit): use the constructor location for the implicit
14266         base initializer constructor.
14267
14268         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14269         and the Expression class now contains two new methods:
14270
14271         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14272         isolate type lookup from the rest of the resolution process.
14273
14274         Since we use Expressions to hold type definitions due to the way
14275         we parse the input we have historically overloaded Resolve to
14276         perform the Type lookups if a special flag is passed.  Now this is
14277         eliminated and two methods take their place. 
14278
14279         The differences in the two methods between xStep and xTerminal is
14280         that xStep is involved in our current lookup system that uses
14281         SimpleNames to compose a name, while xTerminal is used just to
14282         catch the case where the simplename lookup failed.
14283
14284 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14285
14286         * expression.cs (ResolveMemberAccess): Remove redundant code.
14287         TypeExpr expressions are always born fully resolved.
14288
14289         * interface.cs (PopulateMethod): Do not lookup the types twice.
14290         We were doing it once during SemanticAnalysis and once during
14291         PopulateMethod.
14292
14293         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14294         in local variable type definitions, were being returned as a
14295         SimpleName (we decomposed everything into a string), that is
14296         because primary_expression was being used instead of a type in the
14297         grammar (reduce/reduce conflicts).
14298
14299         The part that was wrong is that we converted the expression into a
14300         string (an oversimplification in one hand, compounded with primary
14301         expressions doing string concatenation).
14302
14303         So things like:
14304
14305         A.B.C [] x;
14306
14307         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14308         using clauses from working on this particular context.  And a type
14309         was being matched directly against "A.B.C[]".
14310
14311         We now use the correct approach, and allow for ComposedCast to be
14312         part of the unary expression.  So the "A.B.C []" become a composed
14313         cast of "A.B.C" (as a nested group of MemberAccess with a
14314         SimpleName at the end) plus the rank composition "[]". 
14315
14316         Also fixes 35567
14317
14318 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14321         for the access level checking.
14322
14323         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14324         `TypeContainer container', because I kept getting confused when I
14325         was debugging this code.
14326
14327         * expression.cs (Indexers): Instead of tracking getters/setters,
14328         we now track them in parallel.  We create one arraylist less, but
14329         most importantly it is possible now for the LValue code to find a
14330         matching get for a set.
14331
14332         (IndexerAccess.DoResolveLValue): Update the code.
14333         GetIndexersForType has been modified already to extract all the
14334         indexers from a type.  The code assumed it did not.
14335
14336         Also make the code set the correct return type for the indexer.
14337         This was fixed a long time ago for properties, but was missing for
14338         indexers.  It used to be void_type.
14339
14340         (Binary.Emit): Test first for doubles instead of
14341         floats, as they are more common.
14342
14343         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14344         when dealing with floats and the <=, >= operators.  This fixes bug
14345         #39314 
14346
14347         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14348         to load the array value by emitting a load on the foreach variable
14349         type.  This was incorrect.  
14350
14351         We now emit the code to load an element using the the array
14352         variable type, and then we emit the conversion operator.
14353
14354         Fixed #40176
14355
14356 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14357
14358         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14359
14360 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14361
14362         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14363         test for protection before we test for signatures. 
14364
14365         (MethodSignature.ToString): implement.
14366
14367         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14368         to the case where we reduced into a LongConstant.
14369
14370         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14371         depend on whether the information is acurrate, because the
14372         Microsoft runtime will always claim that the array type is public,
14373         regardless of the real state.
14374
14375         If the type is a pointer, another problem happens: the type is
14376         reported as non-public in Microsoft.  
14377
14378         In both cases we have to call CheckAccessLevel recursively with
14379         the underlying type as the argument to be tested.
14380
14381 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14382
14383         * assign.cs (Assign.Emit): If we are dealing with a compound
14384         assignment expression, we should use the code path that stores the
14385         intermediate result in a temporary value.  This fixes #40903.
14386
14387         *expression.cs (Indirection.ToString): Provide ToString method for
14388         debugging. 
14389
14390 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14391
14392         * class.cs: Null out fields holding references to Block objects so
14393         they can be garbage collected.
14394
14395         * expression.cs (OverloadResolve): Remove unused local.
14396
14397 2003-04-07  Martin Baulig  <martin@ximian.com>
14398
14399         * codegen.cs (EmitContext.CurrentFile): New public field.
14400         (EmitContext.Mark): Use the CurrentFile to check whether the
14401         location is in the correct file.
14402         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14403
14404 2003-04-07  Martin Baulig  <martin@ximian.com>
14405
14406         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14407
14408         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14409         location.  [FIXME: The location argument which gets passed to this
14410         method is sometimes wrong!]
14411
14412 2003-04-07  Nick Drochak <ndrochak@gol.com>
14413
14414         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14415
14416 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14417
14418         * expression.cs (Indirection.EmitAssign): We were using the
14419         temporary, but returning immediately instead of continuing the
14420         EmitAssing flow.
14421
14422 2003-04-06  Martin Baulig  <martin@ximian.com>
14423
14424         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14425         if it's a nested child, but also deriving from the outer class.
14426         See test 190.cs.
14427
14428         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14429         nested child, but also deriving from the outer class.  See
14430         test-190.cs.
14431         (FilterWithClosure): We may access private members of the outer
14432         class if we're a nested child and deriving from the outer class.
14433         (RealMemberLookup): Only set `closure_private_ok' if the
14434         `original_bf' contained BindingFlags.NonPublic.
14435
14436 2003-04-05  Martin Baulig  <martin@ximian.com>
14437
14438         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14439         probe if its a type parameter, and if so, flag an error.
14440
14441         * decl.cs: Move here the SetParameterInfo code from class.cs.
14442         Handle IsGeneric here.
14443
14444         Handle a variety of errors in the parameter info definition.
14445
14446         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14447         type parameters here.
14448
14449         * cs-parser.jay (class_declaration): report errors for parameters
14450         here as well.
14451
14452 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14453
14454         * generic.cs: New file, contains support code for generics.
14455
14456         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14457         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14458
14459         Update parser for the above removals.
14460
14461         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14462         now taken care of in the parser.
14463
14464 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14465
14466         * class.cs (Event.Define): Do not allow abstract events to have
14467         initializers. 
14468
14469 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14470
14471         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14472         block in event declarations.
14473
14474         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14475         value type, get its address.
14476
14477         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14478         leaving a class on the stack instead of a boolean value (int
14479         0/1).  Change the code so we compare against null, and then the
14480         result against zero.
14481
14482         * class.cs (TypeContainer.GetClassBases): We were checking for the
14483         parent class being sealed too late.
14484
14485         * expression.cs (Binary.Emit): For <= and >= when dealing with
14486         floating point values, use cgt.un and clt.un instead of cgt and
14487         clt alone.
14488
14489 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14490
14491         * statement.cs: Apply the same optimization as MS: skip the 
14492         GetEnumerator returning an IEnumerator, and use the one returning a 
14493         CharEnumerator instead. This allows us to avoid the try-finally block 
14494         and the boxing.
14495
14496 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14497
14498         * cs-parser.jay: Attributes cannot be applied to
14499                          namespaces. Fixes #40473
14500
14501 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14502
14503         * class.cs:
14504         (Add*): check if the name is valid using the full name for constants,
14505         fields, properties and events.
14506
14507 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14510         char constants to be part of the enumeration.
14511
14512         * expression.cs (Conditional.DoResolve): Add support for operator
14513         true. Implements the missing functionality from 14.12
14514
14515         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14516         operator true/false as required by the spec.
14517
14518         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14519         implicit conversion to boolean.
14520
14521         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14522         also one where the type implements `operator true'. 
14523
14524         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14525         get an expression that will invoke operator true based on an
14526         expression.  
14527
14528         (GetConversionOperators): Removed the hack that called op_True
14529         here.  
14530
14531         (Expression.ResolveBoolean): Move this from Statement.
14532
14533 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * ecore.cs (FieldExpr): do not allow initialization of initonly
14536         fields on derived classes
14537
14538 2003-03-13  Martin Baulig  <martin@ximian.com>
14539
14540         * statement.cs (Block.Emit): Call ig.BeginScope() and
14541         ig.EndScope() when compiling with debugging info; call
14542         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14543
14544 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14545
14546         * expression.cs (Indexers): Do not construct immediately, allow
14547         for new members to be appended as we go.  Fixes 38143
14548
14549 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14550
14551         * expression.cs: save/restore context when resolving an unchecked
14552         expression.
14553
14554 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14555
14556         * cfold.cs: Catch division by zero in modulus operator during
14557         constant folding.
14558
14559 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14560
14561         * interface.cs (Interface.DefineMembers): Avoid defining members
14562         twice. 
14563
14564 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14565
14566         * driver.cs: handle the +/- options for -noconfig
14567
14568         * statement.cs (Unckeched.Resolve): Also track the state of
14569         unchecked in the Resolve phase.
14570
14571 2003-02-27  Martin Baulig  <martin@ximian.com>
14572
14573         * ecore.cs (Expression.MemberLookup): Don't create a
14574         MethodGroupExpr for something which is not a method.  Fixes #38291.
14575
14576 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * class.cs (MemberBase.CheckParameters): Also check that the type
14579         is unmanaged if it is a pointer.
14580
14581         * expression.cs (SizeOf.Resolve): Add location information.
14582
14583         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14584         a managed type is declared.
14585
14586         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14587         parameter modifiers as well.  Fixes bug 38606
14588
14589         * class.cs: Very sad.  Am backing out the speed up changes
14590         introduced by the ArrayList -> Array in the TypeContainer, as they
14591         were not actually that much faster, and introduced a bug (no error
14592         reports on duplicated methods).
14593
14594         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14595         source first, this will guarantee that we have a valid expression
14596         before calling in lower levels functions that will require a
14597         resolved object.  Then use this original_source in the
14598         target.ResolveLValue instead of the original source that was
14599         passed to us.
14600
14601         Another change.  Use target.Resolve instead of LValueResolve.
14602         Although we are resolving for LValues, we will let the Assign code
14603         take care of that (it will be called again from Resolve).  This
14604         basically allows code like this:
14605
14606         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14607         class Y { void A (X x) { x [0] += o; }
14608
14609         The problem was that the indexer was trying to resolve for
14610         set_Item (idx, object o) and never finding one.  The real set_Item
14611         was set_Item (idx, X).  By delaying the process we get the right
14612         semantics. 
14613
14614         Fixes bug 36505
14615
14616 2003-02-23  Martin Baulig  <martin@ximian.com>
14617
14618         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14619         while calling DoEmit ().
14620
14621         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14622         source files; if you use the #line directive inside a method, the
14623         compiler stops emitting line numbers for the debugger until it
14624         reaches the end of the method or another #line directive which
14625         restores the original file.
14626
14627 2003-02-23  Martin Baulig  <martin@ximian.com>
14628
14629         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14630
14631 2003-02-23  Martin Baulig  <martin@ximian.com>
14632
14633         * statement.cs (Block.AddChildVariableNames): We need to call this
14634         recursively, not just for our immediate children.
14635
14636 2003-02-23  Martin Baulig  <martin@ximian.com>
14637
14638         * class.cs (Event.Define): Always make the field private, like csc does.
14639
14640         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14641         actually work, fixes bug #37521.
14642
14643 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14644
14645         * delegate.cs: When creating the various temporary "Parameters"
14646         classes, make sure that we call the ComputeAndDefineParameterTypes
14647         on those new parameters (just like we do with the formal ones), to
14648         allow them to be resolved in the context of the DeclSpace.
14649
14650         This fixes the bug that Dick observed in Bugzilla #38530.
14651
14652 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14653
14654         * expression.cs (ResolveMemberAccess): When resolving a constant,
14655         do not attempt to pull a constant if the value was not able to
14656         generate a valid constant.
14657
14658         * const.cs (LookupConstantValue): Do not report more errors than required.
14659
14660 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14661
14662         * expression.cs: fixes bug #38328.
14663
14664 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * class.cs: Changed all the various members that can be part of a
14667         class from being an ArrayList to be an Array of the right type.
14668         During the DefineType type_list, interface_list, delegate_list and
14669         enum_list are turned into types, interfaces, delegates and enums
14670         arrays.  
14671
14672         And during the member population, indexer_list, event_list,
14673         constant_list, field_list, instance_constructor_list, method_list,
14674         operator_list and property_list are turned into their real arrays.
14675
14676         Although we could probably perform this operation earlier, for
14677         good error reporting we need to keep the lists and remove the
14678         lists for longer than required.
14679
14680         This optimization was triggered by Paolo profiling the compiler
14681         speed on the output of `gen-sample-program.pl' perl script. 
14682
14683         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14684         not crash in methods like MemberLookupFailed that use this field.  
14685
14686         This problem arises when the compiler fails to resolve a type
14687         during interface type definition for example.
14688
14689 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14690
14691         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14692         inherit from System.Object, so we have to stop at null, not only
14693         when reaching System.Object.
14694
14695 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14696
14697         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14698         DeclaredOnly because the parent indexer might have had a different
14699         name, but did not loop until the top of the hierarchy was reached.
14700
14701         The problem this one fixes is 35492: when a class implemented an
14702         indexer from an interface, we were getting the interface method
14703         (which was abstract) and we were flagging an error (can not invoke
14704         abstract method).
14705
14706         This also keeps bug 33089 functioning, and test-148 functioning.
14707
14708         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14709         out if a method is special is to see if it is declared in a
14710         property or event, or whether it is one of the predefined operator
14711         names.   This should fix correctly #36804.
14712
14713 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14714
14715         The goal here is to remove the dependency on EmptyCast.Peel ().
14716         Killing it completely.
14717
14718         The problem is that currently in a number of places where
14719         constants are expected, we have to "probe" for an EmptyCast, and
14720         Peel, which is not the correct thing to do, as this will be
14721         repetitive and will likely lead to errors. 
14722
14723         The idea is to remove any EmptyCasts that are used in casts that
14724         can be reduced to constants, so we only have to cope with
14725         constants. 
14726
14727         This bug hunt was triggered by Bug 37363 and the desire to remove
14728         the duplicate pattern where we were "peeling" emptycasts to check
14729         whether they were constants.  Now constants will always be
14730         constants.
14731
14732         * ecore.cs: Use an enumconstant here instead of wrapping with
14733         EmptyCast.  
14734
14735         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14736         throwing me off.  By handling this we can get rid of a few hacks.
14737
14738         * statement.cs (Switch): Removed Peel() code.
14739
14740 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14741
14742         * class.cs: Location information for error 508
14743
14744         * expression.cs (New.DoResolve): Add a guard against double
14745         resolution of an expression.  
14746
14747         The New DoResolve might be called twice when initializing field
14748         expressions (see EmitFieldInitializers, the call to
14749         GetInitializerExpression will perform a resolve on the expression,
14750         and later the assign will trigger another resolution
14751
14752         This leads to bugs (#37014)
14753
14754         * delegate.cs: The signature for EndInvoke should contain any ref
14755         or out parameters as well.  We were not doing this in the past. 
14756
14757         * class.cs (Field.Define): Do not overwrite the type definition
14758         inside the `volatile' group.  Turns out that volatile enumerations
14759         were changing the type here to perform a validity test, which
14760         broke conversions. 
14761
14762 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14763
14764         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14765         and structs, we do not want to load the instance variable
14766
14767         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14768         enum_type has to be handled like an object reference (implicit
14769         conversions exists from this to object), but the regular IsClass
14770         and IsValueType tests will never return true for this one.
14771
14772         Also we use TypeManager.IsValueType instead of type.IsValueType,
14773         just for consistency with the rest of the code (this is only
14774         needed if we ever use the construct exposed by test-180.cs inside
14775         corlib, which we dont today).
14776
14777 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14778
14779         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14780         just InternalCall.
14781
14782 2003-02-09  Martin Baulig  <martin@ximian.com>
14783
14784         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14785         (Namespace.DefineNamespaces): New static public method; this is
14786         called when we're compiling with debugging to add all namespaces
14787         to the symbol file.
14788
14789         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14790         pass it to the Namespace's .ctor.
14791
14792         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14793         and MethodBase arguments; pass the namespace ID to the symwriter;
14794         pass the MethodBase instead of the token to the symwriter.
14795         (SymbolWriter.DefineNamespace): New method to add a namespace to
14796         the symbol file.
14797
14798 2003-02-09  Martin Baulig  <martin@ximian.com>
14799
14800         * symbolwriter.cs: New file.  This is a wrapper around
14801         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14802         methods here in near future.
14803
14804 2003-02-09  Martin Baulig  <martin@ximian.com>
14805
14806         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14807         ILGenerator.MarkSequencePoint() which are actually used by the
14808         symbol writer.
14809
14810 2003-02-09  Martin Baulig  <martin@ximian.com>
14811
14812         * location.cs (SourceFile): New public sealed class.  This
14813         contains the name and an index which is used in the location's token.
14814         (Location): Reserve an appropriate number of bits in the token for
14815         the source file instead of walking over that list, this gives us a
14816         really huge performance improvement when compiling with debugging.
14817
14818         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14819         `SourceFile' argument instead of a string.
14820         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14821         but don't parse/tokenize here, we need to generate the list of all
14822         source files before we do that.
14823         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14824         the files.
14825
14826         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14827         instead of a string.
14828
14829         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14830         of a string.
14831
14832 2003-02-09  Martin Baulig  <martin@ximian.com>
14833
14834         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14835         filename on `#line default'.
14836
14837 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14838
14839         * statement.cs: don't clear the pinned var when the fixed statement
14840         returns from the method (fixes bug#37752).
14841
14842 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14843
14844         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14845         to IsValueType.
14846
14847 2003-02-07  Martin Baulig  <martin@ximian.com>
14848
14849         * driver.cs: Removed the `--debug-args' command line argument.
14850
14851         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14852         automatically by the AsssemblyBuilder.
14853         (CodeGen.InitializeSymbolWriter): We don't need to call any
14854         initialization function on the symbol writer anymore.  This method
14855         doesn't take any arguments.
14856
14857 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14858
14859         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14860         from referenced assemblies as well.
14861
14862 2003-02-02  Martin Baulig  <martin@ximian.com>
14863
14864         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14865
14866 2003-02-02  Martin Baulig  <martin@ximian.com>
14867
14868         * class.cs (Constructor.Emit): Open the symbol writer before
14869         emitting the constructor initializer.
14870         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14871         single-stepping through constructor initializers.
14872
14873 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14874
14875         * class.cs: Handle error 549: do not allow virtual methods in
14876         sealed classes. 
14877
14878 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14879
14880         * decl.cs: Check access levels when resolving types
14881
14882 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14883
14884         * statement.cs: Add parameters and locals set in catch blocks that might 
14885         return to set vector
14886
14887 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14888
14889         * class.cs (Operator): Set the SpecialName flags for operators.
14890
14891         * expression.cs (Invocation.DoResolve): Only block calls to
14892         accessors and operators on SpecialName methods.
14893
14894         (Cast.TryReduce): Handle conversions from char constants.
14895
14896
14897 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14898
14899         * statement.cs: small memory and time optimization in FlowBranching.
14900
14901 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14902
14903         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14904         problem that the last fix but in the other sid (Set).
14905
14906         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14907         access when there is no indexer in the hierarchy.
14908
14909 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14910
14911         * class.cs: Combine some if statements.
14912
14913 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14914
14915         * driver.cs: fixed bug #37187.
14916
14917 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14918
14919         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14920         any indexer, it's needed to build a list with all the indexers in the
14921         hierarchy (AllGetters), else we have problems. Fixes #35653.
14922
14923 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * class.cs (MethodData.Define): It is wrong for an interface
14926         implementation to be static in both cases: explicit and implicit.
14927         We were only handling this in one case.
14928
14929         Improve the if situation there to not have negations.
14930
14931         * class.cs (Field.Define): Turns out that we do not need to check
14932         the unsafe bit on field definition, only on usage.  Remove the test.
14933
14934 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14935
14936         * driver.cs: use assembly.Location instead of Codebase (the latest
14937         patch made mcs fail when using MS assemblies).
14938
14939 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14940
14941         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14942         get the path to *corlib.dll.
14943
14944 2003-01-21  Nick Drochak <ndrochak@gol.com>
14945
14946         * cs-tokenizer.cs:
14947         * pending.cs:
14948         * typemanager.cs: Remove compiler warnings
14949
14950 2003-01-20  Duncan Mak  <duncan@ximian.com>
14951
14952         * AssemblyInfo.cs: Bump the version number to 0.19.
14953
14954 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14955
14956         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14957
14958 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14959
14960         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14961
14962 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14963
14964         * cs-parser.jay: Small fix: we were not comparing the constructor
14965         name correctly.   Thanks to Zoltan for the initial pointer.
14966
14967 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14968
14969         * cs-tokenizer.cs: Set file name when specified with #line
14970
14971 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14972
14973         * cs-parser.jay: Only perform the constructor checks here if we
14974         are named like the class;  This will help provider a better
14975         error.  The constructor path is taken when a type definition is
14976         not found, but most likely the user forgot to add the type, so
14977         report that rather than the constructor error.
14978
14979 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14980
14981         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14982         allocations.
14983
14984 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14985
14986         * cs-parser.jay: Add cleanup call.
14987
14988 2003-01-13  Duncan Mak  <duncan@ximian.com>
14989
14990         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14991         consistent with other methods.
14992
14993 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14994
14995         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14996
14997 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14998
14999         * attribute.cs: only set GuidAttr to true when we have a
15000         GuidAttribute.
15001
15002 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15003
15004         * ecore.cs:
15005         * expression.cs:
15006         * typemanager.cs: fixes to allow mcs compile corlib with the new
15007         Type.IsSubclassOf fix.
15008
15009 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15010
15011         * expression.cs (LocalVariableReference.DoResolve): Classify a
15012         constant as a value, not as a variable.   Also, set the type for
15013         the variable.
15014
15015         * cs-parser.jay (fixed_statement): take a type instead of a
15016         pointer_type, so we can produce a better error message later.
15017
15018         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15019         as an error.  
15020
15021         (For.DoEmit): Make inifinite loops have a
15022         non-conditional branch back.
15023
15024         (Fixed.DoEmit): First populate the pinned variables, then emit the
15025         statement, then clear the variables.  Before I was emitting the
15026         code once for each fixed piece.
15027
15028
15029 2003-01-08  Martin Baulig  <martin@ximian.com>
15030
15031         * statement.cs (FlowBranching.MergeChild): A break in a
15032         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15033
15034 2003-01-08  Martin Baulig  <martin@ximian.com>
15035
15036         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15037         lives in the same number space than `param_map'.  Fixes #36154.
15038
15039 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * cs-parser.jay (constructor_declaration): Set the
15042         Constructor.ModFlags before probing for it.  This makes the
15043         compiler report 514, 515 and 132 (the code was there, but got
15044         broken). 
15045
15046         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15047         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15048         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15049
15050 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15051
15052         * enum.cs: create the enum static fields using the enum type.
15053
15054 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15055
15056         * class.cs: don't try to create the ParamBuilder for the return
15057         type if it's not needed (and handle it breaking for the ms runtime
15058         anyway).
15059
15060 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15061
15062         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15063
15064 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15065
15066         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15067         the command.   This showed up while compiling the JANET source
15068         code, which used \r as its only newline separator.
15069
15070 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15071
15072         * class.cs (Method.Define): If we are an operator (because it
15073         reuses our code), then set the SpecialName and HideBySig.  #36128
15074
15075 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15076
15077         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15078         exception, report error 120 `object reference required'.
15079
15080         * driver.cs: Add --pause option, used during to measure the size
15081         of the process as it goes with --timestamp.
15082
15083         * expression.cs (Invocation.DoResolve): Do not allow methods with
15084         SpecialName to be invoked.
15085
15086 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15087
15088         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15089         number before adding it.
15090
15091 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15092
15093         * ecore.cs (StandardImplicitConversion): When in an unsafe
15094         context, we allow conversion between void * to any other pointer
15095         type. This fixes bug #35973.
15096
15097 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15098
15099         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15100         is not thrown when extensionless outputs are used 
15101
15102 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15103
15104         * rootcontext.cs: fixed compilation of corlib.
15105
15106 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * attribute.cs (Attributes.Contains): Add new method.
15109
15110         * class.cs (MethodCore.LabelParameters): if the parameter is an
15111         `out' parameter, check that no attribute `[In]' has been passed.
15112
15113         * enum.cs: Handle the `value__' name in an enumeration.
15114
15115 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15116
15117         * decl.cs: Added special case to allow overrides on "protected
15118         internal" methods
15119
15120 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15121
15122         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15123         since it makes much more sense.
15124
15125         (Attributes.ctor): Don't require a Location parameter.
15126
15127         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15128
15129         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15130         since we already have that information per attribute.
15131
15132         * everywhere : make appropriate changes.
15133
15134         * class.cs (LabelParameters): Write the code which actually
15135         applies attributes to the return type. We can't do this on the MS
15136         .NET runtime so we flag a warning in the case an exception is
15137         thrown.
15138
15139 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * const.cs: Handle implicit null conversions here too.
15142
15143 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15144
15145         * class.cs (MethodCore.LabelParameters): Remove the extra
15146         Type [] parameter since it is completely unnecessary. Instead
15147         pass in the method's attributes so that we can extract
15148         the "return" attribute.
15149
15150 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15151
15152         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15153         of ignoring it and letting the compile continue.
15154
15155         * typemanager.cs (ChangeType): use an extra argument to return an
15156         error condition instead of throwing an exception.
15157
15158 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15159
15160         * expression.cs (Unary.TryReduce): mimic the code for the regular
15161         code path.  Perform an implicit cast in the cases where we can
15162         implicitly convert to one of the integral types, and then reduce
15163         based on that constant.   This fixes bug #35483.
15164
15165 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15166
15167         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15168
15169 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15170
15171         * namespace.cs: fixed bug #35489.
15172
15173 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * class.cs: Remove some dead code.
15176
15177         * cs-parser.jay: Estimate the number of methods needed
15178         (RootContext.MethodCount);
15179
15180         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15181         numbers instead of StringBuilders.
15182
15183         * support.cs (PtrHashtable): Add constructor with initial size;
15184         We can now reduce reallocations of the method table.
15185
15186 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15187
15188         * attribute.cs (ApplyAttributes): Keep track of the emitted
15189         attributes on a per-target basis. This fixes bug #35413.
15190
15191 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15194         default to the Windows 1252 encoding.
15195
15196         (UnixParseOption): Support version, thanks to Alp for the missing
15197         pointer. 
15198
15199         * AssemblyInfo.cs: Add nice assembly information.
15200
15201         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15202         (bug 35169).
15203
15204         * cs-parser.jay: Allow a trailing comma before the close bracked
15205         in the attribute_section production.
15206
15207         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15208         address of the instance was being taken, I will take this out,
15209         because we take the address of the object immediately here.
15210
15211 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15212
15213         * typemanager.cs (AreMultipleAllowed): Take care of the most
15214         obvious case where attribute type is not in the current assembly -
15215         stupid me ;-)
15216
15217 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15218
15219         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15220         definitions, instead of doing that afterwards.  
15221
15222         Also we use a nice little hack, depending on the constructor, we
15223         know if we are a "composed" name or a simple name.  Hence, we
15224         avoid the IndexOf test, and we avoid 
15225
15226         * codegen.cs: Add code to assist in a bug reporter to track down
15227         the source of a compiler crash. 
15228
15229 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15230
15231         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15232         types have been emitted for a given element and flag an error
15233         if something which does not have AllowMultiple set is used more
15234         than once.
15235
15236         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15237         attribute types and their corresponding AllowMultiple properties
15238
15239         (AreMultipleAllowed): Check the property for a given type.
15240
15241         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15242         property in the case we have a TypeContainer.
15243
15244         (Attributes.AddAttribute): Detect duplicates and just skip on
15245         adding them. This trivial fix catches a pretty gross error in our
15246         attribute emission - global attributes were being emitted twice!
15247
15248         Bugzilla bug #33187 is now fixed.
15249
15250 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15251
15252         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15253         instead of pp_and).
15254
15255         * expression.cs (Binary.ResolveOperator): I can only use the
15256         Concat (string, string, string) and Concat (string, string,
15257         string, string) if the child is actually a concatenation of
15258         strings. 
15259
15260 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15261
15262         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15263         context where we need a 2-character lookahead.
15264
15265         * pending.cs (PendingImplementation): Rework so we can keep track
15266         of interface types all the time, and flag those which were
15267         implemented by parents as optional.
15268
15269 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15270
15271         * expression.cs (Binary.ResolveOperator): Use
15272         String.Concat(string,string,string) or
15273         String.Concat(string,string,string,string) when possible. 
15274
15275         * typemanager: More helper methods.
15276
15277
15278 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15279
15280         * pending.cs: remove the bogus return from GetMissingInterfaces()
15281         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15282
15283 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15284
15285         * namespace.cs: avoid duplicated 'using xxx' being added to
15286         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15287         when we get more than one 'using' statement for the same namespace.
15288         Report a CS0105 warning for it.
15289
15290 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15291
15292         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15293         of calling getChar/putback, uses internal knowledge of it.    
15294
15295         (xtoken): Reorder tokenizer so most common patterns are checked
15296         first.  This reduces the compilation time in another 5% (from 8.11s
15297         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15298
15299         The parsing time is 22% of the compilation in mcs, and from that
15300         64% is spent on the tokenization process.  
15301
15302         I tried using a binary search for keywords, but this is slower
15303         than the hashtable.  Another option would be to do a couple of
15304         things:
15305
15306                 * Not use a StringBuilder, instead use an array of chars,
15307                   with a set value.  Notice that this way we could catch
15308                   the 645 error without having to do it *afterwards*.
15309
15310                 * We could write a hand-parser to avoid the hashtable
15311                   compares altogether.
15312
15313         The identifier consumption process takes 37% of the tokenization
15314         time.  Another 15% is spent on is_number.  56% of the time spent
15315         on is_number is spent on Int64.Parse:
15316
15317                 * We could probably choose based on the string length to
15318                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15319                   computations. 
15320
15321         Another 3% is spend on wrapping `xtoken' in the `token' function.
15322
15323         Handle 0xa0 as whitespace (#34752)
15324
15325 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * typemanager.cs (IsCLRType): New routine to tell whether a type
15328         is one of the builtin types.  
15329
15330         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15331         typecode in more places instead of doing pointer comparissions.
15332         We could leverage some knowledge about the way the typecodes are
15333         laid out.
15334
15335         New code to cache namespaces in assemblies, it is currently not
15336         invoked, to be used soon.
15337
15338         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15339
15340         * expression.cs (Binary.ResolveOperator): specially handle
15341         strings, and do not perform user-defined operator overloading for
15342         built-in types.
15343
15344 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15345
15346         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15347         internalcall as it is a pretty simple operation;  Avoid whenever
15348         possible to call Char.IsLetter.
15349
15350         (consume_identifier): Cut by half the number of
15351         hashtable calls by merging the is_keyword and GetKeyword behavior.
15352
15353         Do not short-circuit, because if we do, we
15354         report errors (ie, #if false && true would produce an invalid
15355         directive error);
15356
15357
15358 2002-11-24  Martin Baulig  <martin@ximian.com>
15359
15360         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15361         check constant ranges and report a CS0221.  Fixes #33186.
15362
15363 2002-11-24  Martin Baulig  <martin@ximian.com>
15364
15365         * cs-parser.jay: Make this work for uninitialized variable
15366         declarations in the `for' initializer.  Fixes #32416.
15367
15368 2002-11-24  Martin Baulig  <martin@ximian.com>
15369
15370         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15371         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15372
15373 2002-11-24  Martin Baulig  <martin@ximian.com>
15374
15375         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15376         argument; if true, we also check for user-defined conversions.
15377         This is only needed if both arguments are of a user-defined type.
15378         Fixes #30443, added test-175.cs.
15379         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15380
15381         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15382
15383 2002-11-24  Martin Baulig  <martin@ximian.com>
15384
15385         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15386         function to get the store opcode.
15387         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15388         only emit the Ldelema if the store opcode is Stobj.  You must run
15389         both test-34 and test-167 to test this.  Fixes #34529.
15390
15391 2002-11-23  Martin Baulig  <martin@ximian.com>
15392
15393         * ecore.cs (Expression.MemberLookup): Added additional
15394         `qualifier_type' argument which is used when we're being called
15395         from MemberAccess.DoResolve() and null if we're called from a
15396         SimpleName lookup.
15397         (Expression.MemberLookupFailed): New method to report errors; this
15398         does the CS1540 check and reports the correct error message.
15399
15400         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15401         argument for the CS1540 check and redone the way how we're dealing
15402         with private members.  See the comment in the source code for details.
15403         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15404         `closure_start_type' to `closure_qualifier_type' and check whether
15405         it's not null.  It was not this filter being broken, it was just
15406         being called with the wrong arguments.
15407
15408         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15409         and pass it the correct `qualifier_type'; this also does the error
15410         handling for us.
15411
15412 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * expression.cs (Invocation.EmitParams): If the we are dealing
15415         with a non-built-in value type, load its address as well.
15416
15417         (ArrayCreation): Use a a pretty constant instead
15418         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15419         static initializers.  
15420
15421         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15422         because they are not really value types, just glorified integers. 
15423
15424         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15425
15426         * ecore.cs: Remove redundant code for enumerations, make them use
15427         the same code path as everything else, fixes the casting issue
15428         with enumerations in Windows.Forms.
15429
15430         * attribute.cs: Do only cast to string if it is a string, the
15431         validation happens later.
15432
15433         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15434         people upgrade their corlibs.
15435
15436         * ecore.cs: Oops, enumerations were not following the entire code path
15437
15438 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15439
15440         * typemanager.cs (FilterWithClosure): Commented out the test for
15441         1540 in typemanager.cs, as it has problems when accessing
15442         protected methods from a parent class (see test-174.cs). 
15443
15444         * attribute.cs (Attribute.ValidateGuid): new method.
15445         (Attribute.Resolve): Use above.
15446
15447 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15450
15451         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15452         handling for enumerations, as we only needed the TypeContainer
15453         functionality to begin with (this is required for the fix below to
15454         work for enums that reference constants in a container class for
15455         example). 
15456
15457         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15458
15459         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15460         a valid TypeBuilder to perform lookups on.o
15461
15462         * class.cs (InheritableMemberSignatureCompare): Use true in the
15463         call to GetGetMethod and GetSetMethod, because we are comparing
15464         the signature, and we need to get the methods *even* if they are
15465         private. 
15466
15467         (PropertyBase.CheckBase): ditto.
15468
15469         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15470         GotoCase.Resolve): Use Peel on EmpytCasts.
15471
15472         * ecore.cs (EmptyCast): drop child, add Peel method.
15473
15474 2002-11-17  Martin Baulig  <martin@ximian.com>
15475
15476         * ecore.cs (EmptyCast.Child): New public property.
15477
15478         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15479         label resolved to an EmptyCast.  Fixes #34162.
15480         (GotoCase.Resolve): Likewise.
15481         (Block.EmitMeta): Likewise.
15482
15483 2002-11-17  Martin Baulig  <martin@ximian.com>
15484
15485         * expression.cs (Invocation.BetterConversion): Prefer int over
15486         uint; short over ushort; long over ulong for integer literals.
15487         Use ImplicitConversionExists instead of StandardConversionExists
15488         since we also need to check for user-defined implicit conversions.
15489         Fixes #34165.  Added test-173.cs.
15490
15491 2002-11-16  Martin Baulig  <martin@ximian.com>
15492
15493         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15494         with the `true' and `false' literals.  Fixes #33151.
15495
15496 2002-11-16  Martin Baulig  <martin@ximian.com>
15497
15498         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15499         October 22nd; don't do the cs1540 check for static members.
15500
15501         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15502         now using our own filter here and doing the cs1540 check again.
15503
15504 2002-11-16  Martin Baulig  <martin@ximian.com>
15505
15506         * support.cs (InternalParameters): Don't crash if we don't have
15507         any fixed parameters.  Fixes #33532.
15508
15509 2002-11-16  Martin Baulig  <martin@ximian.com>
15510
15511         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15512         when looking up static methods to make this work on Windows.
15513         Fixes #33773.
15514
15515 2002-11-16  Martin Baulig  <martin@ximian.com>
15516
15517         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15518         a setter rather than using PropertyInfo.CanWrite.
15519
15520 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15521
15522         * class.cs: Allow acces to block member by subclasses. Fixes build
15523         breaker.
15524
15525 2002-11-14  Martin Baulig  <martin@ximian.com>
15526
15527         * class.cs (Constructor.Emit): Added the extern/block check.
15528         Fixes bug #33678.
15529
15530 2002-11-14  Martin Baulig  <martin@ximian.com>
15531
15532         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15533         iteration while looking for indexers, this is needed because the
15534         indexer may have a different name in our base classes.  Fixed the
15535         error reporting (no indexers at all, not get accessor, no
15536         overloaded match).  Fixes bug #33089.
15537         (IndexerAccess.DoResolveLValue): Likewise.
15538
15539 2002-11-14  Martin Baulig  <martin@ximian.com>
15540
15541         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15542         indexers.  Fixes the first part of bug #33089.
15543         (MethodSignature.InheritableMemberSignatureCompare): Added support
15544         for properties.
15545
15546 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15547
15548         * attribute.cs (Attribute.Resolve): Catch the
15549         NullReferenceException and report it since it isn't supposed to
15550         happen. 
15551
15552 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15553
15554         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15555         LogicalOr and LogicalAnd that can benefit from recursively
15556         handling EmitBranchable.  The code now should be nice for Paolo.
15557
15558 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15559
15560         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15561         the Type lookups, as we perform quite a number of lookups on
15562         non-Types.  This can be removed once we can deterministically tell
15563         whether we have a type or a namespace in advance.
15564
15565         But this might require special hacks from our corlib.
15566
15567         * TODO: updated.
15568
15569         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15570         and double which avoids a conversion from an integer to a double.
15571
15572         * expression.cs: tiny optimization, avoid calling IsConstant,
15573         because it effectively performs the lookup twice.
15574
15575 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15576
15577         But a bogus return here to keep the semantics of the old code
15578         until the Mono runtime is fixed.
15579
15580         * pending.cs (GetMissingInterfaces): New method used to remove all
15581         the interfaces that are already implemented by our parent
15582         classes from the list of pending methods. 
15583
15584         * interface.cs: Add checks for calls after ResolveTypeExpr.
15585
15586 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15587
15588         * class.cs (Class.Emit): Report warning 67: event not used if the
15589         warning level is beyond 3.
15590
15591         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15592         being a NullLiteral.
15593
15594         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15595         specifiers. 
15596
15597         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15598         path that might fail if a type can not be resolved.
15599
15600         * expression.cs (Binary.Emit): Emit unsigned versions of the
15601         operators. 
15602
15603         * driver.cs: use error 5.
15604
15605 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15606
15607         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15608
15609 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * cs-parser.jay (switch_section): A beautiful patch from Martin
15612         Baulig that fixed 33094.
15613
15614 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15617         Check whether the base is abstract and report an error if so.
15618
15619         * expression.cs (IndexerAccess.DoResolveLValue,
15620         IndexerAccess.DoResolve): ditto. 
15621
15622         (Invocation.DoResolve): ditto.
15623
15624         (Invocation.FullMethodDesc): Improve the report string.
15625
15626         * statement.cs (Block): Eliminate IsVariableDefined as it is
15627         basically just a wrapper for GetVariableInfo.
15628
15629         * ecore.cs (SimpleName): Use new 
15630
15631         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15632         type, as we return the actual parameter ref/unref state on a
15633         different call.
15634
15635 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * support.cs: Return proper flags REF/OUT fixing the previous
15638         commit.  
15639
15640         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15641         not used to mean `ref' but `ref or out' in ParameterReference
15642
15643         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15644         full type signature instead of calling TypeManger.CSharpName
15645         ourselves. 
15646
15647         * support.cs (InternalParameters.ParameterDesc): Do not compare
15648         directly to the modflags, because REF/OUT will actually be bitsets
15649         if set. 
15650
15651         * delegate.cs (VerifyMethod): Check also the modifiers.
15652
15653         * cs-tokenizer.cs: Fix bug where floating point values with an
15654         exponent where a sign was missing was ignored.
15655
15656         * driver.cs: Allow multiple assemblies to be specified in a single
15657         /r: argument
15658
15659 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15660
15661         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15662         because identifiers after a parenthesis would end up in this kind
15663         of production, and we needed to desamiguate it for having casts
15664         like:
15665
15666                 (UserDefinedType *) xxx
15667
15668 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15669
15670         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15671         we should set on the Bindingflags.NonPublic, but not turn on
15672         private_ok.  private_ok controls whether a Private member is
15673         returned (this is chekced on the filter routine), while the
15674         BindingFlags.NonPublic just controls whether private/protected
15675         will be allowed.   This fixes the problem part of the problem of
15676         private properties being allowed to be used in derived classes.
15677
15678         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15679         so we can call the children DoResolveLValue method (this will
15680         properly signal errors on lvalue assignments to base properties)
15681
15682         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15683         getter are null, and we have a property info, we know that this
15684         happened because the lookup failed, so we report an error 122 for
15685         protection level violation.
15686
15687         We also silently return if setter and getter are null in the
15688         resolve functions, this condition only happens if we have flagged
15689         the error before.  This is the other half of the problem. 
15690
15691         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15692         not have accessibility information, that is why we were returning
15693         true in the filter function in typemanager.cs.
15694
15695         To properly report 122 (property is inaccessible because of its
15696         protection level) correctly, we report this error in ResolveAccess
15697         by failing if both the setter and the getter are lacking (ie, the
15698         lookup failed). 
15699
15700         DoResolve and DoLResolve have been modified to check for both
15701         setter/getter being null and returning silently, the reason being
15702         that I did not want to put the knowledge about this error in upper
15703         layers, like:
15704
15705         int old = Report.Errors;
15706         x = new PropertyExpr (...);
15707         if (old != Report.Errors)
15708                 return null;
15709         else
15710                 return x;
15711
15712         So the property expr is returned, but it is invalid, so the error
15713         will be flagged during the resolve process. 
15714
15715         * class.cs: Remove InheritablePropertySignatureCompare from the
15716         class, as we no longer depend on the property signature to compute
15717         whether it is possible to implement a method or not.
15718
15719         The reason is that calling PropertyInfo.GetGetMethod will return
15720         null (in .NET, in Mono it works, and we should change this), in
15721         cases where the Get Method does not exist in that particular
15722         class.
15723
15724         So this code:
15725
15726         class X { public virtual int A { get { return 1; } } }
15727         class Y : X { }
15728         class Z : Y { public override int A { get { return 2; } } }
15729
15730         Would fail in Z because the parent (Y) would not have the property
15731         defined.  So we avoid this completely now (because the alternative
15732         fix was ugly and slow), and we now depend exclusively on the
15733         method names.
15734
15735         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15736         reference method, instead of using the property.
15737
15738         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15739         routines are gone now.
15740
15741         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15742         names, they were incorrectly named.
15743
15744         * cs-tokenizer.cs: Return are more gentle token on failure. 
15745
15746         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15747         had an out-of-sync index variable, which caused it to remove from
15748         the list of pending methods the wrong method sometimes.
15749
15750 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15751
15752         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15753         CanWrite, because those refer to this particular instance of the
15754         property, and do not take into account the fact that we can
15755         override single members of a property.
15756
15757         Constructor requires an EmitContext.  The resolution process does
15758         not happen here, but we need to compute the accessors before,
15759         because the resolution does not always happen for properties.
15760
15761         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15762         subclass, before we did not update this flag, but we did update
15763         bindingflags. 
15764
15765         (GetAccessors): Drop this routine, as it did not work in the
15766         presence of partially overwritten set/get methods. 
15767
15768         Notice that this broke the cs1540 detection, but that will require
15769         more thinking. 
15770
15771 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15772
15773         * class.cs:
15774         * codegen.cs:
15775         * driver.cs: issue a warning instead of an error if we don't support
15776         debugging for the platform. Also ignore a couple of errors that may
15777         arise when trying to write the symbols. Undo my previous patch.
15778
15779 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15780
15781         * driver.cs: ignore /debug switch except for Unix platforms.
15782
15783 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15784
15785         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15786
15787 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15788
15789         * driver.cs: Do not make mcs-debug conditional, so we do not break
15790         builds that use it.
15791
15792         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15793         review this patch.  But basically after all the children variables
15794         have been merged, the value of "Breaks" was not being set to
15795         new_breaks for Switch blocks.  I think that it should be set after
15796         it has executed.  Currently I set this to the value of new_breaks,
15797         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15798         conservative, but I do not understand this code very well.
15799
15800         I did not break anything in the build, so that is good ;-)
15801
15802         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15803
15804 2002-10-20  Mark Crichton  <crichton@gimp.org>
15805
15806         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15807
15808 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15809
15810         * cfold.cs: Fixed compile blocker.
15811
15812 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15813
15814         * driver.cs: I was chekcing the key, not the file.
15815
15816 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15817
15818         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15819         message that we were generating - we just need to silently return
15820         a null.
15821
15822 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15823
15824         * class.cs (Event.Define): Change my previous commit, as this
15825         breaks the debugger.  This is a temporary hack, as it seems like
15826         the compiler is generating events incorrectly to begin with.
15827
15828         * expression.cs (Binary.ResolveOperator): Added support for 
15829         "U operator - (E x, E y)"
15830
15831         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15832         y)".
15833
15834         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15835         init-only variables, but this path did not take into account that
15836         there might be also instance readonly variables.  Correct this
15837         problem. 
15838
15839         This fixes bug 32253
15840
15841         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15842         delegates as well.
15843
15844         * driver.cs: Change the extension for modules to `netmodule'
15845
15846         * cs-parser.jay: Improved slightly the location tracking for
15847         the debugger symbols.
15848
15849         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15850         modifiers that were specified instead of the hardcoded value
15851         (FamAndAssem).  This was basically ignoring the static modifier,
15852         and others.  Fixes 32429.
15853
15854         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15855         fixed a bug in the process (32476)
15856
15857         * expression.cs (ArrayAccess.EmitAssign): Patch from
15858         hwang_rob@yahoo.ca that fixes bug 31834.3
15859
15860 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * driver.cs: Make the module extension .netmodule.
15863
15864 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15865
15866         * driver.cs: Report an error if the resource file is not found
15867         instead of crashing.
15868
15869         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15870         false, like Emit does.
15871
15872 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15873
15874         * typemanager.cs: Remove unused private member.  Also reported mcs
15875         bug to report this as a warning like csc.
15876
15877 2002-10-15  Martin Baulig  <martin@gnome.org>
15878
15879         * statement.cs (Statement.Emit): Made this a virtual method; emits
15880         the line number info and calls DoEmit().
15881         (Statement.DoEmit): New protected abstract method, formerly knows
15882         as Statement.Emit().
15883
15884         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15885
15886 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15889         have fixed a remaining problem: not every AddXXXX was adding a
15890         fully qualified name.  
15891
15892         Now everyone registers a fully qualified name in the DeclSpace as
15893         being defined instead of the partial name.  
15894
15895         Downsides: we are slower than we need to be due to the excess
15896         copies and the names being registered this way.  
15897
15898         The reason for this is that we currently depend (on the corlib
15899         bootstrap for instance) that types are fully qualified, because
15900         we dump all the types in the namespace, and we should really have
15901         types inserted into the proper namespace, so we can only store the
15902         basenames in the defined_names array.
15903
15904 2002-10-10  Martin Baulig  <martin@gnome.org>
15905
15906         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15907         from bug #31834, see the bug report for a testcase which is
15908         miscompiled.
15909
15910 2002-10-10  Martin Baulig  <martin@gnome.org>
15911
15912         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15913         flow analysis code for this.
15914
15915         * statement.cs (Do, While, For): Tell the flow analysis code about
15916         infinite loops.
15917         (FlowBranching.UsageVector): Added support for infinite loops.
15918         (Block.Resolve): Moved the dead code elimination here and use flow
15919         analysis to do it.
15920
15921 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15922
15923         * class.cs (Field.Define): Catch cycles on struct type
15924         definitions. 
15925
15926         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15927         fields if the fields are static.  We only need to check instance
15928         fields. 
15929
15930         * expression.cs (As.DoResolve): Test for reference type.
15931
15932         * statement.cs (Using.ResolveExpression): Use
15933         ConvertImplicitRequired, not ConvertImplicit which reports an
15934         error on failture
15935         (Using.ResolveLocalVariableDecls): ditto.
15936
15937         * expression.cs (Binary.ResolveOperator): Report errors in a few
15938         places where we had to.
15939
15940         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15941
15942 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * expression.cs: Use StoreFromPtr instead of extracting the type
15945         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15946
15947         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15948         an enumeration value to a System.Enum, but System.Enum is not a
15949         value type, but an class type, so we need to box.
15950
15951         (Expression.ConvertExplicit): One codepath could return
15952         errors but not flag them.  Fix this.  Fixes #31853
15953
15954         * parameter.cs (Resolve): Do not allow void as a parameter type.
15955
15956 2002-10-06  Martin Baulig  <martin@gnome.org>
15957
15958         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15959         if it's a class type and not a struct.  Fixes #31815.
15960
15961 2002-10-06  Martin Baulig  <martin@gnome.org>
15962
15963         * statement.cs: Reworked the flow analysis code a bit to make it
15964         usable for dead code elimination.
15965
15966 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15967
15968         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15969
15970 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15971
15972         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15973         to fix the test 165, will investigate deeper.
15974
15975 2002-10-04  Martin Baulig  <martin@gnome.org>
15976
15977         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15978         finally blocks actually work.
15979         (Try.Resolve): We don't need to create a sibling for `finally' if
15980         there is no finally block.
15981
15982 2002-10-04  Martin Baulig  <martin@gnome.org>
15983
15984         * class.cs (Constructor.Define): The default accessibility for a
15985         non-default constructor is private, not public.
15986
15987 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15988
15989         * class.cs (Constructor): Make AllowedModifiers public, add
15990         EXTERN.
15991
15992         * cs-parser.jay: Perform the modifiers test here, as the
15993         constructor for the Constructor class usually receives a zero
15994         because of the way we create it (first we create, later we
15995         customize, and we were never checking the modifiers).
15996
15997         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15998         is a version of LookupTypeReflection that includes the type-name
15999         cache.  This can be used as a fast path for functions that know
16000         the fully qualified name and are only calling into *.GetType() to
16001         obtain a composed type.
16002
16003         This is also used by TypeManager.LookupType during its type
16004         composition.
16005
16006         (LookupType): We now also track the real type name, as sometimes
16007         we can get a quey for the real type name from things like
16008         ComposedCast.  This fixes bug 31422.
16009
16010         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16011         complete type fullname, it does not have to go through the type
16012         resolution system to obtain the composed version of the type (for
16013         obtaining arrays or pointers).
16014
16015         (Conditional.Emit): Use the EmitBoolExpression to
16016         generate nicer code, as requested by Paolo.
16017
16018         (ArrayCreation.CheckIndices): Use the patch from
16019         hwang_rob@yahoo.ca to validate the array initializers. 
16020
16021 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16022
16023         * class.cs (ConstructorInitializer.Emit): simplify code by using
16024         Invocation.EmitCall, and at the same time, fix the bugs in calling
16025         parent constructors that took variable arguments. 
16026
16027         * ecore.cs (Expression.ConvertNumericExplicit,
16028         Expression.ImplicitNumericConversion): Remove the code that
16029         manually wrapped decimal (InternalTypeConstructor call is now gone
16030         as well).
16031
16032         * expression.cs (Cast.TryReduce): Also handle decimal types when
16033         trying to perform a constant fold on the type.
16034
16035         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16036
16037         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16038         that only turned off an error report, and did nothing else. 
16039
16040 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16041
16042         * driver.cs: Handle and ignore /fullpaths
16043
16044 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16045
16046         * expression.cs (Binary.ResolveOperator): Catch the case where
16047         DoNumericPromotions returns true, 
16048
16049         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16050
16051 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16054         report error 70.
16055
16056 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16057
16058         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16059         conversion exists, but it is also required that the conversion be
16060         performed.  This manifested in "(Type64Enum) 2".  
16061
16062         * class.cs (TypeManager.AddMethod): The fix is not to change
16063         AddEnum, because that one was using a fully qualified name (every
16064         DeclSpace derivative does), but to change the AddMethod routine
16065         that was using an un-namespaced name.  This now correctly reports
16066         the duplicated name.
16067
16068         Revert patch until I can properly fix it.  The issue
16069         is that we have a shared Type space across all namespaces
16070         currently, which is wrong.
16071
16072         Options include making the Namespace a DeclSpace, and merge
16073         current_namespace/current_container in the parser.
16074
16075 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16076
16077         * cs-parser.jay: Improve error reporting when we get a different
16078         kind of expression in local_variable_type and
16079         local_variable_pointer_type. 
16080
16081         Propagate this to avoid missleading errors being reported.
16082
16083         * ecore.cs (ImplicitReferenceConversion): treat
16084         TypeManager.value_type as a target just like object_type.   As
16085         code like this:
16086
16087         ValueType v = 1;
16088
16089         Is valid, and needs to result in the int 1 being boxed before it
16090         is assigned to the value type v.
16091
16092         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16093         to validate the enumeration name.
16094
16095         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16096         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16097         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16098
16099         * ecore.cs (TryImplicitIntConversion): When doing an
16100         implicit-enumeration-conversion, check if the type is 64-bits and
16101         perform a conversion before passing to EnumConstant.
16102
16103 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16106         report ambiguous type references.  Unlike the MS version, we
16107         report what the ambiguity is.   Innovation at work ;-)
16108
16109         (DeclSpace.FindType): Require a location argument to
16110         display when we display an ambiguous error.
16111
16112         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16113
16114         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16115
16116         * expression.cs (EmitDynamicInitializers): Apply patch from
16117         hwang_rob@yahoo.ca that fixes the order in which we emit our
16118         initializers. 
16119
16120 2002-09-21  Martin Baulig  <martin@gnome.org>
16121
16122         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16123         delegate takes no arguments.
16124
16125 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16126
16127         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16128         from integers.
16129
16130         * expression.cs: Extract the underlying type.
16131
16132         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16133
16134         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16135
16136 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16137
16138         * class.cs (TypeContainer.DefineType): We can not use the nice
16139         PackingSize with the size set to 1 DefineType method, because it
16140         will not allow us to define the interfaces that the struct
16141         implements.
16142
16143         This completes the fixing of bug 27287
16144
16145         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16146         means also structs.  This fixes part of the problem. 
16147         (Expresion.ImplicitReferenceConversionExists): ditto.
16148
16149         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16150         error if there were no errors reported during the type lookup
16151         process, to avoid duplicates or redundant errors.  Without this
16152         you would get an ambiguous errors plus a type not found.  We have
16153         beaten the user enough with the first error.  
16154
16155         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16156         reference. 
16157
16158         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16159         during the resolution process, stop the lookup, this avoids
16160         repeated error reports (same error twice).
16161
16162         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16163
16164         * typemanager.cs (LookupType): Redo the type lookup code to match
16165         the needs of System.Reflection.  
16166
16167         The issue is that System.Reflection requires references to nested
16168         types to begin with a "+" sign instead of a dot.  So toplevel
16169         types look like: "NameSpace.TopLevelClass", and nested ones look
16170         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16171         levels. 
16172
16173 2002-09-19  Martin Baulig  <martin@gnome.org>
16174
16175         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16176         says that a method always returns or always throws an exception,
16177         don't report the CS0161.
16178
16179         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16180         set `Returns = new_returns'.
16181
16182 2002-09-19  Martin Baulig  <martin@gnome.org>
16183
16184         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16185         to an enum constant, check for a CS0176.
16186
16187 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16188
16189         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16190         for operators that must be in pairs and report errors.
16191
16192         * ecore.cs (SimpleName.DoResolveType): During the initial type
16193         resolution process, when we define types recursively, we must
16194         check first for types in our current scope before we perform
16195         lookups in the enclosing scopes.
16196
16197         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16198
16199         (Invocation.VerifyArgumentsCompat): Call
16200         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16201         I thought we were supposed to always call this, but there are a
16202         few places in the code where we dont do it.
16203
16204 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16205
16206         * driver.cs: Add support in -linkres and -resource to specify the
16207         name of the identifier.
16208
16209 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16210
16211         * ecore.cs (StandardConversionExists): Sync with the conversion
16212         code: allow anything-* to void* conversions.
16213
16214         (FindMostSpecificSource): Use an Expression argument
16215         instead of a Type, because we might be handed over a Literal which
16216         gets a few more implicit conversions that plain types do not.  So
16217         this information was being lost.
16218
16219         Also, we drop the temporary type-holder expression when not
16220         required.
16221
16222 2002-09-17  Martin Baulig  <martin@gnome.org>
16223
16224         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16225         this is an explicit interface implementation.
16226
16227 2002-09-17  Martin Baulig  <martin@gnome.org>
16228
16229         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16230         different `IndexerName' attributes.
16231
16232         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16233         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16234         virtual CommonResolve().
16235
16236 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16237
16238         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16239         and convert that to the UnderlyingType.
16240
16241         * statement.cs (Foreach.Resolve): Indexers are just like variables
16242         or PropertyAccesses.
16243
16244         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16245         inside quoted strings, we were not doing this before.
16246
16247 2002-09-16  Martin Baulig  <martin@gnome.org>
16248
16249         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16250         resolve it.  This is needed for the definite assignment check of the
16251         instance expression, fixes bug #29846.
16252         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16253
16254 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16255
16256         * parameter.cs: Fix compile error.  Cannot reference static member
16257         from an instance object.  Is this an mcs bug?
16258
16259 2002-09-14  Martin Baulig  <martin@gnome.org>
16260
16261         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16262         multiple times.  Fixes bug #30295, added test-166.cs.
16263
16264 2002-09-14  Martin Baulig  <martin@gnome.org>
16265
16266         * statement.cs (Block.Emit): Don't emit unreachable code.
16267         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16268         `break' statements.
16269         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16270
16271 2002-09-14  Martin Baulig  <martin@gnome.org>
16272
16273         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16274         is set.
16275
16276 2002-09-14  Martin Baulig  <martin@gnome.org>
16277
16278         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16279         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16280         be false on the ms runtime.
16281
16282 2002-09-13  Martin Baulig  <martin@gnome.org>
16283
16284         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16285         the CS0038 error message.
16286
16287 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16288
16289         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16290         constant inside, return it.
16291
16292 2002-09-12  Martin Baulig  <martin@gnome.org>
16293
16294         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16295         implicit conversion can be done between enum types.
16296
16297         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16298         check whether an implicit conversion to the current enum's UnderlyingType
16299         exists and report an error if not.
16300
16301         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16302         without debugging support.
16303
16304         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16305         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16306
16307 2002-09-12  Martin Baulig  <martin@gnome.org>
16308
16309         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16310
16311         * ecore.cs (IMemberExpr.DeclaringType): New property.
16312         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16313         nonstatic member of an outer type (CS0038).
16314
16315 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16316
16317         * driver.cs: Activate the using-error detector at warning level
16318         4 (at least for MS-compatible APIs).
16319
16320         * namespace.cs (VerifyUsing): Small buglett fix.
16321
16322         * pending.cs (PendingImplementation): pass the container pointer. 
16323
16324         * interface.cs (GetMethods): Allow for recursive definition.  Long
16325         term, I would like to move every type to support recursive
16326         definitions, not the current ordering mechanism that we have right
16327         now.
16328
16329         The situation is this: Attributes are handled before interfaces,
16330         so we can apply attributes to interfaces.  But some attributes
16331         implement interfaces, we will now handle the simple cases
16332         (recursive definitions will just get an error).  
16333
16334         * parameter.cs: Only invalidate types at the end if we fail to
16335         lookup all types.  
16336
16337 2002-09-09  Martin Baulig  <martin@gnome.org>
16338
16339         * ecore.cs (PropertyExpr.Emit): Also check for
16340         TypeManager.system_int_array_get_length so this'll also work when
16341         compiling corlib.  Fixes #30003.
16342
16343 2002-09-09  Martin Baulig  <martin@gnome.org>
16344
16345         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16346         and throw an exception if we can't get the type's size.  Fixed #30040,
16347         added test-165.cs.
16348
16349 2002-09-09  Martin Baulig  <martin@gnome.org>
16350
16351         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16352
16353         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16354         context.  Fixes bug #30027.
16355
16356         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16357         virtual functions.  Fixes bug #30043, added test-164.cs.
16358
16359 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16360
16361         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16362
16363 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16364
16365         * driver.cs: Use an object to get the windows codepage since it's not a
16366         static property.
16367
16368 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16369
16370         * statement.cs (For.Emit): for infinite loops (test == null)
16371         return whether there is a break inside, not always "true".
16372
16373         * namespace.cs (UsingEntry): New struct to hold the name of the
16374         using definition, the location where it is defined, and whether it
16375         has been used in a successful type lookup.
16376
16377         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16378         strings.
16379
16380         * decl.cs: ditto.
16381
16382 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16383
16384         * attribute.cs : Fix incorrect code which relied on catching
16385         a NullReferenceException to detect a null being passed in
16386         where an object was expected.
16387
16388 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16389
16390         * statement.cs (Try): flag the catch variable as assigned
16391
16392         * expression.cs (Cast): Simplified by using ResolveType instead of
16393         manually resolving.
16394
16395         * statement.cs (Catch): Fix bug by using ResolveType.
16396
16397 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16398
16399         * expression.cs (BetterConversion): Special case for when we have
16400         a NullLiteral as the argument and we have to choose between string
16401         and object types - we choose string the way csc does.
16402
16403         * attribute.cs (Attribute.Resolve): Catch the
16404         NullReferenceException and report error #182 since the Mono
16405         runtime no more has the bug and having this exception raised means
16406         we tried to select a constructor which takes an object and is
16407         passed a null.
16408
16409 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16410
16411         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16412         message (1502, 1503) when we can't locate a method after overload
16413         resolution. This is much more informative and closes the bug
16414         Miguel reported.
16415
16416         * interface.cs (PopulateMethod): Return if there are no argument
16417         types. Fixes a NullReferenceException bug.
16418
16419         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16420         expressions too. Previously we were checking only in one place for
16421         positional arguments leaving out named arguments.
16422
16423         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16424         type to the enum type is not allowed. Remove code corresponding to
16425         that.
16426
16427         (ConvertNumericExplicit): Allow explicit conversions from
16428         the underlying type to enum type. This precisely follows the spec
16429         and closes a bug filed by Gonzalo.
16430
16431 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16432
16433         * compiler.csproj:
16434         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16435
16436 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16437
16438         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16439         it was important that we stored the right value after the
16440         reduction in `converted'.
16441
16442 2002-09-04  Martin Baulig  <martin@gnome.org>
16443
16444         * location.cs (Location.SymbolDocument): Use full pathnames for the
16445         source files.
16446
16447 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16450         of the expression resolve mechanism, because that will catch the
16451         SimpleName error failures.
16452
16453         (Conditional): If we can not resolve the
16454         expression, return, do not crash.
16455
16456 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16457
16458         * cs-tokenizer.cs:
16459         (location): display token name instead of its number.
16460
16461 2002-08-28  Martin Baulig  <martin@gnome.org>
16462
16463         * expression.cs (Binary.ResolveOperator): Don't silently return
16464         but return an error if an operator cannot be applied between two
16465         enum types.
16466
16467 2002-08-28  Martin Baulig  <martin@gnome.org>
16468
16469         * class.cs (Constructor.Define): Set the permission attributes
16470         correctly instead of making all constructors public.
16471
16472 2002-08-28  Martin Baulig  <martin@gnome.org>
16473
16474         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16475         for private members before reporting a CS0103; if we find anything,
16476         it's a CS0122.
16477
16478 2002-08-28  Martin Baulig  <martin@gnome.org>
16479
16480         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16481         to check whether `closure_start_type == closure_invocation_type',
16482         we also need to check whether `m.DeclaringType == closure_invocation_type'
16483         before bypassing the permission checks.  We might be accessing
16484         protected/private members from the base class.
16485         (TypeManager.RealMemberLookup): Only set private_ok if private
16486         members were requested via BindingFlags.NonPublic.
16487
16488         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16489
16490         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16491         MethodGroupExpr.IsExplicitImpl if appropriate.
16492         (Invocation.DoResolve): Don't report the CS0120 for explicit
16493         interface implementations.
16494
16495 2002-08-27  Martin Baulig  <martin@gnome.org>
16496
16497         * expression.cs (Invocation.DoResolve): If this is a static
16498         method and we don't have an InstanceExpression, we must report
16499         a CS0120.
16500
16501 2002-08-25  Martin Baulig  <martin@gnome.org>
16502
16503         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16504         `==' between a valuetype and an object.
16505
16506 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16507
16508         * ecore.cs (TypeExpr): Provide a ToString method.
16509
16510 2002-08-24  Martin Baulig  <martin@gnome.org>
16511
16512         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16513         now called proggie.dbg and it's a binary file.
16514
16515 2002-08-23  Martin Baulig  <martin@gnome.org>
16516
16517         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16518
16519 2002-08-23  Martin Baulig  <martin@gnome.org>
16520
16521         * struct.cs (MyStructInfo.ctor): Make this work with empty
16522         structs; it's not allowed to use foreach() on null.
16523
16524 2002-08-23  Martin Baulig  <martin@gnome.org>
16525
16526         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16527         writer the full pathname of the generated assembly.
16528
16529 2002-08-23  Martin Baulig  <martin@gnome.org>
16530
16531         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16532         A `finally' block never returns or breaks; improved handling of
16533         unreachable code.
16534
16535 2002-08-23  Martin Baulig  <martin@gnome.org>
16536
16537         * statement.cs (Throw.Resolve): Allow `throw null'.
16538
16539 2002-08-23  Martin Baulig  <martin@gnome.org>
16540
16541         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16542         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16543         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16544         MemberLookup would return a wrong event if this is an explicit
16545         interface implementation and the class has an event with the same
16546         name.
16547
16548 2002-08-23  Martin Baulig  <martin@gnome.org>
16549
16550         * statement.cs (Block.AddChildVariableNames): New public method.
16551         (Block.AddChildVariableName): Likewise.
16552         (Block.IsVariableNameUsedInChildBlock): Likewise.
16553         (Block.AddVariable): Check whether a variable name has already
16554         been used in a child block.
16555
16556         * cs-parser.jay (declare_local_variables): Mark all variable names
16557         from the current block as being used in a child block in the
16558         implicit block.
16559
16560 2002-08-23  Martin Baulig  <martin@gnome.org>
16561
16562         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16563         find the symbol writer.
16564
16565         * driver.cs: csc also allows the arguments to /define being
16566         separated by commas, not only by semicolons.
16567
16568 2002-08-23  Martin Baulig  <martin@gnome.org>
16569
16570         * interface.cs (Interface.GetMembers): Added static check for events.
16571
16572 2002-08-15  Martin Baulig  <martin@gnome.org>
16573
16574         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16575         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16576
16577         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16578         why the MethodData.EmitDestructor() change was necessary.
16579
16580 2002-08-20  Martin Baulig  <martin@gnome.org>
16581
16582         * class.cs (TypeContainer.FindMembers): Added static check for events.
16583
16584         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16585
16586         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16587         use Type.GetEvents(), not Type.FindMembers().
16588
16589 2002-08-20  Martin Baulig  <martin@gnome.org>
16590
16591         * decl.cs (MemberCache): Added a special method cache which will
16592         be used for method-only searched.  This ensures that a method
16593         search will return a MethodInfo with the correct ReflectedType for
16594         inherited methods.      
16595
16596 2002-08-20  Martin Baulig  <martin@gnome.org>
16597
16598         * decl.cs (DeclSpace.FindMembers): Made this public.
16599
16600 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16601
16602         * delegate.cs: fixed build on windows.
16603         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16604
16605 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16606
16607         * ecore.cs (StandardConversionExists): Return a false
16608         if we are trying to convert the void type to anything else
16609         since that is not allowed.
16610
16611         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16612         we flag error 70 in the event an event is trying to be accessed
16613         directly from outside the declaring type.
16614
16615 2002-08-20  Martin Baulig  <martin@gnome.org>
16616
16617         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16618         MemberCache from typemanager.cs to decl.cs.
16619
16620 2002-08-19  Martin Baulig  <martin@gnome.org>
16621
16622         * class.cs (TypeContainer): Implement IMemberContainer.
16623         (TypeContainer.DefineMembers): Create the MemberCache.
16624         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16625         return public members if BindingFlags.Public was given, check
16626         whether members are static.
16627
16628 2002-08-16  Martin Baulig  <martin@gnome.org>
16629
16630         * decl.cs (DeclSpace.Define): Splitted this in Define and
16631         DefineMembers.  DefineMembers is called first and initializes the
16632         MemberCache.
16633
16634         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16635         DefineMembers() on all our DeclSpaces.
16636
16637         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16638         but call DefineMembers() on all nested interfaces.  We call their
16639         Define() in our new Define() function.
16640
16641         * interface.cs (Interface): Implement IMemberContainer.
16642         (Interface.Define): Moved all code except the attribute stuf to
16643         DefineMembers().
16644         (Interface.DefineMembers): Initialize the member cache.
16645
16646         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16647         need this anymore since we can use MemberCache.FindMembers directly.
16648
16649 2002-08-19  Martin Baulig  <martin@gnome.org>
16650
16651         * typemanager.cs (MemberCache): When creating the cache for an
16652         interface type, add all inherited members.
16653         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16654         to `out bool used_cache' and documented it.
16655         (TypeManager.MemberLookup): If we already used the cache in the first
16656         iteration, we don't need to do the interfaces check.
16657
16658 2002-08-19  Martin Baulig  <martin@gnome.org>
16659
16660         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16661         here from IMemberFinder and don't implement this interface anymore.
16662         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16663
16664         * typemanager.cs (IMemberFinder): This interface is now only used by
16665         classes which actually support the member cache.
16666         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16667         since we only put DeclSpaces into this Hashtable.
16668         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16669         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16670
16671 2002-08-16  Martin Baulig  <martin@gnome.org>
16672
16673         * typemanager.cs (ICachingMemberFinder): Removed.
16674         (IMemberFinder.MemberCache): New property.
16675         (TypeManager.FindMembers): Merged this with RealFindMembers().
16676         This function will never be called from TypeManager.MemberLookup()
16677         so we can't use the cache here, just the IMemberFinder.
16678         (TypeManager.MemberLookup_FindMembers): Check whether the
16679         IMemberFinder has a MemberCache and call the cache's FindMembers
16680         function.
16681         (MemberCache): Rewrote larger parts of this yet another time and
16682         cleaned it up a bit.
16683
16684 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16685
16686         * driver.cs (LoadArgs): Support quoting.
16687
16688         (Usage): Show the CSC-like command line arguments.
16689
16690         Improved a few error messages.
16691
16692 2002-08-15  Martin Baulig  <martin@gnome.org>
16693
16694         * typemanager.cs (IMemberContainer.Type): New property.
16695         (IMemberContainer.IsInterface): New property.
16696
16697         The following changes are conditional to BROKEN_RUNTIME, which is
16698         defined at the top of the file.
16699
16700         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16701         class'es members, but add all members from TypeHandle.ObjectType
16702         if we're an interface.
16703         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16704         is the current type.
16705         (MemberCache.CacheEntry.Container): Removed this field.
16706         (TypeHandle.GetMembers): Include inherited members.
16707
16708 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16709
16710         * typemanager.cs: fixed compilation and added a comment on a field that
16711         is never used.
16712
16713 2002-08-15  Martin Baulig  <martin@gnome.org>
16714
16715         * class.cs (ConstructorInitializer.Resolve): In the
16716         Expression.MemberLookup call, use the queried_type as
16717         invocation_type.
16718
16719         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16720         declared' attribute, it's always true.
16721         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16722         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16723         temporary wrapper for FindMembers which tells MemberLookup whether
16724         members from the base classes are included in the return value.
16725         This will go away soon.
16726         (TypeManager.MemberLookup): Use this temporary hack here; once the
16727         new MemberCache is completed, we don't need to do the DeclaredOnly
16728         looping here anymore since the MemberCache will take care of this.
16729         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16730         (MemberCache): When creating the MemberCache for a class, get
16731         members from the current class and all its base classes.
16732         (MemberCache.CacheEntry.Container): New field.  This is a
16733         temporary hack until the Mono runtime is fixed to distinguish
16734         between ReflectedType and DeclaringType.  It allows us to use MCS
16735         with both the MS runtime and the unfixed Mono runtime without
16736         problems and without accecting performance.
16737         (MemberCache.SearchMembers): The DeclaredOnly looping from
16738         TypeManager.MemberLookup is now done here.      
16739
16740 2002-08-14  Martin Baulig  <martin@gnome.org>
16741
16742         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16743         Type.GetFields on dynamic types but get the fields from the
16744         corresponding TypeContainer.
16745         (MyStructInfo.GetStructInfo): Added check for enum types.
16746
16747         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16748         (MemberList.SyncRoot): Implemented.
16749         (TypeManager.FilterWithClosure): No need to check permissions if
16750         closure_start_type == closure_invocation_type, don't crash if
16751         closure_invocation_type is null.
16752
16753 2002-08-13  Martin Baulig  <martin@gnome.org>
16754
16755         Rewrote TypeContainer.FindMembers to use a member cache.  This
16756         gives us a speed increase of about 35% for the self-hosting MCS
16757         build and of about 15-20% for the class libs (both on GNU/Linux).
16758
16759         * report.cs (Timer): New class to get enhanced profiling.  This
16760         whole class is "TIMER" conditional since it remarkably slows down
16761         compilation speed.
16762
16763         * class.cs (MemberList): New class.  This is an IList wrapper
16764         which we're now using instead of passing MemberInfo[]'s around to
16765         avoid copying this array unnecessarily.
16766         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16767         (ICachingMemberFinder, IMemberContainer): New interface.
16768         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16769         has already been checked, otherwise use it for the name comparision.
16770         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16771         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16772         if possible.  Returns a MemberList, not a MemberInfo [].
16773         (TypeHandle): New class, implements IMemberContainer.  We create
16774         one instance of this class per type, it contains a MemberCache
16775         which is used to do the member lookups.
16776         (MemberCache): New class.  Each instance of this class contains
16777         all members of a type and a name-based hash table.
16778         (MemberCache.FindMembers): This is our new member lookup
16779         function.  First, it looks up all members of the requested name in
16780         the hash table.  Then, it walks this list and sorts out all
16781         applicable members and returns them.
16782
16783 2002-08-13  Martin Baulig  <martin@gnome.org>
16784
16785         In addition to a nice code cleanup, this gives us a performance
16786         increase of about 1.4% on GNU/Linux - not much, but it's already
16787         half a second for the self-hosting MCS compilation.
16788
16789         * typemanager.cs (IMemberFinder): New interface.  It is used by
16790         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16791         Enum, Delegate or Interface.
16792         (TypeManager.finder_to_member_finder): New PtrHashtable.
16793         (TypeManager.finder_to_container): Removed.
16794         (TypeManager.finder_to_delegate): Removed.
16795         (TypeManager.finder_to_interface): Removed.
16796         (TypeManager.finder_to_enum): Removed.
16797
16798         * interface.cs (Interface): Implement IMemberFinder.
16799
16800         * delegate.cs (Delegate): Implement IMemberFinder.
16801
16802         * enum.cs (Enum): Implement IMemberFinder.
16803
16804         * class.cs (TypeContainer): Implement IMemberFinder.
16805
16806 2002-08-12  Martin Baulig  <martin@gnome.org>
16807
16808         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16809
16810 2002-08-12  Martin Baulig  <martin@gnome.org>
16811
16812         * ecore.cs (ITypeExpression): New interface for expressions which
16813         resolve to a type.
16814         (TypeExpression): Renamed to TypeLookupExpression.
16815         (Expression.DoResolve): If we're doing a types-only lookup, the
16816         expression must implement the ITypeExpression interface and we
16817         call DoResolveType() on it.
16818         (SimpleName): Implement the new ITypeExpression interface.
16819         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16820         hack, the situation that we're only looking up types can't happen
16821         anymore when this method is called.  Moved the type lookup code to
16822         DoResolveType() and call it.
16823         (SimpleName.DoResolveType): This ITypeExpression interface method
16824         is now doing the types-only lookup.
16825         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16826         (ResolveFlags): Added MaskExprClass.
16827
16828         * expression.cs (MemberAccess): Implement the ITypeExpression
16829         interface.
16830         (MemberAccess.DoResolve): Added support for a types-only lookup
16831         when we're called via ITypeExpression.DoResolveType().
16832         (ComposedCast): Implement the ITypeExpression interface.
16833
16834         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16835         Expression.Resolve() with ResolveFlags.Type instead.
16836
16837 2002-08-12  Martin Baulig  <martin@gnome.org>
16838
16839         * interface.cs (Interface.Define): Apply attributes.
16840
16841         * attribute.cs (Attribute.ApplyAttributes): Added support for
16842         interface attributes.
16843
16844 2002-08-11  Martin Baulig  <martin@gnome.org>
16845
16846         * statement.cs (Block.Emit): Only check the "this" variable if we
16847         do not always throw an exception.
16848
16849         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16850         whether the property has a set accessor.
16851
16852 2002-08-11  Martin Baulig  <martin@gnome.org>
16853
16854         Added control flow analysis support for structs.
16855
16856         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16857         with control flow analysis turned off.
16858         (IVariable): New interface.
16859         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16860         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16861         (FieldExpr.DoResolve): Resolve the instance expression with flow
16862         analysis turned off and do the definite assignment check after the
16863         resolving when we know what the expression will resolve to.
16864
16865         * expression.cs (LocalVariableReference, ParameterReference):
16866         Implement the new IVariable interface, only call the flow analysis
16867         code if ec.DoFlowAnalysis is true.
16868         (This): Added constructor which takes a Block argument.  Implement
16869         the new IVariable interface.
16870         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16871         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16872         This does the definite assignment checks for struct members.
16873
16874         * class.cs (Constructor.Emit): If this is a non-static `struct'
16875         constructor which doesn't have any initializer, call
16876         Block.AddThisVariable() to tell the flow analysis code that all
16877         struct elements must be initialized before control returns from
16878         the constructor.
16879
16880         * statement.cs (MyStructInfo): New public class.
16881         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16882         argument to this indexer.  If non-zero, check an individual struct
16883         member, not the whole struct.
16884         (FlowBranching.CheckOutParameters): Check struct members.
16885         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16886         overloaded versions of these methods which take an additional
16887         `int field_idx' argument to check struct members.
16888         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16889         overloaded versions of these methods which take an additional
16890         `string field_name' argument to check struct member.s
16891         (VariableInfo): Implement the IVariable interface.
16892         (VariableInfo.StructInfo): New public property.  Returns the
16893         MyStructInfo instance of the variable if it's a struct or null.
16894         (Block.AddThisVariable): New public method.  This is called from
16895         Constructor.Emit() for non-static `struct' constructor which do
16896         not have any initializer.  It creates a special variable for the
16897         "this" instance variable which will be checked by the flow
16898         analysis code to ensure that all of the struct's fields are
16899         initialized before control returns from the constructor.
16900         (UsageVector): Added support for struct members.  If a
16901         variable/parameter is a struct with N members, we reserve a slot
16902         in the usage vector for each member.  A struct is considered fully
16903         initialized if either the struct itself (slot 0) or all its
16904         members are initialized.
16905
16906 2002-08-08  Martin Baulig  <martin@gnome.org>
16907
16908         * driver.cs (Driver.MainDriver): Only report an error CS5001
16909         if there were no compilation errors.
16910
16911         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16912         `UnsafeContext' property to determine whether the parent is in
16913         unsafe context rather than checking the parent's ModFlags:
16914         classes nested in an unsafe class are unsafe as well.
16915
16916 2002-08-08  Martin Baulig  <martin@gnome.org>
16917
16918         * statement.cs (UsageVector.MergeChildren): Distinguish between
16919         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16920         we return.  Added test17() and test18() to test-154.cs.
16921
16922 2002-08-08  Martin Baulig  <martin@gnome.org>
16923
16924         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16925         Family access, make sure the invoking type isn't a subclass of the
16926         queried type (that'd be a CS1540).
16927
16928         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16929         this method which takes an additional `Type invocation_type'.
16930
16931         * expression.cs (BaseAccess.DoResolve): Use the base type as
16932         invocation and query type.
16933         (MemberAccess.DoResolve): If the lookup failed and we're about to
16934         report a CS0122, try a lookup with the ec.ContainerType - if this
16935         succeeds, we must report a CS1540.
16936
16937 2002-08-08  Martin Baulig  <martin@gnome.org>
16938
16939         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16940         (MethodGroupExpr): Implement the IMemberExpr interface.
16941
16942         * expression (MemberAccess.ResolveMemberAccess): No need to have
16943         any special code for MethodGroupExprs anymore, they're now
16944         IMemberExprs.   
16945
16946 2002-08-08  Martin Baulig  <martin@gnome.org>
16947
16948         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16949         Family, FamANDAssem and FamORAssem permissions.
16950         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16951
16952 2002-08-08  Martin Baulig  <martin@gnome.org>
16953
16954         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16955         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16956         or loop block.
16957
16958 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16959
16960         * driver.cs: implemented /resource option to embed managed resources.
16961
16962 2002-08-07  Martin Baulig  <martin@gnome.org>
16963
16964         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16965         (FieldBase.HasFieldInitializer): New public property.
16966         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16967         returns the field initializer and makes sure it is only resolved once.
16968         (TypeContainer.EmitFieldInitializers): Call
16969         FieldBase.GetInitializerExpression to get the initializer, this ensures
16970         that it isn't resolved multiple times.
16971
16972         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16973         the resolving process (SimpleName/MemberLookup) that we're currently
16974         emitting a field initializer (which must not access any instance members,
16975         this is an error CS0236).
16976
16977         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16978         argument, if the `IsFieldInitializer' flag is set, we must report and
16979         error CS0236 and not an error CS0120.   
16980
16981 2002-08-07  Martin Baulig  <martin@gnome.org>
16982
16983         * ecore.cs (IMemberExpr): New public interface.
16984         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16985         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16986         if the expression is an IMemberExpr.
16987
16988         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16989         to be null, implicitly default to `this' if we're non-static in
16990         this case.  Simplified the code a lot by using the new IMemberExpr
16991         interface.  Also fixed bug #28176 here.
16992
16993 2002-08-06  Martin Baulig  <martin@gnome.org>
16994
16995         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16996         ParameterReferences during semantic analysis so that we can do a
16997         type-only search when resolving Cast, TypeOf and SizeOf.
16998         (block): Pass the `current_local_parameters' to the Block's
16999         constructor.
17000
17001         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17002         argument to the constructor.
17003         (ConstructorInitializer.Resolve): Create a temporary implicit
17004         block with the parameters.
17005
17006         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17007         references here if we aren't doing a type-only search.
17008
17009         * statement.cs (Block): Added constructor which takes a
17010         `Parameters parameters' argument.
17011         (Block.Parameters): New public property.
17012
17013         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17014         to `Parameters' and made it public readonly.
17015
17016 2002-08-06  Martin Baulig  <martin@gnome.org>
17017
17018         * ecore.cs (Expression.Warning): Made this public as well.
17019
17020         * report.cs (Report.Debug): Print the contents of collections.
17021
17022 2002-08-06  Martin Baulig  <martin@gnome.org>
17023
17024         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17025         used to tell Resolve() which kinds of expressions it may return.
17026         (Expression.Resolve): Added overloaded version of this method which
17027         takes a `ResolveFlags flags' argument.  This can be used to tell
17028         Resolve() which kinds of expressions it may return.  Reports a
17029         CS0118 on error.
17030         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17031         ResolveFlags.SimpleName.
17032         (Expression.Error118): Added overloaded version of this method which
17033         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17034         which kinds of expressions are allowed.
17035
17036         * expression.cs (Argument.ResolveMethodGroup): New public method.
17037         Resolves an argument, but allows a MethodGroup to be returned.
17038         This is used when invoking a delegate.
17039
17040         * TODO: Updated a bit.
17041
17042 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17043
17044         Fixed compilation with csc.
17045
17046         * ecore.cs: Expression.Error made public. Is this correct? Should
17047         Warning be made public too?
17048
17049         * expression.cs: use ea.Location instead of ea.loc.
17050         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17051
17052 2002-08-06  Martin Baulig  <martin@gnome.org>
17053
17054         * ecore.cs (Expression.loc): Moved the location here instead of
17055         duplicating it in all derived classes.
17056         (Expression.Location): New public property.
17057         (Expression.Error, Expression.Warning): Made them non-static and
17058         removed the location argument.
17059         (Expression.Warning): Added overloaded version which takes an
17060         `int level' argument.
17061         (Expression.Error118): Make this non-static and removed the
17062         expression and location arguments.
17063         (TypeExpr): Added location argument to the constructor.
17064
17065         * expression.cs (StaticCallExpr): Added location argument to
17066         the constructor.
17067         (Indirection, PointerArithmetic): Likewise.
17068         (CheckedExpr, UnCheckedExpr): Likewise.
17069         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17070         (StringPtr): Likewise.
17071
17072
17073 2002-08-05  Martin Baulig  <martin@gnome.org>
17074
17075         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17076
17077         * assign.cs (Assign.DoResolve): Check whether the source
17078         expression is a value or variable.
17079
17080         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17081         while resolving the corresponding blocks.
17082
17083         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17084         an error, don't silently return null.
17085
17086         * statement.cs (Block.AddVariable): Do the error reporting here
17087         and distinguish between CS0128 and CS0136.
17088         (Block.DoResolve): Report all unused labels (warning CS0164).
17089         (LabeledStatement): Pass the location to the constructor.
17090         (LabeledStatement.HasBeenReferenced): New property.
17091         (LabeledStatement.Resolve): Set it to true here.
17092
17093         * statement.cs (Return.Emit): Return success even after reporting
17094         a type mismatch error (CS0126 or CS0127), this is what csc does and
17095         it avoids confusing the users with any consecutive errors.
17096
17097 2002-08-05  Martin Baulig  <martin@gnome.org>
17098
17099         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17100
17101         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17102
17103         * expression.cs (MemberAccess.DoResolve): Silently return if an
17104         error has already been reported.
17105
17106         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17107         error has already been reported.
17108
17109 2002-08-05  Martin Baulig  <martin@gnome.org>
17110
17111         * statement.cs (UsageVector): Only initialize the `parameters'
17112         vector if we actually have any "out" parameters.
17113
17114 2002-08-05  Martin Baulig  <martin@gnome.org>
17115
17116         * expression.cs (Binary.ResolveOperator): When combining delegates,
17117         they must have the same type.
17118
17119 2002-08-05  Martin Baulig  <martin@gnome.org>
17120
17121         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17122         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17123         work with the ms runtime and we also don't need it: if we're a
17124         PropertyBuilder and not in the `indexer_arguments' hash, then we
17125         are a property and not an indexer.
17126
17127         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17128         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17129         since the latter one doesn't work with the ms runtime.
17130
17131 2002-08-03  Martin Baulig  <martin@gnome.org>
17132
17133         Fixed bugs #27998 and #22735.
17134
17135         * class.cs (Method.IsOperator): New public field.
17136         (Method.CheckBase): Report CS0111 if there's already a method
17137         with the same parameters in the current class.  Report CS0508 when
17138         attempting to change the return type of an inherited method.
17139         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17140         and it's not marked abstract or extern.
17141         (PropertyBase): New abstract base class for Property and Indexer.
17142         (PropertyBase.CheckBase): Moved here from Property and made it work
17143         for indexers.
17144         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17145         the same so we can reuse it there.
17146         (Property, Indexer): Derive from PropertyBase.
17147         (MethodSignature.inheritable_property_signature_filter): New delegate
17148         to find properties and indexers.
17149
17150         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17151         argument and improved error reporting.
17152
17153         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17154         EmptyReadOnlyParameters and made it a property.
17155
17156         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17157         version of this method which takes a `PropertyInfo indexer'.
17158         (TypeManager.RegisterIndexer): New method.
17159
17160         * class.cs: Added myself as author of this file :-)
17161
17162 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17163
17164         * class.cs: fixed compilation on windoze.
17165
17166 2002-08-03  Martin Baulig  <martin@gnome.org>
17167
17168         * interface.cs (Interface.GetInterfaceBases): Check whether all
17169         base interfaces are at least as accessible than the current one.
17170
17171         * class.cs (TypeContainer.GetClassBases): Check whether base types
17172         are at least as accessible than the current type.
17173         (TypeContainer.AsAccessible): Implemented and made non-static.
17174         (MemberBase.CheckParameters): Report errors if the accessibility
17175         checks fail.
17176
17177         * delegate.cs (Delegate.Delegate): The default visibility is
17178         internal for top-level types and private for nested types.
17179         (Delegate.Define): Report errors if the accessibility checks fail.
17180
17181         * enum.cs (Enum.Enum): The default visibility is internal for
17182         top-level types and private for nested types.
17183         (Enum.DefineType): Compute the correct visibility.
17184
17185         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17186         function which takes a `bool is_toplevel' instead of a TypeContainer.
17187
17188         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17189         builtin type.
17190
17191 2002-08-02  Martin Baulig  <martin@gnome.org>
17192
17193         * expression.cs (LocalVariableReferenc): Added constructor which
17194         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17195         (LocalVariableReference.IsReadOnly): New property.
17196         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17197         variable is readonly, use our own readonly flag to do this; you can
17198         use the new constructor to get a writable reference to a read-only
17199         variable.
17200
17201         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17202         reference to the local variable.
17203
17204 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17205
17206         * rootcontext.cs (ResolveCore): Also include System.Exception
17207
17208         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17209         we reach an EmptyStatement.
17210
17211         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17212         is also fine.
17213
17214         * expression.cs (Binary.ResolveOperator): Check error result in
17215         two places.
17216
17217         use brtrue/brfalse directly and avoid compares to null.
17218
17219 2002-08-02  Martin Baulig  <martin@gnome.org>
17220
17221         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17222         Fixes bug #28407, added test-155.cs.
17223
17224 2002-08-01  Martin Baulig  <martin@gnome.org>
17225
17226         * class.cs (Event.EmitDefaultMethod): Make this work with static
17227         events.  Fixes #28311, added verify-3.cs.
17228
17229 2002-08-01  Martin Baulig  <martin@gnome.org>
17230
17231         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17232         `is_disposable' fields.
17233         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17234         `hm.is_disposable' if we're using the collection pattern.
17235         (Foreach.EmitCollectionForeach): Use the correct type for the
17236         enumerator's local variable, only emit the try/finally block if
17237         necessary (fixes #27713).
17238
17239 2002-08-01  Martin Baulig  <martin@gnome.org>
17240
17241         * ecore.cs (Expression.report118): Renamed to Error118 and made
17242         it public static.
17243
17244         * statement.cs (Throw.Resolve): Check whether the expression is of
17245         the correct type (CS0118) and whether the type derives from
17246         System.Exception (CS0155).
17247         (Catch.Resolve): New method.  Do the type lookup here and check
17248         whether it derives from System.Exception (CS0155).
17249         (Catch.CatchType, Catch.IsGeneral): New public properties.
17250
17251         * typemanager.cs (TypeManager.exception_type): Added.
17252
17253 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17254
17255         * driver.cs: Updated About function.
17256
17257 2002-07-31  Martin Baulig  <martin@gnome.org>
17258
17259         Implemented Control Flow Analysis.
17260
17261         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17262         (EmitContext.CurrentBranching): Added.
17263         (EmitContext.StartFlowBranching): Added.
17264         (EmitContext.EndFlowBranching): Added.
17265         (EmitContext.KillFlowBranching): Added.
17266         (EmitContext.IsVariableAssigned): Added.
17267         (EmitContext.SetVariableAssigned): Added.
17268         (EmitContext.IsParameterAssigned): Added.
17269         (EmitContext.SetParameterAssigned): Added.
17270         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17271         Added control flow analysis stuff here.
17272
17273         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17274         resolve the expression as lvalue.
17275         (LocalVariableReference.DoResolve): Check whether the variable has
17276         already been assigned.
17277         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17278         the parameter as assigned here.
17279         (ParameterReference.DoResolve): Check whether the parameter has already
17280         been assigned.
17281         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17282         expression as lvalue.
17283
17284         * statement.cs (FlowBranching): New class for the flow analysis code.
17285         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17286         (LabeledStatement.IsDefined): New public property.
17287         (LabeledStatement.AddUsageVector): New public method to tell flow
17288         analyis that the label may be reached via a forward jump.
17289         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17290         flow analysis.
17291         (VariableInfo.Number): New public field.  This is used by flow analysis
17292         to number all locals of a block.
17293         (Block.CountVariables): New public property.  This is the number of
17294         local variables in this block (including the locals from all parent
17295         blocks).
17296         (Block.EmitMeta): Number all the variables.
17297
17298         * statement.cs: Added flow analysis support to all classes.
17299
17300 2002-07-31  Martin Baulig  <martin@gnome.org>
17301
17302         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17303         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17304         then use this argument.
17305
17306         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17307
17308         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17309         use this to specify /define options.
17310
17311 2002-07-29  Martin Baulig  <martin@gnome.org>
17312
17313         * statement.cs (Fixed): Moved all code that does variable lookups
17314         and resolvings from Emit to Resolve.
17315
17316         * statement.cs (For): Moved all code that does variable lookups
17317         and resolvings from Emit to Resolve.
17318
17319         * statement.cs (Using): Moved all code that does variable lookups
17320         and resolvings from Emit to Resolve.
17321
17322 2002-07-29  Martin Baulig  <martin@gnome.org>
17323
17324         * attribute.cs (Attribute.Resolve): Explicitly catch a
17325         System.NullReferenceException when creating the
17326         CustromAttributeBuilder and report a different warning message.
17327
17328 2002-07-29  Martin Baulig  <martin@gnome.org>
17329
17330         * support.cs (ParameterData.ParameterName): Added method to
17331         get the name of a parameter.
17332
17333         * typemanager.cs (TypeManager.IsValueType): New public method.
17334
17335 2002-07-29  Martin Baulig  <martin@gnome.org>
17336
17337         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17338         is a flag which specifies that it's either ref or out.
17339         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17340         the out parameter to `out Parameter.Modifier mod', also set the
17341         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17342
17343         * support.cs (InternalParameters.ParameterModifier): Distinguish
17344         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17345         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17346
17347         * expression.cs (Argument.GetParameterModifier): Distinguish
17348         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17349         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17350
17351 2002-07-29  Martin Baulig  <martin@gnome.org>
17352
17353         * expression.cs (ParameterReference.ParameterReference): Added
17354         `Location loc' argument to the constructor.
17355
17356         * cs-parser.jay: Pass location to ParameterReference.
17357
17358 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17359
17360         * statement.cs (Try): Initialize the location.
17361
17362         * cs-parser.jay: pass location to Try.
17363
17364         * expression.cs (Unary.Reduce): Change the prototype to return
17365         whether a constant fold could be performed or not.  The result is
17366         returned in an out parameters.  In the case of Indirection and
17367         AddressOf, we want to perform the full tests.
17368
17369 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17370
17371         * statement.cs (Statement.Emit): Flag dead code.
17372
17373 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17374
17375         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17376
17377 2002-07-27  Martin Baulig  <martin@gnome.org>
17378
17379         * class.cs (MethodData.Define): Put back call to
17380         TypeManager.AddMethod(), accidentally commented this out.
17381
17382         * report.cs (Debug): New public method to print debugging information,
17383         this is `[Conditional ("DEBUG")]'.
17384
17385 2002-07-26  Martin Baulig  <martin@gnome.org>
17386
17387         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17388         (switch_statement): Push the current_block to the switch_stack and
17389         pop it again when we're done with the switch.
17390         (switch_section): The new block is a child of the current_block.
17391         Fixes bug #24007, added test-152.cs.
17392
17393 2002-07-27  Martin Baulig  <martin@gnome.org>
17394
17395         * expression.cs (Invocation.EmitArguments): When calling a varargs
17396         function with only its fixed arguments, we need to pass an empty
17397         array.
17398
17399 2002-07-27  Martin Baulig  <martin@gnome.org>
17400
17401         Mono 0.13 has been released.
17402
17403 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17404
17405         * driver.cs: Rename --resource to --linkres, because that is what
17406         we do currently, we dont support --resource yet.
17407
17408         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17409
17410 2002-07-25  Martin Baulig  <martin@gnome.org>
17411
17412         * class.cs (MethodData): New public class.  This is a `method builder'
17413         class for a method or one accessor of a Property/Indexer/Event.
17414         (MethodData.GetMethodFlags): Moved here from MemberBase.
17415         (MethodData.ApplyAttributes): Likewise.
17416         (MethodData.ApplyObsoleteAttribute): Likewise.
17417         (MethodData.ApplyConditionalAttribute): Likewise.
17418         (MethodData.ApplyDllImportAttribute): Likewise.
17419         (MethodData.CheckAbstractAndExternal): Likewise.
17420         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17421         (MethodData.Emit): Formerly known as Method.Emit().
17422         (MemberBase): Moved everything which was specific to a single
17423         accessor/method to MethodData.
17424         (Method): Create a new MethodData and call Define() and Emit() on it.
17425         (Property, Indexer, Event): Create a new MethodData objects for each
17426         accessor and call Define() and Emit() on them.
17427
17428 2002-07-25  Martin Baulig  <martin@gnome.org>
17429
17430         Made MethodCore derive from MemberBase to reuse the code from there.
17431         MemberBase now also checks for attributes.
17432
17433         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17434         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17435         as virtual.
17436         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17437         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17438         (MemberBase.ApplyAttributes): New virtual method; applies the
17439         attributes to a method or accessor.
17440         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17441         (MemberBase.ApplyConditionalAttribute): Likewise.
17442         (MemberBase.ApplyDllImportAttribute): Likewise.
17443         (MemberBase.CheckAbstractAndExternal): Likewise.
17444         (MethodCore.ParameterTypes): This is now a property instead of a
17445         method, it's initialized from DoDefineParameters().
17446         (MethodCore.ParameterInfo): Removed the set accessor.
17447         (MethodCore.DoDefineParameters): New protected virtual method to
17448         initialize ParameterTypes and ParameterInfo.
17449         (Method.GetReturnType): We can now simply return the MemberType.
17450         (Method.GetMethodFlags): Override the MemberBase version and add
17451         the conditional flags.
17452         (Method.CheckBase): Moved some code from Define() here, call
17453         DoDefineParameters() here.
17454         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17455         here to avoid some larger code duplication.
17456         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17457         ensure that abstract and external accessors don't declare a body.
17458
17459         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17460         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17461         lookup in the attribute's parent classes, so we need to abort as soon
17462         as we found the first match.
17463         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17464         the attribute has no arguments.
17465
17466         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17467         of a Method.
17468
17469 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17470
17471         * cs-parser.jay: reverted previous patch.
17472
17473 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17474
17475         * cs-parser.jay: fixed bug #22119.
17476
17477 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17478
17479         * attribute.cs: fixed compilation. The error was:
17480         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17481         be assigned to before control leaves the current method."
17482         [FIXME:  Filed as bug #28186: MCS must report this error.]
17483
17484 2002-07-25  Martin Baulig  <martin@gnome.org>
17485
17486         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17487         method to pull the condition name ouf of a Conditional attribute.
17488         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17489         the obsolete message and error flag out of an Obsolete attribute.
17490
17491         * class.cs (Method.GetMethodFlags): New public method to get the
17492         TypeManager.MethodFlags for this method.
17493         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17494         private methods.
17495         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17496         if we're overriding a virtual function, set the new private variable
17497         `parent_method'; call the new TypeManager.AddMethod().
17498
17499         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17500         the MethodBuilder and the Method in a PtrHashtable.
17501         (TypeManager.builder_to_method): Added for this purpose.
17502         (TypeManager.MethodFlags): Added IsObsoleteError.
17503         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17504         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17505         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17506         the message from the attribute.
17507
17508 2002-07-24  Martin Baulig  <martin@gnome.org>
17509
17510         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17511         preprocessor directives, ensure that the argument to #define/#undef is
17512         exactly one identifier and that it's actually an identifier.
17513
17514         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17515         did not work ....
17516
17517 2002-07-24  Martin Baulig  <martin@gnome.org>
17518
17519         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17520         initialize it to TypeManager.object_type in the constructor.
17521         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17522         of the `hm.get_current' method if we're using the collection pattern.
17523         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17524         for the explicit conversion to make it work when we're using the collection
17525         pattern and the `Current' property has a different return type than `object'.
17526         Fixes #27713.
17527
17528 2002-07-24  Martin Baulig  <martin@gnome.org>
17529
17530         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17531         does not match, but don't report any errors.  This method is called in
17532         order for all methods in a MethodGroupExpr until a matching method is
17533         found, so we don't want to bail out if the first method doesn't match.
17534         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17535         matches, report the 123.  Fixes #28070.
17536
17537 2002-07-24  Martin Baulig  <martin@gnome.org>
17538
17539         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17540         TypeManager.TypeToCoreType() to the top of the method so the
17541         following equality checks will work.  Fixes #28107.
17542
17543 2002-07-24  Martin Baulig  <martin@gnome.org>
17544
17545         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17546         operand is of type uint, and the other operand is of type sbyte,
17547         short or int, the operands are converted to type long." -
17548         Actually do what this comment already told us.  Fixes bug #28106,
17549         added test-150.cs.
17550
17551 2002-07-24  Martin Baulig  <martin@gnome.org>
17552
17553         * class.cs (MethodBase): New abstract class.  This is now a base
17554         class for Property, Indexer and Event to avoid some code duplication
17555         in their Define() and DefineMethods() methods.
17556         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17557         generic methods for Define() and DefineMethods().
17558         (FieldBase): Derive from MemberBase, not MemberCore.
17559         (Property): Derive from MemberBase, not MemberCore.
17560         (Property.DefineMethod): Moved all the code from this method to the
17561         new MethodBase.DefineAccessor(), just call it with appropriate
17562         argumetnts.
17563         (Property.Define): Call the new Property.DoDefine(), this does some
17564         sanity checks and we don't need to duplicate the code everywhere.
17565         (Event): Derive from MemberBase, not MemberCore.
17566         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17567         accessors, this will also make them work with interface events.
17568         (Indexer): Derive from MemberBase, not MemberCore.
17569         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17570         (Indexer.Define): Use the new MethodBase functions.
17571
17572         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17573         argument to the constructor.
17574         (Interface.FindMembers): Added support for interface events.
17575         (Interface.PopluateEvent): Implemented.
17576
17577         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17578
17579 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17580
17581         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17582         but this is required to check for a method name being the same as
17583         the containing class.  
17584
17585         Handle this now.
17586
17587 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17588
17589         * interface.cs: initialize variable.
17590
17591 2002-07-23  Martin Baulig  <martin@gnome.org>
17592
17593         Implemented the IndexerName attribute in interfaces.
17594
17595         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17596         name if this is an explicit interface implementation.
17597         (Indexer.InterfaceIndexerName): New public variable.  If we're
17598         implementing an interface indexer, this is the IndexerName in that
17599         interface.  Otherwise, it's the IndexerName.
17600         (Indexer.DefineMethod): If we're implementing interface indexer,
17601         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17602         and Pending.ImplementIndexer methods.
17603         (Indexer.Define): Also define the PropertyBuilder if we're
17604         implementing an interface indexer and this is neither an explicit
17605         interface implementation nor do the IndexerName match the one in
17606         the interface.
17607
17608         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17609         If a method is defined here, then we always need to create a proxy
17610         for it.  This is used when implementing interface indexers.
17611         (Pending.IsInterfaceIndexer): New public method.
17612         (Pending.ImplementIndexer): New public method.
17613         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17614         This is used when implementing interface indexers to define a proxy
17615         if necessary.
17616         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17617         define a proxy if necessary.
17618
17619         * interface.cs (Interface.IndexerName): New public variable.
17620         (Interface.PopulateIndexer): Set the IndexerName.
17621         (Interface.DefineIndexers): New private method.  Populate all the
17622         indexers and make sure their IndexerNames match.
17623
17624         * typemanager.cs (IndexerPropertyName): Added support for interface
17625         indexers.
17626
17627 2002-07-22  Martin Baulig  <martin@gnome.org>
17628
17629         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17630         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17631         ret if HasReturnLabel.
17632         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17633         variables.
17634
17635         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17636         and set the ec.LoopBeginTryCatchLevel.
17637         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17638         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17639         the current ec.TryCatchLevel, the branch goes out of an exception
17640         block.  In this case, we need to use Leave and not Br.
17641
17642 2002-07-22  Martin Baulig  <martin@gnome.org>
17643
17644         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17645         block unless the block does not always return or it is contained in
17646         another try { ... } catch { ... } block.  Fixes bug #26506.
17647         Added verify-1.cs to the test suite.
17648
17649 2002-07-22  Martin Baulig  <martin@gnome.org>
17650
17651         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17652         then we do not always return.  Fixes bug #24985.
17653
17654 2002-07-22  Martin Baulig  <martin@gnome.org>
17655
17656         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17657         lookup on a per-class level; ie. walk up the class hierarchy until we
17658         found at least one applicable method, then choose the best among them.
17659         Fixes bug #24463 and test-29.cs.
17660
17661 2002-07-22  Martin Baulig  <martin@gnome.org>
17662
17663         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17664         return types of the methods.  The return type is not part of the
17665         signature and we must not check it to make the `new' modifier work.
17666         Fixes bug #27999, also added test-147.cs.
17667         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17668
17669         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17670         on the method's return type.
17671
17672 2002-07-21  Martin Baulig  <martin@gnome.org>
17673
17674         * assign.cs: Make this work if the rightmost source is a constant and
17675         we need to do an implicit type conversion.  Also adding a few more tests
17676         to test-38.cs which should have caught this.
17677
17678         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17679         target in the makefile for this.  The makefile.gnu is primarily intended
17680         for end-users who don't want to debug the compiler.
17681
17682 2002-07-21  Martin Baulig  <martin@gnome.org>
17683
17684         * assign.cs: Improved the Assign class so it can now handle embedded
17685         assignments (X = Y = Z = something).  As a side-effect this'll now also
17686         consume less local variables.  test-38.cs now passes with MCS, added
17687         a few new test cases to that test.
17688
17689 2002-07-20  Martin Baulig  <martin@gnome.org>
17690
17691         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17692         instructions.  Fixes bug #27977, also added test-146.cs.
17693
17694 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17695
17696         * cs-tokenizer.cs: fixed getHex ().
17697
17698 2002-07-19  Martin Baulig  <martin@gnome.org>
17699
17700         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17701         not Type.GetType() to lookup the array type.  This is needed when
17702         we're constructing an array of a user-defined type.
17703         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17704         single-dimensional arrays, but also for single-dimensial arrays of
17705         type decimal.
17706
17707 2002-07-19  Martin Baulig  <martin@gnome.org>
17708
17709         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17710         this function is called, it's not allowed to share LocalBuilders
17711         among ILGenerators.
17712
17713 2002-07-19  Martin Baulig  <martin@gnome.org>
17714
17715         * expression.cs (Argument.Resolve): Report an error 118 when trying
17716         to pass a type as argument.
17717
17718 2002-07-18  Martin Baulig  <martin@gnome.org>
17719
17720         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17721         Conv_R_Un for the signed `long' type.
17722
17723 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17724
17725         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17726         `expr' for the temporary result, as that will fail if we do
17727         multiple resolves on the same expression.
17728
17729 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17730
17731         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17732         ec.TypeContainer for looking up aliases. 
17733
17734         * class.cs (TypeContainer): Remove LookupAlias from here.
17735
17736         * decl.cs (DeclSpace); Move here.
17737
17738 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * class.cs (FindMembers): Only call filter if the constructor
17741         bulider is not null.
17742
17743         Also handle delegates in `NestedTypes' now.  Now we will perform
17744         type lookups using the standard resolution process.  This also
17745         fixes a bug.
17746
17747         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17748         This uses Expressions (the limited kind that can be parsed by the
17749         tree) instead of strings.
17750
17751         * expression.cs (ComposedCast.ToString): Implement, used to flag
17752         errors since now we have to render expressions.
17753
17754         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17755         FormArrayType. 
17756
17757         * ecore.cs (SimpleName.ToString): ditto.
17758
17759         * cs-parser.jay: Instead of using strings to assemble types, use
17760         Expressions to assemble the type (using SimpleName, ComposedCast,
17761         MemberAccess).  This should fix the type lookups in declarations,
17762         because we were using a different code path for this.
17763
17764         * statement.cs (Block.Resolve): Continue processing statements
17765         even when there is an error.
17766
17767 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17768
17769         * class.cs (Event.Define): Also remove the `remove' method from
17770         the list of pending items.
17771
17772         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17773         generate more compact code. 
17774
17775 2002-07-17  Martin Baulig  <martin@gnome.org>
17776
17777         * const.cs (Const.LookupConstantValue): Add support for constant
17778         `unchecked' and `checked' expressions.
17779         Also adding test case test-140.cs for this.
17780
17781 2002-07-17  Martin Baulig  <martin@gnome.org>
17782
17783         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17784         check whether mi.ReturnType implements the IEnumerator interface; the
17785         `==' and the IsAssignableFrom() will fail in this situation.
17786
17787 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17788
17789         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17790         here too.
17791
17792 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17793
17794         * expression.cs: fixed bug #27811.
17795
17796 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17797
17798         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17799         Molaro: when we are a ref, the value already contains a pointer
17800         value, do not take the address of it.
17801
17802 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17803         * removed mb-parser.jay and mb-tokenizer.cs
17804
17805 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17806
17807         * expression.cs: check against the building corlib void type.
17808
17809 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17810
17811         * ecore.cs: fix for valuetype static readonly fields: when 
17812         initializing them, we need their address, not the address of a copy.
17813
17814 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17815
17816         * typemanager.cs: register also enum_type in corlib.
17817
17818 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17819
17820         * class.cs: allow calling this (but not base) initializers in structs.
17821
17822 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17823
17824         * ecore.cs: make sure we compare against the building base types
17825         in GetTypeSize ().
17826
17827 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17828
17829         * typemanager.cs: fix TypeToCoreType() to handle void and object
17830         (corlib gets no more typerefs after this change).
17831
17832 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * expression.cs (ArrayCreation.EmitArrayArguments): use
17835         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17836
17837         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17838         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17839         array indexes, the runtime actually forbids them.
17840
17841         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17842         for array arguments here.
17843
17844         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17845         instead of the default for ValueTypes.
17846
17847         (New.DoEmit): Use IsValueType instead of
17848         IsSubclassOf (value_type)
17849         (New.DoResolve): ditto.
17850         (Invocation.EmitCall): ditto.
17851
17852         * assign.cs (Assign): ditto.
17853
17854         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17855         Statements *are* currently doing part of their resolution during
17856         Emit.  
17857
17858         Expressions do always resolve during resolve, but statements are
17859         only required to propagate resolution to their children.
17860
17861 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17862
17863         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17864
17865         (LoadAssembly): Do not add the dll if it is already specified
17866
17867         (MainDriver): Add the System directory to the link path at the end,
17868         after all the other -L arguments. 
17869
17870         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17871         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17872         ldelem.u1) and using the opposite for sbytes.
17873
17874         This fixes Digger, and we can finally run it.
17875
17876         * driver.cs (UnixParseOption): Move the option parsing here.  
17877         (CSCParseOption): Implement CSC-like parsing of options.
17878
17879         We now support both modes of operation, the old Unix way, and the
17880         new CSC-like way.  This should help those who wanted to make cross
17881         platform makefiles.
17882
17883         The only thing broken is that /r:, /reference: and /lib: are not
17884         implemented, because I want to make those have the same semantics
17885         as the CSC compiler has, and kill once and for all the confussion
17886         around this.   Will be doing this tomorrow.
17887
17888         * statement.cs (Unsafe.Resolve): The state is checked during
17889         resolve, not emit, so we have to set the flags for IsUnsfe here.
17890
17891 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17892
17893         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17894         not catch the Error_ObjectRefRequired in SimpleName (as it is
17895         possible to have a class/instance variable name that later gets
17896         deambiguated), we have to check this here.      
17897
17898 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17899
17900         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17901         make static and put into Expression.
17902
17903         (Event.Define): Register the private field of the event with the 
17904         TypeManager so that GetFieldFromEvent can get at it.
17905
17906         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17907         keep track of the private field associated with an event which
17908         has no accessors.
17909
17910         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17911         private field.
17912
17913         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17914
17915 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * expression.cs (Binary.EmitBranchable): this routine emits the
17918         Binary expression in a branchable context.  This basically means:
17919         we need to branch somewhere, not just get the value on the stack.
17920
17921         This works together with Statement.EmitBoolExpression.
17922
17923         * statement.cs (Statement.EmitBoolExpression): Use
17924         EmitBranchable. 
17925
17926 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17927
17928         * statement.cs (For): Reduce the number of jumps in loops.
17929
17930         (For): Implement loop inversion for the For statement.
17931
17932         (Break): We can be breaking out of a Try/Catch controlled section
17933         (foreach might have an implicit try/catch clause), so we need to
17934         use Leave instead of Br.
17935
17936         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17937         now).  If the instace expression supports IMemoryLocation, we use
17938         the AddressOf method from the IMemoryLocation to extract the
17939         address instead of emitting the instance.
17940
17941         This showed up with `This', as we were emitting the instance
17942         always (Emit) instead of the Address of This.  Particularly
17943         interesting when This is a value type, as we dont want the Emit
17944         effect (which was to load the object).
17945
17946 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17949
17950         * statement.cs (Checked): Set the CheckedState during the resolve
17951         process too, as the ConvCast operations track the checked state on
17952         the resolve process, and not emit.
17953
17954         * cs-parser.jay (namespace_member_declaration): Flag that we have
17955         found a declaration when we do.  This is used to flag error 1529
17956
17957         * driver.cs: Report ok when we display the help only.
17958
17959 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17960
17961         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17962
17963 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * cs-tokenizer.cs (define): We also have to track locally the
17966         defines.  AllDefines is just used for the Conditional Attribute,
17967         but we also need the local defines for the current source code. 
17968
17969 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * statement.cs (While, For, Do): These loops can exit through a
17972         Break statement, use this information to tell whether the
17973         statement is the last piece of code.
17974
17975         (Break): Flag that we break.
17976
17977         * codegen.cs (EmitContexts): New `Breaks' state variable.
17978
17979 2002-07-03  Martin Baulig  <martin@gnome.org>
17980
17981         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17982         modifiers in method declarations in structs.  Otherwise, you won't
17983         be able to override things like Object.Equals().
17984
17985 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17986
17987         * class.cs (Method, Property, Indexer): Do not allow the public
17988         modifier to be used in explicit interface implementations.
17989
17990         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17991         override modifiers in method declarations in structs
17992
17993 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17994
17995         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17996         integer or real overflow, report an error
17997
17998 2002-07-02  Martin Baulig  <martin@gnome.org>
17999
18000         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18001         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18002         to tell the runtime about our newly created System.Object and
18003         System.ValueType types.
18004
18005 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18008         struct instead of Ldarg/Starg.
18009
18010 2002-07-02  Martin Baulig  <martin@gnome.org>
18011
18012         * expression.cs (Indirection.Indirection): Call
18013         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18014
18015 2002-07-02  Martin Baulig  <martin@gnome.org>
18016
18017         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18018         ValueType, call TypeManager.TypeToCoreType() on it.
18019         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18020         the OpCodes.Newarr argument.
18021
18022 2002-07-02  Martin Baulig  <martin@gnome.org>
18023
18024         * expression.cs (Invocation.EmitCall): When compiling corlib,
18025         replace all calls to the system's System.Array type to calls to
18026         the newly created one.
18027
18028         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18029         System.Array methods.
18030         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18031         from the system's System.Array type which must be replaced.
18032
18033 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18034
18035         * typemanager.cs: load unverifiable_code_ctor so we can build
18036         corlib using the correct type. Avoid using GetTypeCode() with
18037         TypeBuilders.
18038         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18039         TypeManager.object_type to allow building corlib.
18040
18041 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18042
18043         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18044
18045 2002-07-01  Martin Baulig  <martin@gnome.org>
18046
18047         * class.cs: Make the last change actually work, we need to check
18048         whether `ifaces != null' to avoid a crash.
18049
18050 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18051
18052         * class.cs: when we build structs without fields that implement
18053         interfaces, we need to add the interfaces separately, since there is
18054         no API to both set the size and add the interfaces at type creation
18055         time.
18056
18057 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18058
18059         * expression.cs: the dimension arguments to the array constructors
18060         need to be converted if they are a long.
18061
18062 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18063
18064         * class.cs: don't emit ldarg.0 if there is no parent constructor
18065         (fixes showstopper for corlib).
18066
18067 2002-06-29  Martin Baulig  <martin@gnome.org>
18068
18069         MCS now compiles corlib on GNU/Linux :-)
18070
18071         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18072         ie. check for MethodImplOptions.InternalCall.
18073
18074         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18075         and TypeManager.attribute_type are null, so we must explicitly check
18076         whether parent is not null to find out whether it's an attribute type.
18077         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18078         and SetBuilder, not only if the property is neither abstract nor external.
18079         This is necessary to set the MethodImplOptions on the accessor methods.
18080         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18081         SetBuilder, see Property.Emit().
18082
18083         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18084         populate "System.Object", "System.ValueType" and "System.Attribute" since
18085         they've already been populated from BootCorlib_PopulateCoreTypes().
18086
18087 2002-06-29  Martin Baulig  <martin@gnome.org>
18088
18089         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18090         is the NullLiteral, we also need to make sure that target_type is not
18091         an enum type.   
18092
18093 2002-06-29  Martin Baulig  <martin@gnome.org>
18094
18095         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18096         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18097         before calling BootstrapCorlib_ResolveDelegate ().
18098
18099 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18100
18101         * statement.cs: fixed build-breaker. All tests passed ok.
18102
18103 2002-06-27  Martin Baulig  <martin@gnome.org>
18104
18105         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18106         for System.Decimal when compiling corlib.
18107
18108 2002-06-27  Martin Baulig  <martin@gnome.org>
18109
18110         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18111         switch blocks which contain nothing but a default clause.
18112
18113 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18114
18115        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18116
18117 2002-06-27  Martin Baulig  <martin@gnome.org>
18118
18119         * ecore.cs (PropertyExpr.PropertyExpr): Call
18120         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18121
18122         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18123         is already a TypeBuilder.
18124
18125 2002-06-27  Martin Baulig  <martin@gnome.org>
18126
18127         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18128         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18129         the "from an array-type to System.Array" case.  This makes it work
18130         when compiling corlib.
18131
18132 2002-06-27  Martin Baulig  <martin@gnome.org>
18133
18134         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18135         non-static PropertyExpr, set its InstanceExpression.  This makes
18136         the `ICollection.Count' property work in System/Array.cs.
18137
18138 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18139
18140         * driver.cs: Made error handling more consistent.  Errors now
18141         tracked by Report class, so many methods which used to return int
18142         now return void.  Main() now prints success/failure and 
18143         errors/warnings message.
18144
18145         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18146         the magic number return values (123 and 124).  Now, if the
18147         expected error occurs, the compiler exits with success (exit value
18148         0).  If the compilation completes without seeing that particular
18149         error, the compiler exits with failure (exit value 1).  The
18150         makefile in mcs/errors has been changed to handle the new behaviour.
18151
18152         * report.cs: Made 'expected error' number a property and renamed
18153         it from 'Probe' to 'ExpectedError'.
18154
18155         * genericparser.cs: Removed error handling support, since it is
18156         now all done by Report class.
18157
18158         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18159         class, so parse() no longer returns an int.
18160
18161         * namespace.cs: Use Report.Error instead of GenericParser.error
18162
18163 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18166         TypeContainer.AddOperator): At the front of the list put the
18167         explicit implementations, so they get resolved/defined first. 
18168
18169 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18170
18171         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18172         interface type is implemented by this TypeContainer.  Used during
18173         explicit interface implementation.
18174
18175         (Property.Define, Indexer.Define, Method.Define): Validate that
18176         the given interface in the explicit implementation is one of the
18177         base classes for the containing type.
18178
18179         Also if we are explicitly implementing an interface, but there is
18180         no match in the pending implementation table, report an error.
18181
18182         (Property.Define): Only define the property if we are
18183         not explicitly implementing a property from an interface.  Use the
18184         correct name also for those properties (the same CSC uses,
18185         although that is really not needed).
18186
18187         (Property.Emit): Do not emit attributes for explicitly implemented
18188         properties, as there is no TypeBuilder.
18189
18190         (Indexer.Emit): ditto.
18191
18192         Hiding then means that we do not really *implement* a pending
18193         implementation, which makes code fail.
18194
18195 2002-06-22  Martin Baulig  <martin@gnome.org>
18196
18197         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18198         the return value of Object.GetType().  [FIXME: we need to do this whenever
18199         we get a type back from the reflection library].
18200
18201 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18202
18203         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18204
18205 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18206
18207         * attribute.cs: Return null if we can not look up the type.
18208
18209         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18210         the interface types found.
18211
18212         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18213         interface types found.
18214
18215         * typemanager.cs (GetInterfaces): Make this routine returns alll
18216         the interfaces and work around the lame differences between
18217         System.Type and System.Reflection.Emit.TypeBuilder in the results
18218         result for GetInterfaces.
18219
18220         (ExpandInterfaces): Given an array of interface types, expand and
18221         eliminate repeated ocurrences of an interface.  This expands in
18222         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18223         be IA, IB, IC.
18224
18225 2002-06-21  Martin Baulig  <martin@gnome.org>
18226
18227         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18228         on System.Enum.
18229
18230 2002-06-21  Martin Baulig  <martin@gnome.org>
18231
18232         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18233         and called with one of the core types, return the corresponding typebuilder for
18234         that type.
18235
18236         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18237         element type.
18238
18239 2002-06-21  Martin Baulig  <martin@gnome.org>
18240
18241         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18242         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18243         (Expression.ConvertReferenceExplicit): Likewise.
18244
18245         * expression.cs (ElementAccess.DoResolve): Likewise.
18246         (ElementAccess.DoResolveLValue): Likewise.
18247
18248 2002-06-10  Martin Baulig  <martin@gnome.org>
18249
18250         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18251         add the "value" parameter to the parameter list.
18252
18253         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18254         to our caller.
18255
18256 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18257
18258         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18259         the argument to an int, uint, long or ulong, per the spec.  Also
18260         catch negative constants in array creation.
18261
18262 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18263
18264         * class.cs: do not allow the same interface to appear twice in
18265         the definition list.
18266
18267 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18268
18269         * ecore.cs: don't use ldlen with System.Array.
18270
18271 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18272
18273         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18274
18275 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18276
18277         * modifiers.cs: produce correct field attributes for protected
18278         internal. Easy fix so miguel can work on ther harder stuff:-)
18279
18280 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18281
18282         * pending.cs: New file.  Move the code from class.cs here.
18283         Support clearning the pending flag for all methods (when not doing
18284         explicit interface implementation).
18285
18286 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18287
18288         * rootcontext.cs: added a couple more types needed to bootstrap.
18289
18290 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18293         constructor in the type, instead of any constructor in the type
18294         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18295         a bug in the Mono runtime when applying the params attribute). 
18296
18297 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18298         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18299
18300 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18301
18302         * expression.cs (Unary.ResolveOperator): Use TypeManager
18303         to resolve the type.
18304
18305 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18306
18307         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18308         attached.
18309
18310         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18311         with each member too.
18312
18313         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18314         field builders too - this takes care of the enum member case.
18315
18316 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18317
18318         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18319         address-of operator on both value types and pointers.
18320
18321 2002-06-10  Martin Baulig  <martin@gnome.org>
18322
18323         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18324         PropertyBuilder to the `property_builders' list.
18325
18326         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18327         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18328         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18329         find any indexers which are inherited from an interface.
18330
18331 2002-06-09  Martin Baulig  <martin@gnome.org>
18332
18333         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18334         the same type as the constant if necessary.  There's also a test-130.cs
18335         for this.
18336
18337         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18338
18339         * typemanager.cs (TypeManager.ChangeType): Previously known as
18340         Enum.ChangeEnumType().
18341
18342 2002-06-09  Martin Baulig  <martin@gnome.org>
18343
18344         * expression.cs (Cast.TryReduce): Added support for consts.
18345
18346 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18347
18348         * class.cs (Accessor): Hold attributes information so we can pass
18349         it along.
18350
18351         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18352         Modify to pass in attributes attached to the methods.
18353
18354         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18355
18356         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18357         to handle the Accessor kind :-)
18358
18359         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18360
18361 2002-06-08  Martin Baulig  <martin@gnome.org>
18362
18363         * expression.cs (Unary.TryReduceNegative): Added support for
18364         ULongConstants.
18365
18366 2002-06-08  Martin Baulig  <martin@gnome.org>
18367
18368         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18369         name can't be found in the `defined_names' - the caller will do a
18370         MemberLookup in this case and thus find methods in System.Enum
18371         such as Enum.IsDefined().
18372
18373 2002-06-08  Martin Baulig  <martin@gnome.org>
18374
18375         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18376         Convert.ChangeType() which works with TypeBuilder created types.
18377         (Enum.LookupEnumValue, Enum.Define): Use it here.
18378
18379         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18380         `TypeBuilder.BaseType != null' check.
18381         (TypeContainer.FindMembers): Only lookup parent members if we
18382         actually have a parent.
18383         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18384         (ConstructorInitializer.Resolve): Likewise.
18385
18386         * interface.cs (Interface.FindMembers): Added
18387         `TypeBuilder.BaseType != null' check.
18388
18389         * rootcontext.cs (RootContext.ResolveCore): Added
18390         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18391         classes_second_stage.
18392
18393         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18394         debug_type and trace_type when compiling with --nostdlib.       
18395
18396 2002-06-07  Martin Baulig  <martin@gnome.org>
18397
18398         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18399         (AddField): Set it to true when adding a non-static field.
18400         (DefineType): Use `have_nonstatic_fields' to find out whether we
18401         have non-static fields, not `Fields != null'.
18402
18403 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18404
18405         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18406         dereferencing a null on the static-field code path)
18407
18408 2002-05-30  Martin Baulig  <martin@gnome.org>
18409
18410         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18411         to take command line arguments.  Use reflection to call the new
18412         custom `Initialize' function on the symbol writer and pass it the
18413         command line arguments.
18414
18415         * driver.cs (--debug-args): New command line argument to pass command
18416         line arguments to the symbol writer.
18417
18418 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18419
18420         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18421         the target type for indexers and properties.  Thanks to Joe for
18422         catching this.
18423
18424 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18425
18426         * typemanager.cs (MethodFlags): returns the method flags
18427         (Obsolete/ShouldIgnore) that control warning emission and whether
18428         the invocation should be made, or ignored. 
18429
18430         * expression.cs (Invocation.Emit): Remove previous hack, we should
18431         not do this on matching a base type, we should do this based on an attribute
18432
18433         Only emit calls to System.Diagnostics.Debug and
18434         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18435         on the command line.
18436
18437         * rootcontext.cs: Global settings for tracing and debugging.
18438
18439         * cs-tokenizer.cs (define): New utility function to track
18440         defines.   Set the global settings for TRACE and DEBUG if found.
18441
18442 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18443
18444         * interface.cs (Populate*): Pass in the TypeContainer as well as
18445         the DeclSpace as parameters so that we can create EmitContexts and
18446         then use that to apply attributes etc.
18447
18448         (PopulateMethod, PopulateEvent, PopulateProperty)
18449         (PopulateIndexer): Apply attributes everywhere.
18450
18451         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18452         etc.
18453
18454         (ApplyAttributes): Update accordingly.
18455
18456         We now apply interface attributes for all members too.
18457
18458 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18459
18460         * class.cs (Indexer.Define); Correctly check if we are explicit
18461         implementation (instead of checking the Name for a ".", we
18462         directly look up if the InterfaceType was specified).
18463
18464         Delay the creation of the PropertyBuilder.
18465
18466         Only create the PropertyBuilder if we are not an explicit
18467         interface implementation.   This means that explicit interface
18468         implementation members do not participate in regular function
18469         lookups, and hence fixes another major ambiguity problem in
18470         overload resolution (that was the visible effect).
18471
18472         (DefineMethod): Return whether we are doing an interface
18473         implementation. 
18474
18475         * typemanager.cs: Temporary hack until we get attributes in
18476         interfaces (Ravi is working on that) and we get IndexerName
18477         support in interfaces.
18478
18479         * interface.cs: Register the indexers as properties.
18480
18481         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18482         warning, I have verified that this is a bug in the .NET runtime
18483         (JavaScript suffers of the same problem).
18484
18485         * typemanager.cs (MemberLookup): When looking up members for
18486         interfaces, the parent of an interface is the implicit
18487         System.Object (so we succeed in searches of Object methods in an
18488         interface method invocation.  Example:  IEnumerable x;  x.ToString
18489         ()) 
18490
18491 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18492
18493         * class.cs (Event): Events should also register if they do
18494         implement the methods that an interface requires.
18495
18496         * typemanager.cs (MemberLookup); use the new GetInterfaces
18497         method. 
18498
18499         (GetInterfaces): The code used to lookup interfaces for a type is
18500         used in more than one place, factor it here. 
18501
18502         * driver.cs: Track the errors at the bottom of the file, we kept
18503         on going.
18504
18505         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18506         instance if the method we are calling is static!
18507
18508 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18509
18510         * attribute.cs (ApplyAttributes): Make this function filter out
18511         the IndexerName attribute (as that attribute in reality is never
18512         applied) and return the string constant for the IndexerName
18513         attribute. 
18514
18515         * class.cs (TypeContainer.Emit): Validate that all the indexers
18516         have the same IndexerName attribute, and if so, set the
18517         DefaultName attribute on the class. 
18518
18519         * typemanager.cs: The return value might contain other stuff (not
18520         only methods).  For instance, consider a method with an "Item"
18521         property and an Item method.
18522
18523         * class.cs: If there is a problem with the parameter types,
18524         return. 
18525
18526 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18527
18528         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18529         looks at user defined conversion after making a call to 
18530         StandardConversionExists - we need this for overload resolution.
18531
18532         * expression.cs : Update accordingly the various method calls.
18533
18534         This fixes 2 bugs filed against implicit user defined conversions 
18535
18536 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * statement.cs: Track the result of the assignment.
18539
18540 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18541
18542         * expression.cs (MemberAccess): Improved error reporting for
18543         inaccessible members.
18544
18545 2002-05-22  Martin Baulig  <martin@gnome.org>
18546
18547         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18548         itself with debugging support.
18549
18550 2002-05-22  Martin Baulig  <martin@gnome.org>
18551
18552         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18553         Removed, this isn't needed anymore.
18554
18555 2002-05-20  Martin Baulig  <martin@gnome.org>
18556
18557         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18558         be underlying type for an enum.
18559
18560 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18561
18562         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18563         that splits out the loading of just the core types.
18564
18565         * rootcontext.cs (ResolveCore): Split the struct resolution in
18566         two, so we can load the enumeration underlying types before any
18567         enums are used.
18568
18569         * expression.cs (Is): Bandaid until we fix properly Switch (see
18570         bug #24985 for details).
18571
18572         * typemanager.cs (ImplementsInterface): The hashtable will contain
18573         a null if there are no interfaces implemented.
18574
18575 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18576
18577         * cs-parser.jay (indexer_declarator): It is fine to have array
18578         parameters
18579
18580 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18581
18582         * typemanager.cs: (RegisterBuilder): New function used to register
18583         TypeBuilders that implement interfaces.  Since
18584         TypeBuilder.GetInterfaces (as usual) does not work with lame
18585         Reflection.Emit. 
18586         (AddUserType): register interfaces.
18587
18588         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18589         dealing with TypeBuilder.  Also, arrays are showing up as
18590         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18591         methods can not be invoked on them!
18592
18593         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18594         (ImplicitReferenceConversionExists): Split out from
18595         StandardConversionExists. 
18596
18597         * expression.cs (As): We were only implementing one of the three
18598         cases for the as operator.  We now implement them all.
18599         (Is): Implement the various other cases for Is as well.
18600
18601         * typemanager.cs (CACHE): New define used to control if we want or
18602         not the FindMembers cache.  Seems to have a negative impact on
18603         performance currently
18604
18605         (MemberLookup): Nested types have full acess to
18606         enclosing type members
18607
18608         Remove code that coped with instance/static returns for events, we
18609         now catch this in RealFindMembers.
18610
18611         (RealFindMembers): only perform static lookup if the instance
18612         lookup did not return a type or an event.  
18613
18614 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18615
18616         * assign.cs (CompoundAssign): We pass more semantic information
18617         now to Compound Assignments than we did before: now we have all
18618         the information at hand, and now we resolve the target *before* we
18619         do the expression expansion, which allows the "CacheValue" method
18620         to have the effect we intended (before, a [x] += 1 would generate
18621         two differen ArrayAccess expressions from the ElementAccess,
18622         during the resolution process).
18623
18624         (CompoundAssign.DoResolve): Resolve target and original_source here.
18625
18626 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * expression.cs (ArrayAccess): dropped debugging information. 
18629
18630         * typemanager.cs: Small bug fix: I was always returning i_members,
18631         instead of one of i_members or s_members (depending on which had
18632         the content).
18633
18634         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18635         method is invoked before any code generation takes place, and it
18636         is a mechanism to inform that the expression will be invoked more
18637         than once, and that the method should use temporary values to
18638         avoid having side effects
18639
18640         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18641
18642         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18643         implementation.
18644
18645         * expression.cs (Indirection, ArrayAccess): Add support for
18646         CacheTemporaries in these two bad boys. 
18647
18648         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18649         ldobj or ldind_ref.  
18650         (StoreFromPtr): Handle stobj as well.
18651
18652         * expression.cs (UnaryMutator): Share more code.
18653
18654         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18655         down: I was not tracking the Filter function as well, which
18656         was affecting the results of the cache.
18657
18658 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18659
18660         * attribute.cs: Remove the hack to handle the CharSet property on
18661         StructLayouts. 
18662
18663 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * attribute.cs (DoResolve): More uglyness, we now only try to
18666         resolve the attribute partially, to extract the CharSet
18667         information (only if we are a StructLayout attribute).  Otherwise 
18668
18669         (GetExtraTypeInfo): Add some code to conditionally kill in the
18670         future this.   I am more and more convinced that the .NET
18671         framework has special code to handle the attribute setting on
18672         certain elements.
18673
18674         * expression.cs (IsParamsMethodApplicable): Revert my previous
18675         foreach change here, it was wrong.
18676
18677 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18680         (pp_expr): do not abort on unknown input, just return.
18681         (eval): abort if there are pending chars.
18682
18683         * attribute.cs (Attribute.Resolve): Positional parameters are
18684         optional.  Deal with that case.
18685
18686         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18687         the Ansi/Unicode/Auto information for the type.
18688
18689         (TypeContainer.DefineType): instantiate the EmitContext here, as
18690         we will be using it during the type definition (to resolve
18691         attributes) and during the emit phase.
18692
18693         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18694         to pull type information out of the attributes
18695
18696         (Attribute.Resolve): track the constructor builder, and allow for
18697         multiple invocations (structs and classes will use this).
18698
18699         * ecore.cs (MemberLookupFinal): new version with all the
18700         parameters customizable.
18701
18702         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18703         constructors.  Return if the result value is null (as the error
18704         would have been flagged already by MemberLookupFinal)
18705
18706         Do not allow instances of abstract classes or interfaces to be
18707         created.
18708
18709         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18710         We have to compare the assembly property here when dealing with
18711         FamANDAssem and Assembly access modifiers, because we might be
18712         creating an assembly from *modules* (that means that we are not
18713         getting TypeBuilders for types defined in other modules that are
18714         part of this assembly).
18715
18716         (Method.Emit): If the method is marked abstract and has a body,
18717         emit an error. 
18718
18719         (TypeContainer.DefineMembers): If both the defined member and the
18720         parent name match are methods, then do not emit any warnings: let
18721         the Method.Define routine take care of flagging warnings.  But if
18722         there is a mismatch (method overrides something else, or method is
18723         overriwritten by something, then emit warning).
18724
18725         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18726         set to null, this means `do not check for the return type on the
18727         signature'. 
18728
18729         (Method.Define): set the return type for the method signature to
18730         null, so that we get methods with the same name and parameters and
18731         different return types.  This is used to flag warning 114 (you are
18732         hiding a method, and you probably want to use the new/override
18733         keywords instead).
18734
18735         * typemanager.cs (MemberLookup): Implemented proper access
18736         control, closing a long standing set of bug reports.  The problem
18737         was that the Framework only has two bits: Public and NonPublic,
18738         and NonPublic includes private and protected methods, but we need
18739         to enforce the FamANDAssem, FamOrAssem and Family. 
18740
18741 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18742
18743         * statement.cs (GotoCase): Return true: Ammounts to giving up
18744         knowledge on whether we return or not, and letting the other case
18745         be responsible for it.
18746
18747 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * driver.cs: Do not load directories for each file processed, only
18750         do it if there is a pattern.
18751
18752         * ecore.cs: Report readonly assigns here as well, as we might have
18753         been resolved only by MemberAccess.
18754
18755         (SimpleName.SimpleNameResolve): Also be useful for LValue
18756         resolution.   We need this to propagate assign to local readonly variables
18757
18758         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18759         do not want to reuse potential criteria memory.
18760
18761         * class.cs (MyEventBuilder): Set reflected_type;
18762
18763         * ecore.cs (Constantify): Added support for constifying bools.
18764
18765         (RootContext.LookupType): Added a cache for values looked up in
18766         the declaration space.
18767
18768         * typemanager.cs (FindMembers): Now is a front-end to
18769         RealFindMembers, and provides a two-level hashtable-based cache to
18770         the request.  
18771
18772         15% performance improvement: from 22.5 to 19.2 seconds.
18773
18774         * expression.cs (IsParamsMethodApplicable): use foreach.
18775         (Invocation.DoResolve): ditto.
18776         (New.DoResolve): ditto.
18777         (ArrayCreation.DoResolve): ditto.
18778
18779         * ecore.cs (FindMostEncompassingType): use foreach.
18780
18781         * delegate.cs (NewDelegate.DoResolve): Use foreach
18782
18783         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18784         (RemoveMethods): use foreach.
18785
18786         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18787         nested foreach statements instead of for, and also break out of
18788         the inner loop once a match is found.
18789
18790         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18791
18792 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18795         we actually unwrap the expression to allow for extra information
18796         to be extracted. 
18797
18798         * expression.cs: Use Shr_Un on unsigned operations. 
18799
18800 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18801
18802         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18803         applicable operators was not being considered correctly. This closes
18804         the bug Miguel reported.
18805
18806 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18807
18808         * attribute.cs: check that the type derives from System.Attribute
18809         and report the correct error in that case (moved the duplicate code to
18810         its own method, too).
18811
18812 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18813
18814         * attribute.cs: lookup attribute type name as the spec says: first the
18815         bare attribute name and then name + "Attribute" (nant compiles with
18816         mcs after this fix).
18817
18818 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18821         Because of the way we parse things, we should try to see if a
18822         UIntConstant can fit in an integer.
18823
18824 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18825
18826         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18827         when we are in an explicit context.
18828
18829         (ConvertReferenceExplicit): When converting from Iface type S to Class
18830         T make sure the rules are implemented as an OR.
18831
18832         * parameter.cs (ParameterType): Make it a property for now although the
18833         purpose really isn't anything immediate.
18834
18835         * expression.cs (Is*Applicable): Do better checking on the parameter type
18836         of a ref/out parameter. The ones from the system assemblies are already 
18837         marked with the correct type so we don't need to do any correction.
18838
18839         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18840         the object type is standard too so include that.
18841
18842 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18843
18844         * ecore.cs (StandardConversionExists): Augment with missing code:
18845         deal with IntConstant, LongConstants and Enumerations.
18846
18847         * assign.cs: Report the error, instead of failing silently
18848
18849         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18850         typecontainer that they are declared, because the
18851         typecontainer/namespace will have the list of using clauses that
18852         need to be applied.
18853
18854         Assembly Attributes were escaping the normal registration
18855         mechanism. 
18856
18857         (EmitCode): Apply attributes within an EmitContext that represents
18858         the container they were declared on.
18859
18860         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18861
18862 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18863
18864         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18865         Revamp completely - make much cleaner as we now operate only
18866         on a set of Types.
18867
18868         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18869         to implement the logic detailed in the spec more correctly.
18870
18871         (UserDefinedConversion): Update accordingly.
18872
18873 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * statement.cs: Return flow analysis information up.
18876
18877         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18878         and the default.
18879
18880         (token): Do not consume an extra character before calling
18881         decimal_digits.
18882
18883 2002-05-06  Piers Haken <piersh@friskit.com>
18884
18885         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18886
18887 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18888
18889         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18890         EmitContext during the instance constructor initializer
18891         resolution, to stop access to instance variables.
18892
18893         This is mandated by the spec, last paragraph of the `constructor
18894         initializers' section. 
18895
18896 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18897
18898         * cs-parser.jay, class.cs (Accessor): new class used to represent
18899         an accessor (get or set).  In the past we used `null' to represent
18900         a missing accessor.  But this is ambiguous because there was no
18901         way to tell in abstract indexers/properties if one of them was
18902         specified.
18903
18904         Now there is a way of addressing that.
18905
18906         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18907         instead of FindMembers.
18908
18909         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18910         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18911
18912         * attribute.cs: Treat indexers and properties as the same in terms
18913         of applying attributes
18914
18915         * ecore.cs (FindMostEncompassedType): Use statically initialized
18916         EmptyExpressions()s like we do elsewhere to avoid creating useless
18917         objects (and we take this out of the tight loop).
18918
18919         (GetConversionOperators): Move the code to extract the actual
18920         operators to a separate routine to clean things up.
18921
18922 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18923
18924         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18925         events are always registered FieldBuilders.
18926
18927         * class.cs (FieldBase): New class shared by Fields 
18928
18929         * delegate.cs: If we are a toplevel delegate, use our full name.
18930         If we are a nested delegate, then only use our tail name.
18931
18932 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18933
18934         * expression.cs (IsApplicable): Ensure that we add the "&" to
18935         ref/out types before comparing it with the type of the argument.
18936
18937         (IsParamsMethodApplicable): Ditto.
18938
18939         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18940         silly me ;-)
18941
18942         * delegate.cs : Handle the case when we have more than one applicable
18943         method. Flag an error only when we finish checking all.
18944
18945 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * expression.cs: Add support for boolean static initializers.
18948
18949 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18950
18951         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18952
18953         * parameter.cs (ComputeParameterTypes,
18954         ComputeAndDefineParameterTypes): Better error handling: now we
18955         clear the `types' cache if we fail during any of the type lookups.
18956         We also return the status code correctly to our caller
18957
18958         * delegate.cs: If we fail to define a delegate, abort the extra
18959         steps. 
18960
18961         * expression.cs (Binary.ResolveOperator): for
18962         operator==(object,object) and operator !=(object, object) we also
18963         have to verify that there is an implicit conversion from one to
18964         the other.
18965
18966         (ArrayAccess.DoResolve): Array Access can operate on
18967         non-variables. 
18968
18969 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * assign.cs (CompoundAssign): A new class used as a "flag" that
18972         the assignment actually is happening as part of a compound
18973         assignment operator.
18974
18975         During compound assignment, a few new rules exist to enable things
18976         like:
18977
18978         byte b |= 1 + 2
18979
18980         From the spec:
18981
18982         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18983         to the type of x) if y is implicitly convertible to the type of x,
18984         and the operator is a builtin operator and the return type of the
18985         operator is explicitly convertible to the type of x. 
18986
18987         * rootcontext.cs: Reset warning level to 2.  4 catches various
18988         "interesting" features in mcs, we must clean this up at some
18989         point, but currently am trying to kill other bugs ;-)
18990
18991         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18992         in container classes as well.  
18993
18994         * expression.cs (Binary.ResolveOperator): Handle string case
18995         before anything else (as operator overloading does emit an error
18996         before doing anything else).
18997
18998         This code could go away when we move to a table driven model, but
18999         i could not come up with a good plan last night.
19000
19001 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19002
19003         * typemanager.cs (CSharpName): reimplementation using regex.
19004         * class.cs: added null check for fields in Emit
19005         * rootcontext.cs: set warninglevel to 4
19006
19007 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19008
19009         * typemanager.cs (CSharpName): reimplemented with Lupus
19010         suggestion.
19011
19012 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19013
19014         * statement.cs (If): correclty implement Resolve, because we were
19015         not catching sem errors in there.  The same process is needed
19016         everywhere else. 
19017         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19018
19019
19020         (Statement.Warning_DeadCodeFound): Factorize code.
19021         (While): Report dead code here too.
19022
19023         (Statement): Added Resolve virtual method to allow
19024         for resolution split from the emit code.
19025
19026 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19027
19028         * statement.cs (EmitBoolExpression): No longer try to resolve the
19029         expression here.    
19030         (MakeBoolean): New utility function that resolve, implicitly
19031         converts to boolean and tags the expression. 
19032
19033
19034         (If, Do): Implement dead code elimination.
19035         (While): Implement loop inversion
19036
19037         (Do, While, For, If): Resolve the expression prior to calling our
19038         code generation.
19039
19040 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19041
19042         * class.cs:
19043           - added method Report28 (warning: program has more than one entry point)
19044           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19045           - modified method Method.Define, the part at the end of the method
19046
19047         * rootcontext.cs: added static public Location EntryPointLocation;
19048           
19049         * ../errors/cs0028.cs : Add test case for the above warning.              
19050
19051         * typemanager.cs:
19052           - modified method CSharpName to allow arrays of primitive type to
19053             be printed nicely (e.g. instead of System.Int32[][] it now prints
19054             int[][])
19055           - added method CSharpSignature: returns the signature of a method
19056             in string format to be used in reporting errors, warnings, etc.
19057
19058         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19059         with String.Empty.
19060
19061 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19062
19063         * delegate.cs (Define): Fix extremely silly bug where I was
19064         setting the type of the 'object' parameter of the BeginInvoke
19065         method to System.IAsyncResult instead of System.Object ;-)
19066
19067 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19070         here. 
19071
19072         (Constructor.Emit): return if we fail to initialize the
19073         constructor.  Another door closed!  
19074
19075         * expression.cs (New.DoResolve): Improve error message (from -6 to
19076         1501).  Use DeclaredOnly lookup to find the exact constructor.
19077
19078         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19079         loop.  This is useful.
19080
19081         * cs-parser.jay: Adjust the default parameters so that destructors
19082         have the proper signature.
19083
19084 2002-04-26  Martin Baulig  <martin@gnome.org>
19085
19086         * driver.cs (LoadAssembly): If `assembly' contains any characters
19087         which are only valid in path names and not in assembly names
19088         (currently slash, backslash and point), use Assembly.LoadFrom ()
19089         instead of Assembly.Load () on the `assembly' (before iteration
19090         over the link_paths).
19091
19092 2002-04-26  Martin Baulig  <martin@gnome.org>
19093
19094         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19095
19096 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19097
19098         * class.cs (Property): use the new typemanager.MemberLookup
19099
19100         (TypeContainer.MemberLookup): Implement using the
19101         TypeManager.MemberLookup now. 
19102
19103         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19104         and return MemberInfos, so that these can be used without an
19105         EmitContext (what we had before).
19106
19107 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * expression.cs: Fix the case where the argument to params if the
19110         type of the params.  I omitted handling this before.   Fixed
19111
19112 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19113
19114         * driver.cs: Call BootCorlib_PopulateCoreType
19115
19116         * class.cs (Property.CheckBase): Check for properties only, not
19117         for all members. 
19118
19119         * interface.cs: Temporary hack: try/catch around the
19120         CustomAttributeBuilder, because I am getting an exception that I
19121         do not understand.
19122
19123         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19124         types whose definitions are required to be there (attributes are
19125         defined before standard types).
19126
19127         Compute definitions as we boot the various types, as they are used
19128         immediately (value_type class will need object_type, but if we do
19129         not initialize object_type, we will pass a null, which will let
19130         the runtime pick the System.Object from the existing corlib, which
19131         is not what we want).
19132
19133 2002-04-22  Patrik Torstensson <totte@labs2.com>
19134
19135         * cs-tokenizer.cs: fixed a number of trim() issues.
19136
19137 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19138
19139         * expression.cs (Argument.Type): Ensure that we return the correct
19140         type when we have out or ref parameters [in which case we 
19141         append a "&"].
19142
19143 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * class.cs (Property, Indexer): Allow extern modifier in there. 
19146
19147         * typemanager.cs (InitBaseTypes): Initializes object_type and
19148         value_type, since those will be used early on during the bootstrap
19149         process to compile corlib.
19150
19151         (InitCoreTypes): Move code from here to InitBaseTypes.
19152
19153 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19154
19155         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19156         single-dimension arrays as using the ldlen opcode.  
19157
19158         Daniel Lewis discovered this optimization.  
19159
19160         * typemanager.cs: Add signature for System.Array::get_Length
19161
19162 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19163
19164         * statement.cs: report the error when the foreach does not apply to an
19165         array nor a collection.
19166
19167 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19168
19169         * expression.cs: Add implicit conversions to the operator ~.
19170
19171         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19172
19173         * typemanager.cs: Locate the decimal constructor.
19174
19175 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19176
19177         * attribute.cs: use the new property of TypeOf.
19178         * expression.cs: added 'get' property around typearg.
19179
19180         These changes fix a build breaker reported by NickD. Is this the
19181         correct way to fix?  If not, please, revert my changes and make it
19182         work :-).
19183
19184 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * attribute.cs: Add support for typeof in attribute invocations.
19187         I am not sure that this is right though.
19188
19189 2002-04-14  Duncan Mak  <duncan@ximian.com>
19190
19191         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19192         Binary.Operator.Division case.
19193
19194 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19195
19196         * class.cs (DefineType): Ensure that we do a proper check on
19197         attribute types and also register it with the TypeManager.
19198
19199         (TypeContainer.Targets): The default for attribute types is
19200         AttributeTargets.All.
19201
19202         * attribute.cs (ApplyAttributes): Registering the attribute type
19203         is done elsewhere, not when we discover we have a Usage attribute.
19204
19205 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19206
19207         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19208         and get rid of is_delegate parameter.
19209
19210         * everywhere : update.
19211
19212 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19213
19214         * cs-parser.jay (compilation_unit): Revamp completely to use
19215         some new ideas that I got from Rhys' grammar to solve the problems
19216         with assembly level attributes.
19217
19218         (outer_declaration): New grammar production.
19219
19220         (attribute_sections): Add.
19221
19222         (opt_attributes): Base on attribute_sections
19223
19224         (namespace_declaration): Allow opt_attributes to tackle the case
19225         when we have assembly level attributes - we are clever in this
19226         regard now ;-)
19227
19228         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19229         attributes in the non-global context.
19230
19231         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19232         instead of SetGlobalAttributes.
19233
19234         * class.cs, rootcontext.cs : Ensure we define and generate 
19235         attribute types before anything else.
19236
19237         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19238         and flag the new error -20 for the case when the attribute type
19239         does not have valid targets specified. csc does not catch this.
19240
19241         * ../errors/errors.txt : update for error # -20
19242
19243 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19244
19245         * support.cs (InternalParameters.ParameterModifier): Do some null
19246         checking and return sane values.
19247
19248         * class.cs (Method.Define): If we are a PInvoke method, ensure
19249         that we are static and extern. Report error # 601
19250
19251         * ../errors/cs0601.cs : Add test case for the above error.
19252
19253 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19254
19255         * rootcontext.cs (attribute_types): We need to keep type of
19256         all attribute types separately and emit code for them first.
19257
19258         (RegisterAttribute) : Implement.
19259
19260         * class.cs (DefineType): Check if the current Type is a custom
19261         attribute type and register it accordingly.
19262
19263         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19264         adding the first attribute twice and rename to
19265
19266         (SetGlobalAttributes): this.
19267
19268         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19269         lookups.
19270
19271         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19272         if we are processing global arguments. Hmm, I am unsure of this.
19273
19274 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19275
19276         * expression.cs: added static array of strings to avoid calling
19277         Enum.ToString () for Operator in Binary. Significant recover of
19278         performance.
19279
19280 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19281
19282         * class.cs (FindMembers): Allow the Builders of the various
19283         members to be null.  If they are skip them.  This only happens
19284         during the PInvoke declaration.
19285
19286 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19289         failure, so we do not keep going afterwards.
19290
19291         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19292         wanted to pass `false' as the `is_delegate' argument.  If this is
19293         the case, why not use delegate_type == null to mean `is_delegate =
19294         false' and anything else as is_delegate = true.
19295
19296 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19297
19298         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19299         code for the section, not the beginning of the tests.
19300
19301 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19302
19303         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19304
19305         * expression.cs (Binary): same.  Warn about errors where we have
19306         Enum/Enum in operator + as well.
19307
19308 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19309
19310         * statement.cs:
19311                 - added support for switch(bool)
19312                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19313                 - add TableSwitchEmit() to handle table-based switch statements
19314
19315 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19316
19317         * expression.cs (Invocation.OverloadResolve): Factor out code which
19318         does parameter compatibility checking with arguments so that we can 
19319         re-use the code even from Delegate.VerifyApplicability
19320
19321         (VerifyArgumentsCompat): Move above code here.
19322
19323         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19324         and instead make a call to the above method.
19325
19326 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19327
19328         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19329         We use it to keep track of classes which are attribute types.
19330
19331 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * delegate.cs (Delegate.Define): Correctly define the types in the
19334         presence of fixed and array parameters.
19335
19336         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19337         doing FindMembers.
19338
19339         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19340         include NonPublic after the first iteration.
19341
19342         * class.cs (Indexer.CheckBase): Only check if both parents are
19343         non-null. 
19344
19345         * cs-parser.jay (accessor_body): If empty, set to null.
19346
19347         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19348         same code path here to resolve constants names that we did have in
19349         MemberAccess.DoResolve.  There is too much code duplicated here.
19350
19351 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19354
19355         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19356         to MakeUnionSet.
19357
19358         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19359         tokens, numbers and strings.
19360
19361         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19362         parenthesis.
19363
19364         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19365         asyncronous parameters and the regular parameters.  
19366
19367         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19368         specify the target directory.
19369
19370         * expression.cs: (This.DoResolve): Simplify
19371         (As.Emit): Optimize, do not generate IsInst if the expression is
19372         always of the given type.
19373
19374         (Is.DoResolve): Bug fix, we were reporting both always/never for
19375         the is expression.
19376
19377         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19378         creating too many unnecessary arrays.
19379
19380 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19381
19382         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19383         fields instead of rolling our own initializer.   Takes care of all
19384         implicit conversions, and drops unnecessary static checks/argument.
19385
19386 2002-03-31  Dick Porter  <dick@ximian.com>
19387
19388         * driver.cs: use the GetDirectories() return values properly, and
19389         use "/" as path separator.
19390
19391 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19392
19393         * expression.cs (Unary): Optimize - - expr into expr.
19394         (Binary): Optimize a + (-b) into a -b.
19395
19396         * codegen.cs (CodeGen): Made all methods static.
19397
19398 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * rootcontext.cs: 
19401
19402         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19403         TypeBuilder property.
19404
19405         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19406         instead. 
19407
19408         * tree.cs: Removed the various RecordXXXX, and replaced with a
19409         single RecordDecl.  Removed all the accessor methods, and just
19410         left a single access point Type 
19411
19412         * enum.cs: Rename DefineEnum to DefineType.
19413
19414         * decl.cs: New abstract method `DefineType' used to unify the
19415         Defines for Enumerations, Interfaces, TypeContainers and
19416         Delegates.
19417
19418         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19419         LookupBaseClasses method that used to live in class.cs and
19420         interface.cs here, and renamed to FindType.
19421
19422         * delegate.cs: Implement DefineType.  Take advantage of the
19423         refactored pattern for locating the parent builder without taking
19424         the parent_builder argument (which we know does not work if we are
19425         nested, and triggering a toplevel definition).
19426
19427 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19428
19429         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19430         accessibility of a member has changed during override and report
19431         an error if so.
19432
19433         * class.cs (Method.Define, Property.Define): Only complain on
19434         overrides if the method is private, any other accessibility is
19435         fine (and since we just checked the permission is the same, we are
19436         good to go).
19437
19438         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19439         and elif are processed always.  The other pre-processing
19440         directives are only processed if we are "taking" the path
19441
19442 2002-03-29  Martin Baulig  <martin@gnome.org>
19443
19444         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19445         current location is not Null.
19446
19447         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19448         a separate method so we can profile it.
19449
19450         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19451         `span.Seconds' are just seconds, but no minutes or hours.
19452         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19453
19454 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19455
19456         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19457         Remove the gratuitous set of Final:
19458
19459                                 // If an interface implementation, then we can set Final.
19460                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19461                                     implementing.DeclaringType.IsInterface)
19462                                         flags |= MethodAttributes.Final;
19463
19464         I do not know what I was smoking when I used that.
19465
19466
19467         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19468         step into fixing the name resolution issues for delegates and
19469         unifying the toplevel name resolution.
19470
19471 2002-03-28  Martin Baulig  <martin@gnome.org>
19472
19473         * class.cs (Method.Emit): If we have a symbol writer, call its
19474         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19475         tell it about the current method.
19476
19477         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19478         writer that we're going to emit the first byte of IL code for a new
19479         statement (a new source line).
19480         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19481         EmitContext.Mark() before emitting any code.
19482
19483         * location.cs (SymbolDocument): Return null when we're Null.
19484
19485         * statement.cs (Statement): Moved the `Location loc' variable here.
19486         (Statement.EmitBoolExpression): If we have a symbol writer, call
19487         ec.Mark() before emitting any code to tell it that we're at the
19488         beginning of a new statement.
19489         (StatementExpression): Added `Location' argument to the constructor.
19490         (Block): Added public readonly variable `StartLocation' and public
19491         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19492         (Block): Added constructor which takes a start and end location.
19493         (Block.SetEndLocation): New method. This sets the end location.
19494         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19495         local variables we create.
19496         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19497         each statement and do also mark the begin and end of the block.
19498
19499         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19500         tell it the current lexer.Location, use Location.Null for the end of the
19501         block.
19502         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19503         current block, set its end location using SetEndLocation().
19504         (statement_expression): StatementExpression constructor now takes the
19505         lexer.Location as additional argument.
19506         (for_statement, declare_local_variables): Likewise.
19507         (declare_local_variables): When creating a new implicit block, use the
19508         new Block constructor and pass it the lexer.Location.
19509
19510 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19513         members also on the parent interfaces recursively.
19514
19515 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * report.cs: Use new formats, since Gonzalo finished the missing
19518         bits. 
19519
19520         * expression.cs (Binary.ResolveOperator): added missing operator|
19521         operator& and operator^ for bool/bool.
19522
19523         * cs-parser.jay: CheckDef now takes a Location argument that is
19524         used to report errors more precisly (instead of reporting the end
19525         of a definition, we try to track something which is a lot closer
19526         to the source of the problem).
19527
19528         * cs-tokenizer.cs: Track global token use, so we can properly flag
19529         the use of #define/#undef after the first token has been seen.
19530
19531         Also, rename the reportXXXX to Error_DescriptiveName
19532
19533         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19534         TypeContainer, so that Enum and Interface can use this too.
19535
19536         * class.cs (TypeContainer.LookupInterfaceOrClass,
19537         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19538         `builder' argument.  Typically this was used to pass the parent
19539         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19540         the definition).  
19541
19542         The problem is that a nested class could trigger the definition of
19543         a toplevel class, and the builder would be obviously wrong in that
19544         case. 
19545
19546         So we drop this argument, and we compute dynamically the
19547         TypeBuilder/ModuleBuilder (the correct information was available
19548         to us anyways from DeclSpace.Parent)
19549
19550         * interface.cs (Interface.DefineInterface): Drop builder
19551         parameter cleanup like class.cs
19552
19553         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19554         like class.cs
19555
19556         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19557         values. 
19558
19559         (Try.Emit): Propagate the returns value from the statement.
19560
19561         (Return.Emit): Even if we are leavning 
19562
19563         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19564
19565         * modifiers.cs: Fix the computation of MethodAttributes flags.
19566
19567 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19568
19569         * driver.cs: allow compilation of files that start with '/'.
19570         Add a default case when checking the argument of --target.
19571
19572 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * interface.cs: Implement the same search algorithm for types in
19575         the interface code.
19576
19577         * delegate.cs: Do not allow multiple definition.
19578
19579         * Recovered ChangeLog that got accidentally amputated
19580
19581         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19582
19583         * rootcontext.cs: Load manually enum to allow core classes to
19584         contain enumerations.
19585
19586         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19587         Update to new static methods in TypeManager.
19588
19589         * typemanager.cs (GetMethod, GetConstructor): Use our
19590         implementation of FindMembers to find the members, since during
19591         corlib compilation, the types are TypeBuilders and GetMethod and
19592         GetConstructor do not work.
19593
19594         Make all methods in TypeManager static.
19595
19596         (InitCodeHelpers): Split the functionality from
19597         the InitCodeTypes function.
19598
19599         * driver.cs: Call InitCodeHelpers after we have populated the
19600         types. 
19601
19602         * cs-parser.jay (delegate_declaration): we did not used to compute
19603         the delegate name correctly for void delegates.
19604
19605 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19606
19607         * rootcontext.cs (RootContext): Init the interface_resolve_order
19608         and type_container_resolve_order always.
19609
19610         (ResolveCore, BootstrapCorlib_ResolveClass,
19611         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19612         compiler when compiling with --nostdlib
19613
19614         * class.cs (TypeContainer.DefineType): Check that our parent is
19615         not null.  This test is most important when we are bootstraping
19616         the core types.
19617
19618         * codegen.cs: Split out the symbol writing code.
19619
19620 2002-03-25  Martin Baulig  <martin@gnome.org>
19621
19622         * driver.cs (-g): Made -g an alias for --debug.
19623
19624 2002-03-24  Martin Baulig  <martin@gnome.org>
19625
19626         * codegen.cs (SymbolWriter): New public variable. Returns the
19627         current symbol writer.
19628         (CodeGen): Added `bool want_debugging_support' argument to the
19629          constructor. If true, tell the ModuleBuild that we want debugging
19630         support and ask it for the ISymbolWriter.
19631         (Save): If we have a symbol writer, call it's Close() method after
19632         saving the assembly.
19633
19634         * driver.c (--debug): New command line argument to create a
19635         debugger information file.
19636
19637         * location.cs (SymbolDocument): New public property. Returns an
19638         ISymbolDocumentWriter object for the current source file or null
19639         if we don't have a symbol writer.
19640
19641 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19642
19643         * driver.cs (LoadAssembly): Correctly return when all the paths
19644         have been tried and not before.
19645
19646         * statement.cs (Switch.Emit): return the actual coverage for this
19647         statement (returns/not-returns)
19648
19649         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19650         switch of the statement if we are the last switch section.  That
19651         kills two problems: try/catch problems (we used to emit an empty
19652         nop at the end) and switch statements where all branches would
19653         return. 
19654
19655 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19656
19657         * driver.cs: Add default assemblies (the equivalent to the
19658         Microsoft CSC.RSP file)
19659
19660         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19661         also update tokens_seen and set it to false.
19662
19663         * driver.cs: Implement --recurse for Mike.
19664
19665         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19666         correctly splitting out the paths.
19667
19668 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19669
19670         * interface.cs (Interface.PopulateProperty): Instead of using
19671         `parent' as the declaration space for the set parameters, use
19672         `this' 
19673
19674         * support.cs (InternalParameters): InternalParameters constructor
19675         takes a DeclSpace instead of a TypeContainer.
19676
19677         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19678         types are being initialized, load the address of it before calling
19679         the function.  
19680
19681         (New): Provide a mechanism to disable the generation of local
19682         value type temporaries when the caller will be providing us with
19683         an address to store it.
19684
19685         (ArrayCreation.EmitDynamicInitializers): Use it.
19686
19687 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * expression.cs (Invocation.EmitArguments): Only probe for array
19690         property if there is more than one argument.  Sorry about that.
19691
19692         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19693         empty param arrays.
19694
19695         * class.cs (Method.LabelParameters): Fix incorrect code path that
19696         prevented the `ParamArrayAttribute' from being applied to the
19697         params attribute.
19698
19699 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19700
19701         * support.cs (ReflectionParameters): Correctly compute whether the
19702         last argument is a params array.  Fixes the problem with
19703         string.Split ('a')
19704
19705         * typemanager.cs: Make the assemblies array always be non-null
19706         (empty, but non-null)
19707
19708         * tree.cs (RecordDecl): New function that abstracts the recording
19709         of names.  This reports error 101, and provides a pointer to the
19710         previous declaration.  Fixes a crash in the compiler.
19711
19712         * cs-parser.jay (constructor_declaration): Update to new grammar,
19713         and provide a constructor_body that can be empty.
19714
19715 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19716
19717         * driver.cs: Add support for --resources.
19718
19719         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19720         Make all types for the various array helper methods be integer.
19721
19722         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19723         CheckState to ConvCast.
19724
19725         (ConvCast): Now it takes a `checked' state argument, to avoid
19726         depending on the emit context for the conversion, and just using
19727         the resolve time setting.
19728
19729         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19730         instead of Invocation.EmitArguments.  We do not emit the original
19731         arguments, instead we emit those which have been converted to
19732         unsigned int expressions.
19733
19734         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19735
19736         * codegen.cs: ditto.
19737
19738         * expression.cs (LocalVariableReference): Drop the use of the
19739         Store function that depended on the variable index.
19740
19741         * statement.cs (VariableInfo): Drop the `Idx' property from this
19742         class, as this is not taking into account the indexes for
19743         temporaries tat we generate during the execution, getting the
19744         indexes wrong.
19745
19746         * class.cs: First emit class initializers, then call the parent
19747         constructor. 
19748
19749         * expression.cs (Binary): Fix opcode emision.
19750         (UnaryMutator.EmitCode): Support checked code generation
19751
19752         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19753         matches for events for both the Static and Instance scans,
19754         pointing to the same element.   Fix that.
19755
19756 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19757
19758         * rootcontext.cs (ResolveTree): Always set the
19759         interface_resolve_order, because nested interfaces will be calling
19760         into us.
19761
19762         * class.cs (GetInterfaceOrClass): Track the same resolution
19763         process used by TypeManager.LookupType.  This fixes the nested
19764         type lookups in class declarations (separate path from
19765         LookupType). 
19766
19767         (TypeContainer.DefineType): Also define nested interfaces.
19768         (TypeContainer.RegisterOrder): New public function used to
19769         register the order in which child interfaces need to be closed.
19770
19771         Nested interfaces need to be closed after their parents have been
19772         created. 
19773
19774         * interface.cs (InterfaceAttr): Put all the logic for computing
19775         the interface attribute here. 
19776
19777         (DefineInterface): Register our interface order with the
19778         RootContext or with the TypeContainer depending on the case.
19779
19780 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19781
19782         * cs-parser.jay: rework foreach statement to work with the new
19783         changes to the policy on SimpleNames.
19784
19785         * report.cs: support Stacktrace on warnings as well.
19786
19787         * makefile: drop --unsafe and /unsafe from the compile.
19788
19789 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19790
19791         * ecore.cs (StandardConversionExists): Modify to take an Expression
19792         as the first parameter. Ensure we do null -> reference type conversion
19793         checking.
19794
19795         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19796         temporary Expression objects.
19797
19798 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19799
19800         * interface.cs: workaround bug in method overloading resolution
19801         (there is already a bugzilla bug for it).
19802
19803 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19804
19805         We could also solve this problem by having a separate path for
19806         performing type lookups, instead of DoResolve, we could have a
19807         ResolveType entry point, and only participating pieces of the
19808         production (simplename, deref, array) would implement this. 
19809
19810         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19811         signal SimpleName to only resolve type names and not attempt to
19812         resolve anything else.
19813
19814         * expression.cs (Cast): Set the flag.
19815
19816         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19817
19818         * class.cs: Only report 108 if there is no `new' modifier.
19819
19820         * cs-parser.jay: rework foreach statement to work with the new
19821         changes to the policy on SimpleNames.
19822         
19823         * report.cs: support Stacktrace on warnings as well.
19824
19825         * makefile: drop --unsafe and /unsafe from the compile.
19826
19827 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19828
19829         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19830         lookups here, instead of doing that at parse time.  This means
19831         that our grammar will not introduce `LocalVariableReferences' as
19832         expressions at this point.  That solves the problem of code like
19833         this:
19834
19835         class X {
19836            static void Main ()
19837            { int X = 1;
19838             { X x = null }}}
19839
19840         This is only half the fix.  The full fix requires parameters to
19841         also be handled in this way.
19842
19843         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19844         makes the use more obvious of the DeclSpace.  The
19845         ec.TypeContainer.TypeBuilder is now only used to pull the
19846         TypeBuilder for it.
19847
19848         My theory is that I can get rid of the TypeBuilder completely from
19849         the EmitContext, and have typecasts where it is used (from
19850         DeclSpace to where it matters).  
19851
19852         The only pending problem is that the code that implements Aliases
19853         is on TypeContainer, and probably should go in DeclSpace.
19854
19855         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19856         lookups here, instead of doing that at parse time.  This means
19857         that our grammar will not introduce `LocalVariableReferences' as
19858         expressions at this point.  That solves the problem of code like
19859         this:
19860
19861         class X {
19862            static void Main ()
19863            { int X = 1;
19864             { X x = null }}}
19865
19866         This is only half the fix.  The full fix requires parameters to
19867         also be handled in this way.
19868
19869         * class.cs (Property.DefineMethod): When implementing an interface
19870         method, set newslot, when implementing an abstract method, do not
19871         set the flag (before we tried never setting it, or always setting
19872         it, which is the difference).
19873         (Indexer.DefineMethod): same.
19874         (Method.DefineMethod): same.
19875
19876         * ecore.cs: Only set the status used flag if we get back a Field.
19877
19878         * attribute.cs: Temporary hack, so Paolo can keep working.
19879
19880 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19881
19882         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19883         the unmanaged type in the case we have a MarshalAs attribute.
19884
19885         (Resolve): Handle the case when we are parsing the special MarshalAs
19886         attribute [we need to store the unmanaged type to use later]
19887
19888         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19889         MarshalAs Attribute.
19890
19891         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19892         on parameters and accordingly set the marshalling info.
19893
19894 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * class.cs: Optimizing slightly by removing redundant code after
19897         we switched to the `NoTypes' return value.
19898         (Property.DefineMethod): use NoTypes here too.
19899
19900         This fixes the bug I introduced in my last batch of changes.
19901
19902 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19903
19904         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19905
19906         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19907         Enums since those are types too. 
19908
19909         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19910
19911         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19912         thanks to a call during the lookup process.
19913
19914 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19915
19916         * statement.cs (Foreach): Lots of work to accomodate a particular
19917         kind of foreach statement that I had not kept in mind.  It is
19918         possible to have foreachs on classes that provide a GetEnumerator
19919         method that return objects that implement the "pattern" for using
19920         a foreach, there is no need to support GetEnumerator
19921         specifically. 
19922
19923         This is needed to compile nant.
19924
19925         * decl.cs: Only report 114 if the member is not `Finalize' and if
19926         the warning level is at least 2.
19927
19928         * class.cs: Moved the compare function from Method to
19929         MethodSignature. 
19930
19931         (MethodSignature.InheritableMemberSignatureCompare): Add new
19932         filter function that is used to extract inheritable methods from a
19933         class. 
19934
19935         (Method.Define): Use the new `inheritable_method_signature_filter'
19936         delegate
19937
19938         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19939         command. 
19940
19941 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19942
19943         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19944
19945         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19946
19947         * expression.cs: Pass location information to
19948         ConvertImplicitStandard. 
19949
19950         * class.cs: Added debugging code to track return values from
19951         interfaces. 
19952
19953 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19954
19955         * expression.cs (Is.DoResolve): If either side of the `is' is an
19956         interface, do not flag the warning.
19957
19958         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19959         for interfaces
19960
19961         * report.cs: Allow for --fatal to be used with --probe.
19962
19963         * typemanager.cs (NoTypes): Move the definition for the empty Type
19964         array here. 
19965
19966         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19967         properties. 
19968         (TypeContainer.DefineProxy): New function used to proxy to parent
19969         implementations when implementing interfaces.
19970         (TypeContainer.ParentImplements): used to lookup if our parent
19971         implements a public function that is required by an interface.
19972         (TypeContainer.VerifyPendingMethods): Hook this up.
19973
19974         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19975         `modules' and `assemblies' arraylists into arrays.  We only grow
19976         these are the very early start up of the program, so this improves
19977         the speedof LookupType (nicely measured).
19978
19979         * expression.cs (MakeByteBlob): Replaced unsafe code with
19980         BitConverter, as suggested by Paolo.
19981
19982         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19983         folding of string concatenation, but if either side is a string,
19984         and the other is not, then return null, and let the runtime use
19985         the concatenation on the string plus the object (using
19986         `Object.ToString'). 
19987
19988 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19989
19990         Constant Folding has been implemented now.
19991
19992         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19993         the error instead on types that are not supported in one's
19994         complement. 
19995
19996         * constant.cs (Constant and all children): New set of functions to
19997         perform implict and explicit conversions.
19998
19999         * ecore.cs (EnumConstant): Implement the new functions to perform
20000         conversion by proxying to the child expression.
20001
20002         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20003         own separate setting that can not be turned off from the command
20004         line using --unchecked or --checked and is only controlled using
20005         the checked/unchecked statements and expressions.  This setting is
20006         used by the constant folder to flag errors.
20007
20008         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20009         ConstantCheckState as well.   
20010
20011         During Resolve, they also have to flag the state, because the
20012         constant folder runs completely in the Resolve phase.
20013
20014         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20015         well.
20016
20017 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20018
20019         * cfold.cs: New file, this file contains the constant folder.
20020
20021         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20022         argument to track whether we are using the resulting address to
20023         load or store a value and provide better error messages. 
20024
20025         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20026         new AddressOf arguments.
20027
20028         * statement.cs (Foreach.EmitCollectionForeach): Update
20029
20030         * expression.cs (Argument.Emit): Call AddressOf with proper
20031         arguments to track usage.
20032
20033         (New.DoEmit): Call AddressOf with new arguments.
20034
20035         (Unary.Emit): Adjust AddressOf call.
20036
20037 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20038
20039         * cs-parser.jay (member_access): Change the case for pre-defined types
20040         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20041         this suggestion.
20042
20043         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20044         a method body.
20045
20046         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20047         essentially like methods and apply attributes like MethodImplOptions to them too.
20048
20049         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20050         not being null.
20051
20052         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20053         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20054         is the DeclSpace.
20055
20056         * Update code everywhere accordingly.
20057
20058         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20059
20060         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20061
20062 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20063
20064         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20065         try performing lookups against those instead of jumping straight into using
20066         the 'using' clauses.
20067
20068         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20069
20070         (LookupType): Perform lookups in implicit parents too.
20071
20072         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20073         sequence as RootContext.LookupType. 
20074
20075         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20076         the various cases of namespace lookups into this method.
20077
20078 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20079
20080         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20081         in positional arguments)
20082
20083         * class.cs (Operator): Update the AllowedModifiers to contain
20084         extern. 
20085
20086         * cs-parser.jay: Update operator declaration to allow for the
20087         operator body to be empty.
20088
20089         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20090         values. 
20091
20092 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * class.cs (Method.Emit): Label parameters.
20095
20096         * driver.cs: Return 1 or 0 as the program exit code.
20097
20098 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20099
20100         * expression.cs: Special case the `null' object when trying to
20101         auto-compute the type, as anything can be explicitly converted to
20102         that. 
20103
20104         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20105         spotting this Paolo.
20106
20107         (Expression.ImplicitNumericConversion): Perform comparissions of
20108         the type using the underlying type in the case of an enumeration
20109         rather than using the enumeration type for the compare.
20110
20111         Cope with the underlying == type case, which is not possible to
20112         catch before. 
20113
20114         (Expression.ConvertNumericExplicit): Perform comparissions of
20115         the type using the underlying type in the case of an enumeration
20116         rather than using the enumeration type for the compare.
20117
20118         * driver.cs: If the user does not supply an extension, assume .exe
20119
20120         * cs-parser.jay (if_statement): Rewrote so that we can track the
20121         location for the if statement.
20122
20123         * expression.cs (Binary.ConstantFold): Only concat strings when
20124         the operation is "+", not everything ;-)
20125
20126         * statement.cs (Statement.EmitBoolExpression): Take a location
20127         argument. 
20128         (If, While, Do): Track location.
20129
20130         * expression.cs (Binary.ResolveOperator): In the object + string
20131         case, I was missing a call to ConvertImplicit
20132
20133 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20134
20135         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20136         Location arguments. Ensure we use RootContext.LookupType to do our work
20137         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20138
20139         * interface.cs (PopulateMethod): Handle the type of the parameter being
20140         null gracefully.
20141
20142         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20143         have a params method with no fixed arguments and a call is made with no
20144         arguments.
20145
20146 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20147
20148         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20149         the verbatim-string-literal
20150
20151         * support.cs (InternalParameters.ParameterModifier): handle null
20152         fixed parameters.
20153         (InternalParameters.ParameterType): ditto.
20154
20155         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20156         duplicating the name of the variable parameter.
20157         (GetParameterByName): Fix bug where we were not looking up array
20158         paramters if they were the only present (thanks Paolo!).
20159         (GetParameterInfo): We only have an empty set of types if both
20160         fixed and array are set to null.
20161         (GetParameterInfo-idx): Handle FixedParameter == null
20162
20163         * cs-parser.jay: Handle the case where there is no catch
20164         statements (missing null test).
20165
20166 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20167
20168         * driver.cs (MainDriver): Be conservative on our command line
20169         handling.
20170
20171         Catch DirectoryNotFoundException when calling GetFiles.
20172
20173         (SplitPathAndPattern): Used to split the input specification into
20174         a path and a pattern that we can feed to Directory.GetFiles.
20175
20176 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20177
20178         * statement.cs (Fixed): Implement the last case of the Fixed
20179         statement (string handling).
20180
20181         * expression.cs (StringPtr): New class used to return a char * to
20182         a string;  Used by the Fixed statement.
20183
20184         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20185
20186         * expression.cs (Binary.ResolveOperator): Remove redundant
20187         MemberLookup pn parent type.
20188         Optimize union call, we do not need a union if the types are the same.
20189         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20190         type.
20191
20192         Specialize the use of MemberLookup everywhere, instead of using
20193         the default settings. 
20194
20195         (StackAlloc): Implement stackalloc keyword.
20196
20197         * cs-parser.jay: Add rule to parse stackalloc.
20198
20199         * driver.cs: Handle /h, /help, /?
20200
20201         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20202         before we supported unsafe code.
20203
20204         * makefile: add --unsafe to the self compilation of mcs.
20205
20206 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20207
20208         * expression.cs (PointerArithmetic): New class that is used to
20209         perform pointer arithmetic.
20210         (Binary.Resolve): Handle pointer arithmetic
20211         Handle pointer comparission.
20212         (ArrayPtr): Utility expression class that is used to take the
20213         address of an array.
20214
20215         (ElementAccess): Implement array access for pointers
20216
20217         * statement.cs (Fixed): Implement fixed statement for arrays, we
20218         are missing one more case before we are done.
20219
20220         * expression.cs (Indirection): Implement EmitAssign and set the
20221         ExprClass to Variable.  This allows pointer dereferences to be
20222         treated as variables, and to have values assigned to them.
20223
20224         * ecore.cs (Expression.StoreFromPtr): New utility function to
20225         store values dereferencing.
20226
20227 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20228
20229         * expression.cs (Binary.ResolveOperator): Ensure that we are
20230         not trying to operate on a void type - this fixes the reported
20231         bug.
20232
20233         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20234         the parent implementation is sealed.
20235
20236         * ../errors/cs0239.cs : Add.
20237
20238         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20239
20240         * typemanager.cs (unverifiable_code_type): Corresponds to 
20241         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20242         which have unsafe code in them.
20243
20244         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20245         unsafe context.
20246
20247 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20248
20249         * cs-tokenizer.cs: Add support for @"litreal strings"
20250
20251         Make tokenizer accept pre-processor directives
20252         on any column (remove the old C-like limitation). 
20253
20254         * rootcontext.cs (EmitCode): Emit any global attributes.
20255         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20256
20257         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20258
20259         * cs-parser.jay: Add support for global attributes.  
20260
20261 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20262
20263         * expression.cs (Indirection): New helper class.  Unary will
20264         create Indirection classes to be able to implement the
20265         IMemoryLocation interface on it.
20266
20267 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * cs-parser.jay (fixed_statement): reference the right statement.
20270
20271         * statement.cs (Fixed.Emit): Finish implementing the fixed
20272         statement for the &x case.
20273
20274 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * class.cs (Property.Define, Method.Define): Remove newslot when
20277         `implementing'.  
20278
20279         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20280         wrong.  NewSlot should only be used if the `new' keyword is present.
20281
20282         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20283         locating our system dir.  Sorry about this.
20284
20285 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20286
20287         * driver.cs (GetSystemDir): Compute correctly the location of our
20288         system assemblies.  I was using the compiler directory instead of
20289         the library directory.
20290
20291 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20292
20293         * expression.cs (BetterFunction): Put back in what Miguel commented out
20294         since it is the correct fix. The problem is elsewhere ;-)
20295
20296         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20297         parameters of the parms method are themselves compatible or not !
20298
20299         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20300         to check that a class implements an interface before saying that an implicit
20301         conversion was allowed. Use ImplementsInterface to do the checking.
20302
20303 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20304
20305         * class.cs (Method.Define): Track whether we are an explicit
20306         implementation or not.  And only call DefineMethodOverride if we
20307         are an explicit implementation.
20308
20309         (Property.DefineMethod): Ditto.
20310
20311 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20312
20313         * expression.cs (BetterFunction): Catch hideous bug which was
20314          preventing us from detecting ambiguous calls due to implicit casts i.e
20315         cs0121.
20316
20317 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20318
20319         * support.cs (Pair): Remove un-needed method.  I figured why I was
20320         getting the error in cs-parser.jay, the variable in a foreach loop
20321         is readonly, and the compiler does not really treat this as a variable.
20322
20323         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20324         instead of EQUALS in grammar.  
20325
20326         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20327
20328         * expression.cs (Unary.DoResolve): Check whether the argument is
20329         managed or not.
20330
20331 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20332
20333         * support.cs: Api for Pair to set a value.  Despite the fact that
20334         the variables are public the MS C# compiler refuses to compile
20335         code that accesses the field if the variable is part of a foreach
20336         statement. 
20337
20338         * statement.cs (Fixed): Begin implementation of the fixed
20339         statement.
20340
20341         (Block.AddVariable): Return the VariableInfo on success and null
20342         on failure instead of true/false. 
20343
20344         * cs-parser.jay (foreach): Catch errors on variables already
20345         defined (we were ignoring this value before) and properly unwind
20346         the block hierarchy
20347
20348         (fixed_statement): grammar for the fixed statement.
20349
20350 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20351
20352         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20353         pointer types to be incretemented.
20354
20355         (SizeOf): Implement.
20356
20357         * cs-parser.jay (pointer_member_access): Implement
20358         expr->IDENTIFIER production.
20359
20360         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20361         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20362         on safe contexts.
20363
20364         (Unary): Implement indirection.
20365
20366         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20367         use in non-unsafe context).
20368
20369         (SimpleName.DoResolve): Check for pointers in field access on safe
20370         contexts. 
20371
20372         (Expression.LoadFromPtr): Factor the load-indirect code in this
20373         function.  This was duplicated in UnboxCast and ParameterReference
20374
20375 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20376
20377         * expression.cs (ComposedCast): report an error if a pointer cast
20378         is used in a safe region.
20379
20380         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20381         pointer type casts in unsafe context.
20382
20383         * codegen.cs (EmitContext): Set up IsUnsafe.
20384
20385         * cs-parser.jay (non_expression_type): Add productions for pointer
20386         casts. 
20387
20388         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20389         code.  We should not use force into static mode if the method is
20390         not virtual.  Fixes bug in MIS
20391
20392         * statement.cs (Do.Emit, While.Emit, For.Emit,
20393         Statement.EmitBoolExpression): Add support to Do and While to
20394         propagate infinite loop as `I do return' semantics.
20395
20396         Improve the For case to also test for boolean constants.
20397
20398         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20399         to the list of attributes we can add.
20400
20401         Remove `EmitContext' argument.
20402
20403         * class.cs (Method.Define): Apply parameter attributes.
20404         (Constructor.Define): Apply parameter attributes.
20405         (MethodCore.LabelParameters): Move here the core of labeling
20406         parameters. 
20407
20408         * support.cs (ReflectionParameters.ParameterModifier,
20409         InternalParameters.ParameterModifier): Use IsByRef on the type and
20410         only return the OUT bit for these parameters instead of in/out/ref
20411         flags.
20412
20413         This is because I miss-understood things.  The ParameterInfo.IsIn
20414         and IsOut represent whether the parameter has the [In] and [Out]
20415         attributes set.  
20416
20417 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20418
20419         * ecore.cs (FieldExpr.Emit): Release temporaries.
20420
20421         * assign.cs (LocalTemporary.Release): new function.
20422
20423         * codegen.cs (EmitContext.GetTemporaryStorage,
20424         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20425         temporary storage.  Now we can "put back" localbuilders when we
20426         are done with them
20427
20428 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20429
20430         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20431         need to make a copy of the variable to generate verifiable code.
20432
20433 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20434
20435         * driver.cs: Compute dynamically the system directory.
20436
20437         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20438         Slower, but more generally useful.  Used by the abstract
20439         registering implementation. 
20440
20441         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20442         the rules for the special rule on Type/instances.  First check if
20443         we have the same name, and if so, try that special static path
20444         rather than the instance path.
20445
20446 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20447
20448         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20449         for, while and if.
20450
20451         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20452         Enum, ValueType, Delegate or Array for non-corlib compiles.
20453
20454         * cs-tokenizer.cs: Catch long identifiers (645)
20455
20456         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20457         piece of code.
20458
20459         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20460         fix, we were returning too early, so we were not registering
20461         pending methods from abstract classes.
20462
20463         Do not register pending methods if the class is abstract.
20464
20465         * expression.cs (Conditional.DoResolve): Report circular implicit
20466         conversions when we neecd to compute it for conditional
20467         expressions. 
20468
20469         (Is.DoResolve): If the expression is always of the provided type,
20470         flag warning 183.  If the expression can not ever be of the
20471         provided type flag warning 184.
20472
20473         * class.cs: Catch 169 as well.
20474
20475         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20476         read. 
20477
20478 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20479
20480         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20481
20482 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20483
20484         * interface.cs: (PopulateMethod): Check for pointers being defined
20485         only if the unsafe context is active.
20486         (PopulateProperty): ditto.
20487         (PopulateIndexer): ditto.
20488
20489         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20490         specified.  If pointers are present, make sure that they are
20491         present in an unsafe context.
20492         (Constructor, Constructor.Define): ditto.
20493         (Field, Field.Define): ditto.
20494         (Property, Property.Define): ditto.
20495         (Event, Event.Define): ditto.
20496
20497         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20498         hashtable if there are classes or structs defined.
20499
20500         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20501         code, as the constant resolution moved.
20502
20503         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20504         the metadata, so we can flag error 133. 
20505
20506         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20507         pointer is being declared in an unsafe context.
20508
20509 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20510
20511         * modifiers.cs (Modifiers.Check): Require a Location argument.
20512         Report error 227 for Unsafe use.
20513
20514         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20515
20516         * statement.cs (For.Emit): If the test is null, then report that
20517         we do `return', as we wont reach anything afterwards.
20518
20519         (Switch.SwitchGoverningType): Track the expression that matched
20520         the conversion.
20521
20522         * driver.cs: Allow negative numbers as an error code to flag.
20523
20524         * cs-parser.jay: Handle 1551.
20525
20526         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20527
20528 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20529
20530         * cs-parser.jay: Report 1518 (type declaration can only contain
20531         class, struct, interface, enum or delegate)
20532
20533         (switch_label): Report 1523 (keywords `case' or `default' must
20534         preced code)
20535
20536         (opt_switch_sections): Report 1522 (empty switch)
20537
20538         * driver.cs: Report 1515 (response file specified multiple times)
20539         Report 1516 (Source file specified multiple times).
20540
20541         * expression.cs (Argument.Resolve): Signal 1510
20542
20543         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20544         access not allowed in static code)
20545
20546 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20547
20548         * typemanager.cs (IsPointerType): Utility method which we are going
20549         to need a lot.
20550
20551         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20552         the object type, so we take care of that.
20553
20554         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20555
20556         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20557         added to non-params parameters :-)
20558
20559         * typemanager.cs (CSharpName): Include 'void' type too. 
20560
20561         (void_ptr_type): Include in the set of core types.
20562
20563         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20564         duplicating code.
20565
20566         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20567         an unsafe context.
20568
20569         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20570         completely forgotten about it.
20571
20572 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20573
20574         * cs-parser.jay (pointer_type): Add. This begins our implementation
20575         of parsing rules for unsafe code.
20576
20577         (unsafe_statement): Implement.
20578
20579         (embedded_statement): Modify to include the above.
20580
20581         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20582
20583         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20584         if the current context is an unsafe one.
20585
20586         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20587         are handled differently, we need separate rules for them.
20588
20589         (local_variable_declaration): Update to use local_variable_pointer_type
20590         to allow variable declarations of unmanaged pointer types.
20591
20592         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20593         in unsafe contexts.
20594
20595         * ../errors/cs0214.cs : Add.
20596
20597 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20598
20599         * makefile: remove 'response' file when cleaning.
20600
20601 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20602
20603         * cs-parser.jay: Report 1524.
20604
20605 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20606
20607         * typemanager.cs (RegisterMethod): drop checking if we have
20608         registered this from here
20609
20610 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20611
20612         * class.cs (Method.EmitDestructor): Implement calling our base
20613         destructor. 
20614
20615         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20616         value of InFinally.
20617
20618         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20619         this routine and will wrap the call in a try/catch block.  Deal
20620         with the case.
20621
20622 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20623
20624         * ecore.cs (Expression.MemberLookup): instead of taking a
20625         parameter `same_type' that was used to tell whether we could
20626         access private members we compute our containing type from the
20627         EmitContext.
20628
20629         (FieldExpr): Added partial support for volatile fields.  This does
20630         not work for volatile fields exposed from assemblies, as I can not
20631         figure out how to extract the modreq from it.
20632
20633         Updated all the source files to use this.
20634
20635         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20636         because it is referenced by MemberLookup very often. 
20637
20638 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20639
20640         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20641         TypeBuilder.GetCustomAttributes to retrieve what we need.
20642
20643         Get rid of redundant default_member_attr_type as this is the same as
20644         default_member_type which already exists.
20645
20646         * interface.cs, attribute.cs : Update accordingly.
20647
20648 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20651         work for TYpeBuilders though.  Ravi, can you please fix this?
20652
20653         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20654
20655         * expression.cs (Argument.Emit): Handle the case of ref objects
20656         being passed to ref functions;  
20657
20658         (ParameterReference.EmitLoad): Loads the content of the pointer
20659         without dereferencing.
20660
20661 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20662
20663         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20664
20665 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20666
20667         * class.cs (Indexer.DefineMethod): Incorporate the interface
20668         type in the name of the method if we are doing explicit interface
20669         implementation.
20670
20671         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20672
20673         (BetterConversion): Fix extremely trivial bug where we were referring to
20674         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20675         again !
20676
20677         * ../errors/bug16.cs : Add although we have fixed it.
20678
20679 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20680
20681         * expression.cs (BaseIndexer): Begin implementation.
20682
20683         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20684
20685         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20686         production directly to remove a shift/reduce, and implement
20687         explicit interface implementation.
20688
20689         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20690         after a floating point suffix.
20691
20692         * expression.cs (DoNumericPromotions): Improved the conversion for
20693         uint/uint.  If we have a constant, we avoid doing a typecast to a
20694         larger type.
20695
20696         * class.cs (Indexer): Implement explicit interface implementation
20697         for indexers.
20698
20699 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20700
20701         * class.cs: make the default instance constructor public and hidebysig.
20702
20703 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20704
20705         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20706         so we can call it from elsewhere.
20707
20708         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20709         we emit it internally if the class has a defined indexer; otherwise the user
20710         emits it by decorating the class definition with the DefaultMemberAttribute.
20711
20712         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20713         attribute is not used on a type which defines an indexer.
20714
20715         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20716         character when we skip whitespace.
20717
20718         * ../errors/cs0646.cs : Add.
20719
20720 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20721
20722         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20723         again. 
20724
20725         * makefile: Add practical target `mcs3.exe' which builds the third
20726         generation compiler. 
20727
20728         * expression.cs (New): Fix structures constructor calling.
20729
20730         * class.cs (Property, Method, Indexer): Emit Final flag on the
20731         method if we are an interface implementation and we are not
20732         abstract. 
20733
20734         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20735         whether this property is referencing a `base' method.
20736
20737         * expression.cs (Invocation.EmitCall): take an extra argument:
20738         is_base, this is used to determine whether the `call' or
20739         `callvirt' opcode should be used.
20740
20741
20742         * delegate.cs: update EmitCall.
20743
20744         * class.cs (Method.Define): Set NewSlot for the cases where we are
20745         not implementing an interface method.
20746
20747         (Property.Define): ditto.
20748
20749 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20750
20751         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20752         'r'.  Allows mcs to parse itself fully.
20753
20754 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20755
20756         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20757         of the number of initializers that require the InitializeArray method.
20758
20759         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20760         update the above field where necessary.
20761
20762         (MakeByteBlob): Update accordingly.
20763
20764         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20765         greater than 2.
20766
20767         (EmitDynamicInitializers): Update in accordance with the new optimization.
20768
20769         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20770         same OpCode applies.
20771
20772         * cs-parser.jay : Fix some glaring errors I introduced.
20773
20774 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20775
20776         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20777         so that we can check for name clashes there too.
20778
20779         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20780         for interface indexers.
20781
20782         * interfaces.cs (Define): Emit the default member attribute.
20783
20784         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20785         variable was being referred to while setting the value ;-)
20786
20787 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20790         byte-by-byte information when we know the data is zero.
20791
20792         Make the block always a multiple of 4, because
20793         DefineInitializedData has a bug.
20794
20795         * assign.cs: Fix, we should assign from the temporary, not from
20796         the source. 
20797
20798         * expression.cs (MakeByteBlob): Fix my incorrect code.
20799
20800 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * typemanager.cs (EnumToUnderlying): This function is used to get
20803         the underlying type from an enumeration, because it does not
20804         always work. 
20805
20806         * constant.cs: Use the I4_S form for values between -128 and 127.
20807
20808         * statement.cs (Block.LookupLabel): Looks up a label.
20809         (Block): Drop support for labeled blocks.
20810
20811         (LabeledStatement): New kind of statement that represents a label
20812         only.
20813
20814         (Goto): Finally implement this bad boy.
20815
20816         * cs-parser.jay: Update to reflect new mechanism to implement
20817         labels.
20818
20819 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20820
20821         * codegen.cs (EmitContext.This): a codegen property that keeps the
20822         a single instance of this instead of creating many different this
20823         instances. 
20824
20825         * delegate.cs (Delegate.DoResolve): Update to use the property;
20826
20827         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20828
20829         * expression.cs (BaseAccess.DoResolve): Ditto.
20830
20831 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20832
20833         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20834         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20835
20836         (InitCoreTypes): Update accordingly.
20837
20838         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20839         so we can quickly store the state.
20840
20841         (ApplyAttributes): Set the correct implementation flags
20842         for InternalCall methods.
20843
20844 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * expression.cs (EmitCall): if a method is not virtual, then do
20847         not use callvirt on it.
20848
20849         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20850         user defined stuff) requires the use of stobj, which takes an
20851         address on the stack instead of an array and an index.  So emit
20852         the Ldelema operation for it.
20853
20854         (EmitStoreOpcode): Use stobj for valuetypes.
20855
20856         (UnaryMutator.EmitCode): Use the right 1 value depending on
20857         whether we are dealing with int64/uint64, float or doubles.
20858
20859         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20860         constructors that I implemented last night.
20861
20862         (Constructor.IsDefault): Fix to work properly for static
20863         constructors.
20864
20865         * cs-parser.jay (CheckDef): report method signature errors.
20866         Update error number 103 to be 132.
20867
20868         * decl.cs: New AdditionResult enumeration value: MethodExists.
20869         Although we do this check for methods later on in the semantic
20870         analysis, catching repeated default constructors is so easy that
20871         we catch these here. 
20872
20873         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20874         promotions code.
20875
20876         (ParameterReference.EmitAssign, Emit): handle
20877         bools as bytes.
20878
20879         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20880         (ArrayAccess.EmitStoreOpcode): ditto.
20881
20882         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20883
20884         * expression.cs (MakeByteBlob): Complete all the missing types
20885         (uint, short, ushort, byte, sbyte)
20886
20887         * class.cs: Only init instance field initializers on instance
20888         constructors. 
20889
20890         Rename `constructors' to instance_constructors. 
20891
20892         (TypeContainer.AddConstructor): Only add constructors to the list
20893         if it is not static.
20894
20895         Make sure that we handle default_static_constructor independently
20896         everywhere where we handle instance_constructors
20897
20898 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20899
20900         * class.cs: Do not lookup or create a base initializer for a
20901         static constructor.
20902
20903         (ConstructorInitializer.Resolve): use the proper type to lookup
20904         for constructors.
20905
20906         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20907
20908         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20909         in DeclSpace. 
20910
20911         * decl.cs: CloseType is now an virtual method, the default
20912         implementation just closes this type.
20913
20914 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20915
20916         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20917         to PreserveSig by default. Also emit HideBySig on such methods.
20918
20919         Basically, set the defaults to standard values.
20920
20921         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20922         argument, if candidate is better, it can't be worse than the best !
20923
20924         (Invocation): Re-write bits to differentiate between methods being
20925         applicable in their expanded form and their normal form - for params
20926         methods of course.
20927
20928         Get rid of use_standard everywhere as only standard conversions are allowed
20929         in overload resolution. 
20930
20931         More spec conformance.
20932
20933 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20934
20935         * driver.cs: Add --timestamp, to see where the compiler spends
20936         most of its time.
20937
20938         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20939         `this' in static code.
20940
20941         (SimpleName.DoResolve): Implement in terms of a helper function
20942         that allows static-references to be passed upstream to
20943         MemberAccess.
20944
20945         (Expression.ResolveWithSimpleName): Resolve specially simple
20946         names when called by MemberAccess to implement the special
20947         semantics. 
20948
20949         (Expression.ImplicitReferenceConversion): Handle conversions from
20950         Null to reference types before others, as Null's type is
20951         System.Object. 
20952
20953         * expression.cs (Invocation.EmitCall): Handle the special case of
20954         calling methods declared on a reference type from a ValueType
20955         (Base classes System.Object and System.Enum)
20956
20957         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20958         the left hand side is a TypeExpr, not on every enumeration. 
20959
20960         (Binary.Resolve): If types are reference types, then do a cast to
20961         object on operators != and == of both arguments.
20962
20963         * typemanager.cs (FindMembers): Extract instance and static
20964         members if requested.
20965
20966         * interface.cs (PopulateProperty): Use void_type instead of null
20967         as the return type for the setter method.
20968
20969         (PopulateIndexer): ditto.
20970
20971 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20972
20973         * support.cs (ReflectionParameters): Fix minor bug where we
20974         were examining the wrong parameter for the ParamArray attribute.
20975
20976         Cope with requests for the type of the parameter at position
20977         greater than the params parameter's. We now return the element
20978         type of the params array as that makes more sense.
20979
20980         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20981         accordingly as we no longer have to extract the element type
20982         ourselves.
20983
20984         (Invocation.OverloadResolve): Update.
20985
20986 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20989         against IEnumerator, test whether the return value is a descendant
20990         of the IEnumerator interface.
20991
20992         * class.cs (Indexer.Define): Use an auxiliary method to implement
20993         the other bits of the method definition.  Begin support for
20994         explicit interface implementation.
20995
20996         (Property.DefineMethod): Use TypeManager.void_type instead of null
20997         for an empty return value.
20998
20999 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21000
21001         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21002         dealing with a FieldExpr which is composed of a FieldBuilder, in
21003         the code path we did extract the constant, but we should have
21004         obtained the underlying value to be able to cast it (otherwise we
21005         end up in an infinite loop, this is what Ravi was running into).
21006
21007         (ArrayCreation.UpdateIndices): Arrays might be empty.
21008
21009         (MemberAccess.ResolveMemberAccess): Add support for section
21010         14.5.4.1 that deals with the special case of E.I when E is a type
21011         and something else, that I can be a reference to a static member.
21012
21013         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21014         handle a particular array type to create byte blobs, it is just
21015         something we dont generate byteblobs for.
21016
21017         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21018         arguments. 
21019
21020         * location.cs (Push): remove the key from the hashtable that we
21021         are about to add.   This happens for empty files.
21022
21023         * driver.cs: Dispose files after we have parsed them.
21024
21025         (tokenize): new function that only runs the tokenizer on its
21026         input, for speed testing.
21027
21028 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21029
21030         * class.cs (Event.Define): Define the private field only if there
21031         are no accessors defined.
21032
21033         * expression.cs (ResolveMemberAccess): If there is no associated
21034         field with the event, that means we have an event defined with its
21035         own accessors and we should flag error cs0070 since transforming
21036         ourselves into a field is not valid in that case.
21037
21038         * ecore.cs (SimpleName.DoResolve): Same as above.
21039
21040         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21041         and charset to sane values.
21042
21043 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21044
21045         * assign.cs (DoResolve): Perform check on events only if they 
21046         are being accessed outside the declaring type.
21047
21048         * cs-parser.jay (event_declarations): Update rules to correctly
21049         set the type of the implicit parameter etc.
21050
21051         (add_accessor, remove_accessor): Set current local parameters.
21052
21053         * expression.cs (Binary): For delegate addition and subtraction,
21054         cast the return value from the method into the appropriate delegate
21055         type.
21056
21057 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21058
21059         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21060         of these as the workaround is unnecessary.
21061
21062         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21063         delegate data - none of that is needed at all.
21064
21065         Re-write bits to extract the instance expression and the delegate method
21066         correctly.
21067
21068         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21069         on delegates too.
21070
21071         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21072         of attaching attributes instead of duplicating code everywhere.
21073
21074         * everywhere : Update code to do attribute emission using the above method.
21075
21076 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21077
21078         * expression.cs (IsParamsMethodApplicable): if there are not
21079         parameters, return immediately.
21080
21081         * ecore.cs: The 0 literal can be implicity converted to an enum
21082         type. 
21083
21084         (SimpleName.DoResolve): First lookup the type, then lookup the
21085         members. 
21086
21087         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21088         want to get its address.  If the InstanceExpression is not
21089         addressable, store the result in a temporary variable, then get
21090         the address of it.
21091
21092         * codegen.cs: Only display 219 errors on warning level or above. 
21093
21094         * expression.cs (ArrayAccess): Make it implement the
21095         IMemoryLocation interface.
21096
21097         (Binary.DoResolve): handle the operator == (object a, object b)
21098         and operator != (object a, object b) without incurring into a
21099         BoxedCast (because 5 != o should never be performed).
21100
21101         Handle binary enumerator operators.
21102
21103         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21104         value type, otherwise use Ldelem_ref.
21105
21106         Use precomputed names;
21107
21108         (AddressOf): Implement address of
21109
21110         * cs-parser.jay (labeled_statement): Fix recursive block
21111         addition by reworking the production.
21112
21113         * expression.cs (New.DoEmit): New has a special case:
21114                 
21115                  If we are dealing with a ValueType, we have a few
21116                  situations to deal with:
21117                 
21118                     * The target of New is a ValueType variable, that is
21119                       easy, we just pass this as the variable reference
21120                 
21121                     * The target of New is being passed as an argument,
21122                       to a boxing operation or a function that takes a
21123                       ValueType.
21124                 
21125                       In this case, we need to create a temporary variable
21126                       that is the argument of New.
21127
21128
21129 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21130
21131         * rootcontext.cs (LookupType): Check that current_type is not null before
21132         going about looking at nested types.
21133
21134         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21135         not implement the IAssignMethod interface any more.
21136
21137         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21138         where we tranform them into FieldExprs if they are being resolved from within
21139         the declaring type.
21140
21141         * ecore.cs (SimpleName.DoResolve): Do the same here.
21142
21143         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21144
21145         * ../errors/bug10.cs : Add.
21146
21147         * ../errors/cs0070.cs : Add.
21148
21149         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21150
21151         * assign.cs : Get rid of EventIsLocal everywhere.
21152
21153 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * ecore.cs (ConvertIntLiteral): finished the implementation.
21156
21157         * statement.cs (SwitchLabel): Convert the value we are using as a
21158         key before looking up the table.
21159
21160 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21161
21162         * codegen.cs (EmitTopBlock): Require a Location argument now.
21163
21164         * cs-parser.jay (constructor_declarator): We need to setup
21165         current_local_parameters before we parse the
21166         opt_constructor_initializer, to allow the variables to be bound
21167         to the constructor arguments.
21168
21169         * rootcontext.cs (LookupType): First lookup nested classes in our
21170         class and our parents before we go looking outside our class.
21171
21172         * expression.cs (ConstantFold): Extract/debox the values at the
21173         beginnning. 
21174
21175         * rootcontext.cs (EmitCode): Resolve the constants first before we
21176         resolve the types.  This is not really needed, but it helps debugging.
21177
21178         * statement.cs: report location.
21179
21180         * cs-parser.jay: pass location to throw statement.
21181
21182         * driver.cs: Small bug fix.
21183
21184         * report.cs: Updated format to be 4-zero filled digits.
21185
21186 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21187
21188         * expression.cs (CheckIndices): Fix minor bug where the wrong
21189         variable was being referred to ;-)
21190
21191         (DoEmit): Do not call EmitStaticInitializers when the 
21192         underlying type is System.Object.
21193
21194 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21195
21196         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21197         and do the usual workaround for SRE.
21198
21199         * class.cs (MyEventBuilder.EventType): New member to get at the type
21200         of the event, quickly.
21201
21202         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21203
21204         * assign.cs (Assign.DoResolve): Handle the case when the target
21205         is an EventExpr and perform the necessary checks.
21206
21207         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21208         interface.
21209
21210         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21211
21212         (EventExpr): Set the type in the constructor itself since we 
21213         are meant to be born fully resolved.
21214
21215         (EventExpr.Define): Revert code I wrote earlier.
21216                 
21217         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21218         instance expression is null. The instance expression is a This in that case
21219         or a null, depending on whether it is a static method or not.
21220
21221         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21222         refers to more than one method.
21223
21224         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21225         and accordingly flag errors.
21226
21227 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21228
21229         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21230
21231 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21232
21233         * location.cs (ToString): Provide useful rutine.
21234
21235 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21236
21237         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21238         objects, return the actual integral boxed.
21239
21240         * statement.cs (SwitchLabel): define an ILLabel for each
21241         SwitchLabel. 
21242
21243         (Switch.CheckSwitch): If the value is a Literal, extract
21244         the underlying literal.
21245
21246         Also in the unused hashtable we had, add the SwitchLabel so we can
21247         quickly look this value up.
21248
21249         * constant.cs: Implement a bunch of new constants.  Rewrite
21250         Literal based on this.  Made changes everywhere to adapt to this.
21251
21252         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21253         dereferencing array only once, and also copes with enumrations.
21254
21255         bytes are two bytes wide, not one.
21256
21257         (Cast): Perform constant conversions.
21258
21259         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21260         wrappers to the literals here.
21261
21262         * expression.cs (DoNumericPromotions): long literals can converted
21263         to ulong implicity (this is taken care of elsewhere, but I was
21264         missing this spot).
21265
21266         * ecore.cs (Expression.Literalize): Make the return type Literal,
21267         to improve type checking.
21268
21269         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21270
21271 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21272
21273         * literal.cs: Revert code from ravi that checked the bounds.  The
21274         bounds are sane by the definition of the type itself. 
21275
21276         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21277         need to actually look up in our parent hierarchy for interfaces
21278         implemented. 
21279
21280         * const.cs: Use the underlying type for enumerations
21281
21282         * delegate.cs: Compute the basename for the delegate creation,
21283         that should fix the delegate test case, and restore the correct
21284         Type Lookup semantics in rootcontext
21285
21286         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21287         referencing a nested type with the Reflection API is using the "+"
21288         sign. 
21289
21290         * cs-parser.jay: Do not require EOF token at the end.
21291
21292 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21293
21294         * rootcontext.cs (LookupType): Concatenate type names with
21295         a '.' instead of a '+' The test suite passes again.
21296
21297         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21298         field of the enumeration.
21299
21300         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21301         the case when the member is an EventExpr.
21302
21303         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21304         static has an associated instance expression.
21305
21306         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21307
21308         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21309
21310         * class.cs (Event.Define): Register event and perform appropriate checks
21311         for error #111.
21312
21313         We define the Add and Remove methods even if the use provides none because
21314         in that case, we provide default implementations ourselves.
21315
21316         Define a private field of the type of the event. This is done by the CSC compiler
21317         and we should be doing it too ;-)
21318
21319         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21320         More methods we use in code we generate.
21321
21322         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21323         is important.
21324
21325         (InitCoreTypes): Update accordingly for the above.
21326
21327         * class.cs (Event.Emit): Generate code for default accessors that we provide
21328
21329         (EmitDefaultMethod): Do the job in the above.
21330
21331         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21332         appropriate place.
21333
21334 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21335
21336         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21337         builders even if we were missing one.
21338
21339         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21340         pass the Basename as our class name instead of the Name.  The
21341         basename will be correctly composed for us.
21342
21343         * parameter.cs (Paramters): Now takes a Location argument.
21344
21345         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21346         make all the code call directly LookupType in RootContext and take
21347         this chance to pass the Location information everywhere.
21348
21349         * Everywhere: pass Location information.
21350
21351 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21352
21353         * class.cs (Constructor.Define): Updated way of detecting the
21354         length of the parameters.
21355
21356         (TypeContainer.DefineType): Use basename as the type name for
21357         nested types.
21358
21359         (TypeContainer.Define): Do not recursively define types here, as
21360         definition is taken care in order by the RootContext.
21361
21362         * tree.cs: Keep track of namespaces in a per-file basis.
21363
21364         * parameter.cs (Parameter.ComputeSignature): Update to use
21365         DeclSpace. 
21366
21367         (Parameters.GetSignature): ditto.
21368
21369         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21370         instead of a TypeContainer.
21371
21372         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21373         resolve names.  Because we need to be resolve in our context, not
21374         our parents.
21375
21376         * driver.cs: Implement response files.
21377
21378         * class.cs (TypeContainer.DefineType): If we are defined, do not
21379         redefine ourselves.
21380
21381         (Event.Emit): Emit the code for add/remove handlers.
21382         (Event.Define): Save the MethodBuilders for add/remove.
21383
21384         * typemanager.cs: Use pair here too.
21385
21386         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21387         DictionaryEntry requires the first argument to be non-null.  
21388
21389         (enum_declaration): Compute full name for registering the
21390         enumeration.
21391
21392         (delegate_declaration): Instead of using
21393         formal_parameter_list, use opt_formal_parameter_list as the list
21394         can be empty.
21395
21396         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21397         (EventParsing): New property that controls whether `add' and
21398         `remove' are returned as tokens or identifiers (for events);
21399
21400 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21401
21402         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21403         use MyEventBuilder only and let it wrap the real builder for us.
21404
21405         (MyEventBuilder): Revamp constructor etc.
21406
21407         Implement all operations that we perform on EventBuilder in precisely the same
21408         way here too.
21409
21410         (FindMembers): Update to use the EventBuilder member.
21411
21412         (Event.Emit): Update accordingly.
21413
21414 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21415
21416         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21417         by calling the appropriate methods.
21418
21419         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21420         useful.
21421
21422         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21423
21424 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21425
21426         * delegate.cs (Delegate.Populate): Check that the return type
21427         and various parameters types are indeed accessible.
21428
21429         * class.cs (Constructor.Define): Same here.
21430
21431         (Field.Define): Ditto.
21432
21433         (Event.Define): Ditto.
21434
21435         (Operator.Define): Check that the underlying Method defined itself
21436         correctly - so it's MethodBuilder should not be null.
21437
21438         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21439         expression happens to be null.
21440
21441         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21442         members but as of now we don't seem to be able to do anything really useful with it.
21443
21444         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21445         not the EventBuilder.
21446
21447 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21448
21449         * cs-tokenizer.cs: Add support for defines.
21450         Add support for #if, #elif, #else, #endif
21451
21452         (eval_var): evaluates a variable.
21453         (eval): stubbed for evaluating functions.
21454
21455         * cs-parser.jay: Pass the defines information
21456
21457         * driver.cs: Add --define command line option.
21458
21459         * decl.cs: Move MemberCore here.
21460
21461         Make it the base class for DeclSpace.  This allows us to catch and
21462         report 108 and 109 for everything now.
21463
21464         * class.cs (TypeContainer.Define): Extract all the members
21465         before populating and emit the warning 108 (new keyword required
21466         to override) instead of having each member implement this.
21467
21468         (MemberCore.Define): New abstract method, we will be using this in
21469         the warning reporting engine in Populate.
21470
21471         (Operator.Define): Adjust to new MemberCore protocol. 
21472
21473         * const.cs (Const): This does not derive from Expression, it is a
21474         temporary object we use to create fields, it is a MemberCore. 
21475
21476         * class.cs (Method.Define): Allow the entry point to be in a
21477         specific class.
21478
21479         * driver.cs: Rewrite the argument handler to clean it up a bit.
21480
21481         * rootcontext.cs: Made it just an auxiliary namespace feature by
21482         making everything static.
21483
21484         * driver.cs: Adapt code to use RootContext type name instead of
21485         instance variable.
21486
21487         * delegate.cs: Remove RootContext argument.
21488
21489         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21490         argument. 
21491
21492         * class.cs (Event.Define): The lookup can fail.
21493
21494         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21495
21496         * expression.cs: Resolve the this instance before invoking the code.
21497
21498 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21499
21500         * cs-parser.jay: Add a production in element_access that allows
21501         the thing to become a "type" reference.  This way we can parse
21502         things like "(string [])" as a type.
21503
21504         Note that this still does not handle the more complex rules of
21505         casts. 
21506
21507
21508         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21509
21510         * ecore.cs: (CopyNewMethods): new utility function used to
21511         assemble the list of methods from running FindMembers.
21512
21513         (MemberLookup): Rework FindMembers so that 
21514
21515 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21516
21517         * class.cs (TypeContainer): Remove Delegates who fail to be
21518         defined.
21519
21520         * delegate.cs (Populate): Verify that we dont get null return
21521         values.   TODO: Check for AsAccessible.
21522
21523         * cs-parser.jay: Use basename to emit error 574 (destructor should
21524         have the same name as container class), not the full name.
21525
21526         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21527         possible representation.  
21528
21529         Also implements integer type suffixes U and L.
21530
21531 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21532
21533         * expression.cs (ArrayCreation.DoResolve): We need to do the
21534         argument resolution *always*.
21535
21536         * decl.cs: Make this hold the namespace.  Hold the root context as
21537         well.
21538         (LookupType): Move here.
21539
21540         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21541
21542         * location.cs (Row, Name): Fixed the code, it was always returning
21543         references to the first file.
21544
21545         * interface.cs: Register properties defined through interfaces.
21546
21547         * driver.cs: Add support for globbing on the command line
21548
21549         * class.cs (Field): Make it derive from MemberCore as well.
21550         (Event): ditto.
21551
21552 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21553
21554         * class.cs (Event::Define): Check that the type of the event is a delegate
21555         type else flag error #66.
21556
21557         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21558         same.
21559
21560         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21561         values of EntryPoint, CharSet etc etc.
21562
21563         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21564
21565         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21566         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21567         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21568         which needs this to do its work.
21569
21570         * ../errors/cs0066.cs : Add.
21571
21572 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21573
21574         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21575         helper functions.
21576
21577         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21578         clears out the parameters field.
21579         (MemberSignatureCompare): Cleanup
21580
21581         (MemberCore): New base class used to share code between MethodCore
21582         and Property.
21583
21584         (RegisterRequiredImplementations) BindingFlags.Public requires
21585         either BindingFlags.Instace or Static.  Use instance here.
21586
21587         (Property): Refactored code to cope better with the full spec.
21588
21589         * parameter.cs (GetParameterInfo): Return an empty array instead
21590         of null on error.
21591
21592         * class.cs (Property): Abstract or extern properties have no bodies.
21593
21594         * parameter.cs (GetParameterInfo): return a zero-sized array.
21595
21596         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21597         method modifier validation to the typecontainer so we can reuse
21598         this on properties.
21599
21600         (MethodCore.ParameterTypes): return an empty sized array of types.
21601
21602         (Property.Define): Test property modifier validity.
21603
21604         Add tests for sealed/override too.
21605
21606         (Method.Emit): abstract or extern methods have no bodies.
21607
21608 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21609
21610         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21611         thing.
21612
21613         (Method::Define, ::Emit): Modify accordingly.
21614
21615         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21616
21617         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21618
21619         * makefile: Pass in /unsafe.
21620
21621 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * class.cs (MakeKey): Kill routine.
21624
21625         * class.cs (TypeContainer.Define): Correctly define explicit
21626         method implementations (they require the full interface name plus
21627         the method name).
21628
21629         * typemanager.cs: Deply the PtrHashtable here and stop using the
21630         lame keys.  Things work so much better.
21631
21632         This of course broke everyone who depended on `RegisterMethod' to
21633         do the `test for existance' test.  This has to be done elsewhere.
21634
21635         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21636         the object stupid Equals method (because, that like fails all over
21637         the place).  We still do not use it.
21638
21639         * class.cs (TypeContainer.SetRequiredInterface,
21640         TypeContainer.RequireMethods): Killed these two routines and moved
21641         all the functionality to RegisterRequiredImplementations.
21642
21643         (TypeContainer.RegisterRequiredImplementations): This routine now
21644         registers all the implementations required in an array for the
21645         interfaces and abstract methods.  We use an array of structures
21646         which can be computed ahead of time to reduce memory usage and we
21647         also assume that lookups are cheap as most classes will not
21648         implement too many interfaces.
21649
21650         We also avoid creating too many MethodSignatures.
21651
21652         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21653         clear the "pending" bit if we find that there are problems with
21654         the declaration.
21655
21656         (TypeContainer.VerifyPendingMethods): Update to report errors of
21657         methods that look like implementations but are not.
21658
21659         (TypeContainer.Define): Add support for explicit interface method
21660         implementation. 
21661
21662 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21663
21664         * typemanager.cs: Keep track of the parameters here instead of
21665         being a feature of the TypeContainer.
21666
21667         * class.cs: Drop the registration of parameters here, as
21668         InterfaceMethods are also interface declarations.
21669
21670         * delegate.cs: Register methods with the TypeManager not only with
21671         the TypeContainer.  This code was buggy.
21672
21673         * interface.cs: Full registation here.
21674
21675 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21676
21677         * expression.cs: Remove reducer for binary expressions, it can not
21678         be done this way.
21679
21680         * const.cs: Put here the code that used to go into constant.cs
21681
21682         * constant.cs: Put here the code for constants, this is a new base
21683         class for Literals.
21684
21685         * literal.cs: Make Literal derive from Constant.
21686
21687 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21688
21689         * statement.cs (Return.Emit): Report error 157 if the user
21690         attempts to return from a finally block.
21691
21692         (Return.Emit): Instead of emitting a return, jump to the end of
21693         the function.
21694
21695         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21696         LocalBuilder to store the result of the function.  ReturnLabel is
21697         the target where we jump.
21698
21699
21700 2001-12-09  Radek Doulik  <rodo@ximian.com>
21701
21702         * cs-parser.jay: remember alias in current namespace
21703
21704         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21705         namespaces
21706
21707         * class.cs (LookupAlias): lookup alias in my_namespace
21708
21709         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21710         aliases hashtable
21711         (LookupAlias): lookup alias in this and if needed in parent
21712         namespaces
21713
21714 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21715
21716         * support.cs: 
21717
21718         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21719         making things static.  I need this to avoid passing the
21720         TypeContainer when calling ParameterType.
21721
21722         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21723         that did string manipulation to compute the type and then call
21724         GetType.  Use Parameter.ParameterType instead.
21725
21726         * cs-tokenizer.cs: Consume the suffix for floating values.
21727
21728         * expression.cs (ParameterReference): figure out whether this is a
21729         reference parameter or not.  Kill an extra variable by computing
21730         the arg_idx during emission.
21731
21732         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21733         function that returns whether a parameter is an out/ref value or not.
21734
21735         (Parameter.ParameterType): The type of the parameter (base,
21736         without ref/out applied).
21737
21738         (Parameter.Resolve): Perform resolution here.
21739         (Parameter.ExternalType): The full type (with ref/out applied).
21740
21741         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21742         support for expressions on the using statement.
21743
21744 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21745
21746         * statement.cs (Using.EmitLocalVariableDecls): Split the
21747         localvariable handling of the using statement.
21748
21749         (Block.EmitMeta): Keep track of variable count across blocks.  We
21750         were reusing slots on separate branches of blocks.
21751
21752         (Try.Emit): Emit the general code block, we were not emitting it. 
21753
21754         Check the type of the declaration to be an IDisposable or
21755         something that can be implicity converted to it. 
21756
21757         Emit conversions if required.
21758
21759         * ecore.cs (EmptyExpression): New utility class.
21760         (Expression.ImplicitConversionExists): New utility function.
21761
21762 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * statement.cs (Using): Implement.
21765
21766         * expression.cs (LocalVariableReference): Support read only variables.
21767
21768         * statement.cs: Remove the explicit emit for the Leave opcode.
21769         (VariableInfo): Add a readonly field.
21770
21771 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21772
21773         * ecore.cs (ConvCast): new class used to encapsulate the various
21774         explicit integer conversions that works in both checked and
21775         unchecked contexts.
21776
21777         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21778         properly generate the overflow opcodes.
21779
21780 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21781
21782         * statement.cs: The correct type for the EmptyExpression is the
21783         element_type, not the variable type.  Ravi pointed this out.
21784
21785 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21786
21787         * class.cs (Method::Define): Handle PInvoke methods specially
21788         by using DefinePInvokeMethod instead of the usual one.
21789
21790         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21791         above to do the task of extracting information and defining the method.
21792
21793 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21794
21795         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21796         of the condition for string type.
21797
21798         (Emit): Move that here. 
21799
21800         (ArrayCreation::CheckIndices): Keep string literals in their expression
21801         form.
21802
21803         (EmitDynamicInitializers): Handle strings appropriately.
21804
21805 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21806
21807         * codegen.cs (EmitContext): Replace multiple variables with a
21808         single pointer to the current Switch statement.
21809
21810         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21811         EmitContext.
21812
21813 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21814
21815         * statement.cs 
21816
21817         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21818         default'.
21819
21820         (Foreach.Emit): Foreach on arrays was not setting
21821         up the loop variables (for break/continue).
21822
21823         (GotoCase): Semi-implented.
21824
21825 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21826
21827         * attribute.cs (CheckAttribute): Handle system attributes by using
21828         Attribute.GetAttributes to examine information we need.
21829
21830         (GetValidPlaces): Same here.
21831
21832         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21833
21834         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21835
21836         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21837
21838         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21839
21840         (Method::Emit): Handle the case when we are a PInvoke method.
21841
21842 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21843
21844         * expression.cs: Use ResolveWithSimpleName on compound names.
21845
21846 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21847
21848         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21849         before trying to reduce it.
21850
21851         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21852
21853         * constant.cs (LookupConstantValue): Implement.
21854
21855         (EmitConstant): Use the above in emitting the constant.
21856
21857         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21858         that are user-defined by doing a LookupConstantValue on them.
21859
21860         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21861         too, like above.
21862
21863 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21866
21867         (BaseAccess.DoResolve): Implement.
21868
21869         (MemberAccess.DoResolve): Split this routine into a
21870         ResolveMemberAccess routine that can be used independently
21871
21872 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21873
21874         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21875         As that share bits of the implementation.  Is returns a boolean,
21876         while As returns the Type that is being probed.
21877
21878 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21879
21880         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21881         instead of a Literal - much easier.
21882
21883         (EnumInTransit): Remove - utterly useless :-)
21884
21885         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21886
21887         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21888
21889         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21890         chain when we have no associated expression.
21891
21892 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21893
21894         * constant.cs (Define): Use Location while reporting the errror.
21895
21896         Also emit a warning when 'new' is used and there is no inherited
21897         member to hide.
21898
21899         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21900         populated.
21901
21902         (LookupEnumValue): Implement to lookup an enum member's value and define it
21903         if necessary.
21904
21905         (Populate): Re-write accordingly to use the above routine.
21906
21907 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21908
21909         * expression.cs (This): Fix prototype for DoResolveLValue to
21910         override the base class DoResolveLValue.
21911
21912         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21913         declarations) 
21914
21915         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21916         (we need to load the address of the field here).  This fixes
21917         test-22. 
21918
21919         (FieldExpr.DoResolveLValue): Call the DoResolve
21920         function to initialize the Instance expression.
21921
21922         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21923         correctly the GetEnumerator operation on a value type.
21924
21925         * cs-parser.jay: Add more simple parsing error catches.
21926
21927         * statement.cs (Switch): Add support for string switches.
21928         Handle null specially.
21929
21930         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21931
21932 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21933
21934         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21935
21936         (declare_local_constant): New helper function.
21937
21938         * statement.cs (AddConstant): Keep a separate record of constants
21939
21940         (IsConstant): Implement to determine if a variable is a constant.
21941
21942         (GetConstantExpression): Implement.
21943
21944         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21945
21946         * statement.cs (IsVariableDefined): Re-write.
21947
21948 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21949
21950         * class.cs (TypeContainer::FindMembers): Look for constants
21951         in the case when we are looking for MemberTypes.Field
21952
21953         * expression.cs (MemberAccess::DoResolve): Check that in the
21954         case we are a FieldExpr and a Literal, we are not being accessed
21955         by an instance reference.
21956
21957         * cs-parser.jay (local_constant_declaration): Implement.
21958
21959         (declaration_statement): Implement for constant declarations.
21960
21961 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21962
21963         * statement.cs (Switch): Catch double defaults.
21964
21965         (Switch): More work on the switch() statement
21966         implementation.  It works for integral values now, need to finish
21967         string support.
21968
21969
21970 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21971
21972         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21973         integer literals into other integer literals.  To be used by
21974         switch. 
21975
21976 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21977
21978         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21979         some memory.
21980
21981         (EmitDynamicInitializers): Cope with the above since we extract data
21982         directly from ArrayData now.
21983
21984         (ExpectInitializers): Keep track of whether initializers are mandatory
21985         or not.
21986
21987         (Bounds): Make it a hashtable to prevent the same dimension being 
21988         recorded for every element in that dimension.
21989
21990         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21991         from being found.
21992
21993         Also fix bug which was causing the indices to be emitted in the reverse
21994         order.
21995
21996 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21997
21998         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21999         unfinished.  They do not work, because the underlying code is
22000         sloppy.
22001
22002 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22003
22004         * cs-parser.jay: Remove bogus fixme.
22005
22006         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22007         on Switch statement.
22008
22009 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22010
22011         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22012         the same. 
22013
22014         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22015         parameter. Apparently, any expression is allowed. 
22016
22017         (ValidateInitializers): Update accordingly.
22018
22019         (CheckIndices): Fix some tricky bugs thanks to recursion.
22020
22021         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22022         I was being completely brain-dead.
22023
22024         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22025         and re-write acordingly.
22026
22027         (DelegateInvocation): Re-write accordingly.
22028
22029         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22030
22031         (MakeByteBlob): Handle types more correctly.
22032
22033         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22034         initialization from expressions but it is incomplete because I am a complete
22035         Dodo :-|
22036
22037 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22038
22039         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22040         on If.  Basically, we have to return `true' (ie, we do return to
22041         our caller) only if both branches of the if return.
22042
22043         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22044         short-circuit operators, handle them as short circuit operators. 
22045
22046         (Cast.DoResolve): Resolve type.
22047         (Cast.Cast): Take an expression as the target type.
22048
22049         * cs-parser.jay (cast_expression): Remove old hack that only
22050         allowed a limited set of types to be handled.  Now we take a
22051         unary_expression and we resolve to a type during semantic
22052         analysis.
22053
22054         Use the grammar productions from Rhys to handle casts (this is
22055         not complete like Rhys syntax yet, we fail to handle that corner
22056         case that C# has regarding (-x), but we will get there.
22057
22058 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22059
22060         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22061         field which is an array type.
22062
22063         * cs-parser.jay (declare_local_variables): Support array initialization too.
22064
22065         * typemanager.cs (MakeKey): Implement.
22066
22067         (everywhere): Use the above appropriately.
22068
22069         * cs-parser.jay (for_statement): Update for array initialization while
22070         declaring variables.
22071
22072         * ecore.cs : The error message was correct, it's the variable's names that
22073         were misleading ;-) Make the code more readable.
22074
22075         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22076         the correct type etc.
22077
22078         (ConvertExplicit): Handle Enum types by examining the underlying type.
22079
22080 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22081
22082         * parameter.cs (GetCallingConvention): Always return
22083         CallingConventions.Standard for now.
22084
22085 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22086
22087         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22088         and `r' after calling DoNumericPromotions.
22089
22090         * ecore.cs: Fix error message (the types were in the wrong order).
22091
22092         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22093         BindingFlags.Instance as well 
22094
22095         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22096         implicit int literal conversion in an empty cast so that we
22097         propagate the right type upstream.
22098
22099         (UnboxCast): new class used to unbox value types.
22100         (Expression.ConvertExplicit): Add explicit type conversions done
22101         by unboxing.
22102
22103         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22104         the target type before applying the implicit LongLiterals to ULong
22105         literal cast.
22106
22107 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22108
22109         * cs-parser.jay (for_statement): Reworked the way For works: now
22110         we declare manually any variables that are introduced in
22111         for_initializer to solve the problem of having out-of-band code
22112         emition (that is what got for broken).
22113
22114         (declaration_statement): Perform the actual variable declaration
22115         that used to be done in local_variable_declaration here.
22116
22117         (local_variable_declaration): Do not declare anything, just pass
22118         the information on a DictionaryEntry
22119
22120 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22121
22122         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22123         re-write of the logic to now make it recursive.
22124
22125         (UpdateIndices): Re-write accordingly.
22126
22127         Store element data in a separate ArrayData list in the above methods.
22128
22129         (MakeByteBlob): Implement to dump the array data into a byte array.
22130
22131 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22132
22133         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22134         into CheckIndices.
22135
22136         * constant.cs (Define): Implement.
22137
22138         (EmitConstant): Re-write fully.
22139
22140         Pass in location info.
22141
22142         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22143         respectively.
22144
22145         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22146         DictionaryEntry since we need location info too.
22147
22148         (constant_declaration): Update accordingly.
22149
22150         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22151         code into another method : UpdateIndices.
22152
22153 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22154
22155         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22156         some type checking etc.
22157
22158 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22159
22160         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22161         bits to provide dimension info if the user skips doing that.
22162
22163         Update second constructor to store the rank correctly.
22164
22165 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22166
22167         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22168         and try to implement.
22169
22170         * ../errors/cs0150.cs : Add.
22171
22172         * ../errors/cs0178.cs : Add.
22173
22174 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * statement.cs: Implement foreach on multi-dimensional arrays. 
22177
22178         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22179         name of the params argument.
22180
22181         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22182         initializing the array.
22183
22184         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22185         we can use this elsewhere.
22186
22187         * statement.cs: Finish implementation of foreach for single
22188         dimension arrays.
22189
22190         * cs-parser.jay: Use an out-of-band stack to pass information
22191         around, I wonder why I need this.
22192
22193         foreach_block: Make the new foreach_block the current_block.
22194
22195         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22196         function used to return a static Parameters structure.  Used for
22197         empty parameters, as those are created very frequently.
22198
22199         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22200
22201 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22202
22203         * interface.cs : Default modifier is private, not public. The
22204         make verify test passes again.
22205
22206 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22207
22208         * support.cs (ReflectionParameters): Fix logic to determine
22209         whether the last parameter is a params one. Test 9 passes again.
22210
22211         * delegate.cs (Populate): Register the builders we define with
22212         RegisterParameterForBuilder. Test 19 passes again.
22213
22214         * cs-parser.jay (property_declaration): Reference $6 instead
22215         of $$ to get at the location.
22216
22217         (indexer_declaration): Similar stuff.
22218
22219         (attribute): Ditto.
22220
22221         * class.cs (Property): Register parameters for the Get and Set methods
22222         if they exist. Test 23 passes again.
22223
22224         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22225         call to EmitArguments as we are sure there aren't any params arguments. 
22226         Test 32 passes again.
22227
22228         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22229         IndexOutOfRangeException. 
22230
22231         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22232         Test 33 now passes again.
22233
22234 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22235
22236         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22237         broke a bunch of things.  Will have to come up with a better way
22238         of tracking locations.
22239
22240         * statement.cs: Implemented foreach for single dimension arrays.
22241
22242 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22243
22244         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22245         an error.  This removes the lookup from the critical path.
22246
22247         * cs-parser.jay: Removed use of temporary_loc, which is completely
22248         broken. 
22249
22250 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22251
22252         * support.cs (ReflectionParameters.ParameterModifier): Report
22253         whether the argument is a PARAMS argument or not.
22254
22255         * class.cs: Set the attribute `ParamArrayAttribute' on the
22256         parameter argument.
22257
22258         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22259         and cons_param_array_attribute (ConstructorInfo for
22260         ParamArrayAttribute)., 
22261
22262         * codegen.cs: Emit the return using the `Return' statement, that
22263         way we can report the error correctly for missing return values. 
22264
22265         * class.cs (Method.Emit): Clean up.
22266
22267         * expression.cs (Argument.Resolve): Take another argument: the
22268         location where this argument is used.  Notice that this is not
22269         part of the "Argument" class as to reduce the size of the
22270         structure (we know the approximate location anyways).
22271
22272         Test if the argument is a variable-reference, if not, then
22273         complain with a 206.
22274
22275         (Argument.Emit): Emit addresses of variables.
22276
22277         (Argument.FullDesc): Simplify.
22278
22279         (Invocation.DoResolve): Update for Argument.Resolve.
22280
22281         (ElementAccess.DoResolve): ditto.
22282
22283         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22284         method should be virtual, as this method is always virtual.
22285
22286         (NewDelegate.DoResolve): Update for Argument.Resolve.
22287
22288         * class.cs (ConstructorInitializer.DoResolve): ditto.
22289
22290         * attribute.cs (Attribute.Resolve): ditto.
22291
22292 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22293
22294         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22295
22296         * expression.cs (ParameterReference): Drop IStackStorage and implement
22297         IAssignMethod instead. 
22298
22299         (LocalVariableReference): ditto.
22300
22301         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22302         IAssignMethod instead. 
22303
22304 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22305
22306         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22307         enumerations that are used in heavily used structures derive from
22308         byte in a laughable and pathetic attempt to reduce memory usage.
22309         This is the kind of pre-optimzations that you should not do at
22310         home without adult supervision.
22311
22312         * expression.cs (UnaryMutator): New class, used to handle ++ and
22313         -- separatedly from the other unary operators.  Cleans up the
22314         code, and kills the ExpressionStatement dependency in Unary.
22315
22316         (Unary): Removed `method' and `Arguments' from this class, making
22317         it smaller, and moving it all to SimpleCall, so I can reuse this
22318         code in other locations and avoid creating a lot of transient data
22319         strucutres when not required.
22320
22321         * cs-parser.jay: Adjust for new changes.
22322
22323 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22324
22325         * enum.cs (Enum.Populate): If there is a failure during
22326         definition, return
22327
22328         * cs-parser.jay (opt_enum_base): we used to catch type errors
22329         here, but this is really incorrect.  The type error should be
22330         catched during semantic analysis.
22331
22332 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22333
22334         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22335         current_local_parameters as expected since I, in my stupidity, had forgotten
22336         to do this :-)
22337
22338         * attribute.cs (GetValidPlaces): Fix stupid bug.
22339
22340         * class.cs (Method::Emit): Perform check on applicability of attributes.
22341
22342         (Constructor::Emit): Ditto.
22343
22344         (Field::Emit): Ditto.
22345
22346         (Field.Location): Store location information.
22347
22348         (Property, Event, Indexer, Operator): Ditto.
22349
22350         * cs-parser.jay (field_declaration): Pass in location for each field.
22351
22352         * ../errors/cs0592.cs : Add.
22353
22354 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22355
22356         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22357
22358         (InitCoreTypes): Update accordingly.
22359
22360         (RegisterAttrType, LookupAttr): Implement.
22361
22362         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22363         info about the same.
22364
22365         (Resolve): Update to populate the above as necessary.
22366
22367         (Error592): Helper.
22368
22369         (GetValidPlaces): Helper to the above.
22370
22371         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22372
22373         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22374
22375 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22376
22377         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22378
22379         * ../errors/cs0617.cs : Add.
22380
22381 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22382
22383         * enum.cs (Emit): Rename to Populate to be more consistent with what
22384         we expect it to do and when exactly it is called.
22385
22386         * class.cs, rootcontext.cs : Update accordingly.
22387
22388         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22389         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22390
22391         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22392
22393         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22394         of a fieldinfo using the above, when dealing with a FieldBuilder.
22395
22396 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22397
22398         * ../errors/cs0031.cs : Add.
22399
22400         * ../errors/cs1008.cs : Add.
22401
22402         * ../errrors/cs0543.cs : Add.
22403
22404         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22405         enum type.
22406
22407         (FindMembers): Implement.
22408
22409         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22410         enums and delegates too.
22411
22412         (enum_types): Rename to builder_to_enum.
22413
22414         (delegate_types): Rename to builder_to_delegate.
22415
22416         * delegate.cs (FindMembers): Implement.
22417
22418 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22419
22420         * typemanager.cs (IsEnumType): Implement.
22421
22422         * enum.cs (Emit): Re-write parts to account for the underlying type
22423         better and perform checking etc.
22424
22425         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22426         of the underlying type.
22427
22428         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22429         value
22430
22431         * enum.cs (error31): Helper to report error #31.
22432
22433         * cs-parser.jay (enum_declaration): Store location of each member too.
22434
22435         * enum.cs (member_to_location): New hashtable. 
22436
22437         (AddEnumMember): Update location hashtable.
22438
22439         (Emit): Use the location of each member while reporting errors.
22440
22441 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22442
22443         * cs-parser.jay: A for_initializer if is a
22444         local_variable_declaration really ammount to have an implicit
22445         block with the variable declaration and no initializer for for.
22446
22447         * statement.cs (For.Emit): Cope with null initializers.
22448
22449         This fixes the infinite loop on for initializers.
22450
22451 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22452
22453         * enum.cs: More cleanup.
22454
22455         * ecore.cs: Remove dead code.
22456
22457         * class.cs (Property.Emit): More simplification.
22458         (Event.Emit): ditto.
22459
22460         Reworked to have less levels of indentation.
22461
22462 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22463
22464         * class.cs (Property): Emit attributes.
22465
22466         (Field): Ditto.
22467
22468         (Event): Ditto.
22469
22470         (Indexer): Ditto.
22471
22472         (Operator): Ditto.
22473
22474         * enum.cs (Emit): Ditto.
22475
22476         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22477         Enums too.
22478
22479         * class.cs (Field, Event, etc.): Move attribute generation into the
22480         Emit method everywhere.
22481
22482         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22483         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22484         as we had no way of defining nested enums !
22485
22486         * rootcontext.cs : Adjust code accordingly.
22487
22488         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22489
22490 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22491
22492         * expression.cs (EvalConstantExpression): Move into ecore.cs
22493
22494         * enum.cs (Enum): Rename some members and make them public and readonly
22495         according to our convention.
22496
22497         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22498         nothing else.
22499
22500         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22501
22502         (Enum::Emit): Write a simple version for now which doesn't try to compute
22503         expressions. I shall modify this to be more robust in just a while.
22504
22505         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22506
22507         (TypeContainer::CloseType): Create the Enum types too.
22508
22509         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22510
22511         * expression.cs (EvalConstantExpression): Get rid of completely.
22512
22513         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22514         user-defined values and other cases.
22515
22516         (IsValidEnumLiteral): Helper function.
22517
22518         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22519         out there in the case we had a literal FieldExpr.
22520
22521         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22522
22523         (Literalize): Revamp a bit to take two arguments.
22524
22525         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22526
22527 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22528
22529         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22530
22531         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22532
22533         (Resolve): Use the above to ensure we have proper initializers.
22534
22535 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22536
22537         * expression.cs (Expression::EvalConstantExpression): New method to 
22538         evaluate constant expressions.
22539
22540         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22541
22542 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22543
22544         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22545         in an array.
22546
22547         (Binary.ResolveOperator): Handle operator != (object a, object b)
22548         and operator == (object a, object b);
22549
22550         (Binary.DoNumericPromotions): Indicate whether the numeric
22551         promotion was possible.
22552
22553         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22554         Implement.  
22555
22556         Made the ArrayAccess implement interface IAssignMethod instead of
22557         IStackStore as the order in which arguments are passed reflects
22558         this.
22559
22560         * assign.cs: Instead of using expr.ExprClass to select the way of
22561         assinging, probe for the IStackStore/IAssignMethod interfaces.
22562
22563         * typemanager.cs: Load InitializeArray definition.
22564
22565         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22566         static data that can be used to initialize arrays. 
22567
22568 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22569
22570         * expression.cs: Handle operator== and operator!= for booleans.
22571
22572         (Conditioal.Reduce): Implement reducer for the ?: operator.
22573
22574         (Conditional.Resolve): Implement dead code elimination.
22575
22576         (Binary.Resolve): Catch string literals and return a new
22577         concatenated string.
22578
22579         (Unary.Reduce): Implement reduction of unary expressions.
22580
22581         * ecore.cs: Split out the expression core handling here.
22582
22583         (Expression.Reduce): New method used to perform constant folding
22584         and CSE.  This is needed to support constant-expressions. 
22585
22586         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22587         targets, and optimize for !x.
22588
22589 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22590
22591         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22592         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22593         set custom atttributes.
22594
22595         * literal.cs (Literal::GetValue): New abstract method to return the actual
22596         value of the literal, cast as an object.
22597
22598         (*Literal): Implement GetValue method.
22599
22600         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22601         expressions to the arraylist but objects of type Argument.
22602
22603         * class.cs (TypeContainer::Emit): Emit our attributes too.
22604
22605         (Method::Emit, Constructor::Emit): Ditto.
22606
22607         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22608         to be ignoring earlier.
22609
22610 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22611
22612         * attribute.cs (AttributeSection::Define): Implement to do the business
22613         of constructing a CustomAttributeBuilder.
22614
22615         (Attribute): New trivial class. Increases readability of code.  
22616
22617         * cs-parser.jay : Update accordingly.
22618
22619         (positional_argument_list, named_argument_list, named_argument): New rules
22620
22621         (attribute_arguments): Use the above so that we are more correct.
22622
22623 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22624
22625         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22626         to perform all checks for a method with a params parameter.
22627
22628         (Invocation::OverloadResolve): Update to use the above method and therefore
22629         cope correctly with params method invocations.
22630
22631         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22632         params too.
22633
22634         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22635         constructors in our parent too because we can't afford to miss out on 
22636         protected ones ;-)
22637
22638         * attribute.cs (AttributeSection): New name for the class Attribute
22639
22640         Other trivial changes to improve readability.
22641
22642         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22643         use the new class names.
22644
22645 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22646
22647         * class.cs (Method::Define): Complete definition for params types too
22648
22649         (Indexer::Define): Ditto.
22650
22651         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22652         Cope everywhere with a request for info about the array parameter.
22653
22654 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22655
22656         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22657
22658         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22659         local_variable_type to extract the string corresponding to the type.
22660
22661         (local_variable_type): Fixup the action to use the new helper method.
22662
22663         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22664         go.
22665
22666         * expression.cs : Clean out code which uses the above.
22667
22668 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22669
22670         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22671         and bale out if necessary by returning a false.
22672
22673         (RegisterProperty): Ditto.
22674
22675         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22676         and print out appropriate error messages.
22677
22678         * interface.cs (everywhere): Ditto.
22679
22680         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22681         location to constructor.
22682
22683         * class.cs (Property, Event, Indexer): Update accordingly.
22684
22685         * ../errors/cs111.cs : Added.
22686
22687         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22688         of a method, as laid down by the spec.
22689
22690         (Invocation::OverloadResolve): Use the above method.
22691
22692 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22693
22694         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22695         now take a TypeContainer and a Parameters object.
22696
22697         (ParameterData): Modify return type of ParameterModifier method to be 
22698         Parameter.Modifier and not a string.
22699
22700         (ReflectionParameters, InternalParameters): Update accordingly.
22701
22702         * expression.cs (Argument::GetParameterModifier): Same here.
22703
22704         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22705         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22706         symbol in it at all so maybe this is only for now.
22707
22708 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22709
22710         * support.cs (InternalParameters): Constructor now takes an extra argument 
22711         which is the actual Parameters class.
22712
22713         (ParameterDesc): Update to provide info on ref/out modifiers.
22714
22715         * class.cs (everywhere): Update call to InternalParameters to pass in
22716         the second argument too.
22717
22718         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22719         to return the modifier info [ref/out etc]
22720
22721         (InternalParameters, ReflectionParameters): Implement the above.
22722
22723         * expression.cs (Argument::ParameterModifier): Similar function to return
22724         info about the argument's modifiers.
22725
22726         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22727         too.
22728
22729         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22730         a new SetFormalParameters object which we pass to InternalParameters.
22731
22732 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22733
22734         * expression.cs (NewArray): Merge into the ArrayCreation class.
22735
22736 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22737
22738         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22739         NewUserdefinedArray into one as there wasn't much of a use in having
22740         two separate ones.
22741
22742         * expression.cs (Argument): Change field's name to ArgType from Type.
22743
22744         (Type): New readonly property which returns the proper type, taking into 
22745         account ref/out modifiers.
22746
22747         (everywhere): Adjust code accordingly for the above.
22748
22749         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22750         whether we are emitting for a ref or out parameter.
22751
22752         * expression.cs (Argument::Emit): Use the above field to set the state.
22753
22754         (LocalVariableReference::Emit): Update to honour the flag and emit the
22755         right stuff.
22756
22757         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22758
22759         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22760
22761         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22762
22763         (ReflectionParameters, InternalParameters): Implement the above method.
22764
22765         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22766         reporting errors.
22767
22768         (Invocation::FullMethodDesc): Ditto. 
22769
22770 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22771
22772         * cs-parser.jay: Add extra production for the second form of array
22773         creation. 
22774
22775         * expression.cs (ArrayCreation): Update to reflect the above
22776         change. 
22777
22778         * Small changes to prepare for Array initialization.
22779
22780 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22781
22782         * typemanager.cs (ImplementsInterface): interface might be null;
22783         Deal with this problem;
22784
22785         Also, we do store negative hits on the cache (null values), so use
22786         this instead of calling t.GetInterfaces on the type everytime.
22787
22788 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22789
22790         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22791
22792         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22793         split functionality out into different classes.
22794
22795         (New::FormArrayType): Move into NewBuiltinArray.
22796
22797         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22798         quite useless.
22799
22800         (NewBuiltinArray): New class to handle creation of built-in arrays.
22801
22802         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22803         account creation of one-dimensional arrays.
22804
22805         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22806
22807         (NewUserdefinedArray::DoResolve): Implement.
22808
22809         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22810
22811         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22812         we maintain inside the TypeManager. This is necessary to perform lookups on the
22813         module builder.
22814
22815         (LookupType): Update to perform GetType on the module builders too.     
22816
22817         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22818
22819         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22820
22821 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22822
22823         * expression.cs (New::DoResolve): Implement guts of array creation.
22824
22825         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22826
22827 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22828
22829         * expression.cs: Fix bug I introduced lsat night that broke
22830         Delegates. 
22831
22832         (Expression.Resolve): Report a 246 error (can not resolve name)
22833         if we find a SimpleName in the stream.
22834
22835         (Expression.ResolveLValue): Ditto.
22836
22837         (Expression.ResolveWithSimpleName): This function is a variant of
22838         ResolveName, this one allows SimpleNames to be returned without a
22839         warning.  The only consumer of SimpleNames is MemberAccess
22840
22841 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22842
22843         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22844         might arrive here.  I have my doubts that this is correct.
22845
22846         * statement.cs (Lock): Implement lock statement.
22847
22848         * cs-parser.jay: Small fixes to support `lock' and `using'
22849
22850         * cs-tokenizer.cs: Remove extra space
22851
22852         * driver.cs: New flag --checked, allows to turn on integer math
22853         checking. 
22854
22855         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22856         Threading.Monitor.Exit 
22857
22858 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22859
22860         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22861         Expression Class to be IndexerAccess.
22862
22863         Notice that Indexer::DoResolve sets the eclass to Value.
22864
22865 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22866
22867         * class.cs (TypeContainer::Emit): Emit code for indexers.
22868
22869         * assign.cs (IAssignMethod): New interface implemented by Indexers
22870         and Properties for handling assignment.
22871
22872         (Assign::Emit): Simplify and reuse code. 
22873
22874         * expression.cs (IndexerAccess, PropertyExpr): Implement
22875         IAssignMethod, clean up old code. 
22876
22877 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22878
22879         * typemanager.cs (ImplementsInterface): New method to determine if a type
22880         implements a given interface. Provides a nice cache too.
22881
22882         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22883         method.
22884
22885         (ConvertReferenceExplicit): Ditto.
22886
22887         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22888         various methods, with correct names etc.
22889
22890         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22891         Operator.UnaryNegation.
22892
22893         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22894         we have a unary plus or minus operator.
22895
22896         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22897         UnaryMinus.
22898
22899         * everywhere : update accordingly.
22900
22901         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22902         respectively.
22903
22904         * class.cs (Method::Define): For the case where we are implementing a method
22905         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22906         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22907
22908 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22909
22910         * interface.cs (FindMembers): Implement to work around S.R.E
22911         lameness.
22912
22913         * typemanager.cs (IsInterfaceType): Implement.
22914
22915         (FindMembers): Update to handle interface types too.
22916
22917         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22918         use IsAssignableFrom as that is not correct - it doesn't work.
22919
22920         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22921         and accordingly override EmitStatement.
22922
22923         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22924         using the correct logic :-)
22925
22926 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22927
22928         * ../errors/cs-11.cs : Add to demonstrate error -11 
22929
22930 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22931
22932         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22933         then pass this as a hint to ResolveLValue.
22934
22935         * expression.cs (FieldExpr): Add Location information
22936
22937         (FieldExpr::LValueResolve): Report assignment to readonly
22938         variable. 
22939
22940         (Expression::ExprClassFromMemberInfo): Pass location information.
22941
22942         (Expression::ResolveLValue): Add new method that resolves an
22943         LValue. 
22944
22945         (Expression::DoResolveLValue): Default invocation calls
22946         DoResolve. 
22947
22948         (Indexers): New class used to keep track of indexers in a given
22949         Type. 
22950
22951         (IStackStore): Renamed from LValue, as it did not really describe
22952         what this did.  Also ResolveLValue is gone from this interface and
22953         now is part of Expression.
22954
22955         (ElementAccess): Depending on the element access type
22956
22957         * typemanager.cs: Add `indexer_name_type' as a Core type
22958         (System.Runtime.CompilerServices.IndexerNameAttribute)
22959
22960         * statement.cs (Goto): Take a location.
22961
22962 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22963
22964         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22965         if two delegates are compatible.
22966
22967         (NewDelegate::DoResolve): Update to take care of the case when
22968         we instantiate a delegate from another delegate.
22969
22970         * typemanager.cs (FindMembers): Don't even try to look up members
22971         of Delegate types for now.
22972
22973 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22974
22975         * delegate.cs (NewDelegate): New class to take care of delegate
22976         instantiation.
22977
22978         * expression.cs (New): Split the delegate related code out into 
22979         the NewDelegate class.
22980
22981         * delegate.cs (DelegateInvocation): New class to handle delegate 
22982         invocation.
22983
22984         * expression.cs (Invocation): Split out delegate related code into
22985         the DelegateInvocation class.
22986
22987 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22988
22989         * expression.cs (New::DoResolve): Implement delegate creation fully
22990         and according to the spec.
22991
22992         (New::DoEmit): Update to handle delegates differently.
22993
22994         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22995         because of which we were printing out arguments in reverse order !
22996
22997         * delegate.cs (VerifyMethod): Implement to check if the given method
22998         matches the delegate.
22999
23000         (FullDelegateDesc): Implement.
23001
23002         (VerifyApplicability): Implement.
23003
23004         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23005         delegate invocations too.
23006
23007         (Invocation::Emit): Ditto.
23008
23009         * ../errors/cs1593.cs : Added.
23010
23011         * ../errors/cs1594.cs : Added.
23012
23013         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23014
23015 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23016
23017         * typemanager.cs (intptr_type): Core type for System.IntPtr
23018
23019         (InitCoreTypes): Update for the same.
23020
23021         (iasyncresult_type, asynccallback_type): Ditto.
23022
23023         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23024         correct.
23025
23026         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23027         too.
23028
23029         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23030         the builders for the 4 members of a delegate type :-)
23031
23032         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23033         type.
23034
23035         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23036
23037         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23038
23039 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23040
23041         * statement.cs (Break::Emit): Implement.   
23042         (Continue::Emit): Implement.
23043
23044         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23045         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23046         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23047         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23048         end loop
23049
23050         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23051         properties that track the label for the current loop (begin of the
23052         loop and end of the loop).
23053
23054 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23055
23056         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23057         use of emitting anything at all.
23058
23059         * class.cs, rootcontext.cs : Get rid of calls to the same.
23060
23061         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23062
23063         (Populate): Define the constructor correctly and set the implementation
23064         attributes.
23065
23066         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23067         have been defined.
23068
23069         (AddDelegateType): Implement.
23070
23071         (IsDelegateType): Implement helper method.
23072
23073         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23074
23075         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23076         and accordingly handle it.
23077
23078         * delegate.cs (Populate): Take TypeContainer argument.
23079         Implement bits to define the Invoke method. However, I still haven't figured out
23080         how to take care of the native int bit :-(
23081
23082         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23083         Qualify the name of the delegate, not its return type !
23084
23085         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23086         conversion.
23087
23088         (StandardConversionExists): Checking for array types turns out to be recursive.
23089
23090         (ConvertReferenceExplicit): Implement array conversion.
23091
23092         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23093
23094 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23095
23096         * cs-parser.jay (delegate_declaration): Store the fully qualified
23097         name as it is a type declaration.
23098
23099         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23100         readonly.
23101
23102         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23103         as TypeContainer::DefineType.
23104
23105         (Populate): Method in which all the definition of the various methods (Invoke)
23106         etc is done.
23107
23108         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23109         see.
23110
23111         (CloseDelegate): Finally creates the delegate.
23112
23113         * class.cs (TypeContainer::DefineType): Update to define delegates.
23114         (Populate, Emit and CloseType): Do the same thing here too.
23115
23116         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23117         delegates in all these operations.
23118
23119 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23120
23121         * expression.cs: LocalTemporary: a new expression used to
23122         reference a temporary that has been created.
23123
23124         * assign.cs: Handle PropertyAccess back here, so that we can
23125         provide the proper semantic access to properties.
23126
23127         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23128         a few more explicit conversions. 
23129
23130         * modifiers.cs: `NEW' modifier maps to HideBySig.
23131
23132         * expression.cs (PropertyExpr): Make this into an
23133         ExpressionStatement, and support the EmitStatement code path. 
23134
23135         Perform get/set error checking, clean up the interface.
23136
23137         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23138         them into toplevel access objects.
23139
23140 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23141
23142         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23143         SRE.
23144
23145         * typemanager.cs: Keep track here of our PropertyBuilders again to
23146         work around lameness in SRE.
23147
23148 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * expression.cs (LValue::LValueResolve): New method in the
23151         interface, used to perform a second resolution pass for LValues. 
23152
23153         (This::DoResolve): Catch the use of this in static methods.
23154
23155         (This::LValueResolve): Implement.
23156
23157         (This::Store): Remove warning, assigning to `this' in structures
23158         is 
23159
23160         (Invocation::Emit): Deal with invocation of
23161         methods on value types.  We need to pass the address to structure
23162         methods rather than the object itself.  (The equivalent code to
23163         emit "this" for structures leaves the entire structure on the
23164         stack instead of a pointer to it). 
23165
23166         (ParameterReference::DoResolve): Compute the real index for the
23167         argument based on whether the method takes or not a `this' pointer
23168         (ie, the method is static).
23169
23170         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23171         value types returned from functions when we need to invoke a
23172         method on the sturcture.
23173
23174
23175 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23176
23177         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23178         defining the type in the Modulebuilder or Typebuilder. This is to take
23179         care of nested types which need to be defined on the TypeBuilder using
23180         DefineNestedMethod.
23181
23182         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23183         methods in RootContext, only ported to be part of TypeContainer.
23184
23185         (TypeContainer::GetInterfaceOrClass): Ditto.
23186
23187         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23188
23189         * interface.cs (Interface::DefineInterface): New method. Does exactly
23190         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23191         too.
23192
23193         (Interface::GetInterfaces): Move from RootContext here and port.
23194
23195         (Interface::GetInterfaceByName): Same here.
23196
23197         * rootcontext.cs (ResolveTree): Re-write.
23198
23199         (PopulateTypes): Re-write.
23200
23201         * class.cs (TypeContainer::Populate): Populate nested types too.
23202         (TypeContainer::Emit): Emit nested members too.
23203
23204         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23205         instead just use the name argument passed in as it is already fully
23206         qualified.
23207
23208         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23209         to TypeContainer mapping to see if a type is user-defined.
23210
23211         * class.cs (TypeContainer::CloseType): Implement. 
23212
23213         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23214         the default constructor.
23215
23216         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23217         twice.
23218
23219         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23220
23221         * interface.cs (CloseType): Create the type here.
23222
23223         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23224         the hierarchy.
23225
23226         Remove all the methods which are now in TypeContainer.
23227
23228 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23229
23230         * delegate.cs (Define): Re-write bits to define the delegate
23231         correctly.
23232
23233 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23234
23235         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23236
23237         * expression.cs (ImplicitReferenceConversion): handle null as well
23238         as a source to convert to any reference type.
23239
23240         * statement.cs (Return): Perform any implicit conversions to
23241         expected return type.  
23242
23243         Validate use of return statement.  
23244
23245         * codegen.cs (EmitContext): Pass the expected return type here.
23246
23247         * class.cs (Method, Constructor, Property): Pass expected return
23248         type to EmitContext.
23249
23250 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23251
23252         * expression.cs: Make DoResolve take an EmitContext instead of a
23253         TypeContainer.
23254
23255         Replaced `l' and `location' for `loc', for consistency.
23256
23257         (Error, Warning): Remove unneeded Tc argument.
23258
23259         * assign.cs, literal.cs, constant.cs: Update to new calling
23260         convention. 
23261
23262         * codegen.cs: EmitContext now contains a flag indicating whether
23263         code is being generated in a static method or not.
23264
23265         * cs-parser.jay: DecomposeQI, new function that replaces the old
23266         QualifiedIdentifier.  Now we always decompose the assembled
23267         strings from qualified_identifier productions into a group of
23268         memberaccesses.
23269
23270 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23271
23272         * rootcontext.cs: Deal with field-less struct types correctly now
23273         by passing the size option to Define Type.
23274
23275         * class.cs: Removed hack that created one static field. 
23276
23277 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23278
23279         * statement.cs: Moved most of the code generation here. 
23280
23281 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23282
23283         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23284         seem very right.
23285
23286         (ElementAccess): Remove useless bits for now - keep checks as the spec
23287         says.
23288
23289 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23290
23291         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23292         and start performing checks according to the spec.
23293
23294 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23295
23296         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23297         rank_specifiers instead.
23298
23299         (rank_specifiers): Change the order in which the rank specifiers are stored
23300
23301         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23302
23303         * expression.cs (ElementAccess): Implement the LValue interface too.
23304
23305 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23306
23307         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23308         except that user defined conversions are not included.
23309
23310         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23311         perform the conversion of the return type, if necessary.
23312
23313         (New::DoResolve): Check whether we are creating an array or an object
23314         and accordingly do the needful.
23315
23316         (New::Emit): Same here.
23317
23318         (New::DoResolve): Implement guts of array creation.
23319
23320         (New::FormLookupType): Helper function.
23321
23322 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23323
23324         * codegen.cs: Removed most of the code generation here, and move the
23325         corresponding code generation bits to the statement classes. 
23326
23327         Added support for try/catch/finalize and throw.
23328
23329         * cs-parser.jay: Added support for try/catch/finalize.
23330
23331         * class.cs: Catch static methods having the flags override,
23332         virtual or abstract.
23333
23334         * expression.cs (UserCast): This user cast was not really doing
23335         what it was supposed to do.  Which is to be born in fully resolved
23336         state.  Parts of the resolution were being performed at Emit time! 
23337
23338         Fixed this code.
23339
23340 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23341
23342         * expression.cs: Implicity convert the result from UserCast.
23343
23344 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23345
23346         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23347         prevented it from working correctly. 
23348
23349         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23350         merely ConvertImplicit.
23351
23352 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23353
23354         * typemanager.cs: Make the LookupTypeContainer function static,
23355         and not per-instance.  
23356
23357         * class.cs: Make static FindMembers (the one that takes a Type
23358         argument). 
23359
23360         * codegen.cs: Add EmitForeach here.
23361
23362         * cs-parser.jay: Make foreach a toplevel object instead of the
23363         inline expansion, as we need to perform semantic analysis on it. 
23364
23365 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23366
23367         * expression.cs (Expression::ImplicitUserConversion): Rename to
23368         UserDefinedConversion.
23369
23370         (Expression::UserDefinedConversion): Take an extra argument specifying 
23371         whether we look for explicit user conversions too.
23372
23373         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23374
23375         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23376
23377         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23378         with the appropriate arguments.
23379
23380         * cs-parser.jay (cast_expression): Record location too.
23381
23382         * expression.cs (Cast): Record location info.
23383
23384         (Expression::ConvertExplicit): Take location argument.
23385
23386         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23387         to determine if we are doing explicit conversions.
23388
23389         (UserCast::Emit): Update accordingly.
23390
23391         (Expression::ConvertExplicit): Report an error if everything fails.
23392
23393         * ../errors/cs0030.cs : Add.
23394
23395 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23396
23397         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23398         virtual and newslot bits. 
23399
23400         * class.cs (TypeContainer::RegisterRequiredImplementations):
23401         Record methods we need.
23402
23403         (TypeContainer::MakeKey): Helper function to make keys for
23404         MethodBases, since the Methodbase key is useless.
23405
23406         (TypeContainer::Populate): Call RegisterRequiredImplementations
23407         before defining the methods.   
23408
23409         Create a mapping for method_builders_to_methods ahead of time
23410         instead of inside a tight loop.
23411
23412         (::RequireMethods):  Accept an object as the data to set into the
23413         hashtable so we can report interface vs abstract method mismatch.
23414
23415 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23416
23417         * report.cs: Make all of it static.
23418
23419         * rootcontext.cs: Drop object_type and value_type computations, as
23420         we have those in the TypeManager anyways.
23421
23422         Drop report instance variable too, now it is a global.
23423
23424         * driver.cs: Use try/catch on command line handling.
23425
23426         Add --probe option to debug the error reporting system with a test
23427         suite. 
23428
23429         * report.cs: Add support for exiting program when a probe
23430         condition is reached.
23431
23432 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23433
23434         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23435         we do a forcible conversion regardless of type, to check if 
23436         ForceConversion returns a null.
23437
23438         (Binary::error19): Use location to report error.
23439
23440         (Unary::error23): Use location here too.
23441
23442         * ../errors/cs0019.cs : Check in.
23443
23444         * ../errors/cs0023.cs : Check in.
23445
23446         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23447         case of a non-null MethodInfo object with a length of 0 !
23448
23449         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23450         an applicable member - according to the spec :-)
23451         Also fix logic to find members in base types.
23452
23453         (Unary::ResolveOperator): Same here.
23454
23455         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23456         as I was getting thoroughly confused between this and error19 :-)
23457
23458         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23459         (::FindMostEncompassedType): Implement.
23460         (::FindMostEncompassingType): Implement.
23461         (::StandardConversionExists): Implement.
23462
23463         (UserImplicitCast): Re-vamp. We now need info about most specific
23464         source and target types so that we can do the necessary conversions.
23465
23466         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23467         mathematical union with no duplicates.
23468
23469 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23470
23471         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23472         in order from base classes to child classes, so that we can in
23473         child classes look up in our parent for method names and
23474         attributes (required for handling abstract, virtual, new, override
23475         constructs: we need to instrospect our base class, and if we dont
23476         populate the classes in order, the introspection might be
23477         incorrect.  For example, a method could query its parent before
23478         the parent has any methods and would determine that the parent has
23479         no abstract methods (while it could have had them)).
23480
23481         (RootContext::CreateType): Record the order in which we define the
23482         classes.
23483
23484 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23485
23486         * class.cs (TypeContainer::Populate): Also method definitions can
23487         fail now, keep track of this.
23488
23489         (TypeContainer::FindMembers): Implement support for
23490         DeclaredOnly/noDeclaredOnly flag.
23491
23492         (Constructor::Emit) Return the ConstructorBuilder.
23493
23494         (Method::Emit) Return the MethodBuilder. 
23495         Check for abstract or virtual methods to be public.
23496
23497         * rootcontext.cs (RootContext::CreateType): Register all the
23498         abstract methods required for the class to be complete and the
23499         interface methods that must be implemented. 
23500
23501         * cs-parser.jay: Report error 501 (method requires body if it is
23502         not marked abstract or extern).
23503
23504         * expression.cs (TypeOf::Emit): Implement.
23505
23506         * typemanager.cs: runtime_handle_type, new global type.
23507
23508         * class.cs (Property::Emit): Generate code for properties.
23509
23510 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23511
23512         * expression.cs (Unary::ResolveOperator): Find operators on base type
23513         too - we now conform exactly to the spec.
23514
23515         (Binary::ResolveOperator): Same here.
23516
23517         * class.cs (Operator::Define): Fix minor quirk in the tests.
23518
23519         * ../errors/cs0215.cs : Added.
23520
23521         * ../errors/cs0556.cs : Added.
23522
23523         * ../errors/cs0555.cs : Added.
23524
23525 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23526
23527         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23528         single integer which is really efficient
23529
23530 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23531
23532         *  expression.cs (Expression::ImplicitUserConversion): Use location
23533         even in the case when we are examining True operators.
23534  
23535         * class.cs (Operator::Define): Perform extensive checks to conform
23536         with the rules for operator overloading in the spec.
23537
23538         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23539         some of the other conversions mentioned in the spec.
23540
23541         * typemanager.cs (array_type): New static member for the System.Array built-in
23542         type.
23543
23544         (cloneable_interface): For System.ICloneable interface.
23545
23546         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23547         we start resolving the tree and populating types.
23548
23549         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23550  
23551 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23552
23553         * expression.cs (Expression::ExprClassFromMemberInfo,
23554         Expression::Literalize): Create literal expressions from
23555         FieldInfos which are literals.
23556
23557         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23558         type casts, because they were wrong.  The test suite in tests
23559         caught these ones.
23560
23561         (ImplicitNumericConversion): ushort to ulong requires a widening
23562         cast. 
23563
23564         Int32 constant to long requires widening cast as well.
23565
23566         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23567         for integers because the type on the stack is not i4.
23568
23569 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23570
23571         * expression.cs (report118): require location argument. 
23572
23573         * parameter.cs: Do not dereference potential null value.
23574
23575         * class.cs: Catch methods that lack the `new' keyword when
23576         overriding a name.  Report warnings when `new' is used without
23577         anything being there to override.
23578
23579         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23580
23581         * class.cs: Only add constructor to hashtable if it is non-null
23582         (as now constructors can fail on define).
23583
23584         (TypeManager, Class, Struct): Take location arguments.
23585
23586         Catch field instance initialization in structs as errors.
23587
23588         accepting_filter: a new filter for FindMembers that is static so
23589         that we dont create an instance per invocation.
23590
23591         (Constructor::Define): Catch errors where a struct constructor is
23592         parameterless 
23593
23594         * cs-parser.jay: Pass location information for various new
23595         constructs. 
23596
23597         * delegate.cs (Delegate): take a location argument.
23598
23599         * driver.cs: Do not call EmitCode if there were problesm in the
23600         Definition of the types, as many Builders wont be there. 
23601
23602         * decl.cs (Decl::Decl): Require a location argument.
23603
23604         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23605         into integers, and find the most appropiate integer for it.
23606
23607         * literal.cs: Implement ULongLiteral.
23608
23609         * rootcontext.cs: Provide better information about the location of
23610         failure when CreateType fails.
23611
23612 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23613
23614         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23615         as well.
23616
23617         * expression.cs (Binary::CheckShiftArguments): Add missing type
23618         computation.
23619         (Binary::ResolveOperator): Add type to the logical and and logical
23620         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23621         before.
23622
23623         (Binary::DoNumericPromotions): In the case where either argument
23624         is ulong (and most signed types combined with ulong cause an
23625         error) perform implicit integer constant conversions as well.
23626
23627 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23628
23629         * expression.cs (UserImplicitCast): Method should always be
23630         non-null. 
23631         (Invocation::BetterConversion): Simplified test for IntLiteral.
23632
23633         (Expression::ImplicitNumericConversion): Split this routine out.
23634         Put the code that performs implicit constant integer conversions
23635         here. 
23636
23637         (Expression::Resolve): Become a wrapper around DoResolve so we can
23638         check eclass and type being set after resolve.
23639
23640         (Invocation::Badness): Remove this dead function
23641
23642         (Binary::ResolveOperator): Do not compute the expensive argumnets
23643         unless we have a union for it.
23644
23645         (Probe::Emit): Is needs to do an isinst and then
23646         compare against null.
23647
23648         (::CanConvert): Added Location argument.  If the Location argument
23649         is null (Location.Null), then we do not report errors.  This is
23650         used by the `probe' mechanism of the Explicit conversion.  We do
23651         not want to generate an error for something that the user
23652         explicitly requested to be casted.  But the pipeline for an
23653         explicit cast first tests for potential implicit casts.
23654
23655         So for now, if the Location is null, it means `Probe only' to
23656         avoid adding another argument.   Might have to revise this
23657         strategy later.
23658
23659         (ClassCast): New class used to type cast objects into arbitrary
23660         classes (used in Explicit Reference Conversions).
23661
23662         Implement `as' as well.
23663
23664         Reverted all the patches from Ravi below: they were broken:
23665
23666                 * The use of `level' as a mechanism to stop recursive
23667                   invocations is wrong.  That was there just to catch the
23668                   bug with a strack trace but not as a way of addressing
23669                   the problem.
23670
23671                   To fix the problem we have to *understand* what is going
23672                   on and the interactions and come up with a plan, not
23673                   just get things going.
23674
23675                 * The use of the type conversion cache that I proposed
23676                   last night had an open topic: How does this work across
23677                   protection domains.  A user defined conversion might not
23678                   be public in the location where we are applying the
23679                   conversion, a different conversion might be selected
23680                   (ie, private A->B (better) but public B->A (worse),
23681                   inside A, A->B applies, but outside it, B->A will
23682                   apply).
23683
23684                 * On top of that (ie, even if the above is solved),
23685                   conversions in a cache need to be abstract.  Ie, `To
23686                   convert from an Int to a Short use an OpcodeCast', not
23687                   `To convert from an Int to a Short use the OpcodeCast on
23688                   the variable 5' (which is what this patch was doing).
23689
23690 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23691
23692         * expression.cs (Invocation::ConversionExists): Re-write to use
23693         the conversion cache
23694
23695         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23696         cache all conversions done, not just user-defined ones.
23697
23698         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23699         to determine if a conversion exists instead of acutually trying to 
23700         perform the conversion. It's faster too.
23701
23702         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23703         and only then attempt the implicit conversion.
23704
23705 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23706
23707         * expression.cs (ConvertImplicit): Use a cache for conversions
23708         already found. Check level of recursion and bail out if necessary.
23709
23710 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23711
23712         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23713         Export standard methods that we expect for string operations.
23714
23715         * statement.cs (Block::UsageWarning): Track usage of variables and
23716         report the errors for not used variables.
23717
23718         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23719         operator. 
23720
23721 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23722
23723         * codegen.cs: remove unnneded code 
23724
23725         * expression.cs: Removed BuiltinTypeAccess class
23726
23727         Fix the order in which implicit conversions are
23728         done.  
23729
23730         The previous fixed dropped support for boxed conversions (adding a
23731         test to the test suite now)
23732
23733         (UserImplicitCast::CanConvert): Remove test for source being null,
23734         that code is broken.  We should not feed a null to begin with, if
23735         we do, then we should track the bug where the problem originates
23736         and not try to cover it up here.
23737
23738         Return a resolved expression of type UserImplicitCast on success
23739         rather than true/false.  Ravi: this is what I was talking about,
23740         the pattern is to use a static method as a "constructor" for
23741         objects. 
23742
23743         Also, do not create arguments until the very last minute,
23744         otherwise we always create the arguments even for lookups that
23745         will never be performed. 
23746
23747         (UserImplicitCast::Resolve): Eliminate, objects of type
23748         UserImplicitCast are born in a fully resolved state. 
23749
23750         * typemanager.cs (InitCoreTypes): Init also value_type
23751         (System.ValueType). 
23752
23753         * expression.cs (Cast::Resolve): First resolve the child expression.
23754
23755         (LValue): Add new method AddressOf to be used by
23756         the `&' operator.  
23757
23758         Change the argument of Store to take an EmitContext instead of an
23759         ILGenerator, because things like FieldExpr need to be able to call
23760         their children expression to generate the instance code. 
23761
23762         (Expression::Error, Expression::Warning): Sugar functions for
23763         reporting errors.
23764
23765         (Expression::MemberLookup): Accept a TypeContainer instead of a
23766         Report as the first argument.
23767
23768         (Expression::ResolvePrimary): Killed.  I still want to improve
23769         this as currently the code is just not right.
23770
23771         (Expression::ResolveMemberAccess): Simplify, but it is still
23772         wrong. 
23773
23774         (Unary::Resolve): Catch errors in AddressOf operators.
23775
23776         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23777         index to a byte for the short-version, or the compiler will choose
23778         the wrong Emit call, which generates the wrong data.
23779
23780         (ParameterReference::Emit, ::Store): same.
23781
23782         (FieldExpr::AddressOf): Implement.
23783
23784         * typemanager.cs: TypeManager: made public variable instead of
23785         property.
23786
23787         * driver.cs: document --fatal.
23788
23789         * report.cs (ErrorMessage, WarningMessage): new names for the old
23790         Error and Warning classes.
23791
23792         * cs-parser.jay (member_access): Turn built-in access to types
23793         into a normal simplename
23794
23795 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23796
23797         * expression.cs (Invocation::BetterConversion): Fix to cope
23798         with q being null, since this was introducing a bug.
23799
23800         * expression.cs (ConvertImplicit): Do built-in conversions first.
23801
23802 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23803
23804         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23805
23806 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23807
23808         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23809         I had introduced long ago (what's new ?).
23810
23811         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23812         the work of all the checking. 
23813         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23814         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23815
23816         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23817         that is the right way. 
23818
23819         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23820         overloading resolution. Use everywhere instead of cutting and pasting code.
23821
23822         (Binary::ResolveOperator): Use MakeUnionSet.
23823
23824         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23825         we have to convert to bool types. Not complete yet.
23826
23827 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23828
23829         * typemanager.cs (TypeManager::CSharpName): support ushort.
23830
23831         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23832         to provide an expression that performsn an implicit constant int
23833         conversion (section 6.1.6).
23834         (Expression::ConvertImplicitRequired): Reworked to include
23835         implicit constant expression conversions.
23836
23837         (Expression::ConvertNumericExplicit): Finished.
23838
23839         (Invocation::Emit): If InstanceExpression is null, then it means
23840         that we perform a call on this.
23841
23842 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23843
23844         * expression.cs (Unary::Emit): Remove some dead code.
23845         (Probe): Implement Resolve and Emit for `is'.
23846         (Expression::ConvertImplicitRequired): Attempt to do constant
23847         expression conversions here.  Maybe should be moved to
23848         ConvertImplicit, but I am not sure.
23849         (Expression::ImplicitLongConstantConversionPossible,
23850         Expression::ImplicitIntConstantConversionPossible): New functions
23851         that tell whether is it possible to apply an implicit constant
23852         expression conversion.
23853
23854         (ConvertNumericExplicit): Started work on explicit numeric
23855         conversions.
23856
23857         * cs-parser.jay: Update operator constants.
23858
23859         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23860         (Parameters::GetSignature): Hook up VerifyArgs here.
23861         (Parameters::VerifyArgs): Verifies that no two arguments have the
23862         same name. 
23863
23864         * class.cs (Operator): Update the operator names to reflect the
23865         ones that the spec expects (as we are just stringizing the
23866         operator names).
23867
23868         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23869         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23870         previous usage did only work for our methods.
23871         (Expression::ConvertImplicit): Handle decimal implicit numeric
23872         conversions as well.
23873         (Expression::InternalTypeConstructor): Used to invoke constructors
23874         on internal types for default promotions.
23875
23876         (Unary::Emit): Implement special handling for the pre/post
23877         increment/decrement for overloaded operators, as they need to have
23878         the same semantics as the other operators.
23879
23880         (Binary::ResolveOperator): ditto.
23881         (Invocation::ConversionExists): ditto.
23882         (UserImplicitCast::Resolve): ditto.
23883
23884 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23885
23886         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23887         operator, return after emitting body. Regression tests pass again !
23888
23889         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23890         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23891         (Invocation::OverloadResolve): Ditto.
23892         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23893
23894         * everywhere : update calls to the above methods accordingly.
23895
23896 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23897
23898         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23899
23900         * expression.cs (ExpressionStatement): New base class used for
23901         expressions that can appear in statements, so that we can provide
23902         an alternate path to generate expression that do not leave a value
23903         on the stack.
23904
23905         (Expression::Emit, and all the derivatives): We no longer return
23906         whether a value is left on the stack or not.  Every expression
23907         after being emitted leaves a single value on the stack.
23908
23909         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23910         facilties of ExpressionStatement if possible.
23911
23912         * cs-parser.jay: Update statement_expression.
23913
23914 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23915
23916         * driver.cs: Change the wording of message
23917
23918 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23919
23920         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23921         the type of the expression to the return type of the method if
23922         we have an overloaded operator match ! The regression tests pass again !
23923         (Unary::ResolveOperator): Ditto.
23924
23925         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23926         to find "op_Implicit", not "implicit" ;-)
23927         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23928         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23929
23930         * everywhere : Correct calls to the above accordingly.
23931
23932         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23933         (ConvertImplicit): Do user-defined conversion if it exists.
23934
23935 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23936
23937         * assign.cs: track location.
23938         (Resolve): Use implicit conversions on assignment.
23939
23940         * literal.cs: Oops.  Not good, Emit of short access values should
23941         pass (Bytes) or the wrong argument will be selected.
23942
23943         * expression.cs (Unary::Emit): Emit code for -expr.
23944
23945         (Unary::ResolveOperator): Handle `Substract' for non-constants
23946         (substract from zero from the non-constants).
23947         Deal with Doubles as well. 
23948
23949         (Expression::ConvertImplicitRequired): New routine that reports an
23950         error if no implicit conversion exists. 
23951
23952         (Invocation::OverloadResolve): Store the converted implicit
23953         expressions if we make them
23954
23955 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23956
23957         * class.cs (ConstructorInitializer): Take a Location argument.
23958         (ConstructorBaseInitializer): Same here.
23959         (ConstructorThisInitializer): Same here.
23960
23961         * cs-parser.jay : Update all calls accordingly.
23962
23963         * expression.cs (Unary, Binary, New): Take location argument.
23964         Update accordingly everywhere.
23965
23966         * cs-parser.jay : Update all calls to the above to take a location
23967         argument.
23968
23969         * class.cs : Ditto.
23970
23971 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23972
23973         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23974         (Invocation::BetterConversion): Same here
23975         (Invocation::ConversionExists): Ditto.
23976
23977         (Invocation::ConversionExists): Implement.
23978
23979 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23980
23981         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23982         Also take an additional TypeContainer argument.
23983
23984         * All over : Pass in TypeContainer as argument to OverloadResolve.
23985
23986         * typemanager.cs (CSharpName): Update to check for the string type and return
23987         that too.
23988
23989         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23990         a given method.
23991
23992 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23993
23994         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23995         (Invocation::BetterFunction): Implement.
23996         (Invocation::BetterConversion): Implement.
23997         (Invocation::ConversionExists): Skeleton, no implementation yet.
23998
23999         Okay, things work fine !
24000
24001 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24002
24003         * typemanager.cs: declare and load enum_type, delegate_type and
24004         void_type. 
24005
24006         * expression.cs (Expression::Emit): Now emit returns a value that
24007         tells whether a value is left on the stack or not.  This strategy
24008         might be reveted tomorrow with a mechanism that would address
24009         multiple assignments.
24010         (Expression::report118): Utility routine to report mismatches on
24011         the ExprClass.
24012
24013         (Unary::Report23): Report impossible type/operator combination
24014         utility function.
24015
24016         (Unary::IsIncrementableNumber): Whether the type can be
24017         incremented or decremented with add.
24018         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24019         complemented. 
24020         (Unary::ResolveOperator): Implement ++, !, ~,
24021
24022         (Invocation::Emit): Deal with new Emit convetion.
24023
24024         * All Expression derivatives: Updated their Emit method to return
24025         whether they leave values on the stack or not.
24026
24027         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24028         stack for expressions that are statements. 
24029
24030 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24031
24032         * expression.cs (LValue): New interface.  Must be implemented by
24033         LValue objects.
24034         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24035         LValue interface.
24036
24037         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24038         interface for generating code, simplifies the code.
24039
24040 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24041
24042         * expression.cs (everywhere): Comment out return statements in ::Resolve
24043         methods to avoid the warnings.
24044
24045 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24046
24047         * driver.cs (parse): Report error 2001 if we can not open the
24048         source file.
24049
24050         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24051         not resolve it.
24052
24053         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24054         object. 
24055
24056         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24057         otherwise nested blocks end up with the same index.
24058
24059         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24060
24061         * expression.cs:  Instead of having FIXMEs in the Resolve
24062         functions, throw exceptions so it is obvious that we are facing a
24063         bug. 
24064
24065         * cs-parser.jay (invocation_expression): Pass Location information.
24066
24067         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24068         Use a basename for those routines because .NET does not like paths
24069         on them. 
24070
24071         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24072         already defined.
24073
24074 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24075
24076         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24077         are loading the correct data types (throws an exception if not).
24078         (TypeManager::InitCoreTypes): Use CoreLookupType
24079
24080         * expression.cs (Unary::ResolveOperator): return the child
24081         expression for expressions which are just +expr.
24082         (Unary::ResolveOperator): Return negative literals for -LITERAL
24083         expressions (otherwise they are Unary {Literal}).
24084         (Invocation::Badness): Take into account `Implicit constant
24085         expression conversions'.
24086
24087         * literal.cs (LongLiteral): Implement long literal class.
24088         (IntLiteral): export the `Value' of the intliteral. 
24089
24090 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24091
24092         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24093
24094         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24095         instead of 'Operator'
24096
24097         * expression.cs (Binary::ResolveOperator): Update accordingly.
24098         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24099         and 'Minus'
24100
24101         * cs-parser.jay (unary_expression): Update to use the new names.
24102
24103         * gen-treedump.cs (GetUnary): Same here.
24104
24105         * expression.cs (Unary::Resolve): Implement.
24106         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24107         operators are found instead of making noise ;-)
24108         (Unary::ResolveOperator): New method to do precisely the same thing which
24109         Binary::ResolveOperator does for Binary expressions.
24110         (Unary.method, .Arguments): Add.
24111         (Unary::OperName): Implement.   
24112         (Unary::ForceConversion): Copy and Paste !
24113
24114         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24115         a unary operator.
24116
24117         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24118         for the inbuilt operators. Only overloading works for now ;-)
24119
24120 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24121
24122         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24123         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24124
24125         * expression.cs (This::Emit): Implement. 
24126         (This::Resolve): Implement.
24127         (TypeOf:Resolve): Implement.
24128         (Expression::ResolveSimpleName): Add an implicit this to instance
24129         field references. 
24130         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24131         Bind instance variable to Field expressions.
24132         (FieldExpr::Instance): New field used to track the expression that
24133         represents the object instance.
24134         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24135         binding 
24136         (FieldExpr::Emit): Implement.
24137
24138         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24139         the last instruction contains a return opcode to avoid generating
24140         the last `ret' instruction (this generates correct code, and it is
24141         nice to pass the peverify output).
24142
24143         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24144         initializer for static and instance variables.
24145         (Constructor::Emit): Allow initializer to be null in the case of
24146         static constructors.  Only emit initializer for instance
24147         constructors. 
24148
24149         (TypeContainer::FindMembers): Return a null array if there are no
24150         matches.
24151
24152         Also fix the code for the MemberTypes.Method branch, as it was not
24153         scanning that for operators (or tried to access null variables before).
24154
24155         * assign.cs (Assign::Emit): Handle instance and static fields. 
24156
24157         * TODO: Updated.
24158
24159         * driver.cs: Stop compilation if there are parse errors.
24160
24161         * cs-parser.jay (constructor_declaration): Provide default base
24162         initializer for non-static constructors.
24163         (constructor_declarator): Do not provide a default base
24164         initializers if none was specified.
24165         Catch the fact that constructors should not have parameters.
24166
24167         * class.cs: Do not emit parent class initializers for static
24168         constructors, that should be flagged as an error.
24169
24170 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24171
24172         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24173         Move back code into TypeContainer::Populate.
24174
24175 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24176
24177         * class.cs (TypeContainer::AddConstructor): Fix the check to
24178         compare against Name, not Basename. 
24179         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24180
24181         * cs-parser.jay : Update accordingly.
24182
24183         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24184         for methods, don't forget to look into the operators too.
24185         (RegisterMethodBuilder): Helper method to take care of this for
24186         methods, constructors and operators.
24187         (Operator::Define): Completely revamp.
24188         (Operator.OperatorMethod, MethodName): New fields.
24189         (TypeContainer::Populate): Move the registering of builders into
24190         RegisterMethodBuilder.
24191         (Operator::Emit): Re-write.
24192
24193         * expression.cs (Binary::Emit): Comment out code path to emit method
24194         invocation stuff for the case when we have a user defined operator. I am
24195         just not able to get it right !
24196
24197 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24198
24199         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24200         argument. 
24201
24202         (Expression::MemberLookup): Provide a version that allows to
24203         specify the MemberTypes and BindingFlags. 
24204
24205         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24206         so it was not fetching variable information from outer blocks.
24207
24208         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24209         Beforefieldinit as it was buggy.
24210
24211         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24212         that Ravi put here.  
24213
24214         * class.cs (Constructor::Emit): Only emit if block is not null.
24215         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24216         deal with this by semantically definining it as if the user had
24217         done it.
24218
24219         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24220         constructors as we now "emit" them at a higher level.
24221
24222         (TypeContainer::DefineDefaultConstructor): Used to define the
24223         default constructors if none was provided.
24224
24225         (ConstructorInitializer): Add methods Resolve and Emit. 
24226
24227         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24228
24229 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24230
24231         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24232         the default constructor builder with our hashtable for methodbuilders
24233         to methodcores.
24234
24235         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24236         and argument_count is 0 in which case we have a match.
24237         (Binary::ResolveOperator): More null checking and miscellaneous coding
24238         style cleanup.
24239
24240 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24241
24242         * rootcontext.cs (IsNameSpace): Compare against null.
24243
24244         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24245
24246         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24247         and Unary::Operator.
24248
24249         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24250         accordingly.
24251
24252         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24253         we have overloaded operators.
24254         (Binary::ResolveOperator): Implement the part which does the operator overload
24255         resolution.
24256
24257         * class.cs (Operator::Emit): Implement.
24258         (TypeContainer::Emit): Emit the operators we have too.
24259
24260         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24261         the case when we have a user-defined operator.
24262
24263 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24264
24265         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24266
24267 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24268
24269         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24270         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24271         (Constructor::Emit): Implement.
24272         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24273         if we have no work to do. 
24274         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24275         Emit method.
24276
24277         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24278         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24279
24280         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24281         of parent.parent.
24282
24283 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24284
24285         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24286         in the source.
24287         (Tree::RecordNamespace): Method to do what the name says ;-)
24288         (Tree::Namespaces): Property to get at the namespaces hashtable.
24289
24290         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24291         keep track.
24292
24293         * rootcontext.cs (IsNamespace): Fixed it :-)
24294
24295 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24296
24297         * class.cs (TypeContainer::FindMembers): Add support for
24298         constructors. 
24299         (MethodCore): New class that encapsulates both the shared aspects
24300         of a Constructor and a Method.  
24301         (Method, Constructor): Factored pieces into MethodCore.
24302
24303         * driver.cs: Added --fatal which makes errors throw exceptions.
24304         Load System assembly as well as part of the standard library.
24305
24306         * report.cs: Allow throwing exceptions on errors for debugging.
24307
24308         * modifiers.cs: Do not use `parent', instead use the real type
24309         container to evaluate permission settings.
24310
24311         * class.cs: Put Ravi's patch back in.  He is right, and we will
24312         have to cope with the
24313
24314 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24315
24316         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24317         FamORAssem, not FamANDAssem.
24318
24319 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24320
24321         * driver.cs: Added --parse option that only parses its input files
24322         and terminates.
24323
24324         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24325         incorrect.  IsTopLevel is not used to tell whether an object is
24326         root_types or not (that can be achieved by testing this ==
24327         root_types).  But to see if this is a top-level *class* (not
24328         necessarly our "toplevel" container). 
24329
24330 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24331
24332         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24333         parent instead of a direct call to GetType.
24334
24335 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24336
24337         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24338         Modifiers.TypeAttr. This should just be a call to that method.
24339
24340         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24341         object so that we can determine if we are top-level or not.
24342
24343         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24344         TypeContainer too.
24345
24346         * enum.cs (Enum::Define): Ditto.
24347
24348         * modifiers.cs (FieldAttr): Re-write.
24349
24350         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24351         (TypeContainer::HaveStaticConstructor): New property to provide access
24352         to precisely that info.
24353
24354         * modifiers.cs (MethodAttr): Re-write.
24355         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24356
24357         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24358         of top-level types as claimed.
24359
24360 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24361
24362         * expression.cs (MemberLookup): Fruitless attempt to lookup
24363         constructors.  Maybe I need to emit default constructors?  That
24364         might be it (currently .NET emits this for me automatically).
24365         (Invocation::OverloadResolve): Cope with Arguments == null.
24366         (Invocation::EmitArguments): new function, shared by the new
24367         constructor and us.
24368         (Invocation::Emit): Handle static and instance methods.  Emit
24369         proper call instruction for virtual or non-virtual invocations.
24370         (New::Emit): Implement.
24371         (New::Resolve): Implement.
24372         (MemberAccess:Resolve): Implement.
24373         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24374         to track instances.
24375         (FieldExpr::Resolve): Set type.
24376
24377         * support.cs: Handle empty arguments.
24378                 
24379         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24380         SimpleLookup): Auxiliary routines to help parse a qualifier
24381         identifier.  
24382
24383         Update qualifier_identifier rule.
24384
24385         * codegen.cs: Removed debugging messages.
24386
24387         * class.cs: Make this a global thing, this acts just as a "key" to
24388         objects that we might have around.
24389
24390         (Populate): Only initialize method_builders_to_methods once.
24391
24392         * expression.cs (PropertyExpr): Initialize type from the
24393         PropertyType. 
24394
24395         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24396         Resolve pattern.  Attempt to implicitly convert value to boolean.
24397         Emit code.
24398
24399         * expression.cs: Set the type for the int32/int32 argument case.
24400         (Binary::ResolveOperator): Set the return type to boolean for
24401         comparission operators
24402
24403         * typemanager.cs: Remove debugging print code.
24404
24405         (Invocation::Resolve): resolve type.
24406
24407         * class.cs: Allocate a MemberInfo of the correct size, as the code
24408         elsewhere depends on the test to reflect the correct contents.
24409
24410         (Method::) Keep track of parameters, due to System.Reflection holes
24411
24412         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24413         mapping here.
24414
24415         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24416         of the exact size and return that.
24417
24418         (Class::LookupMethodByBuilder): New function that maps
24419         MethodBuilders to its methods.  Required to locate the information
24420         on methods because System.Reflection bit us again.
24421
24422         * support.cs: New file, contains an interface ParameterData and
24423         two implementations: ReflectionParameters and InternalParameters
24424         used to access Parameter information.  We will need to grow this
24425         as required.
24426
24427         * expression.cs (Invocation::GetParameterData): implement a cache
24428         and a wrapper around the ParameterData creation for methods. 
24429         (Invocation::OverloadResolve): Use new code.
24430
24431 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24432
24433         * class.cs (TypeContainer::EmitField): Remove and move into 
24434         (Field::Define): here and modify accordingly.
24435         (Field.FieldBuilder): New member.
24436         (TypeContainer::Populate): Update accordingly.
24437         (TypeContainer::FindMembers): Implement.
24438
24439 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24440
24441         * statement.cs: (VariableInfo::VariableType): New field to be
24442         initialized with the full type once it is resolved. 
24443
24444 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24445
24446         * parameter.cs (GetParameterInfo): Use a type cache to compute
24447         things only once, and to reuse this information
24448
24449         * expression.cs (LocalVariableReference::Emit): Implement.
24450         (OpcodeCast::Emit): fix.
24451
24452         (ParameterReference::Resolve): Implement.
24453         (ParameterReference::Emit): Implement.
24454
24455         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24456         that are expressions need to stay as Expressions.
24457
24458         * typemanager.cs (CSharpName): Returns the C# name of a type if
24459         possible. 
24460
24461         * expression.cs (Expression::ConvertImplicit): New function that
24462         implements implicit type conversions.
24463
24464         (Expression::ImplicitReferenceConversion): Implements implicit
24465         reference conversions.
24466
24467         (EmptyCast): New type for transparent casts.
24468
24469         (OpcodeCast): New type for casts of types that are performed with
24470         a sequence of bytecodes.
24471
24472         (BoxedCast): New type used for casting value types into reference
24473         types.  Emits a box opcode.
24474
24475         (Binary::DoNumericPromotions): Implements numeric promotions of
24476         and computation of the Binary::Type.
24477
24478         (Binary::EmitBranchable): Optimization.
24479
24480         (Binary::Emit): Implement code emission for expressions.
24481
24482         * typemanager.cs (TypeManager): Added two new core types: sbyte
24483         and byte.
24484
24485 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24486
24487         * class.cs (TypeContainer::FindMembers): Method which does exactly
24488         what Type.FindMembers does, only we don't have to use reflection. No
24489         implementation yet.
24490
24491         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24492         typecontainer objects as we need to get at them.
24493         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24494
24495         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24496         typecontainer object.
24497
24498         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24499         of just a Report object.
24500
24501 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24502
24503         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24504         "remove_"
24505         (TypeContainer::Populate): Now define the delegates of the type too.
24506         (TypeContainer.Delegates): Property to access the list of delegates defined
24507         in the type.
24508
24509         * delegates.cs (Delegate::Define): Implement partially.
24510
24511         * modifiers.cs (TypeAttr): Handle more flags.
24512
24513 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24514
24515         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24516         and not <=
24517         (Operator::Define): Re-write logic to get types by using the LookupType method
24518         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24519         (Indexer::Define): Ditto.
24520         (Event::Define): Ditto.
24521         (Property::Define): Ditto.
24522
24523 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24524
24525         * class.cs (TypeContainer::Populate): Now define operators too. 
24526         (TypeContainer.Operators): New property to access the list of operators
24527         in a type.
24528         (Operator.OperatorMethodBuilder): New member to hold the method builder
24529         for the operator we are defining.
24530         (Operator::Define): Implement.
24531
24532 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24533
24534         * class.cs (Event::Define): Make the prefixes of the accessor methods
24535         addOn_ and removeOn_ 
24536
24537         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24538         of the location being passed in too. Ideally, this should go later since all
24539         error reporting should be done through the Report object.
24540
24541         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24542         (Populate): Iterate thru the indexers we have and define them too.
24543         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24544         for the get and set accessors.
24545         (Indexer::Define): Implement.
24546
24547 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24548
24549         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24550         my previous implementation, did not work.
24551
24552         * typemanager.cs: Add a couple of missing types (the longs).
24553
24554         * literal.cs: Use TypeManager.bool_type instead of getting it.
24555
24556         * expression.cs (EventExpr): New kind of expressions.
24557         (Expressio::ExprClassFromMemberInfo): finish
24558
24559 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24560
24561         * assign.cs: Emit stores to static fields differently.
24562
24563 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24564
24565         * Merge in changes and adjust code to tackle conflicts. Backed out my
24566         code in Assign::Resolve ;-) 
24567
24568 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24569
24570         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24571         instead Report.Error and also pass in the location.
24572         (CSharpParser::Lexer): New readonly property to return the reference
24573         to the Tokenizer object.
24574         (declare_local_variables): Use Report.Error with location instead of plain 
24575         old error.
24576         (CheckDef): Ditto.
24577
24578         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24579         (Operator.CheckBinaryOperator): Ditto.
24580
24581         * cs-parser.jay (operator_declarator): Update accordingly.
24582
24583         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24584         (CheckBinaryOperator): Same here.
24585
24586         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24587         on the name without any prefixes of namespace names etc. This is because we
24588         already might have something already fully qualified like 
24589         'System.Console.WriteLine'
24590
24591         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24592
24593 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24594
24595         * cs-tokenizer.cs (location): Return a string which also contains
24596         the file name.
24597
24598         * expression.cs (ElementAccess): New class for expressions of the
24599         type 'element access.'
24600         (BaseAccess): New class for expressions of the type 'base access.'
24601         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24602         respectively.
24603
24604         * cs-parser.jay (element_access): Implement action.
24605         (base_access): Implement actions.
24606         (checked_expression, unchecked_expression): Implement.
24607
24608         * cs-parser.jay (local_variable_type): Correct and implement.
24609         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24610
24611         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24612
24613         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24614         name and the specifiers.
24615
24616         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24617
24618         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24619         making them all public ;-)
24620
24621         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24622         class anyways.
24623
24624 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24625
24626         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24627         PropertyExprs.
24628         (FieldExpr, PropertyExprs): New resolved expressions.
24629         (SimpleName::MemberStaticCheck): Perform static checks for access
24630         to non-static fields on static methods. Maybe this should be
24631         generalized for MemberAccesses. 
24632         (SimpleName::ResolveSimpleName): More work on simple name
24633         resolution. 
24634
24635         * cs-parser.jay (primary_expression/qualified_identifier): track
24636         the parameter index.
24637
24638         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24639         (EmitContext::EmitBoolExpression): Chain to expression generation
24640         instead of temporary hack.
24641         (::EmitStatementExpression): Put generic expression code generation.
24642
24643         * assign.cs (Assign::Emit): Implement variable assignments to
24644         local variables, parameters and fields.
24645
24646 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24647
24648         * statement.cs (Block::GetVariableInfo): New method, returns the
24649         VariableInfo for a variable name in a block.
24650         (Block::GetVariableType): Implement in terms of GetVariableInfo
24651
24652         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24653         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24654
24655 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24656
24657         * cs-parser.jay (operator_declaration): Continue on my quest : update
24658         to take attributes argument.
24659         (event_declaration): Ditto.
24660         (enum_declaration): Ditto.
24661         (indexer_declaration): Ditto.
24662
24663         * class.cs (Operator::Operator): Update constructor accordingly.
24664         (Event::Event): Ditto.
24665
24666         * delegate.cs (Delegate::Delegate): Same here.
24667
24668         * enum.cs (Enum::Enum): Same here.
24669
24670 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24671
24672         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24673
24674         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24675
24676         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24677         being passed around as an arraylist.
24678         (Attributes::AddAttribute): Method to add attribute sections.
24679
24680         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24681         (struct_declaration): Update accordingly.
24682         (constant_declaration): Update.
24683         (field_declaration): Update.
24684         (method_header): Update.
24685         (fixed_parameter): Update.
24686         (parameter_array): Ditto.
24687         (property_declaration): Ditto.
24688         (destructor_declaration): Ditto.
24689
24690         * class.cs (Struct::Struct): Update constructors accordingly.
24691         (Class::Class): Ditto.
24692         (Field::Field): Ditto.
24693         (Method::Method): Ditto.
24694         (Property::Property): Ditto.
24695         (TypeContainer::OptAttribute): update property's return type.
24696
24697         * interface.cs (Interface.opt_attributes): New member.
24698         (Interface::Interface): Update to take the extra Attributes argument.
24699
24700         * parameter.cs (Parameter::Parameter): Ditto.
24701
24702         * constant.cs (Constant::Constant): Ditto.
24703
24704         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24705         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24706         the attributes as a parameter.
24707         (InterfaceProperty): Update constructor call.
24708         (InterfaceEvent): Ditto.
24709         (InterfaceMethod): Ditto.
24710         (InterfaceIndexer): Ditto.
24711
24712         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24713         pass the attributes too.
24714         (interface_event_declaration): Ditto.
24715         (interface_property_declaration): Ditto.
24716         (interface_method_declaration): Ditto.
24717         (interface_declaration): Ditto.
24718
24719 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24720
24721         * class.cs (Method::Define): Track the "static Main" definition to
24722         create an entry point. 
24723
24724         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24725         EntryPoint if we find it. 
24726
24727         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24728         (EmitContext::ig): Make this variable public.
24729
24730         * driver.cs: Make the default output file be the first file name
24731         with the .exe extension.  
24732
24733         Detect empty compilations
24734
24735         Handle various kinds of output targets.  Handle --target and
24736         rename -t to --dumper.
24737
24738         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24739         methods inherited from Expression return now an Expression.  This
24740         will is used during the tree rewriting as we resolve them during
24741         semantic analysis.
24742
24743         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24744         the spec.  Missing entirely is the information about
24745         accessability of elements of it.
24746
24747         (Expression::ExprClassFromMemberInfo): New constructor for
24748         Expressions that creates a fully initialized Expression based on
24749         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24750         a Type.
24751
24752         (Invocation::Resolve): Begin implementing resolution of invocations.
24753
24754         * literal.cs (StringLiteral):  Implement Emit.
24755
24756 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24757
24758         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24759         member.
24760
24761 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24762
24763         * cs-parser.jay (attribute_arguments): Implement actions.
24764         (attribute): Fix bug in production. Implement action.
24765         (attribute_list): Implement.
24766         (attribute_target): Implement.
24767         (attribute_target_specifier, opt_target_specifier): Implement
24768         (CheckAttributeTarget): New method to check if the attribute target
24769         is valid.
24770         (attribute_section): Implement.
24771         (opt_attributes): Implement.
24772
24773         * attribute.cs : New file to handle attributes.
24774         (Attribute): Class to hold attribute info.
24775
24776         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24777         (attribute_section): Modify production to use 2 different rules to 
24778         achieve the same thing. 1 s/r conflict down !
24779         Clean out commented, useless, non-reducing dimension_separator rules.
24780
24781         * class.cs (TypeContainer.attributes): New member to hold list
24782         of attributes for a type.
24783         (Struct::Struct): Modify to take one more argument, the attribute list.
24784         (Class::Class): Ditto.
24785         (Field::Field): Ditto.
24786         (Method::Method): Ditto.
24787         (Property::Property): Ditto.
24788
24789         * cs-parser.jay (struct_declaration): Update constructor call to
24790         pass in the attributes too.
24791         (class_declaration): Ditto.
24792         (constant_declaration): Ditto.
24793         (field_declaration): Ditto.
24794         (method_header): Ditto.
24795         (fixed_parameter): Ditto.
24796         (parameter_array): Ditto.
24797         (property_declaration): Ditto.
24798
24799         * constant.cs (Constant::Constant): Update constructor similarly.
24800         Use System.Collections.
24801
24802         * parameter.cs (Parameter::Parameter): Update as above.
24803
24804 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24805
24806         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24807         (TypeContainer.delegates): New member to hold list of delegates.
24808
24809         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24810         this time as I seem to be on crack ;-)
24811
24812 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24813
24814         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24815         tell whether an identifier represents a namespace.
24816
24817         * expression.cs (NamespaceExpr): A namespace expression, used only
24818         temporarly during expression resolution.
24819         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24820         utility functions to resolve names on expressions.
24821
24822 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24823
24824         * codegen.cs: Add hook for StatementExpressions. 
24825
24826         * class.cs: Fix inverted test for static flag in methods.
24827
24828 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24829
24830         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24831         to make it coincide with MS' number.
24832         (Operator::CheckBinaryOperator): Ditto.
24833
24834         * ../errors/errors.txt : Remove error numbers added earlier.
24835
24836         * ../errors/cs1019.cs : Test case for error # 1019
24837
24838         * ../errros/cs1020.cs : Test case for error # 1020
24839
24840         * cs-parser.jay : Clean out commented cruft.
24841         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24842         used anywhere - non-reducing rule.
24843         (namespace_declarations): Non-reducing rule - comment out.
24844
24845         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24846         with TypeContainer::AddEnum.
24847
24848         * delegate.cs : New file for delegate handling classes.
24849         (Delegate): Class for declaring delegates.
24850
24851         * makefile : Update.
24852
24853         * cs-parser.jay (delegate_declaration): Implement.
24854
24855 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24856
24857         * class.cs (Event::Define): Implement.
24858         (Event.EventBuilder): New member.
24859
24860         * class.cs (TypeContainer::Populate): Update to define all enums and events
24861         we have.
24862         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24863         readonly fields for all these cases ?
24864
24865 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24866
24867         * class.cs (Property): Revamp to use the convention of making fields readonly.
24868         Accordingly modify code elsewhere.
24869
24870         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24871         the Define method of the Property class.
24872
24873         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24874         trivial bug.
24875         (TypeContainer::Populate): Update to define all the properties we have. Also
24876         define all enumerations.
24877
24878         * enum.cs (Define): Implement.
24879
24880 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24881
24882         * cs-parser.jay (overloadable_operator): The semantic value is an
24883         enum of the Operator class.
24884         (operator_declarator): Implement actions.
24885         (operator_declaration): Implement.
24886
24887         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24888         validity of definitions.
24889         (Operator::CheckBinaryOperator): Static method to check for binary operators
24890         (TypeContainer::AddOperator): New method to add an operator to a type.
24891
24892         * cs-parser.jay (indexer_declaration): Added line to actually call the
24893         AddIndexer method so it gets added ;-)
24894
24895         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24896         already taken care of by the MS compiler ?  
24897
24898 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24899
24900         * class.cs (Operator): New class for operator declarations.
24901         (Operator::OpType): Enum for the various operators.
24902
24903 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24904
24905         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24906         ostensibly handle this in semantic analysis.
24907
24908         * cs-parser.jay (general_catch_clause): Comment out
24909         (specific_catch_clauses, specific_catch_clause): Ditto.
24910         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24911         (catch_args, opt_catch_args): New productions.
24912         (catch_clause): Rewrite to use the new productions above
24913         (catch_clauses): Modify accordingly.
24914         (opt_catch_clauses): New production to use in try_statement
24915         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24916         and re-write the code in the actions to extract the specific and
24917         general catch clauses by being a little smart ;-)
24918
24919         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24920         Hooray, try and catch statements parse fine !
24921
24922 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24923
24924         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24925         string from the hashtable of variables.
24926
24927         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24928         I end up making that mistake ;-)
24929         (catch_clauses): Fixed gross error which made Key and Value of the 
24930         DictionaryEntry the same : $1 !!
24931
24932 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24933
24934         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24935
24936         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24937         when the add and remove accessors are specified. 
24938
24939 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24940
24941         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24942         information about indexer_declarator.
24943         (indexer_declarator): Implement actions.
24944         (parsing_indexer): New local boolean used to keep track of whether
24945         we are parsing indexers or properties. This is necessary because 
24946         implicit_parameters come into picture even for the get accessor in the 
24947         case of an indexer.
24948         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24949
24950         * class.cs (Indexer): New class for indexer declarations.
24951         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24952         (TypeContainer::indexers): New member to hold list of indexers for the
24953         type.
24954
24955 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24956
24957         * cs-parser.jay (add_accessor_declaration): Implement action.
24958         (remove_accessor_declaration): Implement action.
24959         (event_accessors_declaration): Implement
24960         (variable_declarators): swap statements for first rule - trivial.
24961
24962         * class.cs (Event): New class to hold information about event
24963         declarations.
24964         (TypeContainer::AddEvent): New method to add an event to a type
24965         (TypeContainer::events): New member to hold list of events.
24966
24967         * cs-parser.jay (event_declaration): Implement actions.
24968
24969 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24970
24971         * cs-parser.jay (dim_separators): Implement. Make it a string
24972         concatenating all the commas together, just as they appear.
24973         (opt_dim_separators): Modify accordingly
24974         (rank_specifiers): Update accordingly. Basically do the same
24975         thing - instead, collect the brackets here.
24976         (opt_rank_sepcifiers): Modify accordingly.
24977         (array_type): Modify to actually return the complete type string
24978         instead of ignoring the rank_specifiers.
24979         (expression_list): Implement to collect the expressions
24980         (variable_initializer): Implement. We make it a list of expressions
24981         essentially so that we can handle the array_initializer case neatly too.
24982         (variable_initializer_list): Implement.
24983         (array_initializer): Make it a list of variable_initializers
24984         (opt_array_initializer): Modify accordingly.
24985
24986         * expression.cs (New::NType): Add enumeration to help us
24987         keep track of whether we have an object/delegate creation
24988         or an array creation.
24989         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24990         members to hold data about array creation.
24991         (New:New): Modify to update NewType
24992         (New:New): New Overloaded contructor for the array creation
24993         case.
24994
24995         * cs-parser.jay (array_creation_expression): Implement to call
24996         the overloaded New constructor.
24997
24998 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24999
25000         * class.cs (TypeContainer::Constructors): Return member
25001         constructors instead of returning null.
25002
25003 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25004
25005         * typemanager.cs (InitCoreTypes): Initialize the various core
25006         types after we have populated the type manager with the user
25007         defined types (this distinction will be important later while
25008         compiling corlib.dll)
25009
25010         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25011         on Expression Classification.  Now all expressions have a method
25012         `Resolve' and a method `Emit'.
25013
25014         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25015         generation from working.     Also add some temporary debugging
25016         code. 
25017
25018 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25019
25020         * codegen.cs: Lots of code generation pieces.  This is only the
25021         beginning, will continue tomorrow with more touches of polish.  We
25022         handle the fundamentals of if, while, do, for, return.  Others are
25023         trickier and I need to start working on invocations soon.
25024
25025         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25026         s.InitStatement. 
25027
25028         * codegen.cs (EmitContext): New struct, used during code
25029         emission to keep a context.   Most of the code generation will be
25030         here. 
25031
25032         * cs-parser.jay: Add embedded blocks to the list of statements of
25033         this block.  So code generation proceeds in a top down fashion.
25034
25035 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25036
25037         * statement.cs: Add support for multiple child blocks.
25038
25039 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25040
25041         * codegen.cs (EmitCode): New function, will emit the code for a
25042         Block of code given a TypeContainer and its ILGenerator. 
25043
25044         * statement.cs (Block): Standard public readonly optimization.
25045         (Block::Block constructors): Link children. 
25046         (Block::Child): Child Linker.
25047         (Block::EmitVariables): Emits IL variable declarations.
25048
25049         * class.cs: Drop support for MethodGroups here, delay until
25050         Semantic Analysis.
25051         (Method::): Applied the same simplification that I did before, and
25052         move from Properties to public readonly fields.
25053         (Method::ParameterTypes): Returns the parameter types for the
25054         function, and implements a cache that will be useful later when I
25055         do error checking and the semantic analysis on the methods is
25056         performed.
25057         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25058         and made a method, optional argument tells whether this is a class
25059         or a structure to apply the `has-this' bit.
25060         (Method::GetCallingConvention): Implement, returns the calling
25061         convention. 
25062         (Method::Define): Defines the type, a second pass is performed
25063         later to populate the methods.
25064
25065         (Constructor::ParameterTypes): implement a cache similar to the
25066         one on Method::ParameterTypes, useful later when we do semantic
25067         analysis. 
25068
25069         (TypeContainer::EmitMethod):  New method.  Emits methods.
25070
25071         * expression.cs: Removed MethodGroup class from here.
25072
25073         * parameter.cs (Parameters::GetCallingConvention): new method.
25074
25075 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25076
25077         * class.cs (TypeContainer::Populate): Drop RootContext from the
25078         argument. 
25079
25080         (Constructor::CallingConvention): Returns the calling convention.
25081         (Constructor::ParameterTypes): Returns the constructor parameter
25082         types. 
25083
25084         (TypeContainer::AddConstructor): Keep track of default constructor
25085         and the default static constructor.
25086
25087         (Constructor::) Another class that starts using `public readonly'
25088         instead of properties. 
25089
25090         (Constructor::IsDefault): Whether this is a default constructor. 
25091
25092         (Field::) use readonly public fields instead of properties also.
25093
25094         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25095         track of static constructors;  If none is used, turn on
25096         BeforeFieldInit in the TypeAttributes. 
25097
25098         * cs-parser.jay (opt_argument_list): now the return can be null
25099         for the cases where there are no arguments. 
25100
25101         (constructor_declarator): If there is no implicit `base' or
25102         `this', then invoke the default parent constructor. 
25103
25104         * modifiers.cs (MethodAttr): New static function maps a set of
25105         modifiers flags into a MethodAttributes enum
25106         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25107         MethodAttr, TypeAttr to represent the various mappings where the
25108         modifiers are used.
25109         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25110
25111 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25112
25113         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25114         method arguments.
25115
25116         * interface.cs (PopulateIndexer): Implemented the code generator
25117         for interface indexers.
25118
25119 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25120
25121         * interface.cs (InterfaceMemberBase): Now we track the new status
25122         here.  
25123
25124         (PopulateProperty): Implement property population.  Woohoo!  Got
25125         Methods and Properties going today. 
25126
25127         Removed all the properties for interfaces, and replaced them with
25128         `public readonly' fields. 
25129
25130 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25131
25132         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25133         initialize their hashtables/arraylists only when they are needed
25134         instead of doing this always.
25135
25136         * parameter.cs: Handle refs and out parameters.
25137
25138         * cs-parser.jay: Use an ArrayList to construct the arguments
25139         instead of the ParameterCollection, and then cast that to a
25140         Parameter[] array.
25141
25142         * parameter.cs: Drop the use of ParameterCollection and use
25143         instead arrays of Parameters.
25144
25145         (GetParameterInfo): Use the Type, not the Name when resolving
25146         types. 
25147
25148 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25149
25150         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25151         and instead use public readonly fields.
25152
25153         * class.cs: Put back walking code for type containers.
25154
25155 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25156
25157         * class.cs (MakeConstant): Code to define constants.
25158
25159         * rootcontext.cs (LookupType): New function.  Used to locate types 
25160
25161
25162 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25163
25164         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25165         this System.Reflection code is.  Kudos to Microsoft
25166
25167         * typemanager.cs: Implement a type cache and avoid loading all
25168         types at boot time.  Wrap in LookupType the internals.  This made
25169         the compiler so much faster.  Wow.  I rule!
25170
25171         * driver.cs: Make sure we always load mscorlib first (for
25172         debugging purposes, nothing really important).
25173
25174         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25175         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25176
25177         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25178         on namespaces that have been imported using the `using' keyword.
25179
25180         * class.cs (TypeContainer::TypeAttr): Virtualize.
25181         (Class::TypeAttr): Return attributes suitable for this bad boy.
25182         (Struct::TypeAttr): ditto.
25183         Handle nested classes.
25184         (TypeContainer::) Remove all the type visiting code, it is now
25185         replaced with the rootcontext.cs code
25186
25187         * rootcontext.cs (GetClassBases): Added support for structs. 
25188
25189 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25190
25191         * interface.cs, statement.cs, class.cs, parameter.cs,
25192         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25193         Drop use of TypeRefs, and use strings instead.
25194
25195 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25196
25197         * rootcontext.cs: 
25198
25199         * class.cs (Struct::Struct): set the SEALED flags after
25200         checking the modifiers.
25201         (TypeContainer::TypeAttr): new property, returns the
25202         TypeAttributes for a class.  
25203
25204         * cs-parser.jay (type_list): Oops, list production was creating a
25205         new list of base types.
25206
25207         * rootcontext.cs (StdLib): New property.
25208         (GetInterfaceTypeByName): returns an interface by type name, and
25209         encapsulates error handling here.
25210         (GetInterfaces): simplified.
25211         (ResolveTree): Encapsulated all the tree resolution here.
25212         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25213         types. 
25214
25215         * driver.cs: Add support for --nostdlib, to avoid loading the
25216         default assemblies.
25217         (Main): Do not put tree resolution here. 
25218
25219         * rootcontext.cs: Beginning of the class resolution.
25220
25221 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25222
25223         * rootcontext.cs: Provide better error reporting. 
25224
25225         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25226
25227         * rootcontext.cs (CreateInterface): Handle the case where there
25228         are no parent interfaces.
25229
25230         (CloseTypes): Routine to flush types at the end.
25231         (CreateInterface): Track types.
25232         (GetInterfaces): Returns an array of Types from the list of
25233         defined interfaces.
25234
25235         * typemanager.c (AddUserType): Mechanism to track user types (puts
25236         the type on the global type hash, and allows us to close it at the
25237         end). 
25238
25239 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25240
25241         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25242         RecordInterface instead.
25243
25244         * cs-parser.jay: Updated to reflect changes above.
25245
25246         * decl.cs (Definition): Keep track of the TypeBuilder type that
25247         represents this type here.  Not sure we will use it in the long
25248         run, but wont hurt for now.
25249
25250         * driver.cs: Smaller changes to accomodate the new code.
25251
25252         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25253         when done. 
25254
25255         * rootcontext.cs (CreateInterface):  New method, used to create
25256         the System.TypeBuilder type for interfaces.
25257         (ResolveInterfaces): new entry point to resolve the interface
25258         hierarchy. 
25259         (CodeGen): Property, used to keep track of the code generator.
25260
25261 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25262
25263         * cs-parser.jay: Add a second production for delegate_declaration
25264         with `VOID'.
25265
25266         (enum_body): Put an opt_comma here instead of putting it on
25267         enum_body or enum_member_declarations so we can handle trailing
25268         commas on enumeration members.  Gets rid of a shift/reduce.
25269
25270         (type_list): Need a COMMA in the middle.
25271
25272         (indexer_declaration): Tell tokenizer to recognize get/set
25273
25274         * Remove old targets.
25275
25276         * Re-add the parser target.
25277
25278 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25279
25280         * cs-parser.jay: Add precendence rules for a number of operators
25281         ot reduce the number of shift/reduce conflicts in the grammar.
25282
25283 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25284
25285         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25286         and put it here.
25287
25288         Get rid of old crufty code.
25289
25290         * rootcontext.cs: Use this to keep track of the parsed
25291         representation and the defined types available to the program. 
25292
25293         * gen-treedump.cs: adjust for new convention.
25294
25295         * type.cs: Split out the type manager, and the assembly builder
25296         from here. 
25297
25298         * typemanager.cs: the type manager will live here now.
25299
25300         * cil-codegen.cs: And the code generator here. 
25301
25302 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25303
25304         * makefile: Fixed up for easy making.
25305
25306 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25307
25308         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25309         the 
25310
25311         (unary_expression): Expand pre_increment_expression and
25312         post_decrement_expression to reduce a shift/reduce.
25313
25314 2001-07-11  Simon Cozens
25315
25316         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25317
25318         Improve allow_keyword_as_indent name.
25319
25320 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25321
25322         * Adjustments for Beta2. 
25323
25324 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25325
25326         * decl.cs: Added `Define' abstract method.
25327         (InTransit): new property, used to catch recursive definitions. 
25328
25329         * interface.cs: Implement `Define'. 
25330
25331         * modifiers.cs: Map Modifiers.constants to
25332         System.Reflection.TypeAttribute flags.
25333
25334         * class.cs: Keep track of types and user-defined types.
25335         (BuilderInit): New method for creating an assembly
25336         (ResolveType): New function to launch the resolution process, only
25337         used by interfaces for now.
25338
25339         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25340         that are inserted into the name space. 
25341
25342 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25343
25344         * ARGH.  I have screwed up my tree so many times due to the use of
25345         rsync rather than using CVS.  Going to fix this at once. 
25346
25347         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25348         load types.
25349
25350 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25351
25352         * Experiment successful: Use System.Type rather that our own
25353         version of Type.  
25354
25355 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25356
25357         * cs-parser.jay: Removed nsAliases from here.
25358
25359         Use new namespaces, handle `using XXX;' 
25360
25361         * namespace.cs: Reimplemented namespace handling, use a recursive
25362         definition of the class.  Now we can keep track of using clauses
25363         and catch invalid using clauses.
25364
25365 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25366
25367         * gen-treedump.cs: Adapted for all the renaming.
25368
25369         * expression.cs (Expression): this class now has a Type property
25370         which returns an expression Type.
25371
25372         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25373         `Type', as this has a different meaning now in the base
25374
25375 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25376
25377         * interface.cs, class.cs: Removed from all the sources the
25378         references to signature computation, as we can not do method
25379         signature computation during the parsing time, as we are not
25380         trying to solve at that point distinguishing:
25381
25382         class X {
25383                 void a (Blah x) {}
25384                 void a (NS.Blah x) {}
25385         }
25386
25387         Which depending on the context might be valid or not, as we do not
25388         know if Blah is the same thing as NS.Blah at that point.
25389
25390         * Redid everything so the code uses TypeRefs now instead of
25391         Types.  TypeRefs are just temporary type placeholders, that need
25392         to be resolved.  They initially have a pointer to a string and the
25393         current scope in which they are used.  This is used later by the
25394         compiler to resolve the reference to an actual Type. 
25395
25396         * DeclSpace is no longer a CIR.Type, and neither are
25397         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25398         are all DeclSpaces, but no Types. 
25399
25400         * type.cs (TypeRefManager): This implements the TypeRef manager,
25401         which keeps track of all the types that need to be resolved after
25402         the parsing has finished. 
25403
25404 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25405
25406         * ARGH.  We are going to have to store `foreach' as a class rather
25407         than resolving it, as we need to verify error 1579 after name
25408         resolution.   *OR* we could keep a flag that says `This request to
25409         IEnumerator comes from a foreach statement' which we can then use
25410         to generate the error.
25411
25412 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25413
25414         * class.cs (TypeContainer.AddMethod): we now add methods to the
25415         MethodGroup instead of the method hashtable.  
25416
25417         * expression.cs: Add MethodGroup abstraction, which gets us one
25418         step closer to the specification in the way we handle method
25419         declarations.  
25420
25421         * cs-parser.jay (primary_expression): qualified_identifier now
25422         tried to match up an identifier to a local variable reference or
25423         to a parameter reference.
25424
25425         current_local_parameters is now a parser global variable that
25426         points to the current parameters for the block, used during name
25427         lookup.
25428
25429         (property_declaration): Now creates an implicit `value' argument to
25430         the set accessor.
25431
25432 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25433
25434         * parameter.cs: Do not use `param' arguments as part of the
25435         signature, per the spec.
25436
25437 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25438
25439         * decl.cs: Base class for classes, structs and interfaces.  This
25440         is the "Declaration Space" 
25441
25442         * cs-parser.jay: Use CheckDef for checking declaration errors
25443         instead of having one on each function.
25444
25445         * class.cs: Factor out some code for handling error handling in
25446         accordance to the "Declarations" section in the "Basic Concepts"
25447         chapter in the ECMA C# spec.
25448
25449         * interface.cs: Make all interface member classes derive from
25450         InterfaceMemberBase.
25451
25452 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25453
25454         * Many things: all interfaces are parsed and generated in
25455         gen-treedump.  Support for member variables, constructors,
25456         destructors, properties, constants is there.
25457
25458         Beginning of the IL backend, but very little done, just there for
25459         testing purposes. 
25460
25461 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25462
25463         * cs-parser.jay: Fix labeled statement.
25464
25465         * cs-tokenizer.cs (escape): Escape " and ' always.
25466         ref_line, ref_name: keep track of the line/filename as instructed
25467         by #line by the compiler.
25468         Parse #line.
25469
25470 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25471
25472         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25473         to match the values in System.CodeDOM.
25474
25475         Divid renamed to Divide.
25476
25477         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25478         statements. 
25479         (Statements.set): remove.
25480
25481         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25482         statements. 
25483
25484         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25485         falseStatements always have valid values. 
25486
25487         * cs-parser.jay: Use System.CodeDOM now.
25488