Fix #77929
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #77929
4         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
5         testing.
6
7         Fix #77958
8         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9
10         Fix #77962
11         * report.cs (SymbolRelatedToPreviousError): Drop generic type
12         arguments before checking whether a type is reflected or not.
13
14         Fix #77954
15         * expression.cs (Invocation.IsApplicable): Ensure a generic method
16         definition doesn't take part in overload resolution.
17         (Invocation.IsParamsMethodApplicable): Likewise.
18         (Invocation.OverloadResolve): When replacing a reflected override
19         method with its base definition, ensure that type arguments are
20         applied.
21
22 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
23
24         A fix for #77966.
25
26         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
27         was not specified.
28
29         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
30
31 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
32
33         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
34         phase.
35
36         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
37         LocalTemporary change.
38
39         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
40         TypeContainer.
41         (ClassOrStruct.DefineFieldInitializers): Implemented static field
42         initializers optimization.
43         (ClassOrStruct.TypeAttr): Moved from modifiers.
44         (Constructor.CheckBase): Don't crash when static ctor has parameters.
45         (FieldBase.ResolveInitializer): Resolves initializer.
46         (FieldBase.HasDefaultInitializer): New property.
47
48         * cs-parser.jay: Removed message.
49
50         * expression.cs (CompilerGeneratedThis): New specialization.
51
52         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
53
54 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
55
56         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
57
58 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
59
60         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
61         be now EnumConstants only.
62
63 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
64
65         * attribute.cs, driver.cs: Reset more caches.
66
67 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
68
69         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
70
71 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
72
73         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
74         for easier reuse. Updated all overrides.
75         (IntegralConstant): New base class for all integral constants.
76         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
77         of the constant range, report custom error.
78         (UIntConstant.Reduce): Fixed uint conversion.
79
80         * ecore.cs, literal.cs: Reduce updates.
81
82 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
83
84         A fix for #75813.
85
86         * class.cs (Constructor.Define): Removed extra if for default ctors.
87         A patch from Atsushi Enomoto.
88
89 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
90
91         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
92         GetAttributableValue.
93
94         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
95         when required.
96
97         * convert.cs (ImplicitConversionRequired): Error message moved to
98         DoubleLiteral.
99
100         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
101         automatic implicit conversion of an output value.
102         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
103
104         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
105         conversion.
106         (TypeOf.GetAttributableValue): Add extra handling for object type.
107
108         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
109         special error message.
110
111 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
112
113         * class.cs (Constructor.Emit): Don't crash when struct ctor is
114         InternalCall.
115         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
116         compatible with MS runtime.
117
118 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
119
120         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
121         attribute arguments here.
122
123         * class.cs (Indexer.Define): The check was moved to attribute class.
124
125 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
126
127         * expression.cs (StringConcat.Append): Reverted back to no warning state.
128
129 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
130
131         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
132
133         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
134         the blocks too.
135
136 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
137
138         * doc-bootstrap.cs : fix build.
139
140 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
141
142         * expression.cs (StringConcat.Append): Issue a warning when empty string
143         is going to append.
144
145 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
146
147         * assign.cs (CompoundAssign.ResolveSource): Removed.
148
149         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
150         clean up.
151
152         * class.cs (TypeContainer.FindMethods): Removed.
153         (TypeContainer.CheckMemberUsage): Made static.
154
155         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
156
157         * constant.cs (CheckRange): Removed unused type argument.
158         (CheckUnsigned): Removed unused type argument.
159
160         * cs-parser.jay: Updated after MemberAccess clean up.
161         Uses Length for empty string test.
162
163         * cs-tokenizer.cs: Uses Length for empty string test.
164         (IsCastToken): Made static.
165         (is_hex): Made static.
166         (real_type_suffix): Made static.
167
168         * decl.cs (SetupCache): Made static.
169         (OnGenerateDocComment): Removed unused ds argument.
170
171         * delegate.cs (VerifyDelegate): Removed unused argument.
172
173         * doc.cs: Uses Length for empty string test.
174
175         * driver.cs: Uses Length for empty string test.
176
177         * enum.cs (IsValidEnumType): Made static
178
179         * expression.cs (EnumLiftUp): Removed unused argument.
180         (ResolveMethodGroup): Ditto.
181         (BetterConversion): Ditto.
182         (GetVarargsTypes): Ditto.
183         (UpdateIndices): Ditto.
184         (ValidateInitializers): Ditto.
185         (MemberAccess.ctor): Ditto.
186         (GetIndexersForType): Ditto.
187
188         * flowanalysis.cs: (MergeFinally): Removed unused argument.
189
190         * iterators.cs: Updated after MemberAccess clean up.
191
192         * location.cs: Uses Length for empty string test.
193
194         * namespace.cs: Uses Length for empty string test.
195
196          * report.cs (CheckWarningCode): Made static.
197
198         * statement.cs (LabeledStatement): Removed unused argument.
199
200         * typemanager.cs (FilterNone): Removed.
201
202 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
203
204         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
205         obsolete.
206
207         * class.cs: Updated.
208
209 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
210
211         * cs-parser.jay.cs: __arglist is not allowed for delegates.
212
213 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
214
215         A fix for #77816.
216
217         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
218         host container.
219         (AnonymousMethod.ImplicitStandardConversionExists): New method.
220         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
221         Add more error reporting; Fixed issue with params.
222
223         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
224
225         * cs-parser.jay: AnonymousMethod requires host container.
226
227         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
228
229 2006-03-18  Raja R Harinath  <harinath@gmail.com>
230
231         * class.cs: Change 'TypeContainer ds' constructor argument to
232         'DeclSpace parent'.  Some classes were missed below due to
233         different naming convention.
234
235         * class.cs (MemberCore.Parent): Delete.  This makes the
236         ParentContainer changes below enforceable by the compiler.
237
238         Treat pointers to enclosing declaration space as 'DeclSpace', not
239         'TypeContainer'.
240         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
241         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
242
243         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
244         of TypeContainer.
245         (Block.AddThisVariable): Likewise.
246         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
247         (AbstractPropertyEventMethod.Emit): Likewise.
248         (AbstractPropertyEventMethod.EmitMethod): Likewise.
249         (GetMethod.Define, SetMethod.Define): Likewise.
250         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
251         (DelegateMethod.EmitMethod): Likewise.
252
253         Fix regression test-partial-13.cs.
254         Rationalize use of PartialContainer.  Ensure that the partial
255         class semantics can be tied to type-correctness, i.e., any
256         violation will cause a compile error.
257         * class.cs, const.cs: Access all fields that belong to class
258         TypeContainer via ParentContainer.  Arguments of EmitContexts and
259         Resolve()-like functions still use 'Parent'.
260
261         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
262         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
263         (PropertyMethod.CheckModifiers): Remove unused argument.
264         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
265         DeclSpace.
266
267 2006-03-28  Raja R Harinath  <rharinath@novell.com>
268
269         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
270
271 2006-03-17  Raja R Harinath  <harinath@gmail.com>
272
273         Make semantics of PartialContainer simpler.
274         * decl.cs (DeclSpace.IsPartial): Remove.
275         * class.cs (TypeContainer.IsPartial): Likewise.
276         (TypeContainer..ctor): Set PartialContainer to point to self.
277         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
278         (TypeContainer.FindNestedType): Likewise.
279         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
280
281 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
282
283         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
284
285 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
286
287         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
288         classes.
289
290 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
291
292         * class.cs (Operator.Define): An error for base conversion was not
293         reported correctly.
294
295 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
296
297         A fix for #77593, #77574.
298
299         * class.cs (MethodCore.CheckBase): Another if for operator.
300
301 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
302
303         A fix for #77822.
304
305         * expression.cs (VerifyArgumentsCompat): Reverted to double error
306         reporting, it's more tricky than I thought.
307
308 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
309
310         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
311         were not resolved
312
313         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
314         (DelegateCreation.ImplicitStandardConversionExists): New method for just
315         conversion test.
316         
317         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
318         not needed.
319
320 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
321
322         A fix for #77353.
323
324         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
325         (Event.Define): ditto
326         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
327
328         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
329         Removed redundant code and set NewSlot for Invoke method too.
330
331         * parameter.cs (Parameters.ctor): Add custom, type ctor.
332         (Parameters.MergeGenerated): New method. Use this method when you merge
333         compiler generated argument with user arguments.
334
335 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
336
337         * attribute.cs (ResolveAsTypeTerminal): Removed.
338
339         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
340         specialization for predefined types; 30% speed up.
341         Finally placed obsolete check to right place.
342         (Expression.ResolveType): Removed.
343
344         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
345         Updated after ResolveType was removed.
346
347         * expression.cs (Cast.ctor): Check void cast.
348         (Binary.ResolveAsTypeTerminal): Is never type.
349         (Conditional.ResolveAsTypeTerminal): Is never type.
350
351         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
352
353 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
354
355         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
356
357 2006-03-23  Martin Baulig  <martin@ximian.com>
358
359         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
360         type check if either of the types is an open generic type.
361
362 2006-03-23  Martin Baulig  <martin@ximian.com>
363
364         * convert.cs
365         (Convert.ExplicitTypeParameterConversion): New method; implement
366         explicit type parameter conversions.
367
368 2006-03-23  Martin Baulig  <martin@ximian.com>
369
370         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
371         blindly allow all conversions if we do not have any constraints.
372
373 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
374
375         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
376         these two separated members to simplify the code.
377         (Attribute.Resolve): Refactored to use new fields and methods.
378         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
379         implemented obsolete attribute checking.
380         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
381         implemented obsolete checking again. It look line never ending quest ;-)
382         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
383
384         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
385
386         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
387
388         *class.cs (Property.Define): Add RegisterProperty call.
389
390         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
391         argument groups (only 2).
392
393         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
394         encoding expression to arguments.
395         (Expression.ExprClassToResolveFlags): Just turned to property.
396
397         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
398         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
399         optimized as well as implemented support for zero-length attributes.
400
401         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
402         Add caching of PropertyInfo's.
403
404 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
405
406         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
407         error multiple times.
408
409 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
410
411         New partial class implementation.
412         A fix for #77027, #77029, #77403
413
414         * attribute.cs (Attributable): Made attributes protected.
415
416         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
417         the replacements of ClassPart and PartialContainer.
418         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
419         (TypeContainer.AddInterface): Ditto.
420         (TypeContainer.AddPartial): The main method for partial classes. It checks
421         for errors and merges ModFlags and attributes. At the end class is added to
422         partial_parts list.
423         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
424         required here.
425         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
426         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
427         from the rest of partial classes.
428         (TypeContainer.GetClassBases): Simplified.
429         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
430         DefineType.
431         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
432         (TypeContainer.HasExplicitLayout): Uses Flags now.
433         (PartialContainer): Removed.
434         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
435         (StaticClass): Was merged with Class.
436         (Class.GetClassBases): class and static class bases are verified here.
437         (Class.TypeAttr): Added static attributes when class is static.
438         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
439         (MemberBase): In some cases we need to call parent container for partial
440         class. It should be eliminated but it's not easy now.
441
442         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
443
444         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
445         partial classed to accumulate class comments.
446         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
447
448         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
449
450         * driver.cs (MainDriver): Tree.GetDecl was removed.
451
452         * modifiers.cs (Modifiers): Add partial modifier.
453
454         * tree.cs (Tree.decl): Removed.
455         (RootTypes): Started to use this class more often for root types
456         specializations.
457
458 2006-03-23  Raja R Harinath  <rharinath@novell.com>
459
460         * generic.cs (TypeParameter.UpdateConstraints): Update
461         'constraints' if null.
462
463 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
464
465         A fix for #77615
466
467         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
468         external interface does not have an attribute.
469
470 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
471
472         Another prerequisites for new partial classs implementation.
473         
474         * attribute.cs (Attribute.Equal): Implemented.
475         (Attribute.Emit): Changed as attributes can be applied more than twice.
476         (Attributes.Emit): Check for duplicate attributes here.
477
478         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
479         as a parameter, clean-up.
480
481 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
482
483         A fix for #77485
484
485         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
486         contains obsolete attribute check which can in some cases look for base
487         type of current class which is not initialized yet.
488         (TypeContainer.BaseType): Replacement of ptype.
489
490         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
491
492 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
493
494         First of prerequisites for new partial classs implemention.
495         
496         * attribute.cs (Attributable): Extended by ResolveContext;
497         Attributes finally have correct context for resolving in all cases.
498         (AttachTo): Attribute owner is assigned here.
499
500         * codegen.cs (IResolveContext): Introduce new interface to hold
501         all information needed in resolving phase.
502         (EmitContext): Implements IResolveContext; more clean-up needed here.
503         
504         * decl.cs (MemberCore): Implemented IResolveContext.
505
506         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
507         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
508         parameter.cs, statement.cs, tree.cs, typemanager.cs:
509         Refactored to use new IResolveContext instead of EmitContext; cleanup
510
511 2006-03-22  Raja R Harinath  <rharinath@novell.com>
512
513         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
514         mcs to keep code differences small.
515         * attribute.cs (Attribute.GetParameterDefaultValue): New.
516         * typemanager.cs (parameter_default_value_attribute_type): New.
517         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
518         CS1908 check.
519
520 2006-03-22  Martin Baulig  <martin@ximian.com>
521
522         * generic.cs
523         (Nullable.NullableLiteral): Derive from `NullLiteral'.
524
525         * convert.cs
526         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
527         instead of the normal `NullLiteral'.
528
529 2006-03-21  Martin Baulig  <martin@ximian.com>
530
531         Fix #77583.
532         * generic.cs (TypeManager.InferType): If `pt' is a generic
533         parameter, don't check whether `pt == at'.
534
535 2006-03-20  Raja R Harinath  <rharinath@novell.com>
536
537         Fix #77852
538         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
539         (TypeParameter.Resolve): Update to change.
540         (ConstraintChecker.CheckConstraints): Resolve type-argument
541         constraints before use.
542
543 2006-03-16  Martin Baulig  <martin@ximian.com>
544
545         * generic.cs
546         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
547         and don't have any instance constructors, also lookup in the base class.
548         (TypeManager.IsNullableValueType): New public method.
549
550         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
551         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
552         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
553
554         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
555         instead of just TypeManager.IsNullableType() to determine whether
556         a lifted operator exists.
557         (UnaryMutator.DoResolve): Likewise.
558         (Conditional.DoResolve): Likewise.
559         (Binary.DoResolve): A lifted operator only exists if both operands
560         are valuetypes and at least one of them is a nullable type.
561
562 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
563
564         * iterator.cs : yield break is allowed in try statement which has
565           catch clauses. Fixed bug #77767.
566
567 2006-03-12  Martin Baulig  <martin@ximian.com>
568
569         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
570         private IsSignatureEqual() to compare types; see the comment in
571         that method; fixes #77674.
572
573 2006-03-10  Raja R Harinath  <rharinath@novell.com>
574
575         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
576         (Expression.ResolveAsTypeTerminal): Likewise.
577         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
578         * expression.cs, generic.cs, iterators.cs: Likewise.
579         * parameter.cs, statement.cs, typemanager.cs: Likewise.
580
581 2006-03-09  Martin Baulig  <martin@ximian.com>
582
583         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
584         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
585
586 2006-03-09  Martin Baulig  <martin@ximian.com>
587
588         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
589         `prepared' flag is set.
590
591         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
592         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
593         issues; see gtest-254.cs.
594
595 2006-03-07  Martin Baulig  <martin@ximian.com>
596
597         * generic.cs (TypeManager.InferType): Allow infering
598         `IEnumerable<T>' with an array of T; see gtest-251.cs.
599
600 2006-03-06  Martin Baulig  <martin@ximian.com>
601
602         * generic.cs
603         (TypeManager.InferType): Fix gtest-250.cs.
604
605         * typemanager.cs
606         (TypeManager.IsSubclassOf): Also check the base class.
607
608         * expression.cs
609         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
610         fixes gtest-249.cs.
611
612 2006-03-01  Raja R Harinath  <rharinath@novell.com>
613
614         Fix #77679.
615         * expression.cs (ParameterReference.DoResolveBase): Change return
616         type to bool.
617         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
618         Update.
619
620         Fix #77628.
621         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
622
623         Fix #77642.
624         * typemanager.cs (GetFullNameSignature): Don't nullref on
625         protected accessors.
626
627 2006-02-16  Martin Baulig  <martin@ximian.com>
628
629         * generic.cs
630         (TypeManager.GetGenericFieldDefinition): New public method; use it
631         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
632
633 2006-02-14  Martin Baulig  <martin@ximian.com>
634
635         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
636
637 2006-02-14  Martin Baulig  <martin@ximian.com>
638
639         * generic.cs
640         (TypeManager.DropGenericMethodArguments): New public method; don't
641         use GetGenericMethodDefinition() on something which is not a
642         generic method.
643
644 2006-02-14  Martin Baulig  <martin@ximian.com>
645
646         * generic.cs
647         (ConstraintChecker.CheckConstraints): If a type parameter has the
648         `struct' constraint, the type must be a non-nullable valuetype.
649
650 2006-02-10  Martin Baulig  <martin@ximian.com>
651
652         * typemanager.cs
653         (TypeManager.IsOverride): Make this work for instantiated methods
654         in a generic class; fixes #77509.
655         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
656         rather than calling it directly; fixes #77488.  
657
658 2006-02-08  Martin Baulig  <martin@ximian.com>
659
660         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
661         reporting into CheckConstraint() so we can use the correctly
662         instantiated type.
663
664 2006-02-08  Martin Baulig  <martin@ximian.com>
665
666         * expression.cs (BaseAccess): Add support for generic methods.
667
668         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
669         the new MethodGroupExpr.
670
671 2006-02-07  Martin Baulig  <martin@ximian.com>
672
673         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
674         also reference types; fixes #77483.
675
676 2006-02-07  Martin Baulig  <martin@ximian.com>
677
678         * generic.cs
679         (TypeManager.IsGenericMethod): We now return whether something is
680         an instantiated generic method (and not a generic method def).
681         (TypeManager.IsGenericMethodDefinition): New public method.
682
683         * typemanager.cs
684         (TypeManager.CSharpSignature): Only include type arguments for
685         "real" generic methods, not for any instantiated method.
686         (TypeManager.GetMethodName): Likewise, but also allow generic
687         method definitions here.
688
689 2006-02-06  Miguel de Icaza  <miguel@novell.com>
690
691         * codegen.cs (EmitScopeInitFromBlock): check here the
692         capture_context, there is no need to make two calls to the
693         EmitContext. 
694
695         * anonymous.cs: Add some debugging messages that might help me
696         track other instances of this problem in the future (the
697         regression of test 467).
698
699         * cs-parser.jay: track the variable block, as we need to initalize
700         any captured variables declared in this block for the "catch"
701         portion of the "Try" statement.
702
703         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
704         scope initialization for captured variables. 
705
706         Also, move the emit for the variables after the block location has
707         been marked.
708
709 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
710
711        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
712         
713 2006-02-06  Martin Baulig  <martin@ximian.com>
714
715         * class.cs (TypeContainer.DefineType): If we're a struct, pass
716         `TypeManager.value_type' as parent type to
717         ModuleBuilder.DefineType().  Fixes #77358.      
718
719 2006-02-02  Miguel de Icaza  <miguel@novell.com>
720
721         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
722         commit yesterday, the initialization for the roots is necessary.
723         What is not necessary is the scope activation.
724
725 2006-02-02  Raja R Harinath  <rharinath@novell.com>
726
727         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
728         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
729         CS0206 checks.
730         (Argument.Resolve): Remove CS0206 checks.
731
732 2006-02-01  Miguel de Icaza  <miguel@novell.com>
733
734         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
735         scopes for all the roots, the scopes will now be emitted when the
736         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
737
738         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
739         code.  This reduces a lot of existing cruft.
740         
741         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
742         that the ScopeInfo is generated as we enter the scope, not at the
743         time of use, which is what we used to do before.
744
745         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
746         every time a Block is about to be emitted if we have a
747         CaptureContext. 
748
749 2006-02-01  Raja R Harinath  <rharinath@novell.com>
750
751         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
752         attribute for mscorlib too.
753
754         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
755         (Reset): Update.
756         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
757
758         * typemanager.cs (cons_param_array_attribute): Make private.
759         (Reset): Set it to null.
760         (InitCoreHelpers): Don't initialize it.
761         (ConsParamArrayAttribute): New.  Initialize it as needed.
762         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
763
764 2006-01-31  Miguel de Icaza  <miguel@novell.com>
765
766         * expression.cs: There might be errors reported during the
767         selection of applicable methods.  If there are errors, do not
768         continue execution as it will lead the compiler to crash.
769
770 2006-01-30  Miguel de Icaza  <miguel@novell.com>
771
772         * expression.cs: Member access is not allowed on anonymous
773         methods.  Fixes #77402.
774
775 2006-01-30  Raja R Harinath  <rharinath@novell.com>
776
777         Fix #77401
778         * cs-parser.jay (VariableDeclaration): Don't set
779         current_array_type to null.
780         (field_declaration, event_declaration, declaration_statement):
781         Set it to null here.
782
783 2006-01-29  Raja R Harinath  <harinath@gmail.com>
784
785         Fix part of #77397
786         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
787
788 2006-01-28  Raja R Harinath  <harinath@gmail.com>
789
790         * typemanager.cs (GenericParameterPosition): New.
791         * doc.cs: Use it.
792
793 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
794
795         * doc.cs : To process "include" elements, first we should create
796           another list than XmlNodeList, because it could result in node
797           removal, which could result in that the XmlNodeList gives up
798           yielding next node.
799
800 2006-01-25  Miguel de Icaza  <miguel@novell.com>
801
802         * expression.cs: Introduce an error report that we were not
803         catching before.   Gonzalo ran into it.
804
805 2006-01-23  Miguel de Icaza  <miguel@novell.com>
806
807         A fix for bug: #76957
808         
809         * iterators.cs (MoveNextMethod.CreateMethodHost): call
810         ComputeMethodHost before creating the method, this is a new
811         requirement. 
812
813         * anonymous.cs (AnonymousContainer): Now we track all the scopes
814         that this method references (RegisterScope).  The actual scope
815         where the method is hosted is computed with the ComputeMethodHost
816         before we create the method.
817
818         Moved the Deepest routine here.
819
820         (AnonymousContainer.ComputeMethodHost): New routine used to
821         compute the proper ScopeInfo that will host the anonymous method.
822
823         (ScopeInfo): Deal with multiple roots.  The problem was that we
824         did not have a unique root where all ScopeInfos could be hanged
825         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
826         of roots.  
827
828         Remove AdjustMethodScope which is now computed at the end.  Remove
829         LinkScope which did a partial link, instead link all ScopeInfos
830         before code generation from the new "LinkScopes" routine. 
831
832         Simplify all the Add* routines as they no longer need to maintain
833         the tree, they just need to record that they are using variables
834         from a ScopeInfo.
835
836         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
837         routines to produce the forest of ScopeInfo trees.
838
839         * class.cs (TypeContainer.AppendMethod): This is just like
840         AddMethod, but ensures that an interface implementation method
841         (IEnumerable.XXX) is not inserted at the beginning of the queue of
842         methods, but at the end.
843
844         We use this functionality to ensure that the generated MoveNext
845         method in the iterator class is resolved/emitted before the
846         enumerator methods created.   
847
848         This is required because the MoveNext method computes the right
849         ScopeInfo for the method.  And the other methods will eventually
850         need to resolve and fetch information computed from the anonymous
851         method. 
852
853         
854 2006-01-23  Raja R Harinath  <rharinath@novell.com>
855
856         Improve implementation of section 14.4.2.2 (Better function member).
857         * expression.cs (Invocation.MoreSpecific): Compare all type
858         arguments before deciding if one type is more specific than
859         another.  Handle array types too.  Return the more specific type.
860         (Invocation.BetterFunction): Add more tie-breaking rules from
861         section 14.4.2.2.  Perform "more specific" check after
862         other tie-breaking rules.  Compare all parameter types before
863         choosing the "more specific" method.
864
865 2006-01-21  Raja R Harinath  <harinath@gmail.com>
866             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
867
868         Fix rest of #76995.
869         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
870         the 'aliases' hash.
871         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
872         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
873
874 2006-01-18  Martin Baulig  <martin@ximian.com>
875
876         * class.cs (TypeContainer.AddToMemberContainer): Use
877         `symbol.MemberName.MethodName' instead of just `symbol.Name';
878         fixes #77124.
879
880 2006-01-18  Martin Baulig  <martin@ximian.com>
881
882         Fix #76417: a generic class may now have methods which may unify
883         for some type parameter substitutions.
884
885         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
886         for methods which may unify anymore.
887
888         * expression.cs (Invocation.MoreSpecific): New private static
889         method; checks whether one method is more specific than another
890         according to 14.4.2.2 of the spec.
891         (Invocation.BetterFunction): Implement the tie-breaking rules from
892         14.4.2.2 of the spec: if two methods unify for some type parameter
893         substitution, we need to pick the more specific one.
894
895 2006-01-18  Raja R Harinath  <rharinath@novell.com>
896
897         Fix #76656, cs0231-2.cs.
898         * cs-parser.jay (formal_parameter_list): Make error case catch
899         more issues.
900         (parenthesized_expression_0): Add CS1026 check.
901         (invocation_expression): Remove unused { $$ = lexer.Location }.
902
903 2006-01-17  Raja R Harinath  <rharinath@novell.com>
904
905         Fix #76824.
906         * cs-parser.jay (statement_expression): Don't list out the
907         individual statement-expressions.  Convert syntax error into
908         CS0201 check.
909
910 2006-01-16  Raja R Harinath  <rharinath@novell.com>
911
912         Fix #76874.
913         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
914         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
915         CheckIntermediateModification.
916         (FieldExpr.DoResolve): Add new two-argument version that
917         allows us to resolve the InstanceExpression as an lvalue.
918         The one-argument variant is now just a wrapper.
919         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
920         Resolve the lhs as an lvalue if the it has a value type.
921         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
922         from Assign.DoResolve.
923         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
924         resolved as an lvalue.
925         (PropertyExpr.DoResolve): Update.
926         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
927         has a value type.  Move CS1612 check here from
928         CheckIntermediateModification.
929         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
930         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
931         'right_side' of a ResolveLValue on an 'out' argument.
932         (EmptyExpression.LValueMemberAccess): New.  Used as the
933         'right_side' of a propagated ResolveLValue on a value type.
934         (LocalVariableReference.DoResolveBase): Recognize
935         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
936         Add CS1654 check.
937         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
938         EmptyExpression.Null.
939
940 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
941
942         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
943           Type.IsGenericParameter(). Fixed bug #77183.
944         * doc.cs : it is now identical to doc.cs in mcs.
945
946 2006-01-16  Martin Baulig  <martin@ximian.com>
947
948         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
949
950 2006-01-16  Martin Baulig  <martin@ximian.com>
951
952         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
953         ctors; fixes #77250.
954
955 2006-01-12  Miguel de Icaza  <miguel@novell.com>
956
957         This fixes the problem where we used ldfld instead of ldflda to
958         load the "THIS" pointer on captured parameters, when THIS is a
959         value type.  See bug #77205.
960         
961         * iterators.cs (CapturedThisReference.Emit): Pass false to
962         EmitThis (we do not need the address).
963
964         * codegen.cs (EmitThis): it needs to know whether we need the
965         address of `this' or not.  This is used by value types.  
966
967         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
968         every other call passes false.
969
970 2006-01-12  Raja R Harinath  <rharinath@novell.com>
971
972         Fix #77221.
973         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
974         GetOverride.
975         * expression.cs (Invocation.OverloadResolve): Update.
976         (Invocation.DoResolve): Avoid double resolution of invocation.
977
978 2006-01-11  Raja R Harinath  <rharinath@novell.com>
979
980         Fix #77180.
981         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
982         unary negation of floating point types as 0-expr; negation cannot
983         overflow in floating point types.
984
985         Fix #77204.
986         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
987         on operands of 'void' type.
988
989         Fix #77200.
990         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
991         and ExclusiveOr for boolean constants too.
992
993 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
994
995         * expression.cs: Fix Console.WriteLine ((this = x).foo);
996
997 2006-01-12  Miguel de Icaza  <miguel@novell.com>
998
999         * cs-tokenizer.cs (Position): New class used to save and restore
1000         the position state in the tokenizer.  Before this patch the save
1001         and restore was not complete enough so the line and columns would
1002         start to drift and the debugger and stack traces will get the
1003         wrong data.
1004
1005 2006-01-10  Martin Baulig  <martin@ximian.com>
1006
1007         * generic.cs
1008         (TypeParameter.InflateConstraints): New public method.
1009
1010         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1011         constraints; fixes #77042.
1012
1013 2006-01-10  Martin Baulig  <martin@ximian.com>
1014
1015         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1016         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1017         #77061. 
1018
1019 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1020
1021         Fix #75636.
1022         * expression.cs (Invocation.OverloadResolve): Replace reflected
1023         override methods with their base virtual methods, rather than
1024         skipping over them.
1025         * typemanager.cs (TypeManager.GetOverride): New.
1026
1027 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1028
1029         * driver.cs: Report the case of no source files and no -out:
1030         argument provided.
1031
1032 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1033
1034         Fix #77035.
1035         * expression.cs (ComposedCast.GetSignatureForError): Define.
1036
1037 2006-01-05  Jb Evain  <jbevain@gmail.com>
1038
1039         * class.cs (Property.Define, Indexer.Define): do not tag the
1040         properties as SpecialName | RTSpecialName.
1041
1042 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1043
1044         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1045         doing a low-level comparission of parameter types.  It was lacking
1046         a check for __argslist. 
1047
1048 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1049
1050         * expression.cs (ParameterReference.DoResolveBase): Allow
1051         reference parameters if they are local to this block. 
1052
1053         This allows the ref and out parameters of a delegate to be used in
1054         an anonymous method, for example:
1055
1056         delegate void set (out int x);
1057
1058         set s = delegate (out int x){
1059                 x = 0;
1060         };
1061
1062         This is used by functionality introduced late in the C# language.
1063         
1064         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1065         method that take ref and out parameters. 
1066
1067         Fixes #77119 which was a late change in the spec.
1068
1069 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1070
1071         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1072         parent if its the same scope.  Fixes #77060.
1073
1074 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1077
1078 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1079
1080         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1081         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1082         that doesn't contain the full public key. This is a update of the
1083         friend assemblies in .Net 2.0 release.
1084         
1085 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1086
1087         Fix #76995
1088
1089         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1090         ListDictionary, to contain the ExternAliasEntry entries (in
1091         addition to the NamespaceEntry.aliases hashtable). This field is
1092         shared between the original entry and its doppelganger (bodyless 
1093         copy of it).
1094         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1095         extern_aliases field.
1096         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1097         lookup in extern_aliases.
1098
1099 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1100
1101         Fix #77006.
1102         * class.cs (TypeContainer.Mark_HasEquals): New.
1103         (TypeContainer.Mark_HasGetHashCode): New.
1104         (ClassPart): Override them.
1105         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1106
1107         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1108         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1109         DeclSpace.
1110
1111         Fix #77008.
1112         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1113         'parent' argument to the base constructor.
1114
1115         Remove all mention of TypeContainer from decl.cs.
1116         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1117         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1118         (DeclSpace.DeclSpace): Likewise.
1119         (DeclSpace.DefineMembers): Remove unused argument.
1120         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1121         debugging check -- we don't care if the debug code throws an
1122         InvalidCastException instead of an InternalErrorException.
1123         * class.cs (TypeContainer.DefineMembers): Update to changes.
1124         (TypeContainer.DoDefineMembers): Likewise.
1125         (TypeContainer.GetMethods): Likewise.
1126         (PropertyMember.Define): Likewise.
1127         (MemberBase.Parent): New property that forwards to
1128         MemberCore.Parent, but ensures that we get a TypeContainer.
1129         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1130         (RootContext.PopulateTypes): Likewise.  Remove special case code
1131         for !RootContext.StdLib: DefineMembers is idempotent.
1132
1133 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1134
1135         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1136
1137 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1138
1139         * doc.cs : The search for referenced namespace was insufficient to
1140           get global one as it used to do. Fixed bug #76965.
1141
1142 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1143
1144         * doc.cs : check name in cref in the last phase that whether it is
1145           namespace or not.
1146
1147 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1148
1149         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1150           Mono.C5.
1151
1152 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1153
1154         * doc.cs : so it turned out that we cannot skip override check for 
1155           interface members. Fixed bug #76954.
1156
1157 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1158
1159         * cs-tokenizer.cs : fixed bug #75984:
1160           - #warning and #error should not be handled when the source line
1161             is disabled.
1162           - #line is not checked strictly when the source line is disabled.
1163           - #define and #undef is on the other hand checked strictly at any
1164             state.
1165
1166 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1167
1168         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1169           CS1027 report.
1170
1171 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1172
1173         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1174
1175         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1176         nested types.
1177
1178 2005-12-14  Martin Baulig  <martin@ximian.com>
1179
1180         * typemanager.cs (TypeManager.GetFullName): Make this public;
1181         `Type.Fullname' now never returns null.
1182
1183         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1184         explicit interface implementations; we're now using the same
1185         naming convention than csc does.
1186
1187 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1188
1189         * convert.cs (ExplicitConversionCore): Check the return value from
1190         ExplicitConversionCore which can return null on failure.  Fixes #76914
1191
1192 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1193
1194         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1195         instead of IsGenericInstance.
1196         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1197         code that's now covered by the more general test.
1198         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1199
1200         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1201         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1202         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1203         * generic.cs, report.cs, typemanager.cs: Likewise.
1204
1205 2005-12-08  Martin Baulig  <martin@ximian.com>
1206
1207         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1208
1209         * typemanager.cs (TypeManager.CSharpSignature): Include type
1210         arguments in the signature of a generic method.
1211
1212 2005-12-07  Martin Baulig  <martin@ximian.com>
1213
1214         Add support for custom attributes on type parameters.
1215
1216         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1217
1218         * generic.cs (TypeParameterName): New public class; we use this
1219         instead of a `string' to store the name of a type parameter, so we
1220         can also have `Attributes'.
1221         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1222         array instead of a `string[]' array.
1223         (TypeParameter.ctor): We now also take an `Attributes' argument.
1224         (TypeParameter.EmitAttributes): New public method; emit our
1225         `OptAttributes' here.
1226         (GenericMethod.EmitAttributes): New public method; emit the custom
1227         attributes on all our type parameters.
1228
1229         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1230         our type parameters.
1231         (MethodData.Define): If we're a generic method, call
1232         EmitAttributes() on it.
1233
1234 2005-12-07  Martin Baulig  <martin@ximian.com>
1235
1236         * generic.cs
1237         (ConstraintChecker): New public abstract class; move the
1238         constraint checking here from `ConstructedType' and also do
1239         constraint checking for generic methods here.
1240
1241         * expression.cs (Invocation.OverloadResolve): Use
1242         ConstraintChecker.CheckConstraints() if we resolved to a generic
1243         method.  Fix #76806.
1244
1245 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1246
1247         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1248
1249         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1250         event initializers.
1251         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1252         (FieldBase.Initializer): Initializer is now optional.
1253         (EventField.Define): Only event field can have initializer.
1254
1255         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1256
1257         * const.cs (Const): Reuse initializer.
1258
1259         * cs-parser.jay: Updated after FieldBase changes.
1260         Added current_array_type to simplify array initializers.
1261
1262         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1263
1264         * expression.cs, iterators.cs: Updated.
1265
1266         * namespace.cs (NamespaceEntry): Made UsingFound private.
1267
1268 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * parameterCollection.cs: Obsolete, removed.
1271         * parser.cs: Obsolete, removed.
1272
1273 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1274
1275         Fix #76849.
1276         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1277
1278         * enum.cs (Enum.Define): Set obsolete context here.
1279
1280 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1281
1282         * doc.cs :
1283           - FindDocumentedMember() now expects 1) paramList as null
1284             when "we don't have to check the number of parameters" and
1285             2) Type.EmptyTypes when "there is no arguments".
1286           - Introduced FoundMember struct to hold the exact type which was
1287             used to find the documented member (the above change broke
1288             test-xml-044; it might be better just to use DeclaringType than
1289             what MS does, like this change does, but it depends on usage.)
1290
1291 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1292
1293         * doc.cs : documented member might be from DeclaringType for nested
1294           types. Fixed bug #76782.
1295
1296 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1297
1298         * anonymous.cs: Have the param code handle leaving copies on the
1299         stack etc. Allows anonymous params to take part in the assignment
1300         code (++, +=, etc). Fixes bug #76550
1301
1302         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1303         it down to the anon code.
1304
1305         * iterators.cs: Use dummy var here
1306
1307         * codegen.cs: Handle new vars
1308
1309 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1310
1311         Fix #76849.
1312         * class.cs (MethodData.Define): Set proper Obsolete context.
1313
1314         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1315         obsolete context.
1316         (FieldExpr.DoResolve): Ditto.
1317
1318 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1319
1320         Fix #76849.
1321         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1322         parent is not obsolete.
1323
1324 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1325
1326         * doc.cs : (FindDocumentedMember) find parameterless members first
1327           and get CS0419 in the early stage. Fixed first case of bug #76727.
1328
1329 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1330
1331         Fix #76859.
1332         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1333         no error was reported.
1334
1335         *expression.cs (Binary.DoResolve): left can be null.
1336
1337 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1338
1339         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1340         abstract method and all overrides.
1341         * support.cs (ParameterData.GenericConstraints): Delete.
1342         (ReflectionParameters.type_params): Delete.
1343         (ReflectionParameters.ReflectionParameters): Make private.
1344         (ReflectionParameters.GetConstaints): New factory method.
1345         * generic.cs (TypeParameterDefineType): Use it.
1346         (TypeManager.GetTypeParameterConstraints): Likewise.
1347
1348 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1349
1350         Fix #76783.
1351         * class.cs (MethodData.Emit): Parameters should be labeled first.
1352
1353 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1354
1355         Fix #76761.
1356         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1357
1358 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1359
1360         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1361
1362         * class.cs (MethodCore): Parameter clean up.
1363         (IMethodData): Added ParameterInfo.
1364         (MethodData): Parameter clean up.
1365         (Indexer.Define): Parameter clean up.
1366
1367         * anonymous.cs,
1368         * codegen.cs,
1369         * cs-parser.jay,
1370         * decl.cs,
1371         * doc.cs,
1372         * ecore.cs,
1373         * flowanalysis.cs,
1374         * iterators.cs,
1375         * pending.cs,
1376         * statement.cs,
1377         * typemanager.cs: Parameter clean up.
1378
1379         * delegate.cs (Define): Get rid of duplicated code.
1380
1381         * expression.cs (ParameterReference): Removed useless parameters
1382         and simplified.
1383         (Invocation): Ditto.
1384
1385         * parameter.cs (ParamsParameter): New class, params specialization.
1386         (ArglistParameter): Attemp to separate arglist.
1387         (Parameter): Refactored to be reusable and faster.
1388         (Parameter.Modifier): Made understandable.
1389         (Parameters): Changed to be used as a class for `this' assembly
1390         parameters. Refactored to use new specialized classes.
1391
1392         * support.cs (ParameterData): Added Types property.
1393         (InternalParameters): Deleted.
1394
1395 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1396
1397         * doc.cs : the previous patch does not actually fix the bug.
1398           PropertyInfo override check is now implemented and really fixed it.
1399         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1400
1401 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1402
1403         * doc.cs : apply "override filter" also to properties.
1404           Fixed bug #76730.
1405
1406 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1407
1408         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1409           no need to check overrides. For classes, omit those results from 
1410           interfaces since they must exist in the class. Fixed bug #76726.
1411
1412 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1413
1414         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1415           with different parameters. Fixed the second problem in #76685.
1416
1417 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1418
1419         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1420           get expected 'protected' access in CheckValidFamilyAccess()).
1421           Fixed bug #76692.
1422
1423 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1424
1425         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1426           Fixed bug #76705.  CS1569 was incorrectly commented out.
1427
1428 2005-11-23  Martin Baulig  <martin@ximian.com>
1429
1430         * generic.cs (Constraints.Define): Removed.
1431         (TypeParameter.DefineConstraints): Removed.
1432         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1433         on the GenericTypeParameterBuilder here.
1434
1435 2005-11-23  Martin Baulig  <martin@ximian.com>
1436
1437         * typemanager.cs (TypeManager.GetProperty): Make this public.
1438
1439         * generic.cs (Nullable.NullableInfo.ctor): Use
1440         TypeManager.GetProperty() rather than using reflection directly.
1441
1442 2005-11-17  Martin Baulig  <martin@ximian.com>
1443
1444         * expression.cs (Indexers.GetIndexersForType): Added support for
1445         generic parameters; fixes #76587.
1446
1447 2005-11-17  Martin Baulig  <martin@ximian.com>
1448
1449         * anonymous.cs
1450         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1451         inherit the scope from our parent.  Fixes #76653.
1452
1453 2005-11-15  Martin Baulig  <martin@ximian.com>
1454
1455         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1456         instead of `ScopeTypeBuilder' to refer to the "current" type.
1457         (AnonymousMethod.CreateScopeType): Correctly create the helper
1458         class if we're inside a generic type definition.
1459
1460 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1461
1462         * doc.cs : use Invocation.IsOverride() to do real override check.
1463         * expression.cs : made Invocation.IsOverride() internal.
1464
1465 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1466
1467         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1468           TypeBuilder.FindMembers() and filter overriden base members out.
1469           Fixed bug #76990.
1470
1471 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1472
1473         * doc.cs : ref/out parameters are represented as '@' (instead of
1474           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1475
1476 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1477
1478         * doc.cs : when there was no '.' in cref to methods in doc comment,
1479           then parameters were missing in the output. Fixed bug #76691.
1480
1481 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1482
1483         * driver.cs : don't output docs when there is an error.
1484           Fixed bug #76693.
1485
1486 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1487
1488         * doc.cs :
1489           Now it should detect indexers. Fixed primary concern in bug #76685.
1490           Fixed CS0419 message to not show the identical member signature in
1491           the message.
1492
1493 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1494
1495         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1496           instead of Type.FindMembers() since it does not handle events.
1497           Fixed bug #71604.
1498
1499 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1500
1501         * codegen.cs: Fixed typo (speficied -> specified).
1502
1503 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1504
1505         Fix #76369.
1506         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1507
1508 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1509
1510         * attribute.cs: Changed error message.
1511
1512         * cs-tokenizer.cs: One more check.
1513
1514 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1515
1516         * statement.cs (Block.Resolve): Ignore empty statement.
1517
1518 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1519
1520         * report.cs: Made error/warning methods more strict to avoid
1521         their misuse.
1522
1523         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1524         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1525         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1526         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1527
1528 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1529
1530         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1531         Use the more explicit AssemblyName.FullName instead of 
1532         AssemblyName.Name to report errors.
1533         
1534 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1535
1536         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1537         with mcs.
1538
1539 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1540
1541         * class.cs,
1542         * convert.cs,
1543         * cs-parser.jay,
1544         * decl.cs,
1545         * enum.cs,
1546         * expression.cs,
1547         * generic.cs,
1548         * pending.cs,
1549         * report.cs: Fixed error reporting and typos.
1550
1551         * generic.cs (TypeParameter.GetSignatureForError): New method.
1552         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1553
1554         * typemanager.cs (GetFullName): Refactored.
1555
1556 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1557
1558         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1559         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1560
1561         * class.cs (TypeContainer.IsComImport): New property.
1562         (Constructor.Define): Create proper ctor for ComImport types.
1563
1564         * expression.cs (New.CheckComImport): Fixed.
1565
1566 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1567
1568         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1569         that a parameter has been captured does not mean that we do not
1570         have to do the rest of the processing.  This fixes the second part
1571         of #76592.  If there was another anonymous method capturing
1572         values in the past, the Scope would never be set for the second
1573         method that captured the same parameter.
1574
1575         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1576         properly manipulate the stack.   Second part of fix for #76592.
1577
1578         * expression.cs (New): Add support for invoking "new" on
1579         interfaces that have been flagged with the ComImport attribute and
1580         the CoClass.  Fixes #76637 
1581
1582         * statement.cs (Try.DoEmit): When a variable is captured, do not
1583         try to emit the vi.LocalBuilder variable as it has been captured.
1584         Create a temporary variable and store the results on the
1585         FieldBuilder.  Fixes #76642
1586
1587 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1588
1589         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1590
1591         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1592
1593         * expression.cs (Binary.DoResolve): Added && optimalization.
1594     
1595         * typemanager.cs (AddUserType): Removed useless argument.
1596
1597 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1598
1599         * statement.cs (Block.variables): Uses ListDictionary.
1600
1601 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1602
1603         Fix #75969.
1604         * class.cs (PartialContainer.EmitType): Customized to emit
1605         security attributes.
1606         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1607         for partial classes.
1608
1609 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1610
1611         Fix #76599.
1612         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1613         access has to be fixed.
1614         
1615         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1616
1617 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1618
1619         Fix #76590.
1620         * ecore.cs (NullCast.Reduce): Implemented.
1621
1622         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1623         constant type.
1624         
1625         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1626         properly.
1627         (Foreach.Resolve): Catch null properly.
1628
1629 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1630  
1631         * cs-tokenizer.cs: Warning text fix.
1632
1633         * driver.cs: AllWarningNumbers exposed on public interface.
1634
1635         * report.cs (): Reviewed warning numbers.
1636         (IsValidWarning): Use binary search.
1637
1638 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1639  
1640         * driver.cs: Implemeted resource visibility.
1641         (Resources): New class for code sharing between /res: and
1642         /linkres:
1643  
1644 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1645
1646         decl.cs (CurrentTypeParameters): Fixed to be public.
1647
1648 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1649
1650         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1651
1652 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1653
1654         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1655
1656 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1657
1658         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1659
1660 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1661
1662         Add friend assembly access support.
1663         * typemanager.cs: assembly_internals_vis_attrs
1664         cache for friend assembly access. 
1665         (TypeManager.IsFriendAssembly): New method for
1666         checking friend assembly access.
1667         (TypeManager.Error_FriendAccessNameNotMatching): New
1668         helper method.
1669         (TypeManager.CompareKeyTokens): Likewise.
1670         (TypeManager.Filter): Handle friend accessible
1671         members.
1672
1673         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1674         friend accessible types.
1675
1676         * ecore.cs (Expression.IsAccessorAccessible): Handle
1677         friend accessible properties.
1678
1679         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1680         accessible types.
1681         
1682 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1683
1684         Fix #76568.
1685         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1686         folding.
1687         
1688         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1689         contants only.
1690         
1691         * ecore.cs (NullCast): Child is contant only.
1692         
1693         * literal.cs (NullLiteral.Reduce): null can be converted to any
1694         reference type.
1695
1696 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1697
1698         * driver.cs: Use Encoding.Default as default code page instead
1699           of ISO-28591.
1700
1701 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1702
1703         Fix #76085.
1704         * expression.cs (Invocation.Error_InvalidArguments): Handle
1705         __arglist parameters.
1706         (Invocation.VerifyArgumentsCompat): Likewise.
1707         * support.cs (ReflectionParameters.GetSignatureForError): Print
1708         __arglist parameters.
1709         (InternalParamters.GetSignatureForError): Likewise.
1710         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1711
1712 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * attribute.cs (GetPropertyValue): Made public.
1715
1716         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1717         Resolve.
1718         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1719         attribute.
1720         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1721         is not defined.
1722         
1723         * driver.cs: Reflect method name change.
1724         
1725         * statement.cs (Try.Resolve): Warn when try has both general
1726         exception handlers.
1727         
1728         * typemanager.cs: runtime_compatibility_attr_type new predefined
1729         type.
1730
1731 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1732
1733         Fix #76419.
1734         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1735         treat it as an empty parameter list.
1736
1737 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1738
1739         Fix #76271.     
1740         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1741         ResolveAsTypeStep silent.
1742         * statement.cs (Block.AddConstant): Mark block as used.
1743         (Block.ResolveMeta): Avoid piling on error messages
1744         if a constant initializer resolution fails.
1745
1746 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1747
1748         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1749         Remove.
1750         (NamespaceEntry.VerifyAllUsing): New.
1751         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1752         behaviour.  Delegates actual resolution of alias to ...
1753         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1754         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1755         Update.
1756         * driver.cs (Driver.MainDriver): Update.
1757         
1758         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1759         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1760         property.
1761         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1762         Remove.
1763         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1764         RootNamespace.DefineNamespacesForAll.
1765
1766 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1767
1768         * typemanager.cs (assemblies, external_aliases, modules)
1769         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1770         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1771         overhead.  Move resposibility ...
1772         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1773         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1774
1775 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1776
1777         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1778         cached_namespaces.  Improve usage.
1779         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1780         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1781         Move from GlobalRootNamespace and simplify.
1782         (RootNamespace.Global): Make instance variable.
1783         (RootNamespace.RootNamespace): Add "alias name" parameter.
1784         (GlobalRootNamespace): Simplify drastically.
1785         (Namespace.Lookup): Don't use GetNamespace.
1786         * typemanager.cs (GetRootNamespace): Rename from
1787         ComputeNamespaceForAlias.
1788         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1789
1790 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1791
1792         * anonymous.cs (AnonymousContainer): Don't crash when container
1793         doesn't exist.
1794
1795 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1796
1797         * expression.cs (Binary.DoResolve): Warn when comparing same
1798         values.
1799
1800 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1801
1802         Fix #76486.
1803         * expression.cs (Binary.DoResolve): It looks like there are no
1804         convetsion rules in enum context.
1805
1806 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1807
1808         Add support for extern alias qualifiers.
1809         * typemanager.cs: Move some LookupTypeReflection code
1810         to namespace.cs, to have cleaner code. Added some methods
1811         to help us keep track of the extern aliased references.
1812         * driver.cs: Add suport for extern alias assemblies on command
1813         line and check for their warnings/errors. Also keep track of the
1814         extern aliased assemblies.
1815         * namespace.cs: Move the global functionality of Namespace
1816         to GlobalRootNamespace/RootNamespace. Now the global namespace
1817         is GlobalRootNamespace.Globa. Also the code moved from 
1818         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1819         Finally added LocalAliasEntry (AliasEntry before) and
1820         ExternAliasEntry, to handle alias statements.
1821         * cs-parser.jay: Add support in the grammar for extern alias
1822         statement.
1823         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1824         Update callings to Namespace (now in GlobalRootNamespace).
1825
1826 2005-10-25  Martin Baulig  <martin@ximian.com>
1827
1828         * convert.cs (ImplicitTypeParameterConversion): Make base
1829         interfaces actually work; fixes #76557.
1830
1831 2005-10-25  Martin Baulig  <martin@ximian.com>
1832
1833         * generic.cs
1834         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1835         all the type parameters; fixes #76551.
1836
1837 2005-10-25  Martin Baulig  <martin@ximian.com>
1838
1839         Fix #76472.
1840
1841         * generic.cs
1842         (GenericMethod.ctor): Added `Expression return_type' and
1843         `Parameters parameters' arguments.
1844         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1845         parameter and return types to check their constraints if they're
1846         generic types.
1847
1848         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1849         boolean field.
1850
1851         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1852         constraints of a generic type if `ec.ResolvingGenericMethod'.
1853
1854         * class.cs (MethodCore.DoDefineParameters): Set
1855         `ec.ResolvingGenericMethod' if we're a generic method.
1856         (MemberBase.MemberType): Likewise.
1857
1858 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1859
1860         * typemanager.cs (TypeManager): Added 
1861         TypeManager.internals_visible_attr_type to cache
1862         S.R.CompilerServices.InternalsVisibleToAttribute.
1863
1864         * codegen.cs (AssemblyClass): Added checks for 
1865         InternalsVisibleToAttribute in new method 
1866         CheckInternalsVisibleAttribute () and also cache the
1867         AssemblyName in AssemblyClass.Name.
1868         
1869 2005-10-24  Martin Baulig  <martin@ximian.com>
1870
1871         * typemanager.cs
1872         (TypeManager.ExpandInterfaces): Added overloaded version which
1873         just takes a `Type[]' array.
1874
1875         * generic.cs
1876         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1877         just use the interfaces which were explicitly specified and not
1878         the interfaces they inherit.  Fixes #76482.
1879         (TypeParameter.FindMembers): Expand the interfaces here.
1880
1881 2005-10-21  Martin Baulig  <martin@ximian.com>
1882
1883         * generic.cs
1884         (Constraints.Resolve): Also resolve the actual types here.
1885         (Constraints.ResolveTypes): Just check the constraints here.
1886         Fixes #76363; see gtest-218.cs.
1887
1888 2005-10-21  Martin Baulig  <martin@ximian.com>
1889
1890         * convert.cs
1891         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1892         instead of a `BoxedCast'; fixes gtest-217.cs.
1893
1894 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1895
1896         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1897           1) "new()" is specified as generic parameter constraint and 2) the
1898           type is TypeBuilder and 3) the type is abstract even if it has a
1899           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1900
1901 2005-10-20  Martin Baulig  <martin@ximian.com>
1902
1903         * generic.cs
1904         (GenericConstraints.TypeParameter): New public property.
1905         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1906         (TypeParameter.DeclSpace): New public property.
1907         (TypeParameter.DefineType): Inflate the constraints if our
1908         `DeclSpace' is an `Iterator'.   
1909
1910 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1911
1912         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1913           GenericMethod argument to compare methods' generic type arguments.
1914           Fixed bug #76382.
1915
1916 2005-10-19  Martin Baulig  <martin@ximian.com>
1917
1918         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1919         not ResolveType() when resolving the base type, so we're not
1920         checking the constraints here.
1921         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1922         if we have any.
1923
1924 2005-10-19  Martin Baulig  <martin@ximian.com>
1925
1926         * generic.cs (ConstructedType.CheckConstraints): Committing
1927         untested fix for #76441.
1928
1929 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1930
1931         Fix #76371.
1932         * class.cs (TypeContainer.DefineType): Move updating of
1933         topological sort earlier in the code.
1934         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1935
1936 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1937
1938         Fix #76273.
1939         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1940         
1941         * constant.cs (Constant.TryReduce): Moved from Cast class.
1942         (Reduce): Made little bit more OO and fixed missing conversions.
1943         
1944         * ecore.cs (Reduce): Implemented.
1945         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1946         
1947         * literal.cs (Reduce): Implemented.
1948         
1949         * class.cs: Reverted Miguel's wrong commit.
1950
1951 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1952
1953         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1954
1955 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1956
1957         * cs-parser.jay, expression.cs : CS0214 was missing error location
1958           for constants. Fixed bug #76404.
1959
1960 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1961
1962         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1963         InstanceExpression.
1964         (PropertyExpr.EmitCall): Likewise.
1965         * expression.cs (Invocation.EmitArguments): Handle case where
1966         arguments == null.
1967         (Invocation.EmitCall): Avoid allocating temporary variable if
1968         there are no arguments.
1969
1970 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1971
1972         Fix #76370.
1973         * convert.cs (ExplicitConversionCore): Fixed object->enum
1974         conversion.
1975
1976 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1977
1978         Fix #76323.
1979         * convert.cs (ImplicitConversionStandard): Move conversion of
1980         void* to arbitrary pointer types ...
1981         (ExplicitConversionStandard): .. here.
1982         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1983         error to always print typenames.
1984
1985 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1986
1987         * convert.cs (GetConversionOperator): Rename from
1988         GetConversionOperators.  Move operator selection code from ...
1989         (UserDefinedConversion): ... here.
1990
1991 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1992
1993         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1994         conversion.
1995
1996 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1997
1998         * assign.cs (Assign.DoResolve): Error method changed.
1999
2000         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2001         
2002         * const.cs (ResolveValue): Reset in_transit immediately.
2003         
2004         * constant.cs: Error method changed.
2005         
2006         * convert.cs: Removed useless location parameter.
2007         (ExplicitNumericConversion): Don't do double enum check.
2008         (ExplicitConversionCore): Renamed from ExplicitConversion.
2009         (ExplicitUnsafe): Extracted from ExplicitConversion.
2010         (ExplicitConversion): Uses for error reporting.
2011         
2012         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2013         error messages.
2014         (ResolveBoolean): Uses common error method.
2015         (CastToDecimal): Get rid of ec.
2016         (CastFromDecimal): Optimized.
2017         (ConvCast): Get rid of ec.
2018         
2019         * enum.cs (ResolveValue): Reset in_transit immediately.
2020         (Emit): Return after first error.
2021         
2022         * expression.cs: Convert changes.
2023         
2024         * literal.cs: Error method changed.
2025         
2026         * statement.cs: Error method changed.
2027
2028 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2029
2030         Fix gtest-131.cs and gtest-211.cs.
2031         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2032         Only emit code for a label if it is used.  Unreachable code can
2033         violate ECMA evaluation stack invariants.
2034
2035 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2036
2037         * anonymous.cs: Implemented ExprClassName.
2038         
2039         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2040         delegate.
2041         
2042         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2043         check.
2044         
2045         * class.cs (StaticClass.DefineContainerMembers): Report protected
2046         members as error.
2047         
2048         * codegen.cs: if(ed) PRODUCTION.
2049         
2050         * convert.cs (Error_CannotImplicitConversion): Better error
2051         distinction.
2052         
2053         * cs-parser.jay: More error checks.
2054         
2055         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2056         
2057         * driver.cs (CSCParseOption): Enabled wrong option check.
2058         
2059         * ecore.cs (Expression.ExprClassName): Turned to property.
2060         (MemberExpr.CheckIntermediateModification): For checking boxed
2061         value types     modification.
2062         
2063         * statement.cs (Fixed.Resolve): Expression type must be
2064         convertible to fixed type.
2065         (CollectionForeach.GetEnumeratorFilter,TryType):
2066         Small refactoring for easier error checking.
2067
2068 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2069
2070         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2071         attributes.
2072         
2073         * class.cs (GeneratedBaseInitializer): New class for customization
2074         compiler generated initializers.
2075         (MemberBase.DoDefine): Check Obsolete attribute here.
2076         (FieldMember.DoDefine): Ditto.
2077         
2078         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2079         constants.
2080         
2081         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2082         (MemberCore.GetObsoleteAttribute): Removed argument.
2083         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2084         (MemberCore.CheckObsoleteType): New helper.
2085         
2086         * delegate.cs,
2087         * enum.cs,
2088         * statement.cs: Updates after MemberCore changes.
2089         
2090         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2091         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2092         
2093         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2094         obsolete attribute for compiler construct.
2095         (As.DoResolve): Cache result.
2096         
2097         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2098
2099 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2100
2101         * expression.cs (Probe): instead of having a "Type probe_type"
2102         keep the extra information as a TypeExpr probe_type_expr since the
2103         "As" operator needs to perform some type checks.
2104
2105         * (As.DoResolve): If the type is a type parameter, ensure that it
2106         is constrained by a class.
2107
2108 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2109
2110         * statement.cs (Lock): Use the TemporaryVariable class instead of
2111         manually using local variables as those do not work when variables
2112         are captured.
2113
2114         * ecore.cs: Moved the TemporaryVariable class from being a nested
2115         class inside Foreach to be a public class that can be employed in
2116         other places. 
2117
2118 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2119
2120         * cs-parser.jay: interface_accessors replaced by
2121         accessor_declarations.
2122
2123         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2124         location.
2125         
2126         * statement.cs (GotoCase.Resolve): Convert null constant to
2127         null case.
2128         (SwitchLabel.ResolveAndReduce): Ditto.
2129         (SwitchLabel.NullStringCase): Custom null stamp.
2130         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2131         
2132         typemanager.cs (CSharpSignature): Don't skip first argument
2133         for full names.
2134
2135 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2136
2137         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2138         expression.cs, iterators.cs, literal.cs: Store constants and
2139         literals location.
2140         
2141         * class.cs (MemberBase.ShortName): Pass location.
2142         
2143         * cs-parser.jay: Some location fixes.
2144         
2145         * ecore.cs (Expression.Location): Made virtual.
2146
2147 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2148
2149         Fix #72930.
2150         * const.cs (Const.ResolveValue): Check for assigning non-null
2151         value to reference type.
2152
2153 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2154
2155         Fix #76133.
2156         * expression.cs (This.VerifyFixed): In a value type T, the type of
2157         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2158         value type R, 'this' is treated as a value parameter.
2159
2160 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2161
2162         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2163         if the underlying types are the same, otherwise we need to produce
2164         code that will do the proper cast.
2165
2166         This was exposed by Marek's constant rewrite which produced
2167         invalid code for the call site:
2168
2169         enum X : long { a }
2170         void Method (X v) {}
2171
2172         Method ((X) 5)
2173
2174         This fixes test-49.cs
2175
2176 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2177
2178         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2179           Type/Object should be allowed as well. Fixed bug #75968.
2180
2181 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2182
2183         * expression.cs : (Binary.DoResolve): when one is enum constant and
2184           another is constant 0, then return enum one *as enum type*.
2185           Fixed bug 74846.
2186
2187 2005-10-04  Martin Baulig  <martin@ximian.com>
2188
2189         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2190         `SetMemberIsUsed()' work for generics, too.
2191
2192 2005-10-04  Martin Baulig  <martin@ximian.com>
2193
2194         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2195         for corlib.  Fixes #75691.
2196
2197 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2198
2199         Fix #76255.
2200         * driver.cs: Fix compilation files with full root path.
2201
2202 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2203
2204         * report.cs (SymbolRelatedToPreviousError): Format the output so
2205         it does not use an open parenthesis that is never closed. 
2206
2207         * driver.cs: Follow coding guidelines
2208
2209 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2210
2211         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2212
2213         * location.cs (InEmacs): in this mode, do not report column
2214         location as it confuses Emacs.
2215
2216 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2217
2218         * support.cs (SeekableStreamReader.Position): Don't error out when
2219         the requested position is just beyond the end of the current
2220         buffered data.
2221
2222 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2223
2224         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2225         try to keep in sync with the byte count of the underlying Stream.
2226         However, this limits us to a window size of 2048 characters: i.e.,
2227         the maximum lookahead of our lexer/parser can be 2048 characters.
2228
2229 2005-09-22  Martin Baulig  <martin@ximian.com>
2230
2231         * driver.cs: Removed a debugging FIXME.
2232
2233 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2234
2235         * cs-parser.jay (type_arguments): Add CS1644 check.
2236         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2237
2238 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2239
2240         * Makefile (PROGRAM): Make profile specific.
2241         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2242         the current directory.
2243
2244         Fix test-455.cs.
2245         * expression.cs (Invocation.EmitCall): Remove optimization on
2246         this_call since it doesn't handle 'this' being a value type.
2247
2248 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2249
2250         * driver.cs: Ensure file handles are closed after parsing
2251
2252 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2253
2254         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2255         if the underlying types are the same, otherwise we need to produce
2256         code that will do the proper cast.
2257
2258         This was exposed by Marek's constant rewrite which produced
2259         invalid code for the call site:
2260
2261         enum X : long { a }
2262         void Method (X v) {}
2263
2264         Method ((X) 5)
2265
2266         This fixes test-49.cs
2267
2268 2005-09-05  Martin Baulig  <martin@ximian.com>
2269
2270         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2271         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2272
2273         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2274
2275 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2276
2277         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2278           to be a pointer type due to the spec 25.2, so check if declaring
2279           type is generic type definition. Fixed bug #75772.
2280
2281 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2282
2283         Fixed bug #75957.
2284         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2285           both types are not defined by methods.
2286         * expression.cs : (Invocation.IsApplicable): it should work when
2287           the argument type is equal to the parameter type, not only when
2288           ImplicitConversionExists() returns true.
2289
2290 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2291
2292         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2293         internal.
2294
2295         Fix #75941.
2296         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2297         flow-branching for LocalVariableReferences in case we were invoked
2298         from a MemberAccess.
2299         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2300         Carved out of ...
2301         (LocalVariableReference.DoResolveBase): ... this.
2302         (MemberAccess.Resolve): Do the check that was disabled during
2303         SimpleNameResolve.
2304
2305 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2306
2307         * class.cs :
2308           (PartialContainer.Create): check abstract/sealed/static strictly
2309           but abstract/sealed can exist only at one side. Fixed bug #75883.
2310
2311 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2312
2313         Fix #75945.
2314         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2315         specified, don't default to UnmanagedType.I4.
2316
2317 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2318
2319         * expression.cs : conditional operator should check possibly
2320           incorrect assign expression. Fixed bug #75946.
2321
2322 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2323
2324         Fix #75934.
2325         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2326         (ScopeInfo.EmitScopeType): Use it to construct field names from
2327         names of captured locals.
2328
2329         Fix #75929.
2330         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2331         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2332         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2333         (ExplicitConversion): Remove enum cases already handled by
2334         implicit conversion.  Move implicit conversion check to the beginning.
2335         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2336         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2337         Don't treat System.Enum as a struct.
2338
2339 2005-08-30  Jb Evain  <jbevain@gmail.com>
2340
2341         * attribute.cs: handles as expression in parameters.
2342
2343 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2344
2345         Fix #75802.
2346         * class.cs (TypeContainer.VerifyClsName): Don't use a
2347         PartialContainer when verifying CLS compliance.
2348         (AbstractPropertyEventMethod): Set Parent here, ...
2349         (PropertyMethod): ... not here.
2350
2351 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2352
2353         * attribute.cs : escaped attribute name should not be allowed to be
2354           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2355
2356 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2357
2358         Fix #75927.
2359         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2360         when converting a long constant to unsigned long.
2361         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2362         detect where IsApplicable and VerifyArgumentsCompat disagree.
2363
2364 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2365         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2366
2367         Fix #75848.
2368         * class.cs (TypeContainer.CanElideInitializer): New helper.
2369         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2370         can safely emitting the initializer of a field.
2371
2372 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2373
2374         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2375           allowed inside a switch (without loop). Fixed bug #75433.
2376
2377 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2378
2379         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2380         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2381
2382 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2383
2384         * driver.cs : kinda reverting the default encoding changes (not exact 
2385           revert since I noticed that "codepage:reset" might not work fine).
2386
2387 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2388
2389         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2390           Location. Now getter and setter store location correctly.
2391           (errors/cs0111-12.cs now reports the expected location.)
2392
2393 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2394
2395         * driver.cs : Use default encoding on the environment.
2396           Removed (now that) extra parameter for SeekableStreamReader.
2397         * support.cs : (SeekableStreamReader) third .ctor() argument for
2398           StreamReader is not required (always true). preamble size could
2399           be acquired in simpler and safe way.
2400
2401 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2402
2403         * cs-parser.jay: report CS0642 at warning level 3
2404           and report CS0642 for an if else statement also
2405           fixes bug #74745. Patch by John Luke (and a bit
2406           modified by me).
2407           Removed extra CS0642 warning check for "while",
2408           "for" and "fixed".
2409         * statement.cs: In Block.Resolve(), CS0642 check
2410           is reimplemented to check a sequence of an empty
2411           statement and a block.
2412
2413           Both fix bug #66777.
2414
2415 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2416
2417         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2418         detection until I fix it.
2419         
2420         * cs-tokenizer.cs: Changed error message.
2421         
2422         * cs-parser.jay: Fixed 2 error locations.
2423         
2424         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2425         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2426         properties.
2427         
2428         * enum.cs (GetSignatureForError): Fixed.
2429         
2430         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2431         method detection.
2432         
2433         * class.cs,
2434         * typemanager.cs (RegisterProperty): Removed.
2435         
2436         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2437
2438 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2439
2440         Fix #75874.
2441         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2442         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2443
2444 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2445
2446         * expression.cs : tiny fix is required for not warning positive ulong.
2447           See test-441.cs.
2448
2449 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2450
2451         * expression.cs : add CS0652 check for constant and integral
2452           expression. Fixed bug #53974.
2453
2454 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2455
2456         * expression.cs : in DoNumericPromotions(), check if there is implicit
2457           conversion overload for string (to check CS0034). Fixed bug #52492.
2458
2459 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2460
2461         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2462
2463 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2464
2465         * ecore.cs : report location when it is *not* Null.
2466
2467 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2468
2469         * codegen.cs,
2470           ecore.cs,
2471           flowanalysis.cs,
2472           expression.cs:
2473           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2474           correctly. Fixed bug #75721.
2475
2476 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2477
2478         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2479         loop that performs 'min (pos, char_count)'.
2480
2481         Fix #75862.
2482         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2483         converted value in Operator.OnesComplement.
2484
2485 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2486
2487         * anonymous.cs: If the anon method is pulled into a helper class,
2488         it needs to be `internal' not `private'. Fixes runtime behavior on
2489         msft. bug #75704
2490
2491 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2492
2493         Fix #75803
2494         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2495         is a partial class.
2496
2497 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2498
2499         The big constants rewrite
2500         Fix #75746, #75685 and more
2501         As a side effect saved 1MB for MWF ;-)
2502         
2503         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2504         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2505         enum based for corlib compilation.
2506         
2507         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2508         subtractions.
2509         
2510         * class.cs (FixedField.Define): Use ResolveAsConstant.
2511         
2512         * const.cs (IConstant): Interface constants and enums.
2513         (Const.ResolveValue): New method for constant resolvning.
2514         (ExternalConstant): Constants from imported assemblies.
2515         
2516         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2517         conversion; like enums.
2518         (Constant.ToType): Converts this constant to different type.
2519         (Constant.Increment): Adds 1.
2520         
2521         * convert.cs (ImplicitConversionRequired): Simplified.
2522         
2523         * cs-parser.jay: Create EnumMember directly.
2524         
2525         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2526         
2527         * doc.cs (GenerateEnumDocComment): Removed.
2528         
2529         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2530         (ConvertIntLiteral): Removed.
2531         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2532         
2533         * enum.cs (EnumMember): Implement IConstant.
2534         (Enum.IsValidEnumConstant): Removed.
2535         (Enum.GetNextDefaultValue): Removed.
2536         (Enum.FindMembers): Updated.
2537         (Enum.GenerateDocComment): Iterate enum members.
2538         
2539         * expression.cs (Cast.TryReduce): Handle enums correctly.
2540         (New.Constantify): Made public.
2541         (MemberAccess.DoResolve): Removed contant specific if(s).
2542         
2543         * literal.cs (NullLiteral): Implement new abstract methods.
2544         
2545         * statement.cs (GotoCase.Resolve): Use new constant methods.
2546         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2547         
2548         * typemanager.cs (LookupEnum): Removed.
2549         (IsEnumType): Fixed to work with corlib.
2550         (RegisterConstant): Removed.
2551         (LookupConstant): Removed.
2552         (GetConstant): Changed to work with IConstant.
2553
2554 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2555
2556         * location.cs : Fixed overflown (>255) column number.
2557
2558 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2559
2560         First cut of the qualified-alias-member feature.
2561         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2562         token.
2563         * cs-parser.jay (DOUBLE_COLON): New token.
2564         (namespace_or_type_name): Add rule for recognizing
2565         qualified-alias-members.
2566         (primary_expression): Likewise.
2567         (element_access): Allow QualifiedAliasMember as a possible
2568         type-bearing expression.
2569         (local_variable_type, local_variable_pointer_type): Likewise.
2570         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2571         aliases in the current and enclosing namespace declarations.
2572         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2573         * decl.cs (MemberName.is_double_colon): New.
2574         (MemberName.MemberName): Add new constructor for alias-member.
2575         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2576         * expression.cs (QualifiedAliasMember): New expression type.
2577
2578 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2579
2580         * location.cs : it borked when no argument was specified.
2581
2582 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2583
2584         * location.cs : tiny ToString() format fix.
2585
2586 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2587
2588         * statement.cs : oops, it was missing.
2589
2590 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2591
2592         A set of fixes for precise line/column location.
2593
2594         * location.cs :
2595           "token" field now holds a file/line "delta", a line number offset 
2596           from the segment, and a column number. See also:
2597           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2598           December/009508.html
2599           Removed static IsNull. Use instance IsNull property instead.
2600         * cs-tokenizer.cs :
2601           For some tokens it stores Location. For Identifier it stores
2602           LocatedToken which is a pair of string name and location.
2603           Column numbers are adjusted only at getChar().
2604         * report.cs :
2605           Use Location.ToString() for reporting (it now contains column).
2606         * cs-parser.jay :
2607           Largely modified to use LocatedToken instead of
2608           string (IDENTIFIER), and to acquire Location from some tokens.
2609         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2610           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2611           codegen.cs :
2612           Now MemberName holds Location. DeclSpace.ctor() receives Location
2613           as a parameter. Removed extra parameters to all derived classes.
2614           Replaced Location.IsNull() with instance property.
2615         * assign.cs, expression.cs :
2616           Added .ctor() overload that omits Location.
2617         * attribute.cs :
2618           Added "nameEscaped" flag that indicates the identifier was escaped
2619           in the source file. This fixes bug #57047.
2620
2621 2005-09-02  Martin Baulig  <martin@ximian.com>
2622
2623         * class.cs: Make CS3005 a warning, not an error.
2624
2625 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2626
2627         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2628         New method, looking for lo-case imported cls type.
2629
2630         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2631         here.
2632
2633         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2634
2635         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2636
2637         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2638         all_imported_types.
2639         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2640
2641         Optimized to save 3.5 MB for SWF compilation.
2642
2643 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2644
2645         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2646         (PartialContainer.Create): Moved logic AddToContainer.
2647         (PartialContainer.MarkForDuplicationCheck): Shares name.
2648         
2649         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2650         place.
2651         
2652         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2653         initialization.
2654         (Namespace.GetSignatureForError): New method.
2655         
2656         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2657         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2658
2659 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2660
2661         Fix #75669.
2662         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2663         member lookup rather than qualifier_type, since qualifier_type can
2664         be null.
2665
2666 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2667
2668         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2669         enum member.
2670
2671 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2672
2673         * statement.cs: Copy the local exception into the exception
2674         captured local.  Fixes 75674
2675
2676 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2677
2678         Fix #75658.
2679         * expression.cs (Invocation.OverloadResolve): Don't report error
2680         CS1501 if error CS1502 has been reported.
2681         (New.DoResolve): Delegate CS1501 reporting to
2682         Invocation.OverloadResolve.
2683
2684         Fix #75656.
2685         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2686         invariant-meaning-in-block property in an enclosing block if
2687         necessary.
2688
2689 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2690
2691         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2692         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2693         (Switch.CheckSwitch): Just save 50kb for SWF.
2694
2695 2005-07-27  Martin Baulig  <martin@ximian.com>
2696
2697         * anonymous.cs (CaptureContext.AddField): Added
2698         `AnonymousContainer am' argument; compute its toplevel scope if
2699         it's not already computed.  Fixes #75649.
2700
2701 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2702
2703         Fix #75628.
2704         * class.cs (Constructor.Emit): Reset block to null if the block
2705         resolve fails.
2706
2707 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2708
2709         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2710
2711 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2712
2713         * class.cs (MethodData.Define): Check whether accessor implementing
2714         interface is public.
2715
2716         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2717
2718 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2719
2720         Fix #57245
2721         * namespace.cs (LookupType): Moved same type check to...
2722         
2723         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2724         with the same name.
2725
2726 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2727
2728         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2729         already found a typebuilder.
2730         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2731         MemberNames, not strings.
2732
2733         * const.cs (Error_ExpressionMustBeConst): 
2734         Rename from Error_EpressionMustBeConst.
2735         * const.cs, class.cs, statement.cd: Update.
2736
2737 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2738
2739         Fix #65573
2740
2741         * const.cs (Const.LookupConstantValue): Report missing contant expression
2742         everytime.
2743         (Error_EpressionMustBeConstant): Only one error method.
2744
2745         * class.cs, statement.c: Updated.
2746
2747 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2748
2749         * statement.cs (Block.Flags): Add back HasVarargs.
2750         (Block.flags): Make protected.
2751         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2752
2753         * typemanager.cs (types, typecontainers, user_types): Remove.
2754         (UserTypes, TypeContainers): Likewise.
2755         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2756         (CleanUp, Reset): Update.
2757         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2758         (GetNestedType): Use Type.GetNestedType.
2759         (CoreLookupType): Take two arguments, the namespace and the
2760         basename of the type.  Update to use the Namespace.Lookup
2761         mechanism.
2762         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2763         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2764         string concatenation and substring matches.
2765         * class.cs, enum.cs, delegate.cs: Update to changes.
2766
2767 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2768
2769         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2770         Expression and made virtual.
2771
2772         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2773         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2774
2775         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2776
2777         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2778         error message.
2779
2780         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2781         change.
2782
2783 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2784
2785         Fix #57707
2786         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2787         AssemblyCultureAttribute is not used on executable.
2788
2789         * rootcontext.cs,
2790         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2791
2792 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2793
2794         Fix #60638.
2795         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2796         New.  Reports CS0252/CS0253.
2797         Mostly taken from preliminary patch by Duncak Mak.
2798         (Binary.DoResolveOperator): Store results of operator lookup.
2799         Use them to detect if we need to warn about unintended reference
2800         comparisons.
2801
2802 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2803
2804         Fix #72969.
2805         * namespace.cs (Namespace.Lookup): Add back location parameter.
2806         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2807         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2808
2809         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2810         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2811         (Namespace.LookupType): ... this.
2812         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2813         of namespaces.
2814         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2815         purported to handle pointers.
2816         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2817         CoreLookupType.
2818
2819 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2820
2821         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2822         type as namespace.
2823
2824 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2825
2826         * namespace.cs (Namespace.Lookup): Drop location parameter.
2827         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2828         (NamespaceEntry.Lookup): ... this.
2829         (NamespaceEntry.Error_AmbiguousTypeReference):
2830         Move here from DeclSpace.
2831         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2832         names ...
2833         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2834         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2835         Move to NamespaceEntry.
2836         * delegate.cs, expression.cs: Update to changes.
2837
2838 2005-08-31  Martin Baulig  <martin@ximian.com>
2839
2840         Committing a patch from Atsushi Enomoto for #75850.
2841
2842         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2843         Prefer a generic enumerator over a non-generic one.
2844
2845 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2846
2847         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2848         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2849
2850 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2851
2852         * driver.cs : reverting default encoding change as well as mcs.
2853
2854 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2855
2856         * driver.cs, support.cs : merged r48826.
2857           Marek Safer wrote:
2858           > could you integrate your mcs changes to gmcs otherwise
2859           > gmcs cannot compile some files.
2860
2861 2005-08-20  Martin Baulig  <martin@ximian.com>
2862
2863         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2864         scope if we don't already have it.
2865
2866         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2867         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2868         fixes #75867.
2869
2870 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2871
2872         * statement.cs: Copy the local exception into the exception
2873         captured local.  Fixes 75674
2874
2875 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2876
2877         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2878         type as namespace.
2879
2880 2005-08-12  Martin Baulig  <martin@ximian.com>
2881
2882         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2883         for nested types here to avoid hitting the cache too early.
2884
2885 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2886
2887         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2888         an error. 
2889
2890 2005-08-03  Martin Baulig  <martin@ximian.com>
2891
2892         Make iterators in generic methods work; see gtest-191.cs.
2893
2894         * generic.cs
2895         (Constraints.Resolve): Protect against being called twice.
2896
2897         * class.cs
2898         (TypeContainer.GetClassBases): Make this `protected virtual'.
2899
2900         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2901         (Iterator.GetClassBases): Override this and compute the base
2902         classes here.
2903         (Iterator.DefineNestedTypes): If we're a generic method, all our
2904         method type parameters become class type parameters on the proxy
2905         class.
2906
2907         * statement.cs
2908         (ToplevelBlock.Parameters): Make this a property, not a field.
2909         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2910
2911 2005-08-03  Martin Baulig  <martin@ximian.com>
2912
2913         * typemanager.cs (TypeManager.IsSubclassOf): Use
2914         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2915         (TypeManager.GetFullName_recursed): Improved.
2916
2917 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2918
2919         Fix #75417
2920         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2921         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2922         invocation_type == mi.DeclaringType, since the first one also checks
2923         other condition used by generic instances.
2924         
2925 2005-07-27  Martin Baulig  <martin@ximian.com>
2926
2927         * anonymous.cs (CaptureContext.AddField): Added
2928         `AnonymousContainer am' argument; compute its toplevel scope if
2929         it's not already computed.  Fixes #75649.
2930
2931 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2932
2933         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2934         CheckAttributeType and refactored.
2935         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2936         ResolveAsTypeTerminal error handling.
2937         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2938         handling.
2939         (GetSignatureForError): Print errors in same way.
2940
2941         * class.cs,
2942         * codegen.cs: Reflect attribute GetSignatureForError change.
2943
2944         * ecore.cs,
2945         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2946
2947         * namespace.cs (UsingEntry): Refactored to make fields private.
2948
2949         * assign.cs,
2950         statement.cs: Error_UnexpectedKind has extra parameter.
2951
2952 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2953
2954         * ecore.cs (IAlias): Remove.
2955         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2956         that implement the interface.
2957         * namespace.cs (Namespace): Likewise.
2958         (Namespace.declspaces): Renamed from 'defined_names'.
2959         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2960         DeclSpace instead of an IAlias.
2961         * tree.cs (Tree.AddDecl): Update.
2962
2963 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2964
2965         * statement.cs (Block.Flags); Remove HasVarargs.
2966         (Block.HasVarargs): Move to ToplevelBlock.
2967         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2968         (Block.Variables): Make protected.  Initialize variable hashtable
2969         if necessary.
2970         (Block.AddVariable): Update.
2971         (Block.Resolve): Update to changes.
2972         (ToplevelBlock.HasVarargs): New boolean.
2973         (ToplevelBlock.ThisVariable): Move here from Block.
2974         (ToplevelBlock.AddThisVariable): Likewise.
2975         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2976         * expression.cs (This.ResolveBase): Update to changes.
2977         (ArglistAccess.DoResolve): Likewise.
2978
2979 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2980
2981         Fix #75321
2982         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2983
2984         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2985         not used and not used & assigned.
2986         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2987
2988 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2989
2990         Fix #75053
2991         * expression.cs (Is.DoResolve): null is never provided type.
2992
2993 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2994
2995         Fix #52496
2996         * cs-parser.jay: Less strict event error rule to catch more errors.
2997
2998 2005-07-11  Martin Baulig  <martin@ximian.com>
2999
3000         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3001         for the constructor constraint: we do not only have to check
3002         whether the class has a public constructor, but also ensure that
3003         it's parameterless.  Fixes #75492.
3004
3005 2005-07-11  Martin Baulig  <martin@ximian.com>
3006
3007         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3008         between type parameters if they either have the reference type
3009         constraint or the class constraint.
3010
3011 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3012
3013         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3014
3015 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3016
3017         Fix #74975
3018         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3019         (ExtractSecurityPermissionSet): Cope with self referencing security
3020         attributes properly.
3021
3022         * driver.cs (SetOutputFile): Made public property OutputFile.
3023
3024 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3025
3026         Fix #75486.
3027         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3028         has_nonstatic_fields.  Make into a FieldBase pointer.
3029         (TypeContainer.AddField): Add CS0282 check.
3030         (TypeContainer.EmitType): Update.
3031
3032 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3033
3034         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3035         compare if they start with __.
3036
3037 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3038
3039         * statement.cs (Switch.SwitchGoverningType): Only look at
3040         UserCasts that don't need implicit standard conversions to one of
3041         the allowed switch types (Fixes test-322.cs).
3042         (LocalInfo.Resolve): Re-enable sanity-test.
3043
3044 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3045
3046         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3047         
3048         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3049         
3050         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3051
3052 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3053
3054         Fix #75472.
3055         * ecore.cs (SimpleName.GetSignatureForError): Add.
3056         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3057         (MemberAccess.GetSignatureForError): Add.
3058
3059 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3060  
3061         The big error and warning messages review.
3062         
3063         * anonymous.cs,
3064         * assign.cs,
3065         * attribute.cs,
3066         * class.cs,
3067         * codegen.cs,
3068         * convert.cs,
3069         * cs-parser.jay,
3070         * cs-tokenizer.cs,
3071         * decl.cs,
3072         * delegate.cs,
3073         * doc.cs,
3074         * driver.cs,
3075         * ecore.cs,
3076         * enum.cs,
3077         * expression.cs,
3078         * flowanalysis.cs,
3079         * iterators.cs,
3080         * literal.cs,
3081         * location.cs,
3082         * modifiers.cs,
3083         * namespace.cs,
3084         * parameter.cs,
3085         * pending.cs,
3086         * report.cs,
3087         * rootcontext.cs,
3088         * statement.cs,
3089         * support.cs,
3090         * tree.cs,
3091         * typemanager.cs: Updated.
3092         
3093         * class.cs: (MethodCore.SetYields): Moved here to share.
3094         (PropertyMethod.Define): Moved iterator setup here.
3095         
3096         * iterators.cs: Add orig_method to have full access to parent
3097         container.
3098
3099 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3100
3101         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3102         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3103         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3104         variable of struct type.
3105         * expression.cs (Unary.ResolveOperator): Update to change.
3106         (Indirection.VerifyFixed): Likewise.
3107         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3108         (ParameterReference.VerifyFixed): Value parameters are fixed.
3109         (This.VerifyFixed): Treat 'this' as a value parameter.
3110         * statement.cs (LocalInfo.IsFixed): Remove.
3111
3112 2005-07-01  Martin Baulig  <martin@ximian.com>
3113
3114         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3115         `ec.EmitThis ()' to get the correct scope.
3116
3117 2005-07-01  Martin Baulig  <martin@ximian.com>
3118
3119         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3120         instance is a ParameterReference; fixes #75299.
3121
3122 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3123
3124         Fix #75412.
3125         * expression.cs (Indexers.map): Remove.
3126         (Indexers.Append): Filter out inaccessible setters and getters.
3127         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3128
3129         Fix #75283.
3130         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3131         Refactored from ...
3132         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3133         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3134         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3135         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3136
3137 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3138
3139         Fix #75322
3140         * class.cs (FieldBase.GetInitializerExpression): One more field
3141         for backup.
3142
3143 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3144
3145         * pending.cs: Do not define a proxy if the base method is virtual,
3146         it will be picked up by the runtime (bug 75270).
3147
3148 2005-07-08  Martin Baulig  <martin@ximian.com>
3149
3150         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3151         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3152
3153 2005-07-07  Martin Baulig  <martin@ximian.com>
3154
3155         * generic.cs (ConstructedType.CheckConstraint): Use
3156         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3157         called recursively; fixes #75329.
3158
3159 2005-07-06  Martin Baulig  <martin@ximian.com>
3160
3161         * generic.cs (TypeManager.InferTypeArguments): Added support for
3162         anonymous methods; fixes #75461.
3163
3164 2005-07-01  Martin Baulig  <martin@ximian.com>
3165
3166         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3167         `ec.EmitThis ()' to get the correct scope.
3168
3169 2005-07-01  Martin Baulig  <martin@ximian.com>
3170
3171         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3172         instance is `This'; fixes #75299.
3173
3174 2005-06-30  Martin Baulig  <martin@ximian.com>
3175
3176         * class.cs (Indexer): Implement IIteratorContainer; added support
3177         for iterators in indexers.
3178
3179         * codegen.cs
3180         (EmitContext.CurrentIterator): Make this a property, not a field.
3181
3182         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3183
3184 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3185
3186         * pending.cs: Do not define a proxy if the base method is virtual,
3187         it will be picked up by the runtime (bug 75270).
3188
3189 2005-06-28  Martin Baulig  <martin@ximian.com>
3190
3191         * cs-parser.jay (interface_method_declaration): Avoid a
3192         reduce/reduce conflict by moving some of the code into a separate
3193         `interface_method_declaration_body' rule; fixes #75368.
3194
3195 2005-06-28  Martin Baulig  <martin@ximian.com>
3196
3197         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3198         array check after the check for TypeBuilder's.
3199
3200 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3201
3202         * convert.cs (FindMostEncompassedType): Add two trivial special
3203         cases (number_of_types == 0 || number_of_types == 1).
3204         (FindMostEncompasingType): Likewise.
3205
3206 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3207
3208         Some cleanups preparing for the fix of #75283.
3209         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3210         error testing.
3211         (EventExpr.InstanceResolve): Likewise.
3212         (EventExpr.DoResolve): Remove redundant checks.
3213
3214 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3215
3216         * class.cs: Small fix.
3217
3218 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3219
3220         Fix #75160.
3221         * class.cs (GetPartialBases): Fix return value check of
3222         part.GetClassBases.
3223
3224 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3225
3226         Ensure that partial classes are registered in their enclosing
3227         namespace.  Initial part of fix of #75160.
3228         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3229         Register declspace with namespace here, not in
3230         DeclSpace.RecordDecl.
3231         * cs-parser.jay: Pass namespace to RecordDecl.
3232         * class.cs (PartialContainer.Create): Likewise.
3233         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3234         called.
3235         * decl.cs (Declspace.RecordDecl): Remove.
3236         * namespace.cs (NamespaceEntry.DefineName): Remove.
3237
3238 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3239
3240         * rootcontext.cs: Reset TargetExt as well.
3241
3242 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3243
3244         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3245         -langversion:ISO-1.
3246
3247 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3248
3249         Fix #75080, cs0119.cs.
3250         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3251         of ...
3252         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3253         allowing ExprClass.Type and ExprClass.Namespace for
3254         ResolveFlags.VariableOrValue.
3255         (Expression.Resolve) [1-argument variant]: Change default resolve
3256         flags based on language version.
3257         (Expression.Error_UnexpectedKind): Use a simple string array
3258         rather than an ArrayList.
3259         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3260         not ExprClass.Type.
3261         (TypeOfVoid.DoResolve): Likewise.
3262         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3263         flags argument -- it always has the same value.
3264
3265 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3266
3267         Fix #75081.
3268         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3269         Use it in the error message.
3270         * assign.cs, expression.cs, statement.cs: Update.
3271
3272 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3273
3274         Fix #75088.
3275         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3276         the "almostMatchedMember" case too.
3277         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3278         that failed the accessibility checks to 'almost_match'.
3279
3280 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3281
3282         * attribute.cs: Use internal MethodBuilder methods to set
3283         ExactSpelling and SetLastError on PInvoke methods, instead
3284         of passing them via charset.  Fixes #75060.
3285
3286 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3287
3288         * parameter.cs (Parameter): Remove TODO comment.
3289         (Parameter.DefineParameter): Remove Location parameter.
3290         (Parameters.LabelParameters): Likewise.
3291         * class.cs (Constructor.Emit): Update to change.
3292         (MethodData.Emit): Likewise.
3293         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3294         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3295
3296 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3297
3298         * parameter.cs,
3299           Removed Parameters.Location and added Parameter.Location instead.
3300           Removed Location parameter from Emit() and GetSignature().
3301         * anonymous.cs,
3302           class.cs,
3303           cs-parser.jay,
3304           delegate.cs,
3305           iterators.cs,
3306           statement.cs :
3307           Modified all related calls.
3308
3309 2005-06-21  Martin Baulig  <martin@ximian.com>
3310
3311         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3312         left-hand side is not a nullable type; fixes #75328.
3313
3314 2005-06-21  Martin Baulig  <martin@ximian.com>
3315
3316         * typemanager.cs
3317         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3318         (TypeManager.GetFullNameSignature): Likewise.
3319
3320         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3321         `source.FullName' and `target.FullName' to check whether there are
3322         two conflicting definitions.
3323
3324 2005-06-21  Martin Baulig  <martin@ximian.com>
3325
3326         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3327         a BoxedCast - also for reference types - to be compatible with csc.
3328
3329 2005-06-21  Martin Baulig  <martin@ximian.com>
3330
3331         * expression.cs (MemberAccess.DoResolve): Add support for nested
3332         types in a generic instance; fixes #75320.
3333
3334 2005-06-20  Martin Baulig  <martin@ximian.com>
3335
3336         * generic.cs (TypeManager.InferType): Also walk the class
3337         hierarchy for generic instances; fixes #75261.
3338
3339 2005-06-17  Martin Baulig  <martin@ximian.com>
3340
3341         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3342         to make things work for corlib.
3343
3344 2005-06-15  Martin Baulig  <martin@ximian.com>
3345
3346         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3347         obsolete `SecurityAction' values.
3348
3349 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3350
3351         * rootcontext.cs: Reset TargetExt as well.
3352         
3353 2005-06-09  Martin Baulig  <martin@ximian.com>
3354
3355         * delegate.cs (Delegate.VerifyMethod): Added
3356         `MethodGroupExpr old_mg' argument; inherit its
3357         `HasTypeParameters'; fix #75085.
3358
3359 2005-06-09  Martin Baulig  <martin@ximian.com>
3360
3361         * expression.cs (Invocation.OverloadResolve): Correctly handle
3362         generic methods for the SetMemberIsUsed(); fix #75064.
3363
3364 2005-06-09  Martin Baulig  <martin@ximian.com>
3365
3366         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3367         fixes #75062.
3368
3369 2005-06-08  Martin Baulig  <martin@ximian.com>
3370
3371         * cs-parser.jay (nullable_type_or_conditional): If we put the
3372         nullable back and our `type' is a `ComposedCast', remove the
3373         nullable from it.  Fixes #75156.
3374
3375         * expression.cs (ComposedCast.RemoveNullable): New public method.
3376
3377 2005-06-08  Martin Baulig  <martin@ximian.com>
3378
3379         The big Iterators rewrite :-)
3380
3381         * iterators.cs: Rewrite this to use the anonymous methods framework.
3382
3383         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3384         before the TypeContainers; see 2test-21.cs.
3385
3386         * class.cs
3387         (TypeContainer.DefineType): Don't create a new EmitContext if we
3388         already have one (this only happens if we're an Iterator).
3389         (TypeContainer.Define): Also call Define() on all our iterators.
3390         (Method.CreateEmitContext): Added support for iterators.
3391
3392         * anonymous.cs
3393         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3394         (AnonymousContainer.CreateMethodHost): Moved here from
3395         AnonymousMethod and made abstract.
3396         (AnonymousContainer.CreateScopeType): New abstract method.
3397         (AnonymousContainer.IsIterator): New public property.
3398         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3399         get the ScopeTypeBuilder rather than manually defining it here. 
3400         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3401         iterators here.
3402
3403         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3404         before RootContext.DefineTypes().
3405
3406         * codegen.cs (EmitContext.RemapToProxy): Removed.
3407         (EmitContext.CurrentAnonymousMethod): Changed type from
3408         AnonymousMethod -> AnonymousContainer.
3409         (EmitContext.ResolveTopBlock): Protect from being called twice.
3410         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3411         (EmitContext.EmitThis): Removed the iterators hacks; use the
3412         anonymous methods framework for that.
3413
3414         * statement.cs
3415         (ToplevelBlock.Container): Make this a property, not a field.
3416         (ToplevelBlock.ReParent): New public method; move the
3417         ToplevelBlock into a new container.
3418         (Foreach.TemporaryVariable): Simplify.
3419
3420 2005-06-05  Martin Baulig  <martin@ximian.com>
3421
3422         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3423         (Block.AddTemporaryVariable): New public method; creates a new
3424         `LocalInfo' for a temporary variable.
3425         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3426         variables here.
3427         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3428         non-iterator variables.
3429
3430 2005-06-05  Martin Baulig  <martin@ximian.com>
3431
3432         * statement.cs (Foreach.TemporaryVariable): Create the
3433         LocalBuilder in the Emit phase and not in Resolve since in some
3434         situations, we don't have an ILGenerator during Resolve; see
3435         2test-19.cs for an example.
3436
3437 2005-06-04  Martin Baulig  <martin@ximian.com>
3438
3439         The big Foreach rewrite - Part II.
3440
3441         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3442         with `PropertyInfo ienumerator_getcurrent'.
3443
3444         * codegen.cs (VariableStorage): Removed.
3445
3446         * statement.cs
3447         (Foreach): Derive from Statement, not ExceptionStatement.
3448         (Foreach.CollectionForeach): New nested class.  Moved all the code
3449         dealing with collection foreach here.
3450         (Foreach.ForeachHelperMethods): Removed.
3451         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3452
3453 2005-05-23  Martin Baulig  <martin@ximian.com>
3454
3455         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3456         don't need to.  Fix #75014.
3457
3458 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3459
3460         Improve user-defined conversion handling.
3461         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3462         applicable operators.
3463         (AddConversionOperators): New.  Helper for GetConversionOperators.
3464         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3465         there is only one most encompassed/encompassing type.
3466         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3467         "applicable operator" handling.
3468         (UserConversion): Move cache here from GetConversionOperators.
3469         Directly cache the chosen operator, rather than the whole
3470         MethodGroup.
3471         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3472         case.  Allow conversion of decimal to sbyte and byte too.
3473         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3474         New static methods.  Used to avoid allocating EmptyExpressions in
3475         convert.cs.
3476
3477 2005-05-24  Duncan Mak  <duncan@novell.com>
3478
3479         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3480         another class, used in Convert.ExplicitNumericConversion.
3481         (CastToDecimal): New class, similar to above, but casts to
3482         System.Decimal, used in Convert.ImplicitNumericConversion and also
3483         in explicit convesion from double/float to decimal.
3484
3485         * convert.cs (ImplicitNumericConversion): Handle implicit
3486         conversions to System.Decimal.
3487         (ExplicitNumericConversion): handle explicit conversions to
3488         System.Decimal.
3489
3490         This fixes #68711.
3491         
3492 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3493
3494         * typemanager.cs: Do not throw an exception in the TypeBuilder
3495         case, we take care of it on the TypeCode.
3496
3497 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3498         
3499         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3500         is back.
3501         
3502         * cs-parser.jay: Catch more lexical errors.
3503         
3504         * report.cs: Add one more Error method.
3505         
3506         * rootcontext.cs,
3507         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3508
3509 2005-05-20  Martin Baulig  <martin@ximian.com>
3510
3511         * class.cs (TypeContainer.CircularDepException): Removed.
3512         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3513         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3514         (CS0146) and interface (CS0529) dependencies here.
3515
3516 2005-05-20  Martin Baulig  <martin@ximian.com>
3517
3518         * expression.cs (New.DoResolve): Move the CS0712 check above the
3519         CS0144 check; otherwise it can never be reached.
3520
3521 2005-05-20  Martin Baulig  <martin@ximian.com>
3522
3523         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3524
3525 2005-05-20  Martin Baulig  <martin@ximian.com>
3526
3527         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3528
3529         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3530
3531 2005-05-19  Martin Baulig  <martin@ximian.com>
3532
3533         * delegate.cs
3534         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3535         to disable error reporting.
3536
3537         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3538         here since we don't want to report an error; see the new test-336.cs.
3539
3540 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3541
3542         * statement.cs (ToplevelBlock.GetParameterReference)
3543         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3544         Move here from class Block.
3545         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3546         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3547
3548 2005-05-18  Martin Baulig  <martin@ximian.com>
3549
3550         Fix #74978.
3551
3552         * flowanalysis.cs
3553         (FlowBranching.Reachability): Add non-static public And() and Or()
3554         methods.
3555         (FlowBranchingSwitch): New class; do the `break_origins' thing
3556         like in FlowBranchingLoop.
3557         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3558         reachability, not just locals and parameters.
3559         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3560         switch; MergeBreakOrigins() now takes care of that.
3561
3562 2005-05-18  Martin Baulig  <martin@ximian.com>
3563
3564         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3565         a loop and may leave it, reset the barrier; fixes #74974.
3566
3567 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3568
3569         Fix test-382.cs.  Emit values of decimal constants.
3570         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3571         Carved out of ...
3572         (TypeContainer.AddField): ... this.
3573         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3574         with initializers to include 'Const's.
3575         (ClassPart.RegisterFieldForInitialization): Forward to
3576         PartialContainer.
3577         * const.cs (Const.Const): Pass initializer to base class.
3578         (Const.Define): In case of decimal constants, register them for
3579         initialization in a static constructor.
3580
3581 2005-05-14  Martin Baulig  <martin@ximian.com>
3582
3583         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3584         do not call ResolveUnreachable() on unreachable statements in
3585         here, see the comment in the source code.
3586
3587 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3588
3589         Fix #74934.
3590         * expression.cs (BinaryResolveOperator): If one of the operands of
3591         an equality comparison is 'null' and the other is a pointer type,
3592         convert the null to a NullPointer.
3593         * convert.cs (ImplicitReferenceConversion): If the expression is a
3594         NullLiteral and the target type is a pointer type, return a
3595         NullPointer instead.
3596         (ImplicitConversionStandard): Likewise.
3597
3598 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3599         
3600         * cs-parser.jay: Set readonly context based on special constructs.
3601         
3602         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3603         readonly variable error handling.
3604         
3605         * rootcontext.cs (EmitCode): Don't verify members when error
3606         occurred.
3607         
3608         * statement.cs (LocalInfo): Add reaodnly context information.
3609         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3610
3611 2005-05-17  Martin Baulig  <martin@ximian.com>
3612
3613         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3614         #70970. 
3615
3616 2005-05-13  Martin Baulig  <martin@ximian.com>
3617
3618         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3619         handle unreachable blocks.
3620
3621 2005-05-13  Martin Baulig  <martin@ximian.com>
3622
3623         * class.cs
3624         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3625         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3626         #74905. 
3627
3628 2005-05-13  Martin Baulig  <martin@ximian.com>
3629
3630         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3631         instance variable, not a local.  Fix #74873.
3632         (Block.ResolveUnreachable): Set it to true here.
3633
3634 2005-05-12  Martin Baulig  <martin@ximian.com>
3635
3636         * cs-parser.jay (property_declaration): Pass the `current_class',
3637         not the `current_container' to Property's .ctor.  Fixes #74912.
3638
3639 2005-05-11  Martin Baulig  <martin@ximian.com>
3640
3641         * typemanager.cs (Closure): Copy this from MCS and merge all the
3642         GMCS-specific changes into it.
3643
3644 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3645
3646         Fix #74920.
3647         * typemanager.cs (unmanaged_enclosing_types): New.
3648         (IsUnmanagedType): Avoid infloops by using
3649         'unmanaged_enclosing_types' to talk with recursive invocations.
3650
3651 2005-05-11  Duncan Mak  <duncan@novell.com>
3652
3653         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3654         continuing to process for 'arg'.
3655         (handle_preprocessing_directive): Check the argument of the #endif
3656         directive and report error CS1025 if there are any trailing
3657         characters.
3658
3659         According to the C# spec, having even whitespace after the #endif
3660         directive is illegal; however, because we call arg.TrimEnd ()
3661         beforehand, we have the same behavior as csc, allowing whitespace
3662         after the directive.
3663
3664         Fixes #74892.
3665
3666 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3667
3668         Fix #74863.
3669         
3670         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3671         (Constructor.GetObsoleteAttribute): Implemented correctly.
3672
3673 2005-05-10  Martin Baulig  <martin@ximian.com>
3674
3675         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3676         resolve the type; fixes #74864.
3677         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3678         in DoResolve(); fixes #74862.
3679
3680 2005-05-10  Martin Baulig  <martin@ximian.com>
3681
3682         * support.cs (ReflectionParameters.ParameterModifier): Use
3683         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3684         and `ParameterAttributes.In'.  Fixes #74884.
3685
3686 2005-05-10  Martin Baulig  <martin@ximian.com>
3687
3688         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3689         the cache if we're just looking for `MemberTypes.NestedType' in a
3690         generic instance.
3691
3692         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3693         constraints if we're still resolving the type tree.
3694         (Expression.MemberLookup): If we're resolving the type tree, only
3695         look for `MemberTypes.NestedType' since we're only interested in
3696         getting types.
3697
3698         * class.cs (TypeContainer.DefineType): Don't resolve the type
3699         parameters here; do this later in ResolveType() after the type
3700         tree has been resolved.
3701         (TypeContainer.ResolveType): New public method; this is called
3702         after the type tree is resolved and before the types are being
3703         populated.  We resolve the generic constraints here.
3704         (TypeContainer.DoDefineMember): Check the constraints on our base
3705         class and interfaces.
3706
3707         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3708         set the `ResolvingTypeTree' flag on the EmitContext.
3709
3710         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3711
3712 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3713
3714         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3715         
3716         * expression.cs (Argument.GetParameterModifier): Turned to property.
3717         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3718         
3719         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3720         its C# equivalent.
3721         
3722 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3723
3724         Fix #74852.
3725         * decl.cs (MemberCache.AddMethods): Register override methods,
3726         rather than non-override methods.
3727         * typemanager.cs (RegisterOverride): New.
3728         (IsOverride): Update.
3729
3730 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3731
3732         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3733
3734 2005-05-06  Martin Baulig  <martin@ximian.com>
3735
3736         * attribute.cs
3737         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3738         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3739
3740 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3741
3742         Fix #73105.
3743         
3744         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3745         recursive declaration.
3746         
3747         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3748         
3749 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3750
3751         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3752         
3753         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3754
3755 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3756
3757         Fix #74797.
3758         * decl.cs (DeclSpace.FamilyAccessible): 
3759         Use TypeManager.IsNestedFamilyAccessible.
3760
3761         Fix reopened #64812.
3762         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3763         internal'.
3764
3765 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3766             Abin Thomas  <projectmonokochi@rediffmail.com>
3767             Anoob V E  <projectmonokochi@rediffmail.com>
3768             Harilal P R  <projectmonokochi@rediffmail.com>
3769
3770         Fix #64812.
3771         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3772         allow access to all static members.
3773
3774 2005-05-04  Martin Baulig  <martin@ximian.com>
3775
3776         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3777
3778 2005-05-04  Martin Baulig  <martin@ximian.com>
3779
3780         Fix #74655.
3781
3782         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3783         section at the end; make things work if `default' is not the last
3784         section.        
3785
3786 2005-05-04  Martin Baulig  <martin@ximian.com>
3787
3788         Fix #70400.
3789
3790         * statement.cs (Switch): Replaced the `got_default' field with a
3791         `default_section' one.
3792         (Switch.CheckSwitch): Set `default_section' here.
3793         (Switch.Resolve): If we're a constant switch and the constant is
3794         not found, use the default section.
3795
3796 2005-05-03  Martin Baulig  <martin@ximian.com>
3797
3798         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3799
3800         * statement.cs (Foreach.ArrayForeach): New nested class.
3801         (Foreach.TemporaryVariable): New nested class.
3802         (Foreach.EmitArrayForeach): Removed; this is now in the new
3803         ArrayForeach class.
3804
3805 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3806
3807         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3808         more conservative.
3809         (VerifyPendingMethods): Revert change below.
3810
3811         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3812         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3813         that used to trigger warning -28.  Remove warning -28.
3814         * expression.cs (Invocation.OverloadResolve): Use
3815         TypeManager.IsOverride to distinguish override methods.
3816
3817         Fix #74773.
3818         * pending.cs (VerifyPendingMethods): If a base type implements the
3819         requested interface, don't bother checking individual methods of
3820         the base type.  As a side-effect, this prevents the creation of
3821         unnecessary proxies.
3822
3823 2005-05-02  Martin Baulig  <martin@ximian.com>
3824
3825         Fix #70182.
3826
3827         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3828         Also `And' the locals if the old vector is null.
3829         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3830         null; in this case we basically reset all the variables.        
3831
3832 2005-05-02  Martin Baulig  <martin@ximian.com>
3833
3834         Fix #74529.
3835
3836         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3837         Added `FlowBranching branching' argument; always `and' the
3838         variables instead of `or'ing them unless we're an infinite loop.
3839
3840         * statement.cs (While.Resolve): Create a new sibling unless we're
3841         infinite.       
3842
3843 2005-05-02  Martin Baulig  <martin@ximian.com>
3844
3845         Fix #70140.
3846
3847         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3848         arguments; use it instead of creating a new TopLevelBlock.
3849         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3850         our ConstructorInitializer.
3851
3852         * statement.cs
3853         (TopLevelBlock.TopLevelBranching): New public property.
3854         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3855         and create our `TopLevelBranching'.
3856
3857         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3858         anonymous method host, use `block.TopLevelBranching' rather than
3859         creating a new branching.
3860
3861 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3862
3863         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3864         a ScopeInfo, if any of the current children is a child of the new
3865         entry, move those children there.
3866
3867 2005-04-30  Martin Baulig  <martin@ximian.com>
3868
3869         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3870         at the beginning of a SwitchSection.  Fix #73335.
3871
3872 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3873
3874         Fix #74378
3875         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3876         
3877         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3878         (FieldExpr.DoResolve): Obsolete members are ignored for field
3879         initializers.
3880         
3881 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3882
3883         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3884         of arrays detection.
3885
3886         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3887         verification.
3888         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3889
3890         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3891         arrays report.
3892
3893 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3894
3895         * cs-parser.jay: Use the prefered version of -unsafe in error
3896         message.
3897
3898 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3899
3900         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3901         circumstances.
3902
3903 2005-04-20  John Luke  <john.luke@gmail.com>
3904
3905         * driver.cs: fix typo in error message, --outout to --output
3906
3907 2005-04-30  Martin Baulig  <martin@ximian.com>
3908
3909         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3910         handle the .NET 2.x security attributes.
3911
3912 2005-04-30  Martin Baulig  <martin@ximian.com>
3913
3914         * typemanager.cs
3915         (TypeManager.ExpandInterfaces): Don't add things twice.
3916
3917         * class.cs
3918         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3919
3920 2005-04-29  Martin Baulig  <martin@ximian.com>
3921
3922         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3923
3924         * anonymous.cs: Added support for anonymous generic methods.
3925
3926 2005-04-29  Martin Baulig  <martin@ximian.com>
3927
3928         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3929         generic instances.
3930
3931 2005-04-29  Martin Baulig  <martin@ximian.com>
3932
3933         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3934
3935         * expression.cs (New.DoResolve): Fix the CS0304 check.
3936
3937 2005-04-29  Martin Baulig  <martin@ximian.com>
3938
3939         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3940         naming schema.
3941
3942         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3943         explicit interface implementation, compare the interface types.
3944         (MethodData.Define): Use the new naming scheme from the latest
3945         .NET 2.x beta2.
3946         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3947
3948         * decl.cs (MemberName.GetMemberName): Removed.
3949         (MemberName.MethodName, FullName): New properties.
3950
3951 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3952
3953         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3954
3955 2005-04-22  Martin Baulig  <martin@ximian.com>
3956
3957         * generic.cs (GenericMethod): Create the EmitContext in the
3958         `Define()'; in `Define(MethodBuilder)', create the type parameters
3959         before calling `Define()'.  Fixes #73933.
3960
3961 2005-04-22  Martin Baulig  <martin@ximian.com>
3962
3963         * generic.cs
3964         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3965         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3966
3967         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3968         ConstructedType, check its constraints.
3969
3970 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3971
3972         * codegen.cs (InRefOutArgumentResolving): New field.
3973         
3974         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3975         fields outside contructor.
3976         
3977         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3978         
3979 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3980
3981         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3982         parameter code was not completed ever, so it was not as up-to-date
3983         as local variables.  Must finish it.
3984
3985         The bug fix was to compare the Toplevel of the block, not the
3986         current block.  Thanks for Ben for pointing this out. 
3987
3988 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3989
3990         * decl.cs (AddMethods): Use the declaring type of the problem
3991         method to determine if we want to squash a warning.
3992
3993 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3994
3995         * attribute.cs: Removed debug output.
3996
3997         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3998         
3999         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4000         Report.Stderr.
4001         
4002 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4003
4004         Fix #74481.
4005         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4006         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4007         all null comparisons against reference types.
4008
4009 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4010
4011         Fix# 74565
4012         * class.cs (TypeContainer.CircularDepException) New nested
4013         exception class.
4014         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4015         (TypeContainer.DefineType): Removed error, reset InTransit before
4016         exit.
4017         (Class.DefineType): Throw exception when is in Transit.
4018         Catch exception and report error.
4019         (Struct.DefineType): Throw exception when is in Transit.
4020         Catch exception and report error.
4021         (Interface.DefineType): Throw exception when is in Transit.
4022         Catch exception and report error.
4023
4024         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4025         handle nested exception handlers.
4026
4027         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4028         a catch.
4029
4030         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4031         InFinally and InCatch storage.
4032
4033         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4034         (Catch.Resolve): Set and Restore ec.InCatch.
4035         (Try.Resolve): Set and Restore ec.InFinally.
4036         (Try.HasCatch): True when try has catch.
4037
4038 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4039
4040         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4041           for the same event member, so exclude such cases from warning 419.
4042           Fixed bug #74633.
4043
4044 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4045
4046         * expression.cs (Binary.ResolveOperator): Apply patch from John
4047         Luke to fix bug 59864: operators &, | and ^ on enumerations
4048         require that the same enum type on both sides.
4049
4050         * driver.cs: Add warnings to old flag usage, this is to assist
4051         people who produce Makefiles and hope that the Makefiles will be
4052         used on Windows.
4053
4054         * class.cs (TypeContainer.EmitType): Moved the definition of the
4055         special $PRIVATE$ field from the resolve phase to the Emit phase.
4056         During resolve we do not know if we are a struct with
4057         HasExplicitLayout, we know this only after the attributes for the
4058         type are emitted.
4059
4060         Set the FieldOffset to zero on the dummy field that we create for
4061         the class.   Fixes 74590.
4062
4063 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4064
4065         Fix #73834.
4066         * ecore.cs (PropertyExpr.resolved): New.
4067         (DoResolve): Use it to handle a case of double resolution here.
4068         Handle a case of identical-name-and-type-name.
4069         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4070         resolution by storing the results of expression resolution back
4071         into the "probes" array.
4072
4073 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4074
4075         Fix cs0208-7.cs and cs0208-8.cs.
4076         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4077         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4078         error reporting to point out the reason a struct is not unmanaged.
4079
4080 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4081
4082         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4083           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4084
4085 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4086
4087         Fix #74528.
4088         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4089         IdenticalNameAndTypeName here.
4090         (EventExpr.InstanceResolve): Likewise.
4091
4092 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4093
4094         C# 2.0 DefaultCharSetAttribute implementation
4095         
4096         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4097         which allows us to set GlobalNamespace for every resolve.
4098         (Attribute.ResolveArguments): Cut from Resolve.
4099         (Attribute.GetCharSetValue): Returns CharSet named argument.
4100         (Attribute.DefinePInvokeMethod): Gets default charset from
4101         module settings.
4102         (GlobalAttribute.ResolveAsTypeStep): Override.
4103         (GlobalAttribute.ResolveArguments): Override.
4104         
4105         * class.cs (TypeAttr): Is protected.
4106         
4107         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4108         (ModuleClass.DefaultCharSetType): New memeber.
4109         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4110         
4111         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4112         charset from module.
4113         
4114         * delegate.cs (TypeAttr): Override.
4115         (Delegate.DefineType): Use this TypeAttr.
4116         
4117         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4118         at very early stage (before types are defined) to resolve model
4119         module attributes. It will probably not work with corlib but it
4120         should be ok.
4121         
4122         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4123         charset from module.
4124         
4125         * typemanager.cs (default_charset_type): New type.
4126
4127 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4128
4129         * decl.cs (MemberCache.AddMethods): Don't warn if
4130         System.Object.Finalize has buggy MethodAttributes.
4131
4132         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4133         removed below.
4134
4135 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4136
4137         * doc.cs : detect ambiguous reference to overloaded members.
4138           Fixed bug #71603. MS 1.1 csc does not detect it.
4139
4140 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4141
4142         * doc.cs : delegates must not be referenced with parameters.
4143           Fixed bug #71605.
4144
4145 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4146
4147         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4148
4149 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4150
4151         * driver.cs (MainDriver): Stop processing if the CLS stage found
4152         errors. 
4153
4154         (CompilerCallableEntryPoint.InvokeCompiler): Always
4155         reset after execution;   Take a TextWriter argument for the
4156         output.
4157
4158         * report.cs: Use the error stream instead of hardcoding stderr. 
4159
4160 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4161
4162         * class.cs: Reduce code paths to test, too small of an
4163         optimization to make it worth the extra testing.  Always perform
4164         it. 
4165
4166 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4167
4168         Fix #74510.
4169         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4170         operators that had errors reported on them.
4171
4172 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4173
4174         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4175         argument types.
4176         (Attribute.Resolve): Add named argument type checking.
4177         
4178         * class.cs (FixedField.Define): Use IsPrimitiveType
4179         
4180         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4181         
4182         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4183         unsafe parameter types.
4184         
4185         * statement.cs (Using.ResolveExpression): Add better error description.
4186         
4187         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4188         
4189 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4190
4191         Fix #74484.
4192         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4193         AttributeUsageAttribute in the emitcontext of the attribute class,
4194         not in the emitcontext of the attributable entity it was attached to.
4195         * cs-parser.jay: Use 'current_class', not 'current_container',
4196         when creating a GlobalAttribute.
4197
4198 2005-04-08  Alp Toker  <alp@atoker.com>
4199
4200         * pending.cs: The fix to #58413 failed to compile methods implementing
4201         interfaces with/without params modifiers and vice versa, even though
4202         params modifiers aren't part of the signature. Make the modifier check
4203         less strict as in csc.
4204
4205 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4206             Anoob V E  <projectmonokochi@rediffmail.com>
4207             Harilal P R  <projectmonokochi@rediffmail.com>
4208
4209         Fix #58413.
4210         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4211         modifiers of pending methods.
4212         (PendingImplementation.PendingImplementation): Initialize it.
4213         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4214         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4215         with ParameterData.  Add check for modifiers.
4216         * class.cs (MethodData.Define): Update to changes.
4217
4218 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4219
4220         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4221
4222 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4223
4224         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4225         property.
4226         
4227         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4228         
4229         * rootcontext.cs,
4230         * typemanager.cs: Registered RequiredAttributeAttribute.
4231         
4232 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4233
4234         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4235         Warning CS0169 is back at level 3.
4236         (IMethodData.SetMemberIsUsed): New method.
4237         
4238         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4239         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4240         
4241         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4242
4243         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4244         contants.
4245         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4246         is used.
4247         
4248         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4249         is used.
4250         
4251         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4252         to avoid the problems with nested types.
4253
4254 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4255             Anoob V.E  <projectmonokochi@rediffmail.com>
4256             Harilal P.R  <projectmonokochi@rediffmail.com>
4257             Raja R Harinath  <rharinath@novell.com>
4258
4259         Fix #73820.
4260         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4261         attribute.
4262         * typemanager (GetConstructor): Make public.
4263
4264 2005-04-05  John Luke  <john.luke@gmail.com>
4265             Raja R Harinath  <rharinath@novell.com>
4266
4267         Fix #62232.
4268         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4269         struct too.  Return false quicker in a few cases.
4270         (VerifyUnManaged): Use it.
4271
4272 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4273
4274         Fix #74041.
4275         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4276         not 'unreachable_seen'.
4277
4278 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4279
4280         * attribute.cs (Attribute.GetValue): Removed unused.
4281         
4282         * codegen.cs (CodeGen.TrimExt): Removed unused.
4283         
4284         * cs-parser.jay (output): Removed unused.
4285         
4286         * cs-tokenizer.cs (hex_digits): Removed unused.
4287         
4288         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4289         
4290         * expression.cs (Indirection.LoadExprValue): Removed unused.
4291         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4292         
4293         * iterators.cs (Iterator.param_types): Removed unused.
4294         
4295         * statement.cs (Goto.block): Removed unused.
4296         (ToplevelBlock.did): Removed unused.
4297         (Switch.ResolveConstantSwitch): Removed unused.
4298
4299 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4300
4301         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4302         resetting thingy.
4303
4304 2005-04-19  Martin Baulig  <martin@ximian.com>
4305
4306         Merged r42462 from MCS and made it work for GMCS.
4307
4308         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4309
4310         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4311
4312 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4313
4314         Fix #74232 and cs0208-3.cs.
4315         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4316         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4317         unmanaged type.  Don't use FieldBuilders when 't' is a
4318         TypeBuilder.  Use ModFlags and MemberType fields.
4319         * class.cs (MemberBase.member_type): Rename from MemberType.
4320         (MemberBase.MemberType): New property.  Determines member_type on
4321         demand.
4322         (MemberBase.DoDefine): Don't initialize MemberType here.
4323         (FieldMember.Define): Likewise.
4324
4325 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4326
4327         Fix #74241
4328         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4329         Attributes are emitted there.
4330         
4331 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4332
4333         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4334         keyword in 'partial enum' too.
4335         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4336         is not allowed).
4337         Report from Kamil Skalski <nazgul@omega.pl>.
4338
4339         Fix #74309.
4340         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4341         have partial containers too.
4342
4343         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4344         in block' checks to Block.CheckInvariantMeaningInBlock.
4345         * statement.cs (Block.GetKnownVariableInfo): Make private.
4346         (Block.IsVariableUsedInChildBlock): Remove.
4347         (Block.IsVariableUsedInBlock): Likewise.
4348         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4349         conflicting declaration.
4350         (Block.AddVariable): Make error messages less long-winded and more
4351         specific.  Show location of conflicting declaration.
4352         * parameter.cs (Parameters.Location): New readonly property.
4353
4354 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4355
4356         Clean up semantics of invoking ResolveMemberAccess.
4357         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4358         can have an instance, ensure that we pass in a non-TypeExpression
4359         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4360         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4361         argument.  Update to changes and simplify.
4362         (FieldExpr.Emitinstance): Remove CS0120 check.
4363         (PropertyExpr.EmitInstance): Likewise.
4364         * expression.cs (Argument.Resolve): Likewise.
4365         (Invocation.DoResolve): Update to changes in semantics of
4366         InstanceExpression.
4367
4368 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4369
4370         Fix #74241
4371         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4372         customization.
4373         
4374         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4375
4376 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4377
4378         Fix difference in behaviour with commandline invocation.
4379         * driver.cs (Driver.Reset): New.
4380         (CompilerCallableEntryPoint): Call it.
4381
4382         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4383         variable" warnings if the boolean expression failed to resolve.
4384
4385 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4386
4387         * attribute.cs: Fix the union of several permissions when some of them
4388         are unrestricted (so the result isn't an unrestricted permission set).
4389         Fix #74036.
4390
4391 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4392
4393         * ecore.cs (MemberExpr): New class.  Convert from interface
4394         IMemberExpr.
4395         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4396         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4397         error checks.
4398         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4399         (MethodGroupExpr.IsExplicitImpl): Remove.
4400         (Expression.GetFieldFromEvent): Remove.
4401         (SimpleName.MemberStaticCheck): Remove.
4402         (SimpleName.DoSimpleNameResolve): Update to changes.
4403         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4404         (MemberAccess.IdenticalNameAndTypeName): Remove.
4405         (MemberAccess.error176): Move to MemberExpr.
4406         (MemberAccess.DoResolve): Update to changes.
4407         (BaseAccess.DoResolve): Likewise.
4408
4409 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4410
4411         C# 2.0 Conditional attribute class implementation
4412         
4413         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4414         Analyzes class whether it has attribute which has ConditionalAttribute
4415         and its condition is not defined.
4416         
4417         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4418         (Class.IsExcluded): New method. Search for at least one defined
4419         condition in ConditionalAttribute of attribute class.
4420
4421 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4422
4423         * ecore.cs (PropertyExpr): Derive from Expression, not
4424         ExpressionStatement.
4425         (PropertyExpr.EmitStatement): Remove.
4426
4427 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4428
4429         Fix #74060.
4430         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4431         internal field "value__" of an enum be private.  The examples for
4432         "value__" that I found on MSDN all used FieldAttributes.Private.
4433
4434         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4435         Don't mention IL method attribute names.
4436
4437         Fix #47991.  Remove a TODO.
4438         * statement.cs (Block.Toplevel): Make into a field.
4439         (Block.Parameters): Move into ToplevelBlock.
4440         (Block.known_variables): Rename from child_variable_names.
4441         (Block.Block): Remove variants that take Parameters.  Initialize
4442         'Toplevel' with the immediately surrounding toplevel block.
4443         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4444         LocalInfo parameter.
4445         (Block.GetKnownVariableInfo): New.
4446         (Block.IsVariableNameUsedInChildBlock): Update.
4447         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4448         the block, even though it may not be in scope.
4449         (Block.AddVariable): Remove Parameters parameter.  Use
4450         Toplevel.Parameters instead.
4451         (Block.AddConstant): Remove Parameters parameter.
4452         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4453         (Block.IsParamaterReference): Likewise.
4454         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4455         (ToplevelBlock.Parameters): New.  Moved from Block.
4456         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4457         initialize Parameters to a non-null value.
4458         * cs-parser.jay: Update to changes.
4459         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4460         simple names that mean different things in the same block.  Use
4461         Block.IsVariableNameUsedInBlock.
4462
4463 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4464
4465         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4466
4467 2005-03-26  Raja R Harinath  <harinath@acm.org>
4468
4469         Fix #73038.
4470         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4471         fails to resolve, ensure that the LHS is still resolved as an
4472         lvalue.
4473
4474 2005-03-25  Raja R Harinath  <harinath@acm.org>
4475
4476         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4477         ec.ContainerType.
4478         (Enum.current_ec): Remove.
4479         (Enum.LookupEnumValue): Remove EmitContext argument.
4480         Just uses the one created during DefineType.
4481         (Enum.FindMembers): Update.
4482         * expression.cs (MemberAccess.DoResolve): Update.
4483
4484 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4485
4486         * assign.cs (Assign.DoResolve): Check for CS1717 when
4487         source and target are same (uses Equals).
4488
4489         * expression.cs (LocalVariableReference, ParameterReference,
4490         This): Implemented Equals, GetHashCode.
4491
4492         * statement.cs (Block.GetParameterReference): Removed useless
4493         local variable.
4494
4495 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4496
4497         Fix cs0128.cs
4498         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4499         blocks before deciding whether the error is cs0136 or cs0128.
4500
4501         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4502         (using_alias_directive, using_namespace_directive): Pass
4503         MemberName, not an expression to Namespace.UsingAlias and
4504         Namespace.Using.
4505         (MakeName): Use the MemberName of the namespace.
4506         * namespace.cs (Namespace.MemberName): New.
4507         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4508         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4509         Likewise.
4510         * decl.cs (MemberName.Name): Make readonly.
4511         (MemberName.FromDotted): New "constructor".
4512         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4513         (MemberCore.Name): Compute from MemberName on demand.
4514         (MemberCore.SetMemberName): Provide a way to change the
4515         MemberName.
4516         (MemberCore.AddToContainer): Don't take a fullname parameter.
4517         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4518         fully qualified name of the container to the member name.
4519         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4520         only if the type is a member of the root container.
4521         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4522         MemberName.Left rather than searching for an embedded ".".
4523         (PartialContainer.CreatePart): Update to changes in RootContext.
4524         (MemberBase.ShortName): Turn into a property.  Use
4525         MemberCore.SetMemberName.
4526         (MemberBase.ExplicitInterfaceName): Remove.
4527         (MemberBase.UpdateMemberName): Remove.
4528         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4529         (PropertyBase.SetMemberName): New override.
4530         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4531         (Tree.GetDecl): New.
4532         (Tree.AllDecls): Rename from Decls.
4533         * attribute.cs, enum.cs, report.cs: Update to changes.
4534         * driver.cs (MainDriver): Use MemberName.FromDotted on
4535         RootContext.MainClass.
4536
4537 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4538
4539         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4540         checks.
4541
4542         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4543
4544 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4545
4546         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4547         property accessor modifiers.
4548
4549         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4550         fixed buffer attribute (CS1716).
4551         (PropertyMethod.HasCustomAccessModifier): When property accessor
4552         has custom modifier.
4553
4554         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4555         modifiers.
4556         (PropertyExpr.DoResolveLValue): Add CS0272.
4557
4558 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4559
4560         * convert.cs: When converting to a pointer, use the proper Conv.U
4561         or Conv.I depending on the source data type.
4562
4563         * cs-tokenizer.cs: Make the size for large decimal constants,
4564         fixes #72957.
4565
4566 2005-03-17  Martin Baulig  <martin@ximian.com>
4567
4568         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4569         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4570
4571 2005-03-17  Martin Baulig  <martin@ximian.com>
4572
4573         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4574         to bool so we can return an error condition.
4575         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4576         returned an error.
4577
4578 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4579
4580         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4581         attributes.
4582
4583 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4584
4585         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4586         Refactor to avoid traversing the list of assemblies, and to avoid
4587         string concatenation.
4588         * typemanager.cs (guid_attr_type): Remove.
4589         (negative_hits, pointers, references): Remove hashes.
4590         (type_hash): New.
4591         (GetConstructedType): New.  Uses type_hash to handle constructed
4592         types (arrays, references, pointers).
4593         (GetReferenceType, GetPointerType): Use it.
4594         (GetNestedType): New.  Uses type_hash to handle nested types of
4595         reflected types.
4596         (LookupType, LookupTypeDirect): Remove.
4597         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4598         'types' hash and LookupTypeReflection directly.
4599         (params_string, params_object): Use GetConstructedType.
4600         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4601         top-level types.
4602         (Namespace.Lookup): Use cached_types.
4603         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4604         provided by old TypeManager.LookupType.
4605         * rootcontext.cs (MakeFQN): Remove.
4606         * decl.cs (DeclSpace.MakeFQN): Likewise.
4607         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4608         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4609         TypeManager.GetConstructedType.
4610         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4611
4612 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4613
4614         * cs-parser.jay: Fix build.
4615
4616 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4617
4618         * class.cs (TypeContainer.CircularDepException) New nested
4619         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4620
4621         * cs-parser.jay: Reports CS1527 for any namespace element.
4622
4623         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4624         Added CS0407.
4625
4626         * expression.cs (ParameterReference.IsAssigned): Changed error to
4627         CS0269.
4628         (Error_WrongNumArguments): Moved CS0245 detection here.
4629
4630         * statement.cs (Return.Resolve): Add CS1622 report.
4631
4632 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4633
4634         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4635
4636 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4637
4638         * attribute.cs expression.cs: Get rid of some allocations.
4639
4640 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4641
4642         * doc.cs : just eliminate the latest change.
4643
4644 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4645
4646         * doc.cs : commented out the latest change. It breaks xml-030.cs
4647
4648 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4649
4650         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4651           fail. So invoke CreateType() in FindDocumentedType().
4652
4653 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4654
4655         * cs-tokenizer.cs : added IsKeyword().
4656         * doc.cs : Detect keyword incorrectly used as identifier.
4657           Allow identifiers prefixed by @.
4658
4659 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4660
4661         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4662         It caused exception in namespace resolving (again!).
4663         
4664         * class.cs (Class.ctor): Removed exit.
4665         (PropertyMethod.ctor): ditto.
4666         
4667         * codegen.cs (Codegen.Reset): Reset static data.
4668         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4669         
4670         * cs-tokenizer.cs (Cleanup): Removed.
4671         
4672         * driver.cs (GetSystemDir): Rewrote to one line command.
4673         It caused problem with unloaded dynamic modules.
4674         (UnixParseOption): Removed Exit.
4675         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4676         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4677         Now can be mcs used as library.
4678         
4679         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4680         empty location.
4681         
4682         * location.cs (Reset): Reset static data.
4683         
4684         * namespace.cs (Reset): Reset static data.
4685         
4686         * report.cs (Report.Reset): Reset static data.
4687         
4688         * rootcontext.cs (RootContext.Reset): Reset static data.
4689         
4690         * tree.cs (RootTypes.ctor): Use Location.Null
4691         
4692         * typemanager.cs (TypeManager.Reset): Reset static data.
4693         (CoreLookupType): Removed Exit.
4694         (TypeHandle.Reset): Reset static data.
4695         
4696 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4697
4698         Fix #73516.
4699         * typemanager.cs (ComputeNamespaces): Import namespaces from
4700         referenced modules too.
4701
4702 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4703
4704         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4705         than '.'.
4706
4707 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4708
4709         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4710         enclosing DeclSpace.  This ensures that a name-lookup populates
4711         more caches and there are fewer 'TypeExpression's.  Carve out
4712         nested type lookup into ...
4713         (LookupNestedTypeInHierarchy): ... this.
4714
4715 2005-04-15  Martin Baulig  <martin@ximian.com>
4716
4717         Merged r41590 from MCS and make it work in the generics land.
4718
4719         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4720         `check' argument.
4721
4722         * class.cs (PartialContainer.UpdateConstraints): Removed.
4723         (PartialContainer.CheckConstraints): Removed.
4724         (PartialContainer.SetParameterInfo): Store the constraints here.
4725         (PartialContainer.DefineTypeParameters): New public method;
4726         resolve the type parameter's constraints here.  Note that the
4727         PartialContainer doesn't have an EmitContext anymore, so we must
4728         do this in the ClassPart.
4729
4730 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4731
4732         Clean up a few partial-class semantics.  
4733         Fixes test-357.cs and cs1618-2.cs.
4734         * cs-parser.jay (struct_declaration): Use 'current_class' as
4735         parent of newly-created struct.  Remove call to Register ().
4736         Use 'pop_current_class' to complete handing the current struct.
4737         (interface_declaration): Likewise.
4738         (class_declaration): Likewise.
4739         (enum_declaration): Use 'current_class' as parent of newly created
4740         enum.
4741         (delegate_declaration): Likewise.
4742         (pop_current_class): New function.  This is used to handle closing
4743         up the 'current_class' and 'current_container', and pointing them
4744         to the enclosing class/container.
4745         (CSharpParser): Initialize 'current_class' too.
4746         * decl.cs (MemberCore): Add check for invariant: a partial
4747         container is not a parsed entity, and thus does not enclose any
4748         parsed members.
4749         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4750         (DeclSpace.BaseTypeExpr): Use it.
4751         (DeclSpace.LookupType): Add check for invariant.
4752         * class.cs (TypeContainer): Add check for invariant: a nested
4753         class should have the same NamespaceEntry as its enclosing class.
4754         (TypeContainer.EmitFieldInitializers): Make virtual.
4755         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4756         MemberCore.
4757         (TypeContainer.Register): Remove.
4758         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4759         null.  Use TypeResolveEmitContext for resolving base types and
4760         interfaces.  Move initialization of Parts.TypeBuilder here from
4761         ...
4762         (TypeContainer.DefineNestedTypes): ... here.
4763         (PartialContainer): Take a Namespace not a NamespaceEntry.
4764         (PartialContainer.Create): Don't use Register.  Call the
4765         appropriate Add... function directly.
4766         (ClassPart): Take both the PartialContainer and the enclosing
4767         class as constructor arguments.
4768         (ClassPart.EmitFieldInitializers): Override.
4769         (ClassPart.PartFindNestedTypes): Remove.
4770         (FieldBase.GetInitializerExpression): Resolve the initializer
4771         expression in the emit context of the enclosing class.
4772         * tree.cs (RootTypes): Remove Register ().
4773         
4774 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4775
4776         * cs-parser.jay: Removed CS0134.
4777         
4778         * driver.cs: Removed CS1901.
4779         
4780         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4781         for predefined types.
4782
4783 2005-03-07  Duncan Mak  <duncan@novell.com>
4784
4785         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4786         well. Fixes bug #73454.
4787
4788 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4789
4790         * cs-tokenizer.cs (xtoken): Add CS1035.
4791         
4792         * class.cs (MethodData.Define): Add CS0683.
4793         (FieldMember.ctor): Add CS0681.
4794
4795 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4796
4797         * ecore.cs (SimpleName.DoResolve): Rename from
4798         SimpleName.DoResolveAllowStatic.
4799         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4800         Pass 'intermediate' flag to MemberStaticCheck.
4801         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4802         of "intermediate" lookups via MemberAccess.
4803         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4804         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4805
4806 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4807
4808         Fix #73394.
4809         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4810         slipped in because of variable names that are identical to a
4811         builtin type's BCL equivalent ('string String;', 'int Int32;').
4812         (PropertyExpr.EmitInstance): Likewise.
4813
4814 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4815
4816         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4817         
4818         * report.cs (warning_ignore_table): Made public.
4819
4820 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4821
4822         Fix #73282.
4823         * class.cs (MethodData.Emit): Pass 'container' to
4824         container.GetObsoleteAttribute instead of 'container.Parent'.
4825
4826 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4827
4828         * cs-parser.jay: Add 1534 error test.
4829
4830         * iterators.cs (Yield.CheckContext): Add error 1629.
4831         (Iterator.ctor): Save unsafe modifier.
4832         (MoveNextMethod.DoEmit): Restore unsafe context.
4833
4834         * namespace.cs (UsingAlias): Better error message.
4835
4836 2005-03-03  Dan Winship  <danw@novell.com>
4837
4838         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4839         the warning message [#73219]
4840
4841 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4842
4843         Fix compile with MCS 1.0.0.0.
4844         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4845         w_restore to not depend on string constant folding.
4846
4847 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4848
4849         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4850         CS0246 check to users who passed 'silent = false'.
4851         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4852         check.
4853         (SimpleName.SimpleNameResolve): Update.
4854         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4855         (MemberAccess.IdenticalNameAndTypeName): Update.
4856         * doc.cs (FindDocumentedTypeNonArray): Update.
4857
4858 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4859
4860         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4861         * parameters.cs (ComputeAndDefineParameters): Remove.
4862         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4863         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4864         Use GetParameterInfo.
4865
4866 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4867
4868         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4869
4870 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4871
4872         Unify DeclSpace.LookupType and DeclSpace.FindType.
4873         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4874         is in charge of defining nested types on demand.
4875         (DeclSpace.LookupType): Use it when the current_type is a
4876         TypeBuilder.  Use LookupTypeDirect for reflected types.
4877         (DeclSpace.FindType): Remove.
4878         (DeclSpace.LookupInterfaceOrClass): Likewise.
4879         (DeclSpace.DefineTypeAndParents): Likewise.
4880         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4881         DeclSpace.LookupType.
4882         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4883         * typemanager.cs (LookupType): Simplify.
4884         (AddUserType): Remove type from negative_hits.
4885         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4886         * class.cs (TypeContainer.FindMembers): Move handling of nested
4887         types ...
4888         (TypeContainer.FindMembers_NestedTypes): ... here.
4889         (TypeContainer.FindNestedType): Implement override.
4890         (ClassPart.FindNestedType): Delegate to PartialContainer.
4891         (ClassPart.PartFindNestedType): Looks up the nested types of the
4892         part alone.
4893
4894 2005-04-14  Martin Baulig  <martin@ximian.com>
4895
4896         * generic.cs (ConstructedType): Moved all the type lookup and
4897         nested class logic into SimpleName.
4898         (ConstructedType.ResolveConstructedType): Our underlying type is
4899         already fully resolved; all the type lookup stuff is in
4900         SimpleName.
4901
4902         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4903         constructed types here instead of in ConstructedType.
4904
4905         * decl.cs (MemberName.GetTypeExpression): Always create a
4906         SimpleName, not a ConstructedType.
4907         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4908
4909 2005-03-02  Martin Baulig  <martin@ximian.com>
4910
4911         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4912         static constructor in static classes.
4913
4914 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4915
4916         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4917         sizeParamIndex is not specified.
4918
4919 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4920
4921         Fix #73117
4922         * report.cs (WarningMessage.IsEnabled): Missing null check.
4923
4924 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4925
4926         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4927         in the fields and not in the properties.
4928
4929 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4930
4931         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4932         fields as well.
4933
4934 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4935
4936         * attribute.cs: Small refactoring (improved robustness).
4937         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4938         (ValidateGuid): Removed.
4939         (Resolve): Removed referenced to above mentioned.
4940         (GetAttributeUsage): Made private and changed to work without
4941         class assistance.
4942         (GetIndexerAttributeValue): Don't crash.
4943         (GetConditionalAttributeValue): Ditto.
4944         (GetClsCompliantAttributeValue): Ditto.
4945         (ExtractSecurityPermissionSet): All attributes exceptions are
4946         error 648.
4947         (GetPropertyValue): New helper.
4948         (GetMethodImplOptions): New method.
4949         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4950         some missing properties.
4951         
4952         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4953         (Method.ApplyAttributeBuilder): Updated.
4954         
4955         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4956         exception.
4957
4958 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4959
4960         Fix #73052.
4961         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4962         non-simple types (array, pointer, reference).
4963
4964 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4965
4966         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4967
4968         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4969         for operators.
4970         (Method.CheckBase): Catch wrong destructor here.
4971         (MethodData.Define): Add errors 550, 668.
4972
4973         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4974
4975         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4976
4977         * pending.cs (VerifyPendingMethods): Add error 551.
4978
4979         * typemanager.cs (CSharpName): Next error report helper.
4980
4981 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4982
4983         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4984         attributes. Removed useless attribute double check.
4985         It saves almost 2MBs for corlib.
4986
4987 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4988
4989         Fix #72924.
4990         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4991         called twice in case of error.
4992
4993 2005-02-23  Chris Toshok  <toshok@ximian.com>
4994
4995         Fix compiler portions of #72827.
4996         * statement.cs (Block.Emit): call Begin/EndScope on the
4997         EmitContext instead of the ILGenerator.
4998
4999         * codegen.cs (EmitContext.BeginScope): new method, call
5000         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5001         we have one.)
5002         (EmitContext.BeginScope): same, but EndScope and CloseScope
5003
5004         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5005         offset and call the superclass's OpenScope(int) with it.
5006         (SymbolWriter.CloseScope): get the current il
5007         offset and call superclass's CloseScope(int) with it.
5008
5009 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5010
5011         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5012         CS1677 for out and ref as well.
5013
5014         * class.cs (Method.Define): Add error CS1599 detection.
5015         
5016         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5017         
5018         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5019         
5020         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5021         
5022         * support.cs.cs (ModifierDesc): New helper method.
5023
5024 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5025             Abin Thomas  <projectmonokochi@rediffmail.com>
5026             Anoob V E  <projectmonokochi@rediffmail.com>
5027             Harilal P R  <projectmonokochi@rediffmail.com>
5028
5029         Fix #57851, #72718.
5030         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5031         MemberLookup (used for error reporting) actually returns a result.
5032         Fix error report number (122, not 112).
5033
5034 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5035             Anoob V E  <projectmonokochi@rediffmail.com>
5036             Harilal P R  <projectmonokochi@rediffmail.com>
5037
5038         Fix #71134.
5039         * pending.cs (PendingImplementation.GetAbstractMethods):
5040         Find NonPublic members too.
5041
5042 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5043
5044         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5045         Fixed error 217.
5046         
5047         * class.cs (MethodCore.CheckMethodAgainstBase):
5048         Add error 239 report.
5049
5050 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5051
5052         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5053         
5054         * class.cs (Operator.Define): Add error 217 report.
5055         
5056 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5057
5058         Fix #68955.
5059         * expression.cs (Invocation.IsApplicable): Make public.
5060         (Invocation.IsParamsMethodApplicable): Likewise.
5061         * delegate.cs (Delegate.VerifyApplicability): Don't use
5062         Invocation.VerifyArgumentCompat for parameter applicability
5063         testing.  Use Invocation.IsApplicable and
5064         Invocation.IsParamsMethodApplicable.
5065
5066 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5067
5068         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5069         
5070         * class.cs (Operator.Define): Add error 217 report.
5071         
5072 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5073
5074         * namespace.cs (UsingEntry.Resolve): Undo change below.
5075
5076 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5077
5078         Fix #72756.
5079         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5080         disable the error message when the extended MemberLookup also
5081         fails.
5082         (Expression.MemberLookupFinal): Update.
5083         (SimpleName.DoSimpleNameResolve): Update.
5084         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5085         Don't use MemberLookupFinal.
5086         (New.DoResolve): Update.
5087         (BaseAccess.CommonResolve): Update.
5088
5089 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5090
5091         Fix #72732.
5092         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5093         occured previously, don't resolve again.
5094
5095 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5096
5097         Fix #69949
5098         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5099         argument. Call ResolveAttributeUsage for unresolved.
5100         when types doesn't match ctor arguments.
5101         
5102         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5103         for nested attribute classes.
5104         (Class.attribute_usage): Removed.
5105         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5106         for attribute class.
5107         
5108         * ecore.cs (IsAttribute): Removed.
5109         
5110         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5111         
5112         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5113         now normal types.
5114         (attribute_types): Removed.
5115         (EmitCode): Global attributes are emited as the latest.
5116
5117 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5118
5119         * class.cs (EmitFieldInitializers): Don't emit field initializer
5120         for default values when optimilization is on.
5121         
5122         * constant.cs (Constant.IsDefaultValue): New property.
5123         
5124         * driver.cs: Add /optimize handling.
5125         
5126         * constant.cs,
5127         * ecore.cs,
5128         * literal.cs: Implement new IsDefaultValue property.
5129         
5130         * rootcontext.cs (Optimize): New field, holds /optimize option.
5131
5132 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5133
5134         Fix crasher in re-opened #72347.
5135         * namespace.cs (Namespace.Lookup): Return null if
5136         DeclSpace.DefineType returns null.
5137
5138         Fix #72678.
5139         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5140
5141 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5142
5143         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5144         now returns null if it cannot resolve to an lvalue.
5145         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5146         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5147         returned null.  Remove check for SimpleName.
5148         (EventExpr.DoResolveLValue): New.
5149         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5150         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5151         error from ...
5152         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5153         avoid CS0131 error.
5154         (Unary.ResolveOperator): Move CS0211 check ...
5155         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5156         CS0131 error.
5157         (Unary.DoResolveLValue): Simplify.
5158         (AddressOf.DoResolveLValue): New.
5159         (ArrayAccess.DoResolveLValue): New.
5160
5161 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5162
5163         * attribute.cs (Attribute.Resolve): Add arguments casting for
5164         when types doesn't match ctor arguments.
5165
5166 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5167
5168         Fix parts of #63202.
5169         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5170         lookup of operator in base type.  Ensure that all checks happen
5171         when the operator resolves to an "op_..." method.
5172
5173 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5174
5175         Fix #71992.
5176         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5177         'ignore_cs0104' parameter.  Pass it to ...
5178         (NamespaceEntry.Lookup): ... this.
5179         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5180         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5181         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5182         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5183         Update.  Request that cs0104 errors be ignored.
5184         (ComposedCast.ResolveAsTypeStep): Update.
5185
5186 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5187
5188         Fix #59209.
5189         * expression.cs (Invocation.BetterFunction): Remove support for
5190         comparing virtual functions and their overrides.
5191         (Invocation.IsOverride): New.
5192         (Invocation.OverloadResolve): Don't consider 'override' functions
5193         during candidate selection.  Store them in a lookaside list.
5194         If the selected method is a 'virtual' function, use the list to
5195         find any overrides that are closer to the LHS type.
5196
5197 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5198
5199         * expression.cs (New.DoResolve): Add complex core type reduction.
5200         (New.Constantify): Converts complex core type syntax like 'new int ()'
5201         to simple constant.
5202         
5203 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5204
5205         * decl.cs (EntryType.EntryType): New constructor to create an
5206         updated copy of a cache entry.
5207         (MemberCache.AddMethods): Use it.
5208         (MemberCache.ClearDeclaredOnly): Remove.
5209         (MemberCache.MemberCache): Update.
5210
5211 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5212
5213         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5214         variable.  This one is represents the actual low-level declaration
5215         of the method, as opposed to the semantic level `IsStatic'.   
5216
5217         An anonymous method which is hosted into a static method might be
5218         actually an instance method.  IsStatic would reflect the
5219         container, while MethodIsStatic represents the actual code
5220         generated.
5221
5222         * expression.cs (ParameterReference): Use the new MethodIsStatic
5223         instead of IsStatic.
5224
5225         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5226         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5227         set on the current EmitContext. 
5228
5229         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5230         resolve our casted expression as an LValue.  This triggers the
5231         proper LValue processing that is later required by Assign.
5232
5233         This fixes 72347.
5234
5235         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5236
5237 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5238
5239         C# 2.0 Fixed buffer implementation
5240
5241         * anonymous.cs: Update after RegisterHelperClass renaming.
5242
5243         * attribute.cs (AttributeTester.fixed_buffer_cache):
5244         Cache of external fixed buffers.
5245         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5246         implementation if field is fixed buffer else null.
5247
5248         * class.cs
5249         (TypeContainer.AddField): Accept FieldMember instead of Field.
5250         (FieldBase.IsFieldClsCompliant): Extracted code from
5251         VerifyClsCompliance descendant customization.
5252         (FixedField): New class handles fixed buffer fields.
5253         (FixedFieldExternal): Keeps information about imported fixed
5254         buffer.
5255         (IFixedField): Make access to internal or external fixed buffer
5256         same.
5257
5258         * cs-parser.jay: Add fixed buffer parsing.
5259
5260         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5261         buffer.
5262
5263         * expression.cs (Indirection): Extended implementation to accept
5264         fixed buffer field.
5265         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5266         (ElementAccess.MakePointerAccess): Get type as parameter.
5267         (DoResolve): Add fixed buffer field expression conversion.
5268         (DoResolveLValue): Ditto.
5269         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5270         (ArrayPtr): Derives from FixedBufferPtr.
5271         (ArrayPtr.Emit): Add extra emit for array elements.
5272
5273         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5274
5275         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5276         for compiler generated types.
5277         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5278
5279         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5280         and consume less memory.
5281         (Fixed.Resolve): Add fixed buffer case.
5282
5283         * typemanager.cs (compiler_generated_attr_ctor,
5284         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5285         (HasElementType): Add our own implementation to work on every
5286         runtime.
5287
5288 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5289
5290         * anonymous.cs (CaptureContext): Track whether `this' has been
5291         referenced.   
5292
5293         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5294         only captured `this' if it was implicitly done (instance
5295         methods/variables were used). 
5296
5297         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5298         `this' must be captured.
5299
5300 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5301  
5302         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5303         is null it means that there has been no need to capture anything,
5304         so we just create a sibling.
5305
5306         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5307
5308         Just a partial fix.  The other half is fairly elusive.
5309         
5310 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5311
5312         Fix #52586, cs0121-4.cs.
5313         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5314         and return a hashtable.
5315         (MemberCache.ClearDeclaredOnly): New.
5316         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5317         the method_hash of a base type too.
5318         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5319         type methods.  Overwrite entries with the same MethodHandle so
5320         that the ReflectedType is correct.  The process leaves in base
5321         virtual functions and their overrides as distinct entries.
5322         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5323         matters since it was boxed in a ArrayList before.
5324         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5325         modifier.
5326         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5327         case of a virtual function and its override (choose the overload
5328         as better).
5329         (Invocation.OverloadResolve): Avoid 'override' members during
5330         'applicable_type' calculation.
5331
5332 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5333
5334         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5335         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5336         GetTypeHandle.  It is possible for a reflected type to derive from
5337         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5338         System.Array during mscorlib compilation).
5339         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5340         contain a method_hash, don't create one either.  Don't create a
5341         deep copy of the base cache's method_hash.
5342         (MemberCache.SetupCache): Rename back from DeepCopy.
5343         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5344         already initialized.  If we see an override function, add its
5345         underlying base virtual function to the member_hash too.
5346
5347 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5348
5349         Combine two near-redundant caches.
5350         * typemanager.cs (method_params): Rename from method_internal_params.
5351         (TypeManager.GetParameterData): New.  Replace
5352         Invocation.GetParameterData.
5353         (TypeManager.LookupParametersByBuilder): Remove.
5354         * expression.cs (Invocation.method_parameter_cache): Remove.
5355         (Invocation.GetParameterData): Remove.
5356         Update to changes.
5357         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5358         Update to changes.
5359
5360 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5361
5362         Fix #72015.
5363         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5364         TypeManager.multicast_delegate_type is null, resolve it by looking
5365         up "System.MulticastDelegate".
5366         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5367
5368 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5369             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5370             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5371
5372         Fix cs0164.cs.
5373         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5374         (LabeledStatement.AddReference): New.  Set 'referenced'.
5375         (Goto.Resolve): Use it.
5376
5377 2005-02-05  John Luke  <john.luke@gmail.com>
5378
5379         * driver.cs: remove duplicate -doc line in Usage ()
5380
5381 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5382
5383         * location.cs (Location.AddFile): Fix CS2002 error report.
5384
5385 2005-02-02  Martin Baulig  <martin@ximian.com>
5386
5387         * delegate.cs (Delegate.DefineType): Report an internal error if
5388         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5389         details.        
5390
5391 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5392
5393         Fix a crasher in a variant of #31984.
5394         * const.cs (Constant.CheckBase): New override that defers the
5395         new-or-override check in case the base type hasn't been populated
5396         yet.
5397         (Constant.Define): Ensure the new-or-override check is performed.
5398
5399 2005-02-01  Duncan Mak  <duncan@ximian.com>
5400
5401         * const.cs (LookupConstantValue): Check that `ce' is not null
5402         before calling GetValue ().
5403
5404 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5405
5406         Fix test-334.cs (#69519).
5407         * cs-parser.jay (using_alias_directive): Pass in an expression to
5408         NamespaceEntry.UsingAlias.
5409         (using_namespace_directive): Pass in an expression to
5410         NamespaceEntry.Using.
5411         (namespace_name): Don't flatten to a string.
5412         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5413         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5414         ResolveAsTypeStep.
5415         (NamespaceEntry.UsingEntry): Likewise.
5416         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5417         changes.
5418         (NamespaceEntry.LookupForUsing): Remove.
5419         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5420         names.
5421         (NamespaceEntry.Lookup): Remove support for dotted names.
5422
5423 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5424
5425         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5426         split into two.
5427         (NamespaceEntry.ImplicitParent): Compute on demand.
5428         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5429         parallels the current.
5430         (NamespaceEntry.LookupForUsing): Use it.
5431         (NamespaceEntry.Lookup): If the current namespace-entry is
5432         implicit, don't search aliases and using tables.
5433
5434 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5435
5436         Fix #31984.
5437         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5438         BaseCache here.
5439         (TypeContainer.BaseCache): Compute on demand.
5440         (TypeContainer.FindMembers): Define constants and types if they're
5441         not already created.
5442         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5443         check.
5444         * const.cs (Constant.Define): Make idempotent.
5445
5446 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5447
5448         * pending.cs: Produce better code (no nops produced by using Ldarg
5449         + value).
5450         
5451         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5452         i - 1' it should be arg + 1.
5453
5454         Fixes bug #71819.
5455
5456 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5457
5458         * attribute.cs (Attribute.CheckAttributeType): Make private
5459         non-virtual.
5460         (Attribute.ResolveType): Make virtual.
5461         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5462         handling of RootContext.Tree.Types.
5463
5464 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5465
5466         Update attribute-handling to use the SimpleName/MemberAccess
5467         mechanisms.
5468         * cs-parser.jay (attribute): Pass in an expression to the
5469         constructors of Attribute and GlobalAttribute.
5470         * attribute.cs (Attribute): Take an expression for the name.
5471         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5472         passed in attribute name expression.
5473         (Attribute.CheckAttributeType): Use it.
5474         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5475         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5476         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5477         argument to prevent error messages if the lookup fails.
5478
5479 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5480
5481         * expression.cs (Indirection): Implemented IVariable interface
5482         to support indirection in AddressOf operator.
5483         (PointerArithmetic.Emit): Add optimalization for case where
5484         result can be precomputed.
5485
5486 2005-01-26  Martin Baulig  <martin@ximian.com>
5487
5488         * class.cs (TypeContainer.AttributeTargets): Return the correct
5489         AttributeTargets depending on our `Kind' instead of throwing an
5490         exception; fixes #71632.
5491
5492 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5493
5494         Fix #71257
5495         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5496         constant members.
5497
5498 2005-03-17  Martin Baulig  <martin@ximian.com>
5499
5500         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5501         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5502
5503 2005-03-17  Martin Baulig  <martin@ximian.com>
5504
5505         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5506         to bool so we can return an error condition.
5507         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5508         returned an error.
5509
5510 2005-03-17  Martin Baulig  <martin@ximian.com>
5511
5512         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5513
5514         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5515         converting from an array-type of T to `IEnumerable<T>'.
5516
5517 2005-03-16  Martin Baulig  <martin@ximian.com>
5518
5519         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5520         (Nullable.LiftedUnaryMutator): New public class.
5521
5522         * expression.cs (UnaryMutator.DoResolve): Added support for
5523         Nullable Types.
5524
5525 2005-03-14  Martin Baulig  <martin@ximian.com>
5526
5527         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5528
5529 2005-03-14  Martin Baulig  <martin@ximian.com>
5530
5531         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5532         the comparision operators `<', `>', `<=' and `>='.
5533
5534 2005-03-13  Martin Baulig  <martin@ximian.com>
5535
5536         * generic.cs
5537         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5538         avoid confusion with the `NullLiteral'.
5539         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5540
5541 2005-03-13  Martin Baulig  <martin@ximian.com>
5542
5543         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5544         comparing arbitrary types with the null literal.
5545
5546 2005-03-13  Martin Baulig  <martin@ximian.com>
5547
5548         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5549         boolean operators '&&', '||', '&' and '|'.
5550         (Nullable.OperatorTrueOrFalse): New public class.
5551
5552         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5553         instead of a `StaticCallExpr'; added support for nullables.
5554
5555 2005-03-10  Martin Baulig  <martin@ximian.com>
5556
5557         * expression.cs
5558         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5559         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5560
5561 2005-03-07  Martin Baulig  <martin@ximian.com>
5562
5563         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5564         it work if `expr' is not an IMemoryLocation.
5565         (Nullable.Lifted): Implement IMemoryLocation.
5566         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5567         target type.
5568
5569 2005-03-05  Martin Baulig  <martin@ximian.com>
5570
5571         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5572         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5573         (Nullable): Added support for lifted unary and binary operators.
5574
5575         * expression.cs (Unary.DoResolve): Added support for nullable types.
5576         (Binary.DoResolve): Likewise.
5577         (Conditional.DoResolve): Likewise.
5578
5579 2005-03-02  Martin Baulig  <martin@ximian.com>
5580
5581         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5582
5583         * class.cs (ClassPart.SetParameterInfo): Override this.
5584         (PartialContainer.SetParameterInfo): Override this.
5585         (TypeContainer.CheckConstraints): New protected method.
5586         (PartialContainer.CheckConstraints): Override this and check
5587         whether the same contraints were specified in all parts of a
5588         partial generic type definition.
5589         (PartialContainer.UpdateConstraints): New public method.
5590
5591         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5592
5593 2005-03-02  Martin Baulig  <martin@ximian.com>
5594
5595         Committing a patch from Carlos Alberto Cortez to fix #72887.
5596
5597         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5598         casts from `T []' to `int []'.
5599
5600 2005-03-02  Martin Baulig  <martin@ximian.com>
5601
5602         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5603
5604         * expression.cs (Binary.ResolveOperator): When resolving a
5605         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5606         `=='.  Fixes #71866.  See gen-127.cs.
5607
5608 2005-03-02  Martin Baulig  <martin@ximian.com>
5609
5610         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5611         static constructor in static classes.
5612
5613 2005-03-02  Martin Baulig  <martin@ximian.com>
5614
5615         * generic.cs
5616         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5617         (Nullable.LiftedConversion): Added support for user-defined
5618         conversions.
5619
5620         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5621
5622         * cs-parser.jay: Use ComposedCast everywhere instead of
5623         NullableType, so we don't need to check for NullableType
5624         everywhere.
5625         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5626         case where we'll be resolved into a `parenthesized_expression_0'
5627         afterwards.
5628
5629         * convert.cs
5630         (Convert.UserDefinedConversion): Added nullable conversions.
5631
5632 2005-02-28  Martin Baulig  <martin@ximian.com>
5633
5634         * generic.cs (TypeManager.IsNullableType): New static method.
5635         (Nullable): New abstract class.
5636         (Nullable.NullLiteral): New public class.
5637         (Nullable.LiftedConversion): New public class.
5638
5639         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5640         `builtin_types opt_nullable'.
5641
5642         * convert.cs
5643         (Convert.ImplicitConversionStandard): Added nullable conversions.
5644         (Convert.ExplicitConversionStandard): Likewise.
5645         (Convert.ExplicitConversion): Likewise.
5646
5647 2005-02-26  Martin Baulig  <martin@ximian.com>
5648
5649         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5650         begin with a "?", for instance "?[]".  Don't do a type lookup if
5651         `dim' is empty.
5652
5653 2005-02-25  Martin Baulig  <martin@ximian.com>
5654
5655         The first part of Nullable Types :-)
5656
5657         * generic.cs (NullableType): New public class.
5658         (NullCoalescingOperator): New public class.
5659         (TypeArguments.Resolve): Add a CS0306 check.
5660
5661         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5662         (opt_nullable): New rule.
5663         (type): Added `opt_nullable' to `namespace_or_type_name',
5664         `builtin_types' and `pointer_type'.
5665         (array_type): Added `opt_nullable'.
5666         (opt_rank_specifier_or_nullable): New rule; this is the
5667         combination of `opt_rank_specifier' and `opt_nullable'.
5668         (opt_error): New rule; catch errors here.
5669         (nullable_type_or_conditional): New rule; we use this to check for
5670         nullable and still detect the conditional operator.
5671         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5672         instead `opt_rank_specifier'.
5673
5674         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5675         for nullables.
5676
5677 2005-02-24  Martin Baulig  <martin@ximian.com>
5678
5679         * README, README.Changes: Removed; they're old and obsolete.
5680
5681 2005-02-22  Martin Baulig  <martin@ximian.com>
5682
5683         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5684         returned an error, set `constraints' to null to avoid a crash
5685         later on.
5686         (TypeParameter.ResolveType): Likewise.
5687
5688 2005-02-22  Martin Baulig  <martin@ximian.com>
5689
5690         * generic.cs
5691         (Constraints.ResolveTypes): Protect against being called twice.
5692         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5693         (TypeParameter.ResolveType): New public method; calls
5694         constraints.ResolveTypes().
5695         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5696         into the new ResolveType().
5697         (GenericMethod.Define): Call ResolveType() on all our
5698         TypeParameter's.        
5699
5700 2005-02-21  Martin Baulig  <martin@ximian.com>
5701
5702         * generic.cs
5703         (TypeManager.generic_nullable_type): New static public field.
5704         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5705
5706         * rootcontext.cs
5707         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5708
5709 2005-02-15  Martin Baulig  <martin@ximian.com>
5710
5711         * generic.cs (ConstructedType.Constraints): Correctly check
5712         constraints if the argument type is a type parameter; fixes
5713         #72326. 
5714
5715 2005-02-02  Martin Baulig  <martin@ximian.com>
5716
5717         * delegate.cs (Delegate.DefineType): Report an internal error if
5718         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5719         details.        
5720
5721 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5722
5723         * pending.cs: Produce better code (no nops produced by using Ldarg
5724         + value).
5725         
5726         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5727         i - 1' it should be arg + 1.
5728
5729         Fixes bug #71819.
5730         
5731 2005-01-26  Martin Baulig  <martin@ximian.com>
5732
5733         * cs-parser.jay (indexer_declarator): Don't report an error if we
5734         have type parameters since we can be an explicit interface
5735         implementation; fixes #71449.
5736
5737 2005-01-26  Martin Baulig  <martin@ximian.com>
5738
5739         * class.cs (TypeContainer.AttributeTargets): Return the correct
5740         AttributeTargets depending on our `Kind' instead of throwing an
5741         exception; fixes #71632.
5742
5743 2005-01-26  Martin Baulig  <martin@ximian.com>
5744
5745         * delegate.cs (Delegate.DefineType): Correctly define our type
5746         parameters.  Fixes #71483.
5747
5748 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5749
5750         Fix #71602.
5751         * expression.cs (MemberAccess.DoResolve): Don't complain with
5752         cs0572 when the LHS of a member access has identical name and type
5753         name.
5754
5755 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5756
5757         Fix #71651, #71675
5758         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5759         CreatePermission.
5760         Create custom PermissionSet only for PermissionSetAttribute.
5761
5762 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5763
5764         Fix #71649
5765         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5766         delegates in static class.
5767
5768 2005-01-24  Martin Baulig  <martin@ximian.com>
5769
5770         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5771         merging an implicit block, just use its reachability.
5772
5773         * statement.cs (Block.Resolve): Make the unreachable code check
5774         work wrt. implicit blocks; see test-337 from #63842.
5775
5776 2005-01-21  Alp Toker  <alp@atoker.com>
5777  
5778         * cs-parser.jay: destructor_declaration's container is PartialContainer
5779         not Class when partial types are used, so use Kind prop instead of
5780         'is'.
5781         
5782 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5783
5784         * cs-parser.jay: Improve error reporting when an interface
5785         declares new types.
5786
5787 2005-01-20  Dick Porter  <dick@ximian.com>
5788
5789         * support.cs: SeekableStreamReader fix from Sandor Dobos
5790         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5791         chars are read.  Fixes bug 70369.
5792
5793 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5794
5795         * cs-parser.jay (catch_clause): Simplify current_block handling
5796         somewhat.
5797
5798 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5799
5800         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5801         code with ImplicitStandardConversion to handle the implicit
5802         conversion of method groups into valid delegate invocations. 
5803
5804         The problem is that in parameter handling we were using this code
5805         path.  Fixes bug #64698
5806
5807 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5808
5809         * cs-parser.jay: Fix several infelicities.
5810         - Avoid assigning to the parser value stack.  Code like 
5811           '$3 = null' is unclean.  Synthesize a value for the code block
5812           instead. 
5813         - Avoid using oob_stack for storing location information.  Use ...
5814         (_mark_): ... this.  New (empty) rule.  Saves the current location
5815         in $$.
5816         (foreach_statement): Avoid using oob_stack for current_block
5817         handling.  Use technique used in for_statement and
5818         using_statement.  Synthesize a value for the code block to store
5819         additional intermediate information.
5820
5821 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5822
5823         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5824         of a different type is only allowed to private fields of a
5825         containing type, not on fields of a base class.
5826
5827         See test-174.cs and error cs0122-9.cs
5828
5829 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5830
5831         Fix test-335.cs (bug #58126).
5832         * cs-parser.jay (argument): Split out non-expression parts of the
5833         rule into 'non_simple_argument'.
5834         (invocation_expression): Support parenthesized invocations with
5835         multiple arguments, and with single non-simple arguments.
5836
5837 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5838
5839         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5840         places.
5841
5842 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5843
5844         Fix cs0038-1.cs, cs1640-6.cs.
5845         * ecore.cs (Expression.Resolve): Remove special-case for
5846         SimpleName in error-handling.
5847         (Expression.almostMatchedMembers): Relax access permission to
5848         protected.
5849         (Expression.MemberLookupFailed): Handle duplicates in
5850         almostMatchedMembers list.
5851         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5852         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5853         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5854         overload if the passed in MemberInfo is a MethodBase.
5855
5856 2005-01-25  Martin Baulig  <martin@ximian.com>
5857
5858         * doc.cs
5859         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5860
5861 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5862
5863         Fix #70749
5864         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5865         for non-CAS & merge permission sets properly.
5866
5867 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5868
5869         Improve standard-compliance of simple name and member access 
5870         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5871         * ecore.cs (FullNamedExpression): New abstract base class 
5872         for Namespaces and TypeExpressions.
5873         (ResolveFlags.SimpleName): Remove.
5874         (SimpleName): Remove support for dotted names.
5875         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5876         DeclSpace.FindType and DeclSpace.LookupType.
5877         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5878         (Expression.ExprClassName): Make member function.
5879         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5880         a namespace.  Remove creation of dotted "SimpleName"s.
5881         (MemberAccess.DoResolve): Likewise.
5882         * decl.cs (DeclSpace.Cache): Make private.
5883         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5884         (DeclSpace.FindType): Update.
5885         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5886         FullNamedExpression.
5887         * namespace.cs (Namespace): Derive from FullNamedExpression
5888         so that it can be part of expression resolution.
5889         (Namespace.Lookup): Return an FullNamedExpression.
5890         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5891         namespace.
5892         * rootcontext.cs (NamespaceLookup): Remove.
5893         (LookupType): Move to DeclSpace.
5894         * attribute.cs (CheckAttributeType): Update.
5895         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5896         (FindDocumentedTypeNonArray): Likewise.
5897
5898 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5899
5900         Fix cs0509.cs, cs1632.cs.
5901         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5902         is the same as IsInterface.
5903         (TypeContainer.GetClassBases): Likewise.
5904         * statement.cs (LabeledStatement.ig): New field.
5905         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5906         label.
5907         (LabeledStatement.DoEmit): Check that the label was created with
5908         the same ILGenerator.
5909
5910 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5911
5912         Fix #71058
5913         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5914         accessors to its properties.
5915
5916         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5917         from accessors to property.
5918         
5919 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5920
5921         Fix #70722
5922         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5923         only for overrides.
5924         
5925 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5926
5927         * attribute.cs: Check for null and empty strings.  
5928
5929         I have lost another battle to Paolo.
5930
5931 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5932
5933         Fix #70942
5934         * class.cs (PropertyMethod): Set Parent field in ctors.
5935         (SetMethod.InternalParameters): Add unsafe switch hack.
5936         Override MarkForDuplicationCheck where it is appropriate.
5937
5938         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5939         It says whether container allows members with the same name.
5940         Base default is no.
5941         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5942         Removed is_method parameter.
5943
5944 2005-01-06  Duncan Mak  <duncan@ximian.com>
5945
5946         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5947         because the previous change led to incorrect reporting of CS1032
5948         ("Cannot define/undefine preprocessor symbols after first token in
5949         file"). Instead of using `tokens_seen' as the only flag that
5950         triggers CS1040, introduce `comments_seen'. This new flag is used
5951         to signify having seen comments on the current line, so it is
5952         unset after a newline.
5953
5954 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5955
5956         * doc.cs : When searching for a type, find nested type too.
5957           This fixes bug #71040.
5958
5959 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5960
5961         * doc.cs :
5962           - Warn missing member comment on those classes which also does not
5963             have doc comments. Fixed bug #71041.
5964           - Don't warn missing doc comment on default constructor.
5965             Fixed bug #71042.
5966
5967 2005-01-06  Duncan Mak  <duncan@ximian.com>
5968
5969         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5970         comments, set `tokens_seen' to true. This allows us to detect
5971         misplaced preprocessor directives (i.e. not at the beginning of
5972         the a line, nor after whitespaces). In that case, report error
5973         CS1040. This fixes bug #56460.
5974
5975         * cs-parser.jay (interface_member_declaration): Add checks for
5976         IsExplicitImpl, and report CS0541 error if an interface member is
5977         defined as an explicit interface declaration.
5978
5979 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5980
5981         Fix #70817
5982         * class.cs (PropertyMethod): Set Parent field in ctors.
5983         (SetMethod.InternalParameters): Add unsafe switch hack.
5984         
5985         * decl.cs (MemberCore.Parent): Cannot be readonly.
5986
5987 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5988
5989         * decl.cs (DeclSpace.ResolveType): Remove.
5990         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5991         Merge in code from ...
5992         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5993         * class.cs, enum.cs: Update to changes.
5994
5995 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5996
5997         * anonymous.cs: Ensure that we init the scope of our parent if it
5998         has not been initialized yet.
5999
6000 2004-12-30  Duncan Mak  <duncan@ximian.com>
6001
6002         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6003         if field.FieldBuilder is null. Fixes #70758.
6004
6005         * convert.cs: Fixed some typos and updated some of the comments.
6006         (ImplicitStandardConversionExists):
6007         (TryImplicitIntConversion): If `target_type' is an interface and
6008         the type of `ic' implements this interface, return true or a new
6009         BoxedCast instead of null. This fixes #70468.
6010
6011 2004-12-29  Duncan Mak  <duncan@ximian.com>
6012
6013         * expression.cs (Argument.Emit): Check that Expr is
6014         IMemoryLocation before casting to it, and report CS1510 otherwise.
6015
6016         This fixes #70402.
6017
6018 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6019
6020         * statement.cs (Block.ThisVariable): remove the recursion here, to
6021         make the --profile more sane.
6022
6023 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6024
6025         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6026         assembly, by JB Evain.
6027
6028 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6029
6030         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6031           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6032         "parent" refers to enclosing type/class.  "base" refers to superclass.
6033
6034 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6035
6036         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6037         Ensure that we only have GlobalAttributes.
6038         * attribute.cs (Attribute.Emit): Make non-virtual.
6039         (GlobalAttribute.Emit): Remove.
6040         (Attribute.Resolve): Make virtual.
6041         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6042         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6043         the argument. Don't create one.
6044         (Attribute.GetObsoleteAttribute): Likewise.
6045         (Attribute.GetClsCompliantAttributeValue): Likewise.
6046         * class.cs, decl.cs: Update to changes.
6047
6048 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6049
6050         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6051         
6052         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6053         
6054         * statement.cs (Foreach.Resolve): Add error 186 report.
6055
6056 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6057
6058         * expression.cs (Conditional.DoResolve): Add warning 429.
6059         
6060         * statement.cs (If.Resolve): Add warning 665.
6061
6062 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6063
6064         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6065         except when in the parser, and in GlobalAttribute.
6066         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6067         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6068         RootContext.Tree.Types.NamespaceEntry once work is done.
6069         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6070         and resets RootContext.Tree.Types.NamespaceEntry.
6071
6072 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6073
6074         * cs-parser.jay: Don't create a block for every variable.
6075
6076 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6077
6078         * location.cs: Provide extra information.
6079
6080         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6081         variables from the captured environment, it is the ldarg_0.
6082
6083 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6084
6085         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6086         find a conclusion.
6087         
6088         * class.cs: Changed warning level for 169 to avoid developer
6089         displeasure from warning flooding. It will be changed back when they
6090         fix most of current BCL warnings.
6091         
6092         * RootContext.cs: Pushed default WarningLevel to 3.
6093         
6094         * statement.cs: Removed unused variable.
6095
6096 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6097
6098         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6099         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6100         Add error 502 report.
6101         (StaticClass.DefineType): Add error 441 report.
6102         (Class.AllowedModifiersProp): New virtual property as temporary
6103         extension to AllowedModifiers.
6104         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6105         to share implementation with StaticClass and don't call virtual
6106         methods from ctor.
6107         
6108         * driver.cs (MainDriver): Add error 1558 test.
6109
6110         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6111         report. Moved error 36 test here.
6112
6113         * statement.cs (Throw.Resolve): Add error 724 report.
6114
6115         * typemanager.cs: Add out_attribute_type core type.
6116         
6117 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6118
6119         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6120         3018 report.
6121         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6122
6123         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6124         3017 report.
6125         
6126         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6127
6128         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6129         Add error 3023 report.
6130         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6131
6132         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6133         implementation.
6134
6135 2004-12-12  John Luke  <john.luke@gmail.com>
6136
6137         * driver.cs (AddArgs): take -- into account when
6138         adding arguments, fixes bug 65710 
6139
6140 2004-12-12  Martin Baulig  <martin@ximian.com>
6141
6142         * expression.cs (Unary.TryReduceNegative): Added support for
6143         SByteConstant and ByteConstant.
6144         (Unary.Reduce): Check error values from TryReduceNegative().
6145
6146 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6147
6148         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6149         and report exception as error 182.
6150
6151 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6152
6153         * driver.cs (Main): Fix message when there are warnings.
6154
6155 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6156
6157         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6158
6159 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6160
6161         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6162         Reduced number of warnings.
6163         
6164         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6165
6166 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6167
6168         * driver.cs: Removed message.
6169
6170         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6171
6172 2004-12-08    <vargaz@freemail.hu>
6173
6174         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6175
6176 2004-12-08  Martin Baulig  <martin@ximian.com>
6177
6178         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6179         instead of a CS3002 for properties and indexer.
6180
6181 2004-12-08  Martin Baulig  <martin@ximian.com>
6182
6183         * decl.cs (MemberName.ToString): Make this work again.
6184
6185 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6186
6187         * attribute.cs (Resolve): Add error 591 detection.
6188
6189         * class.cs (FieldMember.Define): Add error 1547 detection.
6190         (Indexer.Define): Add error 620 detection.
6191         (Operator.Define): Add error 590 detection.
6192
6193         * ecore.cs: Missing argument for error 79.
6194
6195         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6196         detection.
6197
6198 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6199
6200         Fix #70106
6201         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6202         only.
6203
6204 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6205
6206         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6207           Some operator comments were suppressed.
6208         * doc.cs : Implicit/explicit operator name in doc comments are like
6209           "op_Explicit(type)~returnType", so added suffix handling.
6210
6211 2005-01-21  Alp Toker  <alp@atoker.com>
6212
6213         * cs-parser.jay: destructor_declaration's container is PartialContainer
6214         not Class when partial types are used, so use Kind prop instead of 'is'.
6215
6216 2004-12-12  Martin Baulig  <martin@ximian.com>
6217
6218         * expression.cs (Unary.TryReduceNegative): Added support for
6219         SByteConstant and ByteConstant.
6220         (Unary.Reduce): Check error values from TryReduceNegative().
6221
6222 2004-12-11  Martin Baulig  <martin@ximian.com>
6223
6224         * support.cs (ReflectionParameters.ParameterName): If we have a
6225         `gpd', call `ParameterName' on it.
6226
6227         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6228
6229         * pending.cs (PendingImplementation.DefineProxy): Call
6230         DefineParameter() for all of the MethodBuilder's arguments.
6231
6232 2004-12-09  Martin Baulig  <martin@ximian.com>
6233
6234         * doc.cs (DocUtil): Make this a static class.
6235
6236 2004-12-09  Martin Baulig  <martin@ximian.com>
6237
6238         * expression.cs (Invocation.InferType): Moved the type inference
6239         implementation into TypeManager.
6240
6241         * generics.cs (TypeManager): Moved the type inference
6242         implementation here.
6243
6244 2004-12-09  Martin Baulig  <martin@ximian.com>
6245
6246         * typemanager.cs (TypeManager): Make this a partial class.
6247
6248         * generics.cs
6249         (TypeManager): Move the generics part of `TypeManager' here.
6250
6251 2004-12-08  Martin Baulig  <martin@ximian.com>
6252
6253         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6254         instead of a CS3002 for properties and indexer.  Added CS3024
6255         check for generic interfaces.
6256
6257         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6258         instances are not CLS-compliant.
6259
6260 2004-12-08  Martin Baulig  <martin@ximian.com>
6261
6262         * cs-parser.jay
6263         (void_pointer_expression): New rule for `void*', `void**' etc.
6264         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6265
6266 2004-12-08  Martin Baulig  <martin@ximian.com>
6267
6268         * expression.cs (Invocation.InferType): Removed the hack for
6269         MethodCore.MayUnify().  
6270
6271         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6272         this actually work.
6273
6274         * class.cs (MethodCore.MayUnify): Use
6275         TypeManager.MayBecomeEqualGenericTypes().       
6276
6277 2004-12-08  Martin Baulig  <martin@ximian.com>
6278
6279         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6280         parameter, box it.  Fixes #69233.
6281
6282 2004-12-08  Martin Baulig  <martin@ximian.com>
6283
6284         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6285         have the ctor constraint.  Fixes #68326.
6286
6287 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6288
6289         * cs-parser.jay : interface comment was not consumed because of
6290           extra opt_semicolon before doc handling.
6291
6292 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6293
6294         Fix test-327.cs, test-328.cs, and put in early infrastructure
6295         for eventually fixing #52697.
6296         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6297         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6298         from other methods.
6299         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6300         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6301         (VerifyUsing, error246): Update.
6302         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6303         'NamespaceEntry.LookupNamespaceOrType'.
6304
6305 2004-12-07  Martin Baulig  <martin@ximian.com>
6306
6307         * driver.cs: Call it "BETA SOFTWARE" :-)
6308
6309 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6310
6311         Fix crash on cs0657-17.cs.
6312         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6313         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6314         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6315         the case where the NamespaceEntry gets overwritten.
6316
6317 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6318
6319         Fixed #69195, #56821
6320         * ecore.cs (ResolveBoolean): Tiny refactoring.
6321
6322         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6323         of right expression resolving when left is false constant and
6324         operator is LogicalAnd OR true constant and operator is LogicalOr.
6325
6326         * statement.cs (ResolveUnreachable): Always reports warning.
6327
6328 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6329
6330         * class.cs: Distinguish between 1721 and 1722 (just a little help
6331         for the programmer).
6332
6333 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * delegate.cs: Only allow this on new versions of the language. 
6336
6337 2004-12-02  Duncan Mak  <duncan@ximian.com>
6338
6339         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6340         Expression class.
6341         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6342         here as a static method. Take an additional bool out parameter
6343         `must_do_cs1540_check' for signaling to InstanceResolve.
6344         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6345         member field from PropertyExpr class and made it an argument of
6346         the method instead.
6347         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6348         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6349         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6350         and `remove_accessor' as well as InstanceResolve: report CS0122
6351         where applicable.
6352
6353         Fixes #70129.
6354
6355 2004-12-07  Martin Baulig  <martin@ximian.com>
6356
6357         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6358         and CS0692 where appropriate.
6359
6360 2004-12-06  Martin Baulig  <martin@ximian.com>
6361
6362         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6363         IsDuplicateImplementation() and improved it.
6364
6365         * expression.cs (Invocation.InferTypeArguments): Added
6366         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6367         and removed the "ref" modifier from `infered_types'.
6368
6369         * decl.cs (MemberName.ToString): Removed the exception.
6370
6371 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6372
6373         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6374           comments are allowed.
6375
6376 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6377
6378         * delegate.cs: Add checks for subtypes in paramaters and return values
6379         in VerifyMethod () to add support for Covariance/Contravariance
6380         in delegates.
6381         
6382 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6383
6384         * report.cs: Remove extra closing parenthesis.
6385
6386         * convert.cs (Error_CannotImplicitConversion): If the name of the
6387         types are the same, provide some extra information.
6388
6389 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6390
6391         Fix bug #70102
6392         * attribute.cs (Resolve): Improved implementation of params
6393         attribute arguments.
6394
6395         * support.cs (ParameterData): Add HasParams to be faster.
6396
6397 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6398
6399         all things are for /doc support:
6400
6401         * doc.cs: new file that supports XML documentation generation.
6402         * mcs.exe.sources: added doc.cs.
6403         * driver.cs:
6404           Handle /doc command line option.
6405           Report error 2006 instead of 5 for missing file name for /doc.
6406           Generate XML documentation when required, after type resolution.
6407         * cs-tokenizer.cs:
6408           Added support for picking up documentation (/// and /** ... */),
6409           including a new XmlCommentState enumeration.
6410         * cs-parser.jay:
6411           Added lines to fill Documentation element for field, constant,
6412           property, indexer, method, constructor, destructor, operator, event
6413           and class, struct, interface, delegate, enum.
6414           Added lines to warn incorrect comment.
6415         * rootcontext.cs :
6416           Added Documentation field (passed only when /doc was specified).
6417         * decl.cs:
6418           Added DocComment, DocCommentHeader, GenerateDocComment() and
6419           OnGenerateDocComment() and some supporting private members for
6420           /doc feature to MemberCore.
6421         * class.cs:
6422           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6423         * delegate.cs:
6424           Added overriden DocCommentHeader.
6425         * enum.cs:
6426           Added overriden DocCommentHeader and GenerateDocComment().
6427
6428 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6429
6430         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6431         unwrapping the enumeration values, chain to
6432         DoConstantNumericPromotions again, so we can promote things to the
6433         fundamental types (takes care of enums that are bytes, sbytes).
6434
6435         Fixes bug #62054.
6436
6437 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6438
6439         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6440         Fix long-standing bug in type-lookup.  Use FindType instead of
6441         LookupType when ec.ResolvingTypeTree.
6442         (Attribute.ResolveType, Attribute.Resolve)
6443         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6444         Update to changes.
6445         (Attributes.Search): Remove internal version.  Update.
6446         (Attributes.SearchMulti): Update.
6447         (Attributes.GetClsCompliantAttribute): Remove.
6448         (Attributes.GetIndexerNameAttribute): Remove.
6449         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6450         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6451         * class.cs (Indexer.Define): Likewise.
6452
6453 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6454
6455         Fix bug #68790
6456         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6457         MarshallByReference members access.
6458
6459         * expression.cs: Use CheckMarshallByRefAccess;
6460         Better error CS0197 message.
6461
6462         * report.cs: Print whole related error message.
6463
6464 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6465
6466         * class (GetClassBases): Better error 60 report.
6467         (EventProperty): Disabled warning 67 detection.
6468
6469 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6470
6471         Fix bug #60324
6472         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6473
6474         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6475         precise values.
6476
6477 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6478
6479         Fix bug #49488
6480         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6481
6482         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6483
6484 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6485
6486         * attribute.cs (Attribute.Resolve): Refine error reporting and
6487         report a cs0117 if the identifier does not exist, to distinguish
6488         from 0617 which is a miss-use of the actual identifier.
6489
6490         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6491         between cs0070 and cs0079.
6492
6493         * class.cs (MemberBase.DoDefine): When reporting a wrong
6494         accessibility level, we use MethodCore to compare instead of
6495         Method (this was a regression in some refactoring effort).
6496
6497         So now we correctly report cs0056 again.
6498
6499         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6500         testing the target_type (which was known to be object_type) and
6501         not the source type (which is anonymous_method).
6502
6503         Fixed reporting of error cs1660.
6504
6505         * expression.cs (UserCast.Source): Expose the underlying cast.
6506
6507         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6508         allowed types to find a match to int32 first (most common).
6509
6510         In addition, it ignores any ImplicitUserConversions that did an
6511         internal implicit conversion (as the switch statement allows only
6512         one integral conversion to exist).
6513
6514         * class.cs (PartialContainer.Create): rename `name' to
6515         `member_name' for clarity.  Then replace the string calls with a
6516         call to MemberName.GetPartialName, as now using
6517         MemberName.ToString is an error (this is due to the side effects
6518         it had, that were fixed in the past).
6519
6520         This will restore the error reporting on a number of partial class
6521         errors that were missusing this (and getting an exception as a
6522         results, which is now just a plain textual warning, because
6523         yyparse debug output would crash otherwise).
6524
6525 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6526
6527         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6528
6529 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6530
6531         * rootcontext.cs (LookupType): Make sure to cache lookups that
6532         don't give us a negative result. This saves about 5% of corlib
6533         compilation time.
6534
6535 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6536
6537         * report.cs (AbstractMessage.Print): messages are sent to stderr
6538
6539         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6540         non-interface in the list of interfaces (at this point, either
6541         parent was properly set, or a base class is being listed in the
6542         interfaces section).
6543
6544         This flags error 1722, and resolves the crash from bug 69259.
6545
6546 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6547
6548         * statement.cs (Using.EmitExpressionFinally): make this work right
6549         for valuetypes. Fixes 69926.
6550
6551 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6552
6553         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6554         converted to an enum" here, before we try to change the underlying
6555         type.  This code exists, but it is a different code path than the
6556         one used while encoding constants.
6557
6558         (ImplicitReferenceConversionExists): In addition, resynchronized
6559         the code here, so it matches the same code in
6560         ImplicitReferenceConversionExists for the `from any class-type S
6561         to any interface-type T'.       
6562
6563 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6564
6565         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6566
6567 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6568
6569         * cs-parser.jay: Use verbosity accordingly. 
6570
6571 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6572
6573         * expression.cs (Unary.ResolveOperator): Do not report warning;
6574         AddressOf reads from variable.
6575         
6576         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6577
6578 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6579
6580         Fix bug #69462
6581
6582         * attribute.cs (Attributable): Removed CheckTargets.
6583         (Attributes.Emit): Explicit attribute targets are tested here.
6584
6585         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6586         not enabled for interfaces.
6587
6588         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6589         (GetAssemblyName): Ouch next bug there.
6590
6591 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6592
6593         * expression.cs: Error 275 added.
6594         
6595 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6596
6597         Fix bug #69177 (Implemented decimal constant support)
6598
6599         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6600         (BinaryFold): Add DecimalConstant.
6601
6602         * const.cs (Define): Decimal constant 
6603         (is not constant.
6604         (ChangeType): Add decimal type handling.
6605         (LookupConstantValue): Don't set value for decimal type but
6606         emit DecimalConstantAttribute. Needed for constant optimization.
6607
6608         * constant.cs (ToDecimal): New method.
6609         (ConvertToDecimal): New method.
6610         (IntConstant): Implemented ConvertToDecimal.
6611         (DecimalConstant.Emit): Emit optimized version for decimals in
6612         int range.
6613
6614         * expression.cs (ResolveOperator): Changed order of constant
6615         reduction to work correctly with native types which have
6616         overloaded operators.
6617         (ResolveMemberAccess): Extract constant value from attribute
6618         for decimal type.
6619
6620         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6621
6622         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6623         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6624         (ChangeType): Decimal is special.
6625         (TypeToCoreType): Add decimal type.
6626
6627 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6628
6629         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6630         decimal types.
6631
6632 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6633
6634         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6635         test cs1667-5.cs.
6636
6637 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6638
6639         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6640
6641         * pending.cs (PendingImplementation): Grab only interfaces.
6642
6643 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6644
6645         * statement.cs (ForeachHelperMethods): Add location member and
6646         error 202 detection.
6647
6648 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6649
6650         * expression.cs (DoResolveBase): Fixed wrong warning for out
6651         variables.
6652
6653 2004-12-04  Martin Baulig  <martin@ximian.com>
6654
6655         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6656         to check whether the conversion is ok.
6657
6658         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6659         `Type.EmptyTypes' if we're not a generic TypeContainer.
6660
6661 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6662
6663         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6664         old bug: when converting from the null literal to a pointer,
6665         return an EmptyCast, not the NullLiteral.
6666
6667         This fixes #69921, the recent null_type changes probably made this
6668         bug more prominent.
6669
6670 2004-12-03  Martin Baulig  <martin@ximian.com>
6671
6672         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6673         method as our child, call AnonymousMethod.Compatible() on it.
6674
6675 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6676
6677         * class.cs (FieldBase): Use an unused bit field from the field to
6678         encode the `has_offset' property from the FieldMember.  This saves
6679         a couple of Ks on bootstrap compilation.
6680
6681         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6682         method as our child, return the AnonymousMethod resolved
6683         expression.
6684
6685         * expression.cs (New.DoResolve): Allow return values from
6686         NewDelegate to also include AnonymousMethods.
6687
6688         Fixes #70150.
6689
6690 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6691
6692         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6693         cs1648 report.
6694         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6695         System.Runtime.InteropServices._Exception, since it's a base
6696         interface of the core type System.Exception in the net_2_0 profile.
6697
6698 2004-11-27  Martin Baulig  <martin@ximian.com>
6699
6700         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6701
6702 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6703
6704         * Makefile: Convert to use executable.make.
6705         * gmcs.exe.sources: New.
6706
6707 2004-11-25  Martin Baulig  <martin@ximian.com>
6708
6709         * expression.cs (Invocation.InferType): Added support for byref types.
6710
6711 2004-11-25  Martin Baulig  <martin@ximian.com>
6712
6713         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6714         in TypeManager.TypeToCoreType().
6715
6716 2004-11-25  Martin Baulig  <martin@ximian.com>
6717
6718         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6719         "Dispose" method from the `current_type'.
6720         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6721         DoDefineMembers() instead of using the MethodBuilder; this is
6722         required for generic iterators.
6723
6724         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6725
6726 2004-11-24  Martin Baulig  <martin@ximian.com>
6727
6728         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6729
6730 2004-11-20  Martin Baulig  <martin@ximian.com>
6731
6732         * expression.cs (Invocation.InferType): Correctly infer generic
6733         instances; see gen-103.cs.
6734         (Invocation.InferTypeArguments): If a generic method doesn't have
6735         any unbound type parameters, we don't need to infer anything.
6736
6737 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6738
6739         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6740
6741 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6742
6743         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6744         (TypeHandle.GetMemberCache): New.
6745         (TypeHandle.TypeHandle): Update.
6746         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6747         (TypeManager.LookupParentInterfacesCache):
6748         Rename from LookupInterfaceCache.  Optimize slightly.
6749         (TypeManager.MemberLookup_FindMembers): Update.
6750         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6751         multi-type variant.
6752         (AddCacheContents): Rename from AddHashtable.
6753         * class.cs (TypeContainer.parent_container): Remove.
6754         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6755         (TypeContainer.DoDefineMembers): Don't initialize it.
6756         Update to name changes.
6757         
6758 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6759
6760         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6761         that factors the code to check access modifiers on override.  
6762
6763         (PropertyBase): Use the code here.
6764
6765         Patch from Lluis S'anchez, fixes bug #69361.
6766
6767 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6768
6769         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6770         routine that is used to report the use of a captured variable
6771         whose address has been taken.
6772
6773         There are two checks: one when variables are being captured and
6774         the other check is when the address of a variable is taken. 
6775         
6776         (because an anonymous methods might be resolved before *or* after
6777         the address has been taken) and 
6778
6779         * expression.cs (Conditional.DoResolve): Remove the special
6780         casing that Martin added to trueExpr and falseExpr being both
6781         NullLiteral.  We get the right behavior now just by introducing
6782         the null_type into the compiler. 
6783
6784         * convert.cs (ExplicitConversion): Change the code to use
6785         null_type instead of testing `expr is NullLiteral'.
6786         (ImplicitConversionStandard): use null_type too.
6787         (ImplicitReferenceConversionExists): use null_type too.
6788         (ImplicitReferenceConversion): use null_type too.
6789
6790         * literal.cs: The type of `NullLiteral' is now null_type instead
6791         of object_type. 
6792         (Resolve): Set the type here.
6793
6794         * typemanager.cs: Introduce null_type.
6795
6796 2004-11-18  Martin Baulig  <martin@ximian.com>
6797
6798         * rootcontext.cs
6799         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6800
6801 2004-11-18  Martin Baulig  <martin@ximian.com>
6802
6803         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6804
6805 2004-11-18  Martin Baulig  <martin@ximian.com>
6806
6807         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6808         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6809         call ResolveConstructedType() on it to resolve it without checking
6810         constraints.
6811         (Constraints.ResolveTypes): Check them here.
6812         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6813         but don't check constraints.
6814         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6815         check constraints here.
6816         (ConstructedType.ResolveConstructedType): New public method.  This
6817         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6818         resolve ourselves without checking constraints.
6819
6820         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6821
6822 2004-11-18  Martin Baulig  <martin@ximian.com>
6823
6824         * decl.cs
6825         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6826
6827         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6828
6829 2004-11-18  Martin Baulig  <martin@ximian.com>
6830
6831         * ecore.cs (TypeExpr.ResolveType): Removed.
6832         (Expression.ResolveAsTypeTerminal): We always return a fully
6833         resolved `TypeExpr', so we can just access its `Type'.
6834
6835         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6836
6837 2004-11-17  Martin Baulig  <martin@ximian.com>
6838
6839         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6840         sure we don't return any unresolved TypeExpr's.
6841         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6842         a `TypeExpr'.
6843         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6844
6845         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6846         unresolved `ConstructedType's.
6847
6848 2004-11-17  Martin Baulig  <martin@ximian.com>
6849
6850         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6851
6852 2004-11-17  Martin Baulig  <martin@ximian.com>
6853
6854         * ecore.cs
6855         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6856
6857         * decl.cs (DeclSpace.ResolveType): Removed.
6858         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6859
6860 2004-11-17  Martin Baulig  <martin@ximian.com>
6861
6862         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6863         direction, like FindMembers() does.  Fixes #69546, testcase is in
6864         test-315.cs.    
6865
6866 2004-11-16  Martin Baulig  <martin@ximian.com>
6867
6868         This is based on a patch from Marek Safar, see bug #69082.
6869         Fixes bugs #63705 and #67130.
6870
6871         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6872         method; create a MemberCache for an interface type and cache the
6873         result.
6874
6875         * decl.cs (IMemberContainer.ParentContainer): Removed.
6876         (IMemberContainer.ParentCache): New property.
6877         (MemberCache.SetupCacheForInterface): Removed.
6878         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6879         to create a cache for an interface's "parent".
6880
6881         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6882         interfaces too.
6883
6884 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6885
6886         * statement.cs: Avoid adding bools to a hashtable.
6887
6888 2004-11-15  Martin Baulig  <martin@ximian.com>
6889
6890         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6891
6892 2004-11-11  Martin Baulig  <martin@ximian.com>
6893
6894         * typemanager.cs (TypeManager.GetMethodName): New method.
6895
6896         * class.cs (MethodData.Define): Include the generic arity in the
6897         name of an explicit interface; also add it to the method name.
6898
6899         * pending.cs (PendingImplementation.InterfaceMethod): The method
6900         name now includes the generic arity.
6901
6902 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6903
6904         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6905         calling an unsafe method from a safe location.
6906
6907 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6908
6909         Fix #69167
6910         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6911
6912 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6913
6914         * namespace.cs (VerifyUsing): use GetPartialName instead of
6915         ToString. 
6916
6917 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6918
6919         * statement.cs (Return.Resolve): Fix regression in typo: if
6920         `in_exc', we have to request a NeedReturnLabel, this was a typo
6921         introduced in the anonymous method check-in.  Fixes #69131.
6922
6923         * Indexers were using the ShortName when defining themselves,
6924         causing a regression in the compiler bootstrap when applying the
6925         patch from 2004-11-02 (first part), now they use their full name
6926         and the bug is gone.
6927
6928 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6929
6930         * driver.cs: Strip the path from the names of embedded resources. Fixes
6931         #68519.
6932
6933 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6934
6935         Fix error message regression: cs0104-2.cs.
6936         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6937         (AliasEntry.Resolve): Update.
6938         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6939         'silent' flag.
6940         (RootContext.LookupType): Update.
6941
6942 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6943
6944         * cs-parser.jay: Add support for handling accessor modifiers
6945         * class: Add support port accessor modifiers and error checking,
6946         define PropertyMethod.Define as virtual (not abstract anymore)
6947         * ecore.cs: Add checking for proeprties access with access modifiers
6948         * iterators.cs: Modify Accessor constructor call based in the modified
6949         constructor
6950 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6951
6952         * expression.cs (StringConcat): Handle being called twice,
6953         as when we have a concat in a field init with more than two
6954         ctors in the class
6955
6956 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6957
6958         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6959         special case explicit implementations, we should always produce
6960         the .property or .event declaration.
6961         
6962         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6963         since it will not return correct data if people use this
6964         unresolved in the presence of using statements (see test-313).
6965
6966         * class.cs (MethodData.Define): If we are an explicit interface
6967         implementation, set the method name to the full name of the
6968         interface plus the name of the method.  
6969
6970         Notice that using the method.MethodName.GetFullName() does not
6971         work, as it will only contain the name as declared on the source
6972         file (it can be a shorthand in the presence of using statements)
6973         and not the fully qualifed type name, for example:
6974
6975         using System;
6976
6977         class D : ICloneable {
6978                 object ICloneable.Clone ()  {
6979                 }
6980         }
6981
6982         Would produce a method called `ICloneable.Clone' instead of
6983         `System.ICloneable.Clone'.
6984
6985         * namespace.cs (Alias.Resolve): Use GetPartialName.
6986         
6987 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6988
6989         * cs-parser.jay: Add error 1055 report.
6990
6991 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6992
6993         * assign.cs (Assign.DoResolve): Only do the transform of
6994         assignment into a New if the types are compatible, if not, fall
6995         through and let the implicit code deal with the errors and with
6996         the necessary conversions. 
6997
6998 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6999
7000         * cs-parser.jay: Add error 1031 report.
7001
7002         * cs-tokenizer.cs: Add location for error 1038.
7003
7004 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7005
7006         * cs-parser.jay: Add error 1016 report.
7007
7008 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7009
7010         * cs-parser.jay: Add errors 1575,1611 report.
7011
7012 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7013
7014         * cs-parser.jay: Add error 1001 report.
7015
7016 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7017
7018         Fix #68850
7019         * attribute.cs (GetMarshal): Add method argument for
7020         caller identification.
7021
7022         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7023         agument for GetMarshal and RuntimeMissingSupport.
7024
7025 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7026
7027         * attribute.cs (ExtractSecurityPermissionSet): Removed
7028         TypeManager.code_access_permission_type.
7029
7030         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7031
7032 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7033
7034         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7035         for obsolete use of a variable here.   Fixes regression on errors
7036         cs0619-25 and cs0619-26.
7037
7038 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7039
7040         Fix #62358, implemented security attribute encoding.
7041
7042         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7043         Tests permitted SecurityAction for assembly or other types.
7044         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7045         data from SecurityPermissionAttribute to PermisionSet class.
7046
7047         * class.cs (ApplyAttributeBuilder): Added special handling
7048         for System.Security.Permissions.SecurityAttribute based types.
7049
7050         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7051         special handling for System.Security.Permissions.SecurityAttribute
7052         based types.
7053
7054         * enum.cs (ApplyAttributeBuilder): Added special handling
7055         for System.Security.Permissions.SecurityAttribute based types.
7056
7057         * parameter.cs (ApplyAttributeBuilder): Added special handling
7058         for System.Security.Permissions.SecurityAttribute based types.
7059
7060         * rootcontext.cs: Next 2 core types.
7061
7062         * typemanager.cs (TypeManager.security_permission_attr_type):
7063         Built in type for the SecurityPermission Attribute.
7064         (code_access_permission_type): Build in type.
7065
7066 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7067
7068         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7069         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7070         all of this information into
7071         EmitContext.EmitCapturedVariableInstance.
7072         
7073         * codegen.cs (EmitCapturedVariableInstance): move here the
7074         funcionality of emitting an ldarg.0 in the presence of a
7075         remapping.   This centralizes the instance emit code.
7076
7077         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7078         then emit a load of this: it means that we have reached the
7079         topmost ScopeInfo: the one that contains the pointer to the
7080         instance of the class hosting the anonymous method.
7081
7082         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7083         captures to the topmost CaptureContext.
7084
7085 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7086
7087         * expression.cs (LocalVariableReference): Move the knowledge about
7088         the iterators into codegen's EmitCapturedVariableInstance.
7089
7090 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7091
7092         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7093         all code paths return a value from an anonymous method (it is the
7094         same as the 161 error, but for anonymous methods).
7095
7096 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7097
7098         The introduction of anonymous methods in the compiler changed
7099         various ways of doing things in the compiler.  The most
7100         significant one is the hard split between the resolution phase
7101         and the emission phases of the compiler.
7102
7103         For instance, routines that referenced local variables no
7104         longer can safely create temporary variables during the
7105         resolution phase: they must do so from the emission phase,
7106         since the variable might have been "captured", hence access to
7107         it can not be done with the local-variable operations from the runtime.
7108         
7109         * statement.cs 
7110
7111         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7112         is a toplevel block.
7113
7114         (ToplevelBlock): A new kind of Block, these are the blocks that
7115         are created by the parser for all toplevel method bodies.  These
7116         include methods, accessors and anonymous methods.
7117
7118         These contain some extra information not found in regular blocks:
7119         A pointer to an optional CaptureContext (for tracking captured
7120         local variables and parameters).  A pointer to the parent
7121         ToplevelBlock.
7122         
7123         (Return.Resolve): Catch missmatches when returning a value from an
7124         anonymous method (error 1662).
7125         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7126         phase.
7127
7128         (Break.Resolve): ditto.
7129
7130         (SwitchLabel): instead of defining the labels during the
7131         resolution phase, we now turned the public ILLabel and ILLabelCode
7132         labels into methods called GetILLabelCode() and GetILLabel() that
7133         only define the label during the Emit phase.
7134
7135         (GotoCase): Track the SwitchLabel instead of the computed label
7136         (its contained therein).  Emit the code by using
7137         SwitchLabel.GetILLabelCode ().
7138
7139         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7140         whether the Local has been captured or not.
7141
7142         (LocalInfo.IsCaptured): New property, used to tell whether the
7143         local has been captured.
7144         
7145         * anonymous.cs: Vastly updated to contain the anonymous method
7146         support.
7147
7148         The main classes here are: CaptureContext which tracks any
7149         captured information for a toplevel block and ScopeInfo used to
7150         track the activation frames for various local variables.   
7151
7152         Each toplevel block has an optional capture context associated
7153         with it.  When a method contains an anonymous method both the
7154         toplevel method and the anonymous method will create a capture
7155         context.   When variables or parameters are captured, they are
7156         recorded on the CaptureContext that owns them, for example:
7157
7158         void Demo () {
7159              int a;
7160              MyDelegate d = delegate {
7161                  a = 1;
7162              }
7163         }
7164
7165         Here `a' will be recorded as captured on the toplevel
7166         CapturedContext, the inner captured context will not have anything
7167         (it will only have data if local variables or parameters from it
7168         are captured in a nested anonymous method.
7169
7170         The ScopeInfo is used to track the activation frames for local
7171         variables, for example:
7172
7173         for (int i = 0; i < 10; i++)
7174                 for (int j = 0; j < 10; j++){
7175                    MyDelegate d = delegate {
7176                         call (i, j);
7177                    }
7178                 }
7179
7180         At runtime this captures a single captured variable `i', but it
7181         captures 10 different versions of the variable `j'.  The variable
7182         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7183         recorded on a child.  
7184
7185         The toplevel ScopeInfo will also track information like the `this'
7186         pointer if instance variables were referenced (this is necessary
7187         as the anonymous method lives inside a nested class in the host
7188         type of the method). 
7189
7190         (AnonymousMethod): Expanded to track the Toplevel, implement
7191         `AnonymousMethod.Compatible' to tell whether an anonymous method
7192         can be converted to a target delegate type. 
7193
7194         The routine now also produces the anonymous method content
7195
7196         (AnonymousDelegate): A helper class that derives from
7197         DelegateCreation, this is used to generate the code necessary to
7198         produce the delegate for the anonymous method that was created. 
7199
7200         * assign.cs: API adjustments for new changes in
7201         Convert.ImplicitStandardConversionExists.
7202
7203         * class.cs: Adjustments to cope with the fact that now toplevel
7204         blocks are of type `ToplevelBlock'. 
7205
7206         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7207         insteda of standard blocks.
7208
7209         Flag errors if params arguments are passed to anonymous methods.
7210
7211         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7212         `CurrentAnonymousMethod' which points to the current Anonymous
7213         Method.  The variable points to the AnonymousMethod class that
7214         holds the code being compiled.  It is set in the new EmitContext
7215         created for the anonymous method.
7216
7217         (EmitContext.Phase): Introduce a variable and an enumeration to
7218         assist in enforcing some rules about when and where we are allowed
7219         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7220         only one that enfonces this right now).
7221
7222         (EmitContext.HaveCaptureInfo): new helper method that returns
7223         whether we have a CapturedContext initialized.
7224
7225         (EmitContext.CaptureVariable): New method used to register that a
7226         LocalInfo must be flagged for capturing. 
7227
7228         (EmitContext.CapturedParameter): New method used to register that a
7229         parameters must be flagged for capturing. 
7230         
7231         (EmitContext.CapturedField): New method used to register that a
7232         field must be flagged for capturing. 
7233
7234         (EmitContext.HaveCapturedVariables,
7235         EmitContext.HaveCapturedFields): Return whether there are captured
7236         variables or fields. 
7237
7238         (EmitContext.EmitMethodHostInstance): This is used to emit the
7239         instance for the anonymous method.  The instance might be null
7240         (static methods), this (for anonymous methods that capture nothing
7241         and happen to live side-by-side with the current method body) or a
7242         more complicated expression if the method has a CaptureContext.
7243
7244         (EmitContext.EmitTopBlock): Routine that drives the emission of
7245         code: it will first resolve the top block, then emit any metadata
7246         and then emit the code.  The split is done so that we can extract
7247         any anonymous methods and flag any captured variables/parameters.
7248         
7249         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7250         during this phase, the ILGenerator should not be used as labels
7251         and local variables declared here might not be accessible to any
7252         code that is part of an anonymous method.  
7253
7254         Exceptions to this include the temporary variables that are
7255         created by some statements internally for holding temporary
7256         variables. 
7257         
7258         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7259         metadata for a cb
7260
7261         (EmitContext.TemporaryReturn): This method is typically called
7262         from the Emit phase, and its the only place where we allow the
7263         ReturnLabel to be defined other than the EmitMeta.  The reason is
7264         that otherwise we would have to duplicate a lot of logic in the
7265         Resolve phases of various methods that today is on the Emit
7266         phase. 
7267
7268         (EmitContext.NeedReturnLabel): This no longer creates the label,
7269         as the ILGenerator is not valid during the resolve phase.
7270
7271         (EmitContext.EmitThis): Extended the knowledge in this class to
7272         work in anonymous methods in addition to iterators. 
7273
7274         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7275         code is necessary on the stack to access the instance to a local
7276         variable (the variable will be accessed as a field).
7277
7278         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7279         EmitContext.EmitAddressOfParameter): Routines to support
7280         parameters (not completed at this point). 
7281         
7282         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7283         will also remove the parameters.
7284
7285         * convert.cs (Convert): Define a `ConstantEC' which points to a
7286         null.  This is just to prefity some code that uses
7287         ImplicitStandardConversion code and do not have an EmitContext
7288         handy.
7289
7290         The idea is to flag explicitly that at that point in time, it is
7291         known that the conversion will not trigger the delegate checking
7292         code in implicit conversions (which requires a valid
7293         EmitContext). 
7294
7295         Everywhere: pass new EmitContext parameter since
7296         ImplicitStandardConversionExists now requires it to check for
7297         anonymous method conversions. 
7298
7299         (Convert.ImplicitStandardConversionExists): If the type of an
7300         expression is the anonymous_method_type, and the type is a
7301         delegate, we invoke the AnonymousMethod.Compatible method to check
7302         whether an implicit conversion is possible. 
7303
7304         (Convert.ImplicitConversionStandard): Only do implicit method
7305         group conversions if the language level is not ISO_1.
7306
7307         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7308         MethodInfo for the Invoke method.  used by Delegate and
7309         AnonymousDelegate.
7310
7311         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7312         method conversions if the target type is a delegate.
7313
7314         Removed extra debugging nops.
7315
7316         (LocalVariableReference): Turn the `local_info' into a public
7317         field. 
7318
7319         Add `prepared' field, the same hack used for FieldExprs to cope
7320         with composed assignments, as Local variables do not necessarily
7321         operate purely on the stack as they used to: they can be captured
7322         fields. 
7323
7324         Add `temp' for a temporary result, like fields.
7325
7326         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7327
7328         It now copes with Local variables that are captured and emits the
7329         proper instance variable to load it from a field in the captured
7330         case. 
7331
7332         (ParameterReference.DoResolveBase): During the resolve phase,
7333         capture parameters if we are in an anonymous method.
7334
7335         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7336         anonymous method, use the EmitContext helper routines to emit the
7337         parameter reference.
7338
7339         * iterators.cs: Set RemapToProxy to true/false during the
7340         EmitDispose class.
7341
7342         * parameters.cs (GetParameterByName): New helper method. 
7343
7344         * typemanager.cs (anonymous_method_type) a new type that
7345         represents an anonyous method.  This is always an internal type,
7346         used as a fencepost to test against the anonymous-methodness of an
7347         expression. 
7348         
7349 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7350
7351         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7352         561 report.
7353         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7354
7355 2004-11-10  Martin Baulig  <martin@ximian.com>
7356
7357         * expression.cs (Invocation.BetterFunction): If two methods have
7358         equal parameter types, but only one of them is generic, the
7359         non-generic one wins.
7360         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7361         instance; just use `Type.IsValueType' to determine whether
7362         something is a struct or not.
7363         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7364         so we can be called multiple times.
7365
7366 2004-11-10  Martin Baulig  <martin@ximian.com>
7367
7368         * generic.cs (TypeParameter.DefineConstraints): New public method.
7369         (TypeParameter.CheckAccessLevel): Override this and return true.
7370         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7371         override ResolveType() anymore.
7372         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7373
7374 2004-11-10  Martin Baulig  <martin@ximian.com>
7375
7376         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7377         call DeclSpace.ResolveNestedType() on it.
7378
7379 2004-11-10  Martin Baulig  <martin@ximian.com>
7380
7381         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7382         non-null, call ParameterModifier() on it.
7383
7384 2004-11-10  Martin Baulig  <martin@ximian.com>
7385
7386         * iterators.cs
7387         (Iterators): Added `current_type' and `this_type' fields.
7388         (Iterators.DefineIterator): Create a new EmitContext and store it
7389         in `ec'; compute `this_type'.
7390
7391 2004-11-10  Martin Baulig  <martin@ximian.com>
7392
7393         * typemanager.cs
7394         (TypeManager.IsPrivateAccessible): New public method.
7395         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7396
7397 2004-11-10  Martin Baulig  <martin@ximian.com>
7398
7399         * class.cs (TypeContainer.DefineType): Call
7400         TypeBuilder.DefineGenericParameters() before resolving the type
7401         parameters.
7402         (MethodData.parent_method): New protected field.
7403         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7404         (MethodData.Define): Compute `parent_method'.
7405
7406         * decl.cs
7407         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7408         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7409         (DeclSpace.ec): New protected field; store the EmitContext here.
7410         (DeclSpace.EmitContext): New public property.
7411         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7412         (DeclSpace.ResolveNestedType): New public method.
7413         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7414         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7415         (DeclSpace.FamilyAccessible): Likewise.
7416         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7417         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7418         EmitContext.
7419
7420         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7421         field.
7422
7423         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7424         (Enum.Emit): Don't create a new EmitContext.
7425
7426 2004-10-18  Martin Baulig  <martin@ximian.com>
7427
7428         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7429         `Type' directly, but call ResolveType() on it.
7430         (Catch.Resolve): Likewise.
7431         (Foreach.Resolve): Likewise.
7432
7433 2004-10-18  Martin Baulig  <martin@ximian.com>
7434
7435         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7436         `Type' directly, but call ResolveType() on it.
7437         (Probe.DoResolve): Likewise.
7438         (ArrayCreation.LookupType): Likewise.
7439         (TypeOf.DoResolve): Likewise.
7440         (SizeOf.DoResolve): Likewise.
7441
7442 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7443
7444         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7445         the ResolveType.
7446
7447 2004-10-17  John Luke  <john.luke@gmail.com>
7448
7449         * class.cs (Operator.GetSignatureForError): use CSharpName
7450
7451         * parameter.cs (Parameter.GetSignatureForError): Returns
7452         correct name even if was not defined.
7453
7454 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7455
7456         Fix #65816.
7457         * class.cs (TypeContainer.EmitContext): New property.
7458         (DefineNestedTypes): Create an emitcontext for each part.
7459         (MethodCore.DoDefineParameters): Use container's emitcontext.
7460         Pass type array to InternalParameters.
7461         (MemberBase.DoDefine): Use container's emitcontext.
7462         (FieldMember.Define): Likewise.
7463         (Event.Define): Likewise.
7464         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7465         Pass type array to InternalParameters.
7466         (SetIndexerMethod.GetParameterInfo): Likewise.
7467         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7468         * delegate.cs (Define): Pass emitcontext to
7469         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7470         array to InternalParameters.
7471         * expression.cs (ParameterReference.DoResolveBase): Pass
7472         emitcontext to GetParameterInfo.
7473         (ComposedCast.DoResolveAsTypeStep): Remove check on
7474         ec.ResolvingTypeTree.
7475         * parameter.cs (Parameter.Resolve): Change argument to
7476         EmitContext.  Use ResolveAsTypeTerminal.
7477         (Parameter.GetSignature): Change argument to EmitContext.
7478         (Parameters.ComputeSignature): Likewise.
7479         (Parameters.ComputeParameterTypes): Likewise.
7480         (Parameters.GetParameterInfo): Likewise.
7481         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7482         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7483         * support.cs (InternalParameters..ctor): Remove variant that takes
7484         a DeclSpace.
7485         * typemanager.cs (system_intptr_expr): New.
7486         (InitExpressionTypes): Initialize it.
7487
7488 2004-10-12  Chris Toshok  <toshok@ximian.com>
7489
7490         * cs-parser.jay: fix location for try_statement and catch_clause.
7491
7492 2004-10-18  Martin Baulig  <martin@ximian.com>
7493
7494         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7495         `Type' directly, but call ResolveType() on it.
7496         (MemberBase.DoDefine): Likewise.
7497
7498         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7499         `Type' directly, but call ResolveType() on it.
7500         (ComposedCast.DoResolveAsTypeStep): Likewise.
7501
7502         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7503         `Type' directly, but call ResolveType() on it.
7504
7505 2004-10-17  John Luke  <john.luke@gmail.com>
7506
7507         * class.cs (Operator.GetSignatureForError): use CSharpName
7508
7509         * parameter.cs (Parameter.GetSignatureForError): Returns
7510         correct name even if was not defined.
7511
7512 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7513
7514         Fix #65816.
7515         * class.cs (TypeContainer.EmitContext): New property.
7516         (DefineNestedTypes): Create an emitcontext for each part.
7517         (MethodCore.DoDefineParameters): Use container's emitcontext.
7518         Pass type array to InternalParameters.
7519         (MemberBase.DoDefine): Use container's emitcontext.
7520         (FieldMember.Define): Likewise.
7521         (Event.Define): Likewise.
7522         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7523         Pass type array to InternalParameters.
7524         (SetIndexerMethod.GetParameterInfo): Likewise.
7525         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7526         * delegate.cs (Define): Pass emitcontext to
7527         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7528         array to InternalParameters.
7529         * expression.cs (ParameterReference.DoResolveBase): Pass
7530         emitcontext to GetParameterInfo.
7531         (ComposedCast.DoResolveAsTypeStep): Remove check on
7532         ec.ResolvingTypeTree.
7533         * parameter.cs (Parameter.Resolve): Change argument to
7534         EmitContext.  Use ResolveAsTypeTerminal.
7535         (Parameter.GetSignature): Change argument to EmitContext.
7536         (Parameters.ComputeSignature): Likewise.
7537         (Parameters.ComputeParameterTypes): Likewise.
7538         (Parameters.GetParameterInfo): Likewise.
7539         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7540         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7541         * support.cs (InternalParameters..ctor): Remove variant that takes
7542         a DeclSpace.
7543         * typemanager.cs (system_intptr_expr): New.
7544         (InitExpressionTypes): Initialize it.
7545
7546 2004-10-12  Chris Toshok  <toshok@ximian.com>
7547
7548         * cs-parser.jay: fix location for try_statement and catch_clause.
7549
7550 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7551
7552         More DeclSpace.ResolveType avoidance.
7553         * decl.cs (MemberCore.InUnsafe): New property.
7554         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7555         with newly created EmitContext.
7556         (FieldMember.Define): Likewise.
7557         * delegate.cs (Delegate.Define): Likewise.
7558         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7559         only if normal name-lookup fails.
7560         (TypeExpr.DoResolve): Enable error-checking.
7561         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7562         (SizeOf.DoResolve): Likewise.
7563         (ComposedCast.DoResolveAsTypeStep): Likewise.
7564         (StackAlloc.DoResolve): Likewise.
7565         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7566         (Block.Unsafe): New property.
7567         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7568         (Unsafe): Set 'unsafe' flag of contained block.
7569         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7570         (Fixed.Resolve): Likewise.
7571         (Catch.Resolve): Likewise.
7572         (Using.ResolveLocalVariableDecls): Likewise.
7573         (Foreach.Resolve): Likewise.
7574
7575 2004-10-05  John Luke <john.luke@gmail.com>
7576
7577         * cs-parser.jay: add location to error CS0175
7578
7579 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7580
7581         * ecore.cs (Expression.Constantity): Add support for turning null
7582         into a constant.
7583
7584         * const.cs (Const.Define): Allow constants to be reference types
7585         as long as the value is Null.
7586
7587 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7588
7589         * namespace.cs (NamespaceEntry.Using): No matter which warning
7590         level is set, check if this namespace name has already been added.
7591
7592 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7593
7594         * expression.cs: reftype [!=]= null should always use br[true,false].
7595         # 67410
7596
7597 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7598
7599         Fix #67108
7600         * attribute.cs: Enum conversion moved to 
7601         GetAttributeArgumentExpression to be applied to the all
7602         expressions.
7603
7604 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7605
7606         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7607         * class.c (TypeContainer.DefineType): Flag error if
7608         base types aren't accessible due to access permissions.
7609         * decl.cs (DeclSpace.ResolveType): Move logic to
7610         Expression.ResolveAsTypeTerminal.
7611         (DeclSpace.ResolveTypeExpr): Thin layer over
7612         Expression.ResolveAsTypeTerminal.
7613         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7614         Refactor code into NestedAccess.  Use it.
7615         (DeclSpace.NestedAccess): New.
7616         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7617         argument to silence errors.  Check access permissions.
7618         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7619         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7620         (Cast.DoResolve): Likewise.
7621         (New.DoResolve): Likewise.
7622         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7623         (TypeOf.DoResolve): Likewise.
7624
7625         * expression.cs (Invocation.BetterConversion): Return the Type of
7626         the better conversion.  Implement section 14.4.2.3 more faithfully.
7627         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7628         section 14.4.2.2 explicit.
7629         (Invocation.OverloadResolve): Update.
7630         (Invocation): Remove is_base field.
7631         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7632         (Invocation.Emit): Likewise.
7633
7634 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7635
7636         * cs-parser.jay: Reverted 642 warning fix.
7637
7638 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7639
7640         Fix bug #66615
7641         * decl.cs (FindMemberWithSameName): Indexer can have more than
7642         1 argument.
7643
7644 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7645
7646         * expression.cs (LocalVariableReference.DoResolveLValue):
7647         Do not report warning 219 for out values.
7648         (EmptyExpression.Null): New member to avoid extra allocations.
7649
7650 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7651
7652         * cs-parser.jay: Fix wrong warning 642 report.
7653
7654         * cs-tokenizer.cs (CheckNextToken): New helper;
7655         Inspect next character if is same as expected.
7656
7657 2004-09-23  Martin Baulig  <martin@ximian.com>
7658
7659         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7660         (Convert.ImplicitReferenceConversionExists): Likewise.
7661
7662 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7663
7664         * Makefile (DISTFILES): Comment out a few missing files.
7665
7666 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7667
7668         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7669         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7670         (gmcs.exe): Invoke bootstrap-libs.
7671         (clean-local): Clean the net_2_0_bootstrap profile too.
7672         (PROGRAM_INSTALL_DIR): New.
7673         (install-local): Use it.
7674
7675 2004-10-13  Martin Baulig  <martin@ximian.com>
7676
7677         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7678         (TypeParameter.DefineType): If we're a method type parameter and
7679         that method is overriding something, "inflate" its constraints.
7680
7681 2004-10-12  Martin Baulig  <martin@ximian.com>
7682
7683         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7684         and have type arguments, create and resolve a ConstructedType.
7685
7686 2004-10-12  Martin Baulig  <martin@ximian.com>
7687
7688         * decl.cs (MemberCache.FindMemberToOverride): Use
7689         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7690         to compare the invocationType.
7691
7692         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7693         When comparing two type parameters, only do the signature-only
7694         comparision for method type parameters.
7695
7696 2004-10-11  Martin Baulig  <martin@ximian.com>
7697
7698         * report.cs: Don't make --fatal abort on warnings, we have
7699         -warnaserror for that.
7700
7701 2004-10-11  Martin Baulig  <martin@ximian.com>
7702
7703         * typemanager.cs
7704         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7705         (TypeManager.IsEqual): Call ourself recursively instead of using
7706         Type.IsEqual(). 
7707
7708 2004-10-11  Martin Baulig  <martin@ximian.com>
7709
7710         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7711         on our own type parameters, not on the ones we inherit from a containing
7712         class.
7713
7714         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7715         the comparision.
7716
7717         * generic.cs (TypeParameter.Define): We may only be called once.
7718
7719         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7720         instead of TypeManager.IsEqual().
7721
7722 2004-09-28  Martin Baulig  <martin@ximian.com>
7723
7724         * generic.cs
7725         (GenericConstraints.EffectiveBaseClass): New public property.
7726         (TypeParameter.GenericConstraints): New public property.
7727         (ConstructedType.CheckConstraints): Improved.
7728
7729         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7730         (Convert.TypeParameterConversion): New private method; use this in
7731         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7732         for all conversions related to type parameters.
7733
7734 2004-09-24  Martin Baulig  <martin@ximian.com>
7735
7736         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7737         type parameter conversions for type parameters which are known to
7738         be reference types.
7739
7740 2004-09-24  Martin Baulig  <martin@ximian.com>
7741
7742         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7743         `IsValueType' properties.
7744
7745         * support.cs (ReflectionConstraints): Use
7746         Type.GetGenericParameterConstraints() instead of the old hack.
7747
7748 2004-09-24  Martin Baulig  <martin@ximian.com>
7749
7750         * generic.cs (GenericConstraints): Moved here and made it an
7751         abstract class.
7752
7753         * support.cs (GenericConstraints): Moved to generic.cs.
7754
7755 2004-09-24  Martin Baulig  <martin@ximian.com>
7756
7757         * support.cs
7758         (ReflectionConstraints): Un-nested this class and made it public.
7759
7760         * typemanager.cs
7761         (TypeManager.GetTypeParameterConstraints): New public method.
7762         (TypeManager.HasConstructorConstraint): Use the attributes.
7763
7764 2004-09-24  Martin Baulig  <martin@ximian.com>
7765
7766         * support.cs (GenericConstraints): Replaced `HasConstructor',
7767         `IsReferenceType' and `IsValueType' with `Attributes'.
7768         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7769         method and made the .ctor public.
7770
7771         * generic.cs (Constraints.Attributes): New public property.
7772         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7773         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7774         `IsValueType' -> `HasValueTypeConstraint'.
7775
7776 2004-09-23  Martin Baulig  <martin@ximian.com>
7777
7778         * generic.cs (Constraints): Reflect latest runtime changes.
7779
7780 2004-09-23  Martin Baulig  <martin@ximian.com>
7781
7782         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7783         (Convert.ImplicitReferenceConversionExists): Likewise.
7784
7785 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7786
7787         * class.cs (Operator.Define): Add error 448 and 559 report.
7788         
7789 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7790
7791         * class.cs (MemberBase.IsTypePermitted): New protected
7792         method for checking error CS0610.
7793
7794 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7795
7796         * class.cs (TypeContainer.HasExplicitLayout): New property
7797         Returns whether container has StructLayout attribute set Explicit.
7798         (FieldMember): New abstract class for consts and fields.
7799         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7800         (Field): Reuse FieldMember.
7801
7802         * const.cs (Const): Reuse FieldMember.
7803
7804         * rootcontext.cs: EmitConstants call moved to class.
7805
7806 2004-09-22  Martin Baulig  <martin@ximian.com>
7807
7808         Marek and me just fixed one of our oldest bugs: #28562 :-)
7809
7810         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7811
7812         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7813         we're an EnumConstant, just return that.
7814         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7815         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7816         to get the value which'll actually be written into the attribute.
7817         However, we have to use GetValue() to access the attribute's value
7818         in the compiler.        
7819
7820 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7821
7822         * constant.cs (Constant.IsNegative): New abstract property
7823         IsNegative.
7824
7825         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7826         (StackAlloc.DoResolve): Reused IsNegative.
7827
7828 2004-09-22  Martin Baulig  <martin@ximian.com>
7829
7830         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7831         public method; like LookupTypeContainer, but also works for
7832         generic instances.
7833
7834         * report.cs (Report.SymbolRelatedToPreviousError): Use
7835         TypeManager.LookupGenericTypeContainer().       
7836
7837 2004-09-22  Martin Baulig  <martin@ximian.com>
7838
7839         Thanks to Peter Sestoft for this bug report.
7840
7841         * expression.cs (Conditional): If both the `trueExpr' and the
7842         `falseExpr' is a NullLiteral, return a NullLiteral.
7843
7844 2004-09-22  Martin Baulig  <martin@ximian.com>
7845
7846         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7847         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7848         for the "get_Current" call.
7849
7850 2004-09-21  Martin Baulig  <martin@ximian.com>
7851
7852         * convert.cs (Convert.ImplicitReferenceConversion): When
7853         converting to an interface type, first check whether we're
7854         converting from a reference type.
7855
7856 2004-09-14  Martin Baulig  <martin@ximian.com>
7857
7858         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7859
7860 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7861
7862         Fixed bug #61902
7863         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7864         called and is obsolete then this member suppress message
7865         when call is inside next [Obsolete] method or type.
7866
7867         * expression.cs: Use TestObsoleteMethodUsage member.
7868
7869 2004-09-14  Martin Baulig  <martin@ximian.com>
7870
7871         * genericparser.cs: Removed.
7872
7873 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7874
7875         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7876
7877 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7878
7879         * attribute.cs (Attribute.Resolve): Add error 653 report.
7880
7881         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7882         report.
7883         (Method.ApplyAttributeBuilder): Add error 685 report.
7884         (Operator.Define): Add error 564 report.
7885
7886         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7887
7888         * expression.cs (Invocation.DoResolve): Add error
7889         245 and 250 report.
7890
7891         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7892         error 674 report.
7893
7894 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7895
7896         * class.cs (ConstructorInitializer.Resolve):
7897         Wrong error number (515->516).
7898
7899 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7900
7901         * class.cs (Indexer.Define): Add error 631 report.
7902
7903 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7904
7905         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7906
7907 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7908
7909         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7910
7911 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7912
7913         * cs-parser.jay: Added error CS0241 report.
7914
7915 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7916
7917         * cs-parser.jay (fixed_statement): Introduce a scope for the
7918         declaration in the 'fixed' statement.
7919
7920 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7921
7922         * cs-parser.jay: Added CS0230 error report.
7923
7924 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7925
7926         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7927
7928 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7929
7930         * expression.cs (Argument.Resolve): Added error CS0192 and
7931         CS0199 report.
7932
7933 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7934
7935         C# 2.0 #pragma warning feature
7936
7937         * cs-tokenizer.cs (PreProcessPragma): New method; 
7938         Handles #pragma directive.
7939
7940         * report.cs (WarningRegions): New class; Support
7941         class for #pragma warning directive. It tests whether
7942         warning is enabled for a given line.
7943
7944 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7945
7946         * const.cs: Add more descriptive error report, tahnks to
7947         Sebastien. 
7948
7949 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7950
7951         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7952
7953 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * expression.cs: Apply patch from Ben: Remove dead code from
7956         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7957         as that code just threw an exception anwyays.
7958
7959         * const.cs: Remove the call to the turnintoconstant, for details
7960         see bug: #63144
7961         
7962         * literal.cs: The type of the null-literal is the null type;  So
7963         we use a placeholder type (literal.cs:System.Null, defined here)
7964         for it.
7965
7966         * expression.cs (Conditional.DoResolve): Remove some old code that
7967         is no longer needed, conversions have been fixed.
7968
7969         (ArrayCreationExpression.DoResolve): Return false if we fail to
7970         resolve the inner expression.
7971
7972 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7973
7974         Fix test-290.cs.
7975         * cs-parser.jay (delegate_declaration): Record a delegate
7976         declaration as a type declaration.
7977         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7978
7979 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7980
7981         * parameter.cs: Do not crash if the type can not be resolved. 
7982
7983         * expression.cs: Report errors with unsafe pointers, fixes #64896
7984
7985 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7986
7987         * expression.cs: Pointer arith always needs to do a conv.i
7988         if the operand is a long. fix 65320
7989
7990 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7991
7992         Fixed cs0619-37.cs, cs0619-38.cs
7993
7994         * enum.cs (GetObsoleteAttribute): Removed.
7995
7996         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7997         on Enum member is double staged. The first is tested member
7998         and then enum.
7999
8000 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8001
8002         Fixed #56986, #63631, #65231
8003
8004         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8005         adds member to name container.
8006         (TypeContainer.AddToTypeContainer): New method, adds type to
8007         name container.
8008         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8009         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8010         AddOperator): Simplified by reusing AddToMemberContainer.
8011         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8012         instead of field.
8013         (Method.CheckForDuplications): Fixed implementation to test all
8014         possibilities.
8015         (MemberBase): Detection whether member is explicit interface
8016         implementation is now in constructor.
8017         (MemberBase.UpdateMemberName): Handles IndexerName.
8018         (Accessor): Changed to keep also location information.
8019         (AbstractPropertyEventMethod): Is derived from MemberCore.
8020         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8021         will be emited or not.
8022         (PropertyBase.AreAccessorsDuplicateImplementation):
8023         Tests whether accessors are not in collision with some method.
8024         (Operator): Is derived from MethodCore to simplify common
8025         operations.
8026
8027         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8028         must be performed.
8029         (DeclSpace.AddToContainer): Adds the member to defined_names
8030         table. It tests for duplications and enclosing name conflicts.
8031
8032         * enum.cs (EnumMember): Clean up to reuse the base structures
8033
8034 2004-09-03  Martin Baulig  <martin@ximian.com>
8035
8036         Merged latest changes into gmcs.  Please keep this comment in
8037         here, it makes it easier for me to see what changed in MCS since
8038         the last time I merged.
8039
8040 2004-09-03  Martin Baulig  <martin@ximian.com>
8041
8042         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8043         into TypeContainer, to make partial classes work again.
8044
8045 2004-09-03  Martin Baulig  <martin@ximian.com>
8046
8047         * rootcontext.cs (RootContext.V2): Removed.
8048
8049 2004-03-23  Martin Baulig  <martin@ximian.com>
8050
8051         * expression.cs (Invocation.OverloadResolve): Added `bool
8052         may_fail' argument and use it instead of the Location.IsNull() hack.
8053
8054 2004-09-09  Martin Baulig  <martin@ximian.com>
8055
8056         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8057
8058 2004-09-09  Martin Baulig  <martin@ximian.com>
8059
8060         * generic.cs (TypeParameter.DefineType): Added support for
8061         explicit interface methods.
8062
8063 2004-09-09  Martin Baulig  <martin@ximian.com>
8064
8065         * README.Changes: New document.  Started to list important changes
8066         between MCS and GMCS here.
8067
8068 2004-09-08  Martin Baulig  <martin@ximian.com>
8069
8070         * class.cs
8071         (TypeContainer.CheckRecursiveDefinition): New protected method.
8072         (TypeContainer.DefineType): Move the CS0146 check into
8073         CheckRecursiveDefinition().     
8074
8075 2004-09-06  Martin Baulig  <martin@ximian.com>
8076
8077         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8078         types for the constructor constraint.
8079
8080 2004-09-03  Martin Baulig  <martin@ximian.com>
8081
8082         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8083         into TypeContainer, to make partial classes work again.
8084
8085 2004-09-03  Martin Baulig  <martin@ximian.com>
8086
8087         * rootcontext.cs (RootContext.V2): Removed.
8088
8089 2004-03-23  Martin Baulig  <martin@ximian.com>
8090
8091         * expression.cs (Invocation.OverloadResolve): Added `bool
8092         may_fail' argument and use it instead of the Location.IsNull() hack.
8093
8094 2004-09-03  Martin Baulig  <martin@ximian.com>
8095
8096         Merged latest changes into gmcs.  Please keep this comment in
8097         here, it makes it easier for me to see what changed in MCS since
8098         the last time I merged.
8099
8100 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8101
8102         Fix #61128.
8103         * expression.cs (BetterConversion): Don't allow either conversion 
8104         to be null.  Remove redundant implicit conversion test when 'q ==
8105         null' -- when this function is invoked, we already know that the
8106         implicit conversion exists.
8107         (BetterFunction): Assume that 'best' is non-null.  Remove
8108         redundant reimplementation of IsApplicable when 'best' is null.
8109         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8110         number of arguments.
8111         (IsAncestralType): Extract from OverloadResolve.
8112         (OverloadResolve): Make robust to the MethodGroupExpr being
8113         unsorted.  Implement all the logic of Section 14.5.5.1, and
8114         support overloading of methods from multiple applicable types.
8115         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8116
8117         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8118         (RealError, Warning): Append type of report to related symbol.
8119
8120 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8121
8122         * enum.cs: Fixed CLS-Compliance checks for enum members.
8123         Error tests cs3008-8.cs, cs3014-8.cs
8124
8125 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8126
8127         Fixed bug #62342, #63102
8128         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8129         like ImplementMethod.
8130
8131 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8132
8133         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8134         Fixed bug #65170.
8135
8136 2004-09-02  Martin Baulig  <martin@ximian.com>
8137
8138         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8139         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8140         on the MethodBase.
8141
8142 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8143
8144         C# 2.0 Static classes implemented
8145
8146         * class.cs (TypeContainer): instance_constructors,
8147         initialized_fields, initialized_static_fields,
8148         default_constructor, base_inteface_types are protected to be
8149         accessible from StaticClass.
8150         (TypeContainer.DefineDefaultConstructor): New virtual method
8151         for custom default constructor generating
8152         (StaticClass): New class to handle "Static classes" feature.
8153
8154         * cs-parser.jay: Handle static keyword on class like instance
8155         of StaticClass.
8156
8157         * driver.cs: Added "/langversion" command line switch with two
8158         options (iso-1, default).
8159
8160 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8161
8162         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8163
8164 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8165
8166         * delegate.cs: Style.
8167
8168 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8169
8170         * delegate.cs: Add seperate instance expr field for miguel.
8171
8172 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8173
8174         * PointerArithmetic (Resolve): make sure we are not doing
8175         pointer arith on void*. Also, make sure we are resolved
8176         by not setting eclass until resolve.
8177
8178         All callers: Make sure that PointerArithmetic gets resolved.
8179
8180 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8181
8182         * ArrayCreation (LookupType): If the type does not resolve 
8183         to an array, give an error.
8184
8185 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8186
8187         * statement.cs (Try.Resolve): Fixed bug #64222
8188
8189 2004-08-27  Martin Baulig  <martin@ximian.com>
8190
8191         * class.cs
8192         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8193         crash here.     
8194
8195 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8196
8197         * ecore.cs (Constantify): Get underlying type via
8198         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8199         Windows in special cases.
8200
8201 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8202
8203         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8204         for obtaining also private methods.
8205         (GetRemoveMethod): Used GetRemoveMethod (true)
8206         for obtaining also private methods.
8207
8208 2004-09-02  Martin Baulig  <martin@ximian.com>
8209
8210         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8211         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8212         on the MethodBase.
8213
8214 2004-08-27  Martin Baulig  <martin@ximian.com>
8215
8216         * class.cs
8217         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8218         crash here.     
8219
8220 2004-08-25  Martin Baulig  <martin@ximian.com>
8221
8222         * support.cs (ReflectionParameters..ctor): If this is a generic
8223         method, retrieve and store its type parameters.
8224         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8225         (ReflectionParameters.GenericConstraints): The argument specifies
8226         the type parameter, not the method parameter.
8227         (InternalParameters.GenericConstraints): Likewise.
8228
8229         * generic.cs (TypeParameter.DefineType): Correctly handle
8230         constraints wrt. generic methods in interfaces and their
8231         implementations.        
8232
8233 2004-08-24  Martin Baulig  <martin@ximian.com>
8234
8235         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8236         (Constraints.IsSubclassOf): New internal method.
8237
8238         * typemanager.cs (TypeManager.FindMembers): Added special support
8239         for GenericTypeParameterBuilder's.      
8240         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8241         type parameters.
8242
8243 2004-08-24  Martin Baulig  <martin@ximian.com>
8244
8245         * typemanager.cs
8246         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8247         this for accessibility checks.
8248         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8249         IsNestedFamilyAccessible.
8250         (TypeManager.IsSubclassOf): New method, do what the name actually
8251         says.   
8252
8253 2004-08-24  Martin Baulig  <martin@ximian.com>
8254
8255         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8256         as a SimpleName, include the generic arity.
8257
8258 2004-08-24  Martin Baulig  <martin@ximian.com>
8259
8260         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8261         MethodAttributes.HideBySig for operators.
8262
8263 2004-08-23  Martin Baulig  <martin@ximian.com>
8264
8265         Back to the old error reporting system :-)
8266
8267         * report.cs (Message): Removed.
8268         (Report.MessageData, ErrorData, WarningData): Removed.
8269         (Report.Error, Warning): Back to the old system.
8270
8271 2004-08-23  Martin Baulig  <martin@ximian.com>
8272
8273         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8274
8275         * class.cs (TypeContainer.ParentContainer): New public virtual
8276         method; replaces the explicit interface implementation.
8277         (ClassPart.ParentContainer): Override.
8278
8279 2004-08-23  Martin Baulig  <martin@ximian.com>
8280
8281         * statement.cs (Switch): Added support for constant switches; see
8282         #59428 or test-285.cs.
8283
8284 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8285
8286         Fixed bug #62740.
8287         * statement.cs (GetEnumeratorFilter): Removed useless
8288         logic because C# specs is strict. GetEnumerator must be
8289         public.
8290
8291 2004-08-22  Martin Baulig  <martin@ximian.com>
8292
8293         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8294         a switch and may break, reset the barrier.  Fixes #59867.
8295
8296 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8297
8298         CLS-Compliance speed up (~5% for corlib)
8299
8300         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8301         New method. Tests container for CLS-Compliant names
8302
8303         * class.cs (TypeContainer.VerifyClsName): New method.
8304         Checks whether container name is CLS Compliant.
8305         (Constructor): Implements IMethodData.
8306
8307         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8308         low-case table for CLS Compliance test.
8309         (MemberCache.VerifyClsParameterConflict): New method.
8310         Checks method parameters for CS3006 error.
8311
8312         * enum.cs (EnumMember): Is derived from MemberCore.
8313         (Enum.VerifyClsName): Optimized for better performance.
8314
8315 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8316
8317         * report.cs: Renamed Error_T to Error and changed all
8318         references.
8319
8320 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8321
8322         * class.cs (TypeContainer.IndexerArrayList): New inner class
8323         container for indexers.
8324         (TypeContainer.DefaultIndexerName): New constant for default
8325         indexer name. Replaced all "Item" with this constant.
8326         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8327
8328         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8329         DefaultMemberAttribute constructor.
8330
8331 2004-08-05  Martin Baulig  <martin@ximian.com>
8332
8333         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8334         Fix bug #59429.
8335
8336 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8337
8338         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8339         multi platforms problem.
8340
8341         * compiler.csproj: Included shared files.
8342
8343 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8344
8345         Fix bug 60333, 55971 in the more general way
8346         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8347         Added arg_type argument for constant conversion.
8348         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8349
8350 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8351
8352         Fix bug #59760
8353         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8354         OperatorArrayList, MethodCoreArrayList for typecontainer
8355         containers. Changed class member types to these new types.
8356         (MethodArrayList.DefineMembers): Added test for CS0659.
8357
8358 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8359
8360         * cfold.cs: Synchronize the folding with the code in expression.cs
8361         Binary.DoNumericPromotions for uint operands.
8362
8363         * attribute.cs: Revert patch from Raja, it introduced a regression
8364         while building Blam-1.2.1 (hard to isolate a test case).
8365
8366 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8367
8368         Fix for #55382
8369         * class.cs:
8370         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8371         name collision.
8372         (MethodCore.parent_method): New member. The method we're overriding
8373         if this is an override method.
8374         (MethodCore.CheckBase): Moved from Method class and made common.
8375         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8376         private.
8377         (MethodCore.CheckForDuplications): New abstract method. For custom
8378         member duplication search in a container
8379         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8380         method and its return type.
8381         (Event.conflict_symbol): New member. Symbol with same name in the
8382         parent class.
8383
8384         * decl.cs:
8385         (MemberCache.FindMemberWithSameName): New method. The method
8386         is looking for conflict with inherited symbols.
8387
8388 2004-08-04  Martin Baulig  <martin@ximian.com>
8389
8390         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8391
8392         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8393
8394 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8395
8396         * report.cs (Message): New enum for better error, warning reference in
8397         the code.
8398         (MessageData): New inner abstract class. It generally handles printing of
8399         error and warning messages.
8400         Removed unused Error, Warning, Message methods.
8401
8402 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8403
8404         Fix for cs0592-8.cs test
8405         * attribute.cs
8406         (Attributable.ValidAttributeTargets): Made public.
8407         (Attribute.ExplicitTarget): New member for explicit target value.
8408         (Attribute.CheckTargets): Now we translate explicit attribute
8409         target to Target here.
8410
8411 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8412
8413         * ecore.cs (MethodGroupExpr): new IsBase property.
8414
8415         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8416
8417         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8418         rather than an instance expr.
8419
8420         (DelegateCreation.Emit): Use the method group rather than
8421         the instance expression. Also, if you have base.Foo as the
8422         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8423
8424         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8425
8426         (NewDelegate.DoResolve): Only check for the existance of Invoke
8427         if the method is going to be needed. Use MethodGroupExpr.
8428
8429         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8430
8431         * expression.cs: For pointer arith., make sure to use
8432         the size of the type, not the size of the pointer to
8433         the type.
8434
8435 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8436
8437         Fix for #60722
8438         * class.cs (Class): Added error CS0502 test.
8439
8440 2004-08-03  John Luke  <jluke@cfl.rr.com>
8441             Raja R Harinath  <rharinath@novell.com>
8442
8443         Fix for #60997.
8444         * attribute.cs (Attribute.complained_before): New flag.
8445         (Attribute.ResolveType, Attribute.Resolve),
8446         (Attribute.DefinePInvokeMethod): Set it.
8447         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8448         
8449 2004-08-03  Martin Baulig  <martin@ximian.com>
8450
8451         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8452         use a user-defined operator; we still need to do numeric
8453         promotions in case one argument is a builtin type and the other
8454         one has an implicit conversion to that type.  Fixes #62322.
8455
8456 2004-08-18  Martin Baulig  <martin@ximian.com>
8457
8458         * class.cs (Method.Define): Use the correct method name when
8459         creating the MethodBuilder for a generic method.
8460
8461 2004-08-17  Martin Baulig  <martin@ximian.com>
8462
8463         * generic.cs (Constraints): Support type parameter constraints.
8464
8465 2004-08-16  Martin Baulig  <martin@ximian.com>
8466
8467         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8468         (Token.GENERIC_DIMENSION): New token; this is returned if we
8469         encounter an unbound generic type in a typeof() expression.
8470
8471         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8472         this token is only generated while parsing a typeof() expression.
8473         (typeof_expression): Removed the old unbound_type hack.
8474
8475         * generic.cs (TypeArguments.IsUnbound): New public property.
8476
8477         * decl.cs (MemberName): Added support for unbound types.
8478
8479 2004-08-14  Martin Baulig  <martin@ximian.com>
8480
8481         * typemanager.cs
8482         (TypeManager.IsEqualGenericInstance): New static method.
8483         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8484         just used to check accessibility, so follow the rules of 26.1.6.        
8485
8486         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8487         ConstructedType instead of a TypeExpression if we have type arguments.
8488
8489         * cs-parser.jay (typeof_expression): Support unbound generic types.
8490
8491         * ecore.cs (UnboundTypeExpression): New public class.
8492
8493 2004-08-12  Martin Baulig  <martin@ximian.com>
8494
8495         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8496         TypeManager.IsEqual() rather than `=='.
8497
8498         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8499         generic instances as well.
8500
8501 2004-08-12  Martin Baulig  <martin@ximian.com>
8502
8503         * expression.cs (Invocation.InferType): We can only infer method
8504         type parameters.  Fixes #62647.
8505
8506 2004-08-11  Martin Baulig  <martin@ximian.com>
8507
8508         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8509         before resolving the base classes.
8510
8511 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8512
8513         * Makefile: install .mdb file too.
8514
8515 2004-08-05  Martin Baulig  <martin@ximian.com>
8516
8517         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8518         initializer, the current type is just the TypeBuilder, not the
8519         instantiated generic type.
8520         (FieldExpr.IsFieldInitializer): New public property.
8521
8522 2004-08-04  Martin Baulig  <martin@ximian.com>
8523
8524         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8525
8526         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8527
8528 2004-08-03  Martin Baulig  <martin@ximian.com>
8529
8530         * class.cs (MethodData.Define): If we're an explicit
8531         implementation, remove the generic arity from the type name.
8532
8533 2004-08-03  Martin Baulig  <martin@ximian.com>
8534
8535         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8536         use a user-defined operator; we still need to do numeric
8537         promotions in case one argument is a builtin type and the other
8538         one has an implicit conversion to that type.  Fixes #62322.
8539
8540 2004-08-02  Martin Baulig  <martin@ximian.com>
8541
8542         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8543         `TypeExpr[]' array.
8544         (TypeContainer.GetClassBases): Return the unexpanded list of
8545         interfaces; we expand them later.
8546         (TypeContainer.DefineType): After creating the TypeBuilder, call
8547         TypeManager.ExpandInterfaces() to get an expanded and resolved
8548         list of interfaces.
8549
8550         * ecore.cs (TypeExpr.GetInterfaces): Removed
8551
8552         * generics.cs (Constraints.InterfaceConstraints): Remove.
8553         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8554         register the interface constraints.
8555
8556         * typemanager.cs
8557         (TypeManager.AddUserType): Removed the `ifaces' argument.
8558         (TypeManager.AddTypeParameter): Likewise.
8559         (TypeManager.AddUserInterface): Removed, was unused.
8560         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8561         `TypeExpr[]' array for the interfaces.
8562         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8563         has been defined, returns a list of the resolved interfaces types.
8564         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8565         (TypeManager.GetExplicitInterfaces): Likewise.  
8566
8567 2004-08-02  Martin Baulig  <martin@ximian.com>
8568
8569         * expression.cs (Invocation.EmitCall): If we're invoking a method
8570         on a type parameter, use the new `Constrained' prefix opcode.
8571
8572 2004-08-02  Martin Baulig  <martin@ximian.com>
8573
8574         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8575         (LocalInfo.IsThis): New public property.
8576         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8577
8578 2004-08-01  Martin Baulig  <martin@ximian.com>
8579
8580         * class.cs (TypeContainer.GetClassBases): Don't set the default
8581         here since we may get called from GetPartialBases().
8582         (TypeContainer.DefineType): If GetClassBases() didn't return a
8583         parent, use the default one.
8584
8585 2004-07-30  Martin Baulig  <martin@ximian.com>
8586
8587         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8588
8589         * class.cs (SourceMethod): New public class, derive from the
8590         symbol writer's ISourceMethod.
8591         (Method): Use the new symbol writer API.
8592
8593         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8594         as argument and use the new symbol writer.
8595
8596         * location.cs
8597         (SourceFile): Implement the symbol writer's ISourceFile.
8598         (Location.SymbolDocument): Removed.
8599         (Location.SourceFile): New public property.
8600
8601         * symbolwriter.cs: Use the new symbol writer API.
8602
8603 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8604
8605         * Makefile (install-local): Remove.  Functionality moved to
8606         executable.make.
8607
8608 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8609
8610         * Makefile: Install mcs.exe.config file together with mcs.exe.
8611         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8612         correct runtime version.
8613         
8614 2004-07-25  Martin Baulig  <martin@ximian.com>
8615
8616         * class.cs
8617         (TypeContainer.RegisterOrder): Removed, this was unused.
8618         (TypeContainer, interface_order): Removed.
8619         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8620         TypeContainer as argument since we can also be called with a
8621         `PartialContainer' for a partial class/struct/interface.
8622         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8623         of checking whether we're an `Interface' - we could be a
8624         `PartialContainer'.
8625         (PartialContainer.Register): Override; call
8626         AddClass()/AddStruct()/AddInterface() on our parent.
8627
8628         * cs-parser.jay (interface_member_declaration): Add things to the
8629         `current_container', not the `current_class'.
8630
8631         * rootcontext.cs (RegisterOrder): The overloaded version which
8632         takes an `Interface' was unused, removed.
8633
8634         * typemanager.cs (TypeManager.LookupInterface): Return a
8635         `TypeContainer', not an `Interface'.
8636         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8637         contain a `PartialContainer' for an interface, so check it's
8638         `Kind' to figure out what it is.
8639
8640 2004-07-25  Martin Baulig  <martin@ximian.com>
8641
8642         * class.cs (Class.DefaultTypeAttributes): New public constant.
8643         (Struct.DefaultTypeAttributes): Likewise.
8644         (Interface.DefaultTypeAttributes): Likewise.
8645         (PartialContainer.TypeAttr): Override this and add the
8646         DefaultTypeAttributes.
8647
8648 2004-07-25  Martin Baulig  <martin@ximian.com>
8649
8650         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8651         we can just use the `Parent' field instead.
8652
8653 2004-07-25  Martin Baulig  <martin@ximian.com>
8654
8655         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8656
8657 2004-07-25  Martin Baulig  <martin@ximian.com>
8658
8659         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8660         our parts before defining any methods.
8661         (TypeContainer.VerifyImplements): Make this virtual.
8662         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8663         on our PartialContainer.
8664
8665 2004-07-25  Martin Baulig  <martin@ximian.com>
8666
8667         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8668
8669         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8670         argument, we can just use the `Parent' field instead.
8671
8672         * class.cs
8673         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8674         (MemberBase.DoDefine): Likewise.
8675
8676 2004-07-24  Martin Baulig  <martin@ximian.com>
8677
8678         * decl.cs (MemberCore.Parent): New public field.
8679         (DeclSpace.Parent): Moved to MemberCore.
8680
8681         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8682         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8683         parent's .ctor.
8684         (FieldBase, Field, Operator): Likewise.
8685         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8686         (EventField, Event): Likewise.
8687
8688 2004-07-23  Martin Baulig  <martin@ximian.com>
8689
8690         * class.cs (PartialContainer): New public class.
8691         (ClassPart): New public class.
8692         (TypeContainer): Added support for partial classes.
8693         (TypeContainer.GetClassBases): Splitted some of the functionality
8694         out into GetNormalBases() and GetPartialBases().
8695
8696         * cs-tokenizer.cs (Token.PARTIAL): New token.
8697         (Tokenizer.consume_identifier): Added some hacks to recognize
8698         `partial', but only if it's immediately followed by `class',
8699         `struct' or `interface'.
8700
8701         * cs-parser.jay: Added support for partial clases.
8702
8703 2004-07-23  Martin Baulig  <martin@ximian.com>
8704
8705         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8706         a `DeclSpace' and also made it readonly.
8707         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8708         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8709         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8710
8711         * cs-parser.jay: Pass the `current_class', not the
8712         `current_container' (at the moment, this is still the same thing)
8713         to a new Method, Property, Event, Indexer or Constructor.
8714
8715 2004-07-23  Martin Baulig  <martin@ximian.com>
8716
8717         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8718         and removed the `current_interface' one.
8719         (struct_declaration, class_declaration, interface_declaration):
8720         Set `current_class' to the newly created class/struct/interface;
8721         set their `Bases' and call Register() before parsing their body.
8722
8723 2004-07-23  Martin Baulig  <martin@ximian.com>
8724
8725         * class.cs (Kind): New public enum.
8726         (TypeContainer): Made this class abstract.
8727         (TypeContainer.Kind): New public readonly field.
8728         (TypeContainer.CheckDef): New public method; moved here from
8729         cs-parser.jay.
8730         (TypeContainer.Register): New public abstract method.
8731         (TypeContainer.GetPendingImplementations): New public abstract
8732         method.
8733         (TypeContainer.GetClassBases): Removed the `is_class' and
8734         `is_iface' parameters.
8735         (TypeContainer.DefineNestedTypes): Formerly known as
8736         DoDefineType().
8737         (ClassOrStruct): Made this class abstract.
8738
8739         * tree.cs (RootTypes): New public type. 
8740
8741 2004-07-20  Martin Baulig  <martin@ximian.com>
8742
8743         * tree.cs (Tree.RecordNamespace): Removed.
8744         (Tree.Namespaces): Removed.
8745
8746         * rootcontext.cs (RootContext.IsNamespace): Removed.
8747
8748         * cs-parser.jay (namespace_declaration): Just create a new
8749         NamespaceEntry here.
8750
8751 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8752
8753         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8754         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8755         entry to make sure it runs in the correct runtime version.
8756         
8757 2004-07-18  Martin Baulig  <martin@ximian.com>
8758
8759         * generic.cs (ConstructedType.CheckConstraints): Improved
8760         constraints checking.
8761
8762 2004-07-18  Martin Baulig  <martin@ximian.com>
8763
8764         * expression.cs (Invocation.BetterMethod): Call
8765         TypeManager.TypeToCoreType() on all types and removed my previous
8766         hack; we're already doig the right thing here.
8767
8768 2004-07-17  Martin Baulig  <martin@ximian.com>
8769
8770         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8771
8772 2004-07-16  Martin Baulig  <martin@ximian.com>
8773
8774         * iterators.cs: Added generics support.
8775
8776 2004-07-16  Martin Baulig  <martin@ximian.com>
8777
8778         * iterators.cs: Rewrote this.  We're now using one single Proxy
8779         class for both the IEnumerable and the IEnumerator interface and
8780         `Iterator' derives from Class so we can use the high-level API.
8781
8782         * class.cs (TypeContainer.AddIterator): New method.
8783         (TypeContainer.DoDefineType): New protected virtual method, which
8784         is called from DefineType().
8785         (TypeContainer.DoDefineMembers): Call DefineType() and
8786         DefineMembers() on all our iterators.
8787         (TypeContainer.Emit): Call Emit() on all our iterators.
8788         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8789
8790         * codegen.cs (EmitContext.CurrentIterator): New public field.
8791
8792 2004-07-15  Martin Baulig  <martin@ximian.com>
8793
8794         * typemanager.cs
8795         (TypeManager.not_supported_exception_type): New type.   
8796
8797 2004-07-14  Martin Baulig  <martin@ximian.com>
8798
8799         * typemanager.cs
8800         (TypeManager.generic_ienumerable_type): New type.
8801         (TypeManager.generic_ienumerator_type): New type.
8802
8803         * rootcontext.cs
8804         (RootContext.interfaces_first_stage): Added
8805         "System.Collections.Generic.IEnumerator`1" and
8806         "System.Collections.Generic.IEnumerable`1".     
8807
8808 2004-07-14  Martin Baulig  <martin@ximian.com>
8809
8810         * iterators.cs: Use real error numbers.
8811
8812 2004-07-14  Martin Baulig  <martin@ximian.com>
8813
8814         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8815         requires this to be a System.Collection.IEnumerable and not a
8816         class implementing that interface.
8817         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8818
8819 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8820
8821         * class.cs: Fixed previous fix, it broke some error tests.
8822
8823 2004-07-12  Martin Baulig  <martin@ximian.com>
8824
8825         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8826         Fixes #61293.
8827
8828 2004-07-14  Martin Baulig  <martin@ximian.com>
8829
8830         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8831         an exclamation mark (!) for the generic arity to reflect the
8832         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8833
8834 2004-07-13  Martin Baulig  <martin@ximian.com>
8835
8836         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8837         specifiers being part of a type argument.
8838
8839 2004-07-13  Martin Baulig  <martin@ximian.com>
8840
8841         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8842         name for generic types.
8843
8844 2004-07-13  Martin Baulig  <martin@ximian.com>
8845
8846         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8847         bit to fix #60119.
8848
8849 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8850
8851         * assign.cs (LocalTemporary): Add new argument: is_address,If
8852         `is_address' is true, then the value that we store is the address
8853         to the real value, and not the value itself.
8854         
8855         * ecore.cs (PropertyExpr): use the new local temporary
8856         stuff to allow us to handle X.Y += z (where X is a struct)
8857
8858 2004-07-08  Martin Baulig  <martin@ximian.com>
8859
8860         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8861         not always return, just like we're doing in Using.Resolve().
8862
8863 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8864
8865         * cs-parser.jay (fixed_statement): flag this as Pinned.
8866
8867 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8868
8869         * typemanager.cs (TypeManager): Removed MakePinned method, this
8870         mechanism is replaced with the .NET 2.x compatible mechanism of
8871         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8872
8873         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8874         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8875         `IsFixed' property which has a different meaning.
8876
8877 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8878
8879         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8880         visible from inside a nested class, not just the names of the
8881         immediately enclosing class.
8882         Fix for bug #60730.
8883
8884 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8885
8886         * expression.cs (BetterConversion): Remove buggy special-case
8887         handling of "implicit constant expression conversions".  At this
8888         point, we already know that the conversion is possible -- we're
8889         only checking to see which is better.
8890
8891 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8892
8893         * cs-parser.jay: Added error CS0210 test.
8894
8895 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8896
8897         * cs-parser.jay: Added error CS0134 test.
8898
8899 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8900
8901         Fix bug #52507
8902         * cs-parser.jay: Added error CS0145 test.
8903
8904 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8905
8906         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8907
8908 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8909         
8910         * expression.cs (StackAlloc.Resolve): The argument may not
8911         be a constant; deal with this case.
8912         
8913 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8914
8915         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8916         GetIndexerAttributeValue.
8917         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8918
8919         * class.cs (Indexer.Define): Added error tests for CS0415,
8920         CS0609.
8921
8922 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8923
8924         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8925         property code.
8926
8927 2004-06-23  Martin Baulig  <martin@ximian.com>
8928
8929         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8930         neither return nor throw, reset the barrier as well.  Fixes #60457.
8931
8932 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8933
8934         * class.cs : EventAttributes is now set to None by default.
8935           This fixes bug #60459.
8936
8937 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8938
8939         Fix bug #60219
8940         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8941         Don't throw exception but return null (it's sufficient now).
8942
8943 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8944
8945         * typemanager.cs (GetArgumentTypes): Faster implementation.
8946
8947 2004-06-18  Martin Baulig  <martin@ximian.com>
8948
8949         * attribute.cs (Attribute.Resolve): Check whether we're an
8950         EmptyCast which a Constant child.  Fixes #60333.
8951
8952 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8953
8954         * statement.cs (EmitCollectionForeach): Account for the fact that
8955         not all valuetypes are in areas which we can take the address of.
8956         For these variables, we store to a temporary variable. Also, make
8957         sure that we dont emit a `callvirt' on a valuetype method.
8958
8959 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8960
8961         * expression.cs (StackAlloc.DoReSolve): Added test for
8962         negative parameter (CS0247).
8963
8964 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8965
8966         Fix bug #59792
8967         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8968
8969 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8970
8971         Fix bug #59781
8972         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8973         ulong.
8974
8975 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8976
8977         Fix bug #58254 & cs1555.cs, cs1556.cs
8978         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8979
8980 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8981
8982         * cs-parser.jay: Added error CS1669 test for indexers.
8983
8984 2004-06-18  Martin Baulig  <martin@ximian.com>
8985
8986         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8987         argument.  Fixes #60441.
8988
8989 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8990         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8991         The name needs to have the actual name of the method in order
8992         for other tests (such as the one in OverloadResolve for Invoke
8993         on a delegate) to work. As well, it does not really help
8994         error reporting because the method group had multiple methods.
8995         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8996         Make profiling work.
8997         
8998 2004-06-13  Martin Baulig  <martin@ximian.com>
8999
9000         * cs-parser.jay: Don't allow generic attributes.
9001
9002 2004-06-13  Martin Baulig  <martin@ximian.com>
9003
9004         * class.cs (MemberBase.DoDefineBase): New protected method.
9005         (MemberBase.DoDefine): Compute the `flags' in the new
9006         DoDefineBase() which must be called first.
9007         (Method.Define): Call DoDefineBase() first so we have the flags
9008         when defining the generic method.
9009
9010         * cs-parser.jay (interface_method_declaration): Support generic methods.
9011
9012 2004-06-13  Martin Baulig  <martin@ximian.com>
9013
9014         * decl.cs (TypeName): Removed.
9015         (MemberName): Removed TypeName and MemberNow; now we just have
9016         MemberName.
9017
9018         * cs-parser.jay: Don't distinguish between type arguments and type
9019         parameters in the grammar and simplified the rules a bit.  The
9020         reduce/reduce conflicts are now gone (except the one we inherited
9021         from mcs).
9022
9023 2004-06-11  Martin Baulig  <martin@ximian.com>
9024
9025         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9026         call this twice: for params and varargs methods.
9027
9028 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9029
9030         * class.cs:
9031         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9032
9033 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9034
9035         * attribute.cs (Attribute.GetValidTargets): Made public.
9036
9037         * class.cs: 
9038         (AbstractPropertyEventMethod): New class for better code sharing.
9039         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9040         CS1667 report.
9041         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9042
9043 2004-06-09  Martin Baulig  <martin@ximian.com>
9044
9045         * cs-parser.jay: Removed a reduce/reduce conflict.
9046
9047 2004-06-03  Martin Baulig  <martin@ximian.com>
9048
9049         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9050         GetSimpleName() and return a SimpleName.
9051
9052         * ecore.cs (SimpleName.Arguments): New public field.
9053         (SimpleName): Added overloaded ctor which takes an additional
9054         TypeArguments argument.
9055         (SimpleName.SimpleNameResolve): Added support for generic methods.
9056         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9057         formerly in MemberAccess.DoResolve(), but we also need it in
9058         SimpleNameResolve().
9059
9060         * expression.cs (MemberAccess.DoResolve): Use the new
9061         MethodGroupExpr.ResolveGeneric().       
9062
9063 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9064
9065         * decl.cs: If possible, use lookuptypedirect here. We can only do
9066         this if there is no `.' after the namespace. Avoids using
9067         LookupType, which does lots of slow processing.
9068         (FindNestedType) New method, does what it says :-).
9069         * namespace.cs: use LookupTypeDirect.
9070         * rootcontext.cs: use membercache, if possible.
9071         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9072
9073 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9074
9075         * expression.cs:
9076         According to the spec, 
9077
9078         In a member access of the form E.I, if E is a single identifier,
9079         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9080         field, property, localvariable, or parameter with the same type as
9081         the meaning of E as a type-name (§3.8), then both possible
9082         meanings of E are permitted.
9083
9084         We did not check that E as a simple-name had the same type as E as
9085         a type name.
9086
9087         This trivial check gives us 5-7% on bootstrap time.
9088
9089 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9090
9091         * expression.cs (Invocation.OverloadResolve): Avoid the
9092         use of hashtables and boxing here by allocating on demand.
9093
9094 2004-05-30  Martin Baulig  <martin@ximian.com>
9095
9096         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9097         we're doing a silent lookup.  Don't try to lookup nested types in
9098         TypeManager.object_type (thanks to Ben Maurer).
9099
9100 2004-05-30  Martin Baulig  <martin@ximian.com>
9101
9102         Committing a patch from Ben Maurer.
9103
9104         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9105
9106 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9107
9108         * convert.cs: add a trivial cache for overload operator resolution.
9109
9110 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9111
9112         * attribute.cs
9113         (AttributeTester.GetObsoleteAttribute): Returns instance of
9114         ObsoleteAttribute when type is obsolete.
9115
9116         * class.cs
9117         (TypeContainer.VerifyObsoleteAttribute): Override.
9118         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9119         (MethodCode.VerifyObsoleteAttribute): Override.
9120         (MemberBase.VerifyObsoleteAttribute): Override.
9121
9122         * decl.cs
9123         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9124         and report proper error.
9125
9126         *delegate.cs
9127         (Delegate.VerifyObsoleteAttribute): Override.
9128
9129         * ecore.cs
9130         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9131         and report proper error.
9132         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9133
9134         * enum.cs
9135         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9136         and enum member.
9137
9138         * expression.cs
9139         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9140         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9141         Added test for ObsoleteAttribute.
9142
9143         * statement.cs
9144         (Catch): Derived from Statement.
9145
9146 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9147
9148         * decl.cs: If possible, use lookuptypedirect here. We can only do
9149         this if there is no `.' after the namespace. Avoids using
9150         LookupType, which does lots of slow processing.
9151         (FindNestedType) New method, does what it says :-).
9152         * namespace.cs: use LookupTypeDirect.
9153         * rootcontext.cs: use membercache, if possible.
9154         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9155
9156 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9157
9158         * expression.cs:
9159         According to the spec, 
9160
9161         In a member access of the form E.I, if E is a single identifier,
9162         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9163         field, property, localvariable, or parameter with the same type as
9164         the meaning of E as a type-name (§3.8), then both possible
9165         meanings of E are permitted.
9166
9167         We did not check that E as a simple-name had the same type as E as
9168         a type name.
9169
9170         This trivial check gives us 5-7% on bootstrap time.
9171
9172 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9173
9174         Fixed bug #59071 & cs0160.cs
9175         * statement.cs (Try.Resolve): Check here whether order of catch
9176         clauses matches their dependencies.
9177
9178 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9179
9180         Fixed bug #58624
9181         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9182         unsafe type.
9183
9184 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9185
9186         * expression.cs (Invocation.OverloadResolve): Avoid the
9187         use of hashtables and boxing here by allocating on demand.
9188
9189 2004-05-30  Martin Baulig  <martin@ximian.com>
9190
9191         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9192         we're doing a silent lookup.  Don't try to lookup nested types in
9193         TypeManager.object_type (thanks to Ben Maurer).
9194
9195 2004-05-30  Martin Baulig  <martin@ximian.com>
9196
9197         Committing a patch from Ben Maurer.
9198
9199         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9200
9201 2004-05-29  Martin Baulig  <martin@ximian.com>
9202
9203         * class.cs (IMethodData.ShouldIgnore): New method.
9204
9205         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9206         `Location' argument, we don't need it anywhere.  Use
9207         `IMethodData.ShouldIgnore ()' instead of
9208         `MethodData.GetMethodFlags ()'.
9209         (TypeManager.AddMethod): Removed.
9210         (TypeManager.AddMethod2): Renamed to AddMethod.
9211
9212 2004-05-29  Martin Baulig  <martin@ximian.com>
9213
9214         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9215
9216         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9217         converting from a class type S to an interface type and we already
9218         have an object on the stack, don't box it again.  Fixes #52578.
9219
9220 2004-05-29  Martin Baulig  <martin@ximian.com>
9221
9222         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9223         Added support for `params' parameters.  Fixes #59267.
9224
9225 2004-05-29  Martin Baulig  <martin@ximian.com>
9226
9227         * literal.cs (NullPointer): Provide a private .ctor which sets
9228         `type' to TypeManager.object_type.  Fixes #59048.
9229
9230 2004-05-29  Martin Baulig  <martin@ximian.com>
9231
9232         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9233         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9234
9235         * ecore.cs (EventExpr.instance_expr): Make the field private.
9236
9237 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9238
9239         Fixed bug #50080 & cs0214-2.cs
9240         * expression.cs (Cast.DoResolve): Check unsafe context here.
9241         
9242         * statement.cs (Resolve.DoResolve): Likewise.
9243
9244 2004-05-26  Martin Baulig  <martin@ximian.com>
9245
9246         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9247
9248         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9249         (RootContext.LookupType): Pass down the `silent' flag.
9250
9251 2004-05-25  Martin Baulig  <martin@ximian.com>
9252
9253         * expression.cs
9254         (MethodGroupExpr.IdenticalTypeName): New public property.
9255         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9256         expression actually refers to a type.
9257
9258 2004-05-25  Martin Baulig  <martin@ximian.com>
9259
9260         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9261         for #56176 and made it actually work.
9262
9263 2004-05-25  Martin Baulig  <martin@ximian.com>
9264
9265         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9266         (FieldExpr, PropertyExpr): Override and implement
9267         CacheTemporaries.  Fixes #52279.
9268
9269 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9270
9271         * location.cs: In the new compiler listing a file twice is a
9272         warning, not an error.
9273
9274 2004-05-24  Martin Baulig  <martin@ximian.com>
9275
9276         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9277         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9278
9279 2004-05-24  Martin Baulig  <martin@ximian.com>
9280
9281         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9282         walking the `using' list.  Fixes #53921.
9283
9284 2004-05-24  Martin Baulig  <martin@ximian.com>
9285
9286         * const.cs (Const.LookupConstantValue): Added support for
9287         EmptyCast's; fixes #55251.
9288
9289 2004-05-24  Martin Baulig  <martin@ximian.com>
9290
9291         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9292         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9293         which does the CS0135 check.  The reason is that we first need to
9294         check whether the variable actually exists.
9295
9296 2004-05-24  Martin Baulig  <martin@ximian.com>
9297
9298         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9299         than RootContext.LookupType() to find the explicit interface
9300         type.  Fixes #58584.
9301
9302 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9303
9304         * Makefile: Simplify.  Use executable.make.
9305         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9306
9307 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9308
9309         * decl.cs:
9310         * enum.cs:
9311         Use the invariant culture when doing String.Compare for CLS case
9312         sensitivity.
9313         
9314 2004-05-23  Martin Baulig  <martin@ximian.com>
9315
9316         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9317         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9318
9319         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9320
9321 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9322
9323         * class.cs (MemberBase.Define): Reuse MemberType member for 
9324         resolved type. Other methods can use it too.
9325
9326 2004-05-23  Martin Baulig  <martin@ximian.com>
9327
9328         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9329         the variable also exists in the current block (otherwise, we need
9330         to report a CS0103).  Fixes #58670.
9331
9332 2004-05-23  Martin Baulig  <martin@ximian.com>
9333
9334         * flowanalysis.cs (Reachability.Reachable): Compute this
9335         on-the-fly rather than storing it as a field.
9336
9337 2004-05-23  Martin Baulig  <martin@ximian.com>
9338
9339         * flowanalysis.cs (Reachability.And): Manually compute the
9340         resulting `barrier' from the reachability.      
9341        
9342 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9343
9344         Fix bug #57835
9345         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9346         instance of ObsoleteAttribute when symbol is obsolete.
9347
9348         * class.cs
9349         (IMethodData): Extended interface for ObsoleteAttribute support.
9350
9351 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9352
9353         * attribute.cs: Fix bug #55970
9354
9355 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9356
9357         Fix bug #52705
9358         * attribute.cs
9359         (GetObsoleteAttribute): New method. Creates the instance of
9360         ObsoleteAttribute.
9361         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9362         ObsoleteAttribute when member is obsolete.
9363         (AttributeTester.Report_ObsoleteMessage): Common method for
9364         Obsolete error/warning reporting.
9365
9366         * class.cs
9367         (TypeContainer.base_classs_type): New member for storing parent type.
9368
9369         * decl.cs
9370         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9371         for this MemberCore.
9372
9373 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9374
9375         * attribute.cs, const.cs: Fix bug #58590
9376
9377 2004-05-21  Martin Baulig  <martin@ximian.com>
9378
9379         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9380         out parameters if the end of the method is unreachable.  Fixes
9381         #58098. 
9382
9383 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9384
9385         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9386         Hari was right, why extra method.
9387
9388 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9389
9390         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9391
9392 2004-05-20  Martin Baulig  <martin@ximian.com>
9393
9394         * delegate.cs: Convert this file to Unix mode - like the original
9395         version in mcs is.
9396
9397 2004-05-20  Martin Baulig  <martin@ximian.com>
9398
9399         * attribute.cs: Convert this file to Unix mode - like the original
9400         version in mcs is.
9401
9402 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9403
9404        Fix bug #58688 (MCS does not report error when the same attribute
9405        is assigned twice)
9406
9407        * attribute.cs (Attribute.Emit): Distinction between null and default.
9408
9409 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9410
9411        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9412        of a top-level attribute without an attribute target.
9413        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9414        Make non-static.
9415        (Attribute.Conditional_GetConditionName), 
9416        (Attribute.Obsolete_GetObsoleteMessage): Update.
9417        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9418        part of ScanForIndexerName.
9419        (Attribute.CanIgnoreInvalidAttribute): New function.
9420        (Attribute.ScanForIndexerName): Move to ...
9421        (Attributes.ScanForIndexerName): ... here.
9422        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9423        (Attributes.Search): New internal variant that can choose not to
9424        complain if types aren't resolved.  The original signature now
9425        complains.
9426        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9427        complaints suppressed.
9428        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9429        only if it not useful.
9430        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9431        top-level for attributes that are shared between the assembly
9432        and a top-level class.
9433        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9434        * class.cs: Update to reflect changes.
9435        (DefineIndexers): Fuse loops.
9436        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9437        a couple more variants of attribute names.
9438
9439 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9440
9441         Fix bug #52585 (Implemented explicit attribute declaration)
9442
9443         * attribute.cs:
9444         (Attributable.ValidAttributeTargets): New abstract method. It gets
9445         list of valid attribute targets for explicit target declaration.
9446         (Attribute.Target): It holds target itself.
9447         (AttributeSection): Removed.
9448         (Attribute.CheckTargets): New method. It checks whether attribute
9449         target is valid for the current element.
9450
9451         * class.cs:
9452         (EventProperty): New class. For events that are declared like
9453         property (with add and remove accessors).
9454         (EventField): New class. For events that are declared like field.
9455         class.cs
9456
9457         * cs-parser.jay: Implemented explicit attribute target declaration.
9458
9459         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9460         Override ValidAttributeTargets.
9461
9462         * parameter.cs:
9463         (ReturnParameter): Class for applying custom attributes on 
9464         the return type.
9465         (ParameterAtribute): New class. Class for applying custom
9466         attributes on the parameter type.
9467
9468 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9469
9470         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9471         definitions. 
9472
9473         (Method): Allow UNSAFE here.
9474
9475         * modifiers.cs: Support unsafe reporting.
9476
9477 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9478
9479         * decl.cs: Fix bug #58478.
9480
9481 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9482
9483         * statement.cs: When checking for unreachable code on an EmptyStatement,
9484         set the location. Fixes bug #58488.
9485
9486 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9487
9488         * driver.cs: Add -pkg handling.
9489
9490         From Gonzalo: UseShelLExecute=false
9491
9492 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9493
9494         * attribute.cs:
9495         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9496         for attribute.
9497         (Attribute.IsClsCompliaceRequired): Moved to base for better
9498         accesibility.
9499         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9500         when attribute is AttributeUsageAttribute.
9501         (Attribute.GetValidTargets): Simplified.
9502         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9503         attribute for this type.
9504         (Attribute.ApplyAttributes): Method renamed to Emit and make
9505         non-static.
9506         (GlobalAttributeSection): New class for special handling of global
9507         attributes (assembly, module).
9508         (AttributeSection.Emit): New method.
9509
9510         * class.cs: Implemented Attributable abstract methods.
9511         (MethodCore.LabelParameters): Moved to Parameter class.
9512         (Accessor): Is back simple class.
9513         (PropertyMethod): Implemented Attributable abstract class.
9514         (DelegateMethod): Implemented Attributable abstract class.
9515         (Event): New constructor for disctintion between normal Event
9516         and Event with accessors.
9517
9518         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9519
9520         * codegen.cs, const.cs, decl.cs, delegate.cs:
9521         (CommonAssemblyModulClass): Implemented Attributable abstract class
9522         and simplified.
9523
9524         * enum.cs: Implement IAttributeSupport interface.
9525         (EnumMember): New class for emum members. Implemented Attributable
9526         abstract class
9527
9528         * parameter.cs:
9529         (ParameterBase): Is abstract.
9530         (ReturnParameter): New class for easier [return:] attribute handling.
9531
9532         * typemanager.cs: Removed builder_to_attr.
9533
9534 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9535
9536         Fix bug #57151.
9537         * attribute.cs (Attribute.GetPositionalValue): New function.
9538         * class.cs (TypeContainer.VerifyMembers): New function.
9539         (TypeContainer.Emit): Use it.
9540         (ClassOrStruct): New base class for Class and Struct.
9541         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9542         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9543         class.
9544         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9545         then each non-static field should have a FieldOffset attribute.
9546         Otherwise, none of the fields should have a FieldOffset attribute.
9547         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9548         and FieldOffset attributes.
9549         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9550         (TypeManager.field_offset_attribute_type): New core types.
9551         (TypeManager.InitCoreTypes): Initialize them.
9552
9553 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9554
9555         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9556         Return correct type.
9557         From bug #58270.
9558
9559 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9560
9561         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9562         be implicitly converted to ulong.
9563         
9564         * expression.cs: The logic for allowing operator &, | and ^ worked
9565         was wrong, it worked before because we did not report an error in
9566         an else branch.  Fixes 57895.
9567
9568         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9569         allow volatile fields to be reference types.
9570
9571 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9572
9573         * driver.cs: Add support for /debug-
9574
9575 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9576
9577         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9578         Add a 'complain' parameter to silence errors.
9579         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9580         silently overlooked type-resolutions.
9581         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9582         to reflect changes.
9583         (Attributes.Search): New function.
9584         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9585         (Attributes.GetAttributeFullName): Remove hack.
9586         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9587         Update to reflect changes.
9588         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9589         Use Attributes.Search instead of nested loops.
9590
9591 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9592
9593         * decl.cs:
9594         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9595         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9596         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9597
9598         * report.cs: (Report.Warning): Renamed to Warning_T because of
9599         parameter collision.
9600
9601 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9602
9603         * expression.cs (MemberAccess.ResolveMemberAccess):
9604         Exit with non-zero status after Report.Error.
9605         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9606         Likewise.
9607         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9608
9609 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9610
9611         * support.cs: Don't hang when the file is empty.
9612
9613 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9614
9615         * support.cs: In SeekableStreamReader, compute the preamble size of the
9616           underlying stream. Position changes should take into account that initial
9617           count of bytes.
9618
9619 2004-05-03  Todd Berman  <tberman@sevenl.net>
9620
9621         * driver.cs: remove unused GetSysVersion function.
9622
9623 2004-05-03  Todd Berman  <tberman@sevenl.net>
9624
9625         * driver.cs: Remove the hack from saturday, as well as the hack
9626         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9627         link_paths to get that bit proper.
9628
9629 2004-05-01  Todd Berman  <tberman@sevenl.net>
9630
9631         * driver.cs: Try a LoadFrom before a Load, this checks the current
9632         path. This is currently a bug in mono that is be fixed, however, this
9633         provides a workaround for now. This will be removed when the bug
9634         is fixed.
9635
9636 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9637
9638         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9639         incomplete key pairs (#57941).
9640
9641 2004-05-01  Todd Berman  <tberman@sevenl.net>
9642
9643         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9644         from the GAC
9645
9646 2004-04-30  Jackson Harper  <jackson@ximian.com>
9647
9648         * codegen.cs: Open keys readonly.
9649         
9650 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9651
9652         * typemanager.cs: don't report cyclic struct layout when a struct
9653         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9654         which has 2 Pango.Rectangle fields.
9655
9656 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9657
9658         * expression.cs: Handle IntPtr comparisons with IL code
9659         rather than a method call.
9660
9661 2004-04-29  Martin Baulig  <martin@ximian.com>
9662
9663         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9664         the list of PropertyInfo's in class hierarchy and find the
9665         accessor.  Fixes #56013.
9666
9667 2004-04-29  Martin Baulig  <martin@ximian.com>
9668
9669         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9670
9671 2004-04-29  Martin Baulig  <martin@ximian.com>
9672
9673         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9674
9675         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9676
9677 2004-04-29  Martin Baulig  <martin@ximian.com>
9678
9679         * class.cs (ConstructorInitializer.Resolve): Check whether the
9680         parent .ctor is accessible.  Fixes #52146.
9681
9682 2004-04-29  Martin Baulig  <martin@ximian.com>
9683
9684         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9685
9686         * statement.cs (Using.EmitLocalVariableDecls): Use
9687         TypeManager.idisposable_type, not typeof (IDisposable).
9688         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9689
9690 2004-04-29  Martin Baulig  <martin@ximian.com>
9691
9692         * class.cs (Event.Define): Don't emit the field and don't set
9693         RTSpecialName and SpecialName for events on interfaces.  Fixes
9694         #57703. 
9695
9696 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9697
9698         Refactor Attribute.ApplyAttributes.
9699         * attribute.cs (Attributable): New base class for objects that can
9700         have Attributes applied on them.
9701         (Attribute): Make AttributeUsage fields public.
9702         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9703         (Attribute.IsInternalCall): New property.
9704         (Attribute.UsageAttr): Convert to a public read-only property.
9705         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9706         (Attribute.ResolveType, Attribute.Resolve)
9707         (Attribute.ScanForIndexerName): Update to reflect changes.
9708         (Attribute.CheckAttributeTarget): Re-format.
9709         (Attribute.ApplyAttributes): Refactor, to various
9710         Attributable.ApplyAttributeBuilder methods.
9711         * decl.cs (MemberCore): Make Attributable.
9712         * class.cs (Accessor): Make Attributable.
9713         (MethodData.ApplyAttributes): Use proper attribute types, not
9714         attribute names.
9715         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9716         (TypeContainer.ApplyAttributeBuilder)
9717         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9718         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9719         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9720         (Operator.ApplyAttributeBuilder): New factored-out methods.
9721         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9722         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9723         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9724         * parameter.cs (ParameterBase): New Attributable base class
9725         that can also represent Return types.
9726         (Parameter): Update to the changes.
9727
9728 2004-04-29  Jackson Harper  <jackson@ximian.com>
9729
9730         * driver.cs: Prefer the corlib system version when looking for
9731         assemblies in the GAC. This is still a hack, but its a better hack
9732         now.
9733         
9734 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9735
9736         * decl.cs, enum.cs: Improved error 3005 reporting.
9737   
9738         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9739         (related_symbols): New private member for list of symbols
9740         related to reported error/warning.
9741         
9742         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9743
9744 2004-04-29  Martin Baulig  <martin@ximian.com>
9745
9746         * ecore.cs (Expression.Constantify): If we're an enum and
9747         TypeManager.TypeToCoreType() doesn't give us another type, use
9748         t.UnderlyingSystemType.  Fixes #56178.  
9749
9750 2004-04-29  Martin Baulig  <martin@ximian.com>
9751
9752         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9753         interfaces and for each interface, only add members directly
9754         declared in that interface.  Fixes #53255.
9755
9756 2004-04-28  Martin Baulig  <martin@ximian.com>
9757
9758         * expression.cs (ConditionalLogicalOperator): Use a temporary
9759         variable for `left' to avoid that we evaluate it more than once;
9760         bug #52588.
9761
9762 2004-04-28  Martin Baulig  <martin@ximian.com>
9763
9764         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9765         `void[]' (CS1547).
9766
9767 2004-04-28  Martin Baulig  <martin@ximian.com>
9768
9769         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9770         void (CS1547).
9771
9772         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9773         whether the type is not void (CS1547).
9774
9775 2004-04-28  Martin Baulig  <martin@ximian.com>
9776
9777         * expression.cs (Unary.DoResolveLValue): Override this and report
9778         CS0131 for anything but Operator.Indirection.
9779
9780 2004-04-28  Martin Baulig  <martin@ximian.com>
9781
9782         Committing a patch from Ben Maurer; see bug #50820.
9783
9784         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9785         check for classes.
9786
9787         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9788         classes.        
9789
9790 2004-04-28  Martin Baulig  <martin@ximian.com>
9791
9792         Committing a patch from Ben Maurer; see bug #50820.
9793
9794         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9795         check for classes.
9796
9797         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9798         classes.        
9799
9800 2004-04-28  Martin Baulig  <martin@ximian.com>
9801
9802         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9803         (Block.AddLabel): Call DoLookupLabel() to only search in the
9804         current block.
9805
9806 2004-04-28  Martin Baulig  <martin@ximian.com>
9807
9808         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9809         comparing StringConstants and NullLiterals in Equality and Inequality.
9810
9811 2004-04-28  Jackson Harper  <jackson@ximian.com>
9812
9813         * driver.cs: Attempt to load referenced assemblies from the
9814         GAC. This is the quick and dirty version of this method that
9815         doesnt take into account versions and just takes the first
9816         canidate found. Will be good enough for now as we will not have more
9817         then one version installed into the GAC until I update this method.
9818
9819 2004-04-28  Martin Baulig  <martin@ximian.com>
9820
9821         * typemanager.cs (TypeManager.CheckStructCycles): New public
9822         static method to check for cycles in the struct layout.
9823
9824         * rootcontext.cs (RootContext.PopulateTypes): Call
9825         TypeManager.CheckStructCycles() for each TypeContainer.
9826         [Note: We only need to visit each type once.]
9827
9828 2004-04-28  Martin Baulig  <martin@ximian.com>
9829
9830         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9831
9832         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9833         success and added `out object value'.  Use a `bool resolved' field
9834         to check whether we've already been called rather than
9835         `ConstantValue != null' since this breaks for NullLiterals.
9836
9837 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9838
9839         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9840         setting of this flag, since the 'set' method may be non-public.
9841
9842 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9843
9844         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9845         check on current_vector.Block.
9846
9847 2004-04-27  Martin Baulig  <martin@ximian.com>
9848
9849         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9850         a field initializer.  Fixes #56459.
9851
9852 2004-04-27  Martin Baulig  <martin@ximian.com>
9853
9854         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9855         we're not attempting to use an indexer.  Fixes #52154.
9856
9857 2004-04-27  Martin Baulig  <martin@ximian.com>
9858
9859         * statement.cs (Return): Don't create a return label if we don't
9860         need it; reverts my change from January 20th.  Thanks to Ben
9861         Maurer for this.
9862
9863 2004-04-27  Martin Baulig  <martin@ximian.com>
9864
9865         According to the spec, `goto' can only leave a nested scope, but
9866         never enter it.
9867
9868         * statement.cs (Block.LookupLabel): Only lookup in the current
9869         block, don't recurse into parent or child blocks.
9870         (Block.AddLabel): Check in parent and child blocks, report
9871         CS0140/CS0158 if we find a duplicate.
9872         (Block): Removed this indexer for label lookups.
9873         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9874         this already does the error reporting for us.
9875
9876         * flowanalysis.cs
9877         (FlowBranching.UsageVector.Block): New public variable; may be null.
9878         (FlowBranching.CreateSibling): Added `Block' argument.
9879         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9880         label for the target of a `goto' and check whether we're not
9881         leaving a `finally'.
9882
9883 2004-04-27  Martin Baulig  <martin@ximian.com>
9884
9885         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9886         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9887         just for returns).
9888
9889 2004-04-27  Martin Baulig  <martin@ximian.com>
9890
9891         * statement.cs (Block.AddLabel): Also check for implicit blocks
9892         and added a CS0158 check.
9893
9894 2004-04-27  Martin Baulig  <martin@ximian.com>
9895
9896         * flowanalysis.cs (FlowBranchingLoop): New class.
9897         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9898         UsageVector's instead of an ArrayList.
9899         (FlowBranching.Label): Likewise.
9900         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9901         (FlowBranching.AddBreakVector): New method.
9902
9903 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9904
9905         * attribute.cs: Small regression fix: only convert the type if we
9906         the type is different, fixes System.Drawing build.
9907
9908 2004-04-27  Martin Baulig  <martin@ximian.com>
9909
9910         * attribute.cs (Attribute.Resolve): If we have a constant value
9911         for a named field or property, implicity convert it to the correct
9912         type.
9913
9914 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9915
9916         * statement.cs (Block.Block): Implicit blocks share
9917         'child_variable_names' fields with parent blocks.
9918         (Block.AddChildVariableNames): Remove.
9919         (Block.AddVariable): Mark variable as "used by a child block" in
9920         every surrounding block.
9921         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9922         been used in a child block, complain about violation of "Invariant
9923         meaning in blocks" rule.
9924         * cs-parser.jay (declare_local_variables): Don't use
9925         AddChildVariableNames.
9926         (foreach_statement): Don't create an implicit block: 'foreach'
9927         introduces a scope.
9928
9929 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9930
9931         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9932         converting from 0L to ulong.  Fixes 57522.
9933
9934 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9935
9936         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9937         derived class hides via 'new' keyword field from base class (test-242.cs).
9938         TODO: Handle this in the more general way.
9939         
9940         * class.cs (CheckBase): Ditto.
9941
9942 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9943
9944         * decl.cs (caching_flags): New member for storing cached values
9945         as bit flags.
9946         (MemberCore.Flags): New enum where bit flags for caching_flags
9947         are defined.
9948         (MemberCore.cls_compliance): Moved to caching_flags.
9949         (DeclSpace.Created): Moved to caching_flags.
9950
9951         * class.cs: Use caching_flags instead of DeclSpace.Created
9952         
9953 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9954
9955         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9956         if we are only a derived class, not a nested class.
9957
9958         * typemanager.cs: Same as above, but do this at the MemberLookup
9959         level (used by field and methods, properties are handled in
9960         PropertyExpr).   Allow for the qualified access if we are a nested
9961         method. 
9962
9963 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9964
9965         * class.cs: Refactoring.
9966         (IMethodData): New inteface; Holds links to parent members
9967         to avoid member duplication (reduced memory allocation).
9968         (Method): Implemented IMethodData interface.
9969         (PropertyBase): New inner classes for get/set methods.
9970         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9971         (Event): New inner classes for add/remove methods.
9972         (Event.DelegateMethod): Implemented IMethodData interface.
9973
9974         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9975         EmitContext (related to class.cs refactoring).
9976
9977 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9978
9979         * delegate.cs (Delegate.VerifyApplicability): If the number of
9980         arguments are the same as the number of parameters, first try to
9981         verify applicability ignoring  any 'params' modifier on the last
9982         parameter.
9983         Fixes #56442.
9984
9985 2004-04-08  Martin Baulig  <martin@ximian.com>
9986
9987         Merged latest changes into gmcs.  Please keep this comment in
9988         here, it makes it easier for me to see what changed in MCS since
9989         the last time I merged.
9990
9991 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9992
9993         * class.cs (TypeContainer.AddIndexer): Use
9994         'ExplicitInterfaceName' to determine if interface name was
9995         explicitly specified.  'InterfaceType' is not initialized at this time.
9996         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9997         Indexers array is already in the required order.  Initialize
9998         'IndexerName' only if there are normal indexers.
9999         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10000         (TypeContainer.Emit): Emit DefaultMember attribute only if
10001         IndexerName is initialized.
10002         Fixes #56300.
10003
10004 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10005
10006         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10007         Fixes #57007
10008
10009 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10010
10011         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10012         attributes.
10013         Fix for #56456.
10014
10015         * attribute.cs (Attribute.Resolve): Check for duplicate named
10016         attributes.
10017         Fix for #56463.
10018
10019 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10020
10021         * iterators.cs (MarkYield): track whether we are in an exception,
10022         and generate code accordingly.  Use a temporary value to store the
10023         result for our state.
10024
10025         I had ignored a bit the interaction of try/catch with iterators
10026         since their behavior was not entirely obvious, but now it is
10027         possible to verify that our behavior is the same as MS .NET 2.0
10028
10029         Fixes 54814
10030
10031 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10032
10033         * iterators.cs: Avoid creating temporaries if there is no work to
10034         do. 
10035
10036         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10037         Enumerations, use TypeManager.EnumToUnderlying and call
10038         recursively. 
10039
10040         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10041         bug #57013
10042
10043         (This.Emit): Use EmitContext.EmitThis to emit our
10044         instance variable.
10045
10046         (This.EmitAssign): Ditto.
10047
10048         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10049         codepaths, we will move all the functionality into
10050         Mono.CSharp.This 
10051
10052         (FieldExpr.EmitAssign): Ditto.
10053
10054         This fixes several hidden bugs that I uncovered while doing a code
10055         review of this today.
10056
10057         * codegen.cs (EmitThis): reworked so the semantics are more clear
10058         and also support value types "this" instances.
10059
10060         * iterators.cs: Changed so that for iterators in value types, we
10061         do not pass the value type as a parameter.  
10062
10063         Initialization of the enumerator helpers is now done in the caller
10064         instead of passing the parameters to the constructors and having
10065         the constructor set the fields.
10066
10067         The fields have now `assembly' visibility instead of private.
10068
10069 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10070
10071         * expression.cs (Argument.Resolve): Check if fields passed as ref
10072         or out are contained in a MarshalByRefObject.
10073
10074         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10075         another compiler type.
10076
10077 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10078
10079         * class.cs (Indexer.Define): use the new name checking method.
10080         Also, return false on an error.
10081         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10082         (is_identifier_[start/part]_character): make static.
10083
10084 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10085
10086         * expression.cs (Binary.ResolveOperator): Do no append strings
10087         twice: since we can be invoked more than once (array evaluation)
10088         on the same concatenation, take care of this here.  Based on a fix
10089         from Ben (bug #56454)
10090
10091 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10092
10093         * codegen.cs: Fix another case where CS1548 must be reported (when 
10094         delay-sign isn't specified and no private is available #56564). Fix
10095         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10096         error when MCS is used on the MS runtime and we need to delay-sign 
10097         (which seems unsupported by AssemblyBuilder - see #56621).
10098
10099 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10100
10101         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10102         (TypeManager.ComputeNamespaces): Faster implementation for
10103         Microsoft runtime.
10104
10105         * compiler.csproj: Updated AssemblyName to mcs.
10106
10107 2004-05-11  Jackson Harper  <jackson@ximian.com>
10108
10109         * Makefile: Preserve MONO_PATH
10110         
10111 2004-05-11  Jackson Harper  <jackson@ximian.com>
10112
10113         * Makefile: Use mono and mcs to build gmcs
10114         
10115 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10116
10117         * codegen.cs: Add patch from Robert Shade
10118         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10119         sync with mcs.
10120
10121 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10122
10123         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10124         incomplete key pairs (#57941).
10125
10126 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10127
10128         * codegen.cs: Fix another case where CS1548 must be reported (when 
10129         delay-sign isn't specified and no private is available #56564). Fix
10130         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10131         error when MCS is used on the MS runtime and we need to delay-sign 
10132         (which seems unsupported by AssemblyBuilder - see #56621).
10133
10134 2004-04-29  Jackson Harper  <jackson@ximian.com>
10135
10136         * Makefile: Set MONO_PATH to use the bootstrap corlib
10137         * driver.cs: Check the GAC for referenced assemblies.
10138                 
10139 2004-04-29  Martin Baulig  <martin@ximian.com>
10140
10141         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10142
10143 2004-04-07  Martin Baulig  <martin@ximian.com>
10144
10145         * expression.cs (Binary.ResolveOperator): Added special case for
10146         Equality/Inequality between a type parameter and a null literal.
10147
10148 2004-04-07  Martin Baulig  <martin@ximian.com>
10149
10150         * convert.cs: Check null literal -> type parameter conversions.
10151
10152 2004-04-07  Martin Baulig  <martin@ximian.com>
10153
10154         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10155         `class' and `struct' constraints.
10156
10157 2004-04-07  Martin Baulig  <martin@ximian.com>
10158
10159         * generic.cs (SpecialConstraint): New public enum.
10160         (Constraints.Resolve): Added support for the `class' and `struct'
10161         constraints.
10162
10163         * cs-parser.jay (type_parameter_constraint): Added support for the
10164         `class' and `struct' constraints.
10165
10166 2004-04-07  Martin Baulig  <martin@ximian.com>
10167
10168         * support.cs (GenericConstraints): Replaced `Types' by
10169         `ClassConstraint' and `InterfaceConstraints'; added
10170         `HasClassConstraint'.   
10171
10172 2004-04-07  Martin Baulig  <martin@ximian.com>
10173
10174         * generic.cs
10175         (Constraints.InterfaceConstraints): New public property.
10176         (Constraints.Types): Make this property public
10177         (TypeParameter): Implement IMemberContainer.
10178         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10179         instead of a TypeBuilder/MethodBuilder; pass the interface
10180         constraints to TypeManager.AddTypeParameter().
10181         (TypeParameter.DefineType): Just take an EmitContext and no
10182         TypeBuilder/MethodBuilder.  Use the new public API.
10183
10184         * typemanager.cs (TypeManager.AddTypeParameter): Added
10185         `TypeExpr[]' argument; add the interfaces to the
10186         `builder_to_ifaces' hash.
10187         (TypeManager.LookupMemberContainer): For
10188         GenericTypeParameterBuilders, get the TypeParameter from the
10189         `builder_to_type_param'.
10190         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10191         the TypeParameter and call FindMembers on it.
10192
10193 2004-04-07  Martin Baulig  <martin@ximian.com>
10194
10195         * class.cs
10196         (MethodCore.GenericMethod): Moved this field here from Method.
10197         (MethodCore.IsDuplicateImplementation): Take the number of type
10198         parameters into account if we're a generic method.
10199
10200         * expression.cs (Invocation.InferTypeArguments): Don't return true
10201         if `arguments' is null; we still need to check whether we actually
10202         don't need to infer anything in this case.
10203         (MemberAccess): Merged the functionality from GenericMemberAccess
10204         into this class.
10205
10206         * generic.cs (GenericMemberAccess): Removed.
10207
10208 2004-04-05  Martin Baulig  <martin@ximian.com>
10209
10210         * decl.cs (MemberCore): For generic classes, interfaces and
10211         structs, `Name' now includes the number of type parameters
10212         ("Stack!1.Node!1").
10213         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10214         encode the number of type arguments in the type name.
10215
10216         * expression.cs (Expression.MemberLookup): Removed the
10217         `num_type_args' argument; we now encode the number of type
10218         arguments in the type name.
10219
10220         * ecore.cs (SimpleName): Encode the number of type arguments in
10221         the type name itself.
10222
10223         * generic.cs (ConstructedType): Likewise.
10224
10225         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10226         `MemberName'; we now include the number of type parameters in the
10227         type name.
10228
10229         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10230         (TypeManager.MemberLookup): Removed the
10231         `num_type_args' argument; we now encode the number of type
10232         arguments in the type name.     
10233
10234 2004-04-03  Martin Baulig  <martin@ximian.com>
10235
10236         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10237         (MemberCore.MemberName): Moved here from MemberBase.
10238         (DeclSpace.SetParameterInfo): Just take the constraints as an
10239         ArrayList; we already have the type parameters in our
10240         `MemberName'; also do the CS0080 reporting here.
10241
10242         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10243         `IDENTIFIER opt_type_parameter_list'; when constructing our
10244         `MemberName', it'll already include our type parameters.
10245         (class_declaration, interface_declaration): Likewise.
10246         (delegate_declaration): Likewise.
10247         (MakeName): Take a MemberName and return a MemberName.
10248         The following two changes are required to avoid shift/reduce conflicts:
10249         (member_name): Don't include a TypeName anymore; ie. this is now
10250         just 'IDENTIFIER opt_type_parameter_list'.
10251         (property_declaration, event_declaration): Use a
10252         `namespace_or_type_name' instead of a `member_name'.            
10253
10254 2004-04-03  Martin Baulig  <martin@ximian.com>
10255
10256         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10257         `MemberName' class.
10258         (TypeName): Formerly known as MemberName.
10259
10260         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10261         instead of a `MemberName'.
10262
10263         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10264         (member_name): New rule; create a MemberName.
10265
10266 2004-04-02  Martin Baulig  <martin@ximian.com>
10267
10268         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10269         (CS0305 and CS0308).
10270
10271 2004-04-02  Martin Baulig  <martin@ximian.com>
10272
10273         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10274         support for nested types.
10275
10276 2004-04-02  Martin Baulig  <martin@ximian.com>
10277
10278         * ecore.cs (IAlias): New public interface.
10279         (TypeExpr, TypeExpression): Implement IAlias.
10280         (TypeAliasExpression): New public class.
10281
10282         * namespace.cs (Namespace): Implement IAlias.
10283         (Namespace.Lookup): Return an IAlias instead on an object.
10284         (Namespace.DefineName): Take an IAlias instead of an object.
10285         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10286         an object.
10287         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10288         Expression.
10289         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10290         object.
10291         (NamespaceEntry.Lookup): Likewise.
10292
10293         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10294         instead of a Type.      
10295
10296         * decl.cs (DeclSpace): Implement IAlias.
10297         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10298
10299         * generic.cs (ConstructedType): Improved error checking.
10300
10301 2004-04-02  Martin Baulig  <martin@ximian.com>
10302
10303         * convert.cs: Added type parameter conversions.
10304
10305         * ecore.cs
10306         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10307         (ClassCast.Emit): If the source type is a type parameter, box it.
10308         If the target type is a type parameter, emit an `unbox.any'
10309         instead of a `classcast'.1      
10310
10311 2004-04-01  Martin Baulig  <martin@ximian.com>
10312
10313         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10314
10315 2004-04-01  Martin Baulig  <martin@ximian.com>
10316
10317         * generic.cs (ConstructedType.CheckConstraints): Use
10318         Convert.ImplicitStandardConversionExists(); user-defined implicit
10319         conversions are not allowed according to the spec.
10320
10321 2004-03-30  Martin Baulig  <martin@ximian.com>
10322
10323         * expression.cs (New): Added support for type parameters.
10324
10325         * typemanager.cs
10326         (TypeManager.activator_type): New public static field.
10327         (TypeManager.activator_create_instance): Likewise.
10328
10329 2004-03-30  Martin Baulig  <martin@ximian.com>
10330
10331         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10332         public method.
10333
10334 2004-03-30  Martin Baulig  <martin@ximian.com>
10335
10336         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10337         the spec here: the argument type must be convertible to the
10338         constraints.
10339
10340 2004-03-30  Martin Baulig  <martin@ximian.com>
10341
10342         * generic.cs
10343         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10344         TypeManager.AddTypeParameter().
10345         (ConstructedType.CheckConstraints): Re-enable this and actually
10346         check whether we have a constructor constraint.
10347
10348         * typemanager.cs
10349         (TypeManager.builder_to_type_param): New static field.
10350         (TypeManager.AddTypeParameter): New static method.
10351         (TypeManager.LookupTypeParameter): New public method.
10352
10353 2004-03-30  Martin Baulig  <martin@ximian.com>
10354
10355         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10356         the new API to actually define the constructor constraint.
10357
10358         * typemanager.cs
10359         (TypeManager.new_constraint_attr_type): New static field.
10360         (TypeManager.InitCoreTypes): Initialize it.
10361
10362 2004-03-30  Martin Baulig  <martin@ximian.com>
10363
10364         * generic.cs (Constraints): Completed error checking, use correct
10365         error numbers.
10366
10367 2004-03-29  Martin Baulig  <martin@ximian.com>
10368
10369         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10370
10371         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10372         public version which takes a `ParameterData pd' instead of an
10373         `ArrayList args'.
10374
10375 2004-03-29  Martin Baulig  <martin@ximian.com>
10376
10377         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10378         not a MethodInfo.       
10379
10380 2004-03-29  Martin Baulig  <martin@ximian.com>
10381
10382         * expression.cs (Argument.ResolveMethodGroup): If we're a
10383         ConstructedType, call GetMemberAccess() on it.  
10384
10385 2004-03-29  Martin Baulig  <martin@ximian.com>
10386
10387         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10388         (MethodCore.CheckGenericOverride): When overriding a generic
10389         method, check whether the constraints match.
10390
10391         * support.cs (GenericConstraints): New public interface.
10392         (ParameterData.GenericConstraints): New public method.
10393
10394         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10395         method parameter and compute our constraints if appropriate.
10396         (Parameter.GenericConstraints): New public property.
10397
10398         * generic.cs (Constraints): Implement GenericConstraints.
10399
10400 2004-03-29  Martin Baulig  <martin@ximian.com>
10401
10402         * decl.cs (MemberCache.FindMemberToOverride): Use
10403         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10404
10405 2004-03-29  Martin Baulig  <martin@ximian.com>
10406
10407         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10408
10409 2004-03-29  Martin Baulig  <martin@ximian.com>
10410
10411         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10412         not allowed on non-generic declarations").
10413
10414 2004-03-29  Martin Baulig  <martin@ximian.com>
10415
10416         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10417         public version of this method.
10418
10419         * class.cs (MethodCore.IsDuplicateImplementation): Use
10420         Invocation.InferTypeArguments() to check this.
10421
10422 2004-03-29  Martin Baulig  <martin@ximian.com>
10423
10424         * convert.cs: Use TypeManager.IsDelegateType() instead of
10425         comparing types correctly.
10426
10427 2004-03-29  Martin Baulig  <martin@ximian.com>
10428
10429         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10430         types directly to make it work for generic instances.
10431
10432         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10433
10434 2004-03-29  Martin Baulig  <martin@ximian.com>
10435
10436         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10437         support for arrays.     
10438
10439 2004-03-24  Martin Baulig  <martin@ximian.com>
10440
10441         * decl.cs (DeclSpace.FindType): Also use
10442         TypeManager.CheckGeneric() for types from the using clauses.
10443
10444 2004-03-23  Martin Baulig  <martin@ximian.com>
10445
10446         * expression.cs (Invocation.OverloadResolve): Added `bool
10447         may_fail' argument and use it instead of the Location.IsNull() hack.
10448
10449 2004-03-23  Martin Baulig  <martin@ximian.com>
10450
10451         * expression.cs (Invocation.InferType): Use correct type inference
10452         rules here.     
10453
10454 2004-03-23  Martin Baulig  <martin@ximian.com>
10455
10456         * ecore.cs (MethodGroupExpr.Name): Use
10457         TypeManager.CSharpSignature() instead of just the name.
10458
10459         * expression.cs (Invocation.OverloadResolve): Provide better error
10460         reporting.
10461         (Invocation.DoResolve): OverloadResolve() never returns null
10462         without reporting an error, so removed the error -6 reporting here.
10463
10464 2004-03-23  Martin Baulig  <martin@ximian.com>
10465
10466         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10467         generic methods.
10468
10469         * cs-parser.jay (delegate_declaration): Support generic delegates.
10470
10471         * delegate.cs: Support generic delegates.
10472
10473 2004-03-22  Martin Baulig  <martin@ximian.com>
10474
10475         * expression.cs (Invocation.InferParamsTypeArguments): New static
10476         method; does type inference for params arguments.
10477
10478 2004-03-21  Martin Baulig  <martin@ximian.com>
10479
10480         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10481         method; checks whether a method is a generic method.    
10482
10483         * expression.cs (Invocation.InferTypeArguments): New static method;
10484         infer type arguments for generic method invocation.
10485
10486         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10487         property; we set this to true if we're resolving a generic method
10488         invocation and the user specified type arguments, ie. we're not
10489         doing type inference.
10490
10491 2004-03-20  Martin Baulig  <martin@ximian.com>
10492
10493         * class.cs (MethodData.DeclaringType): New public property.
10494         (MethodData.Define): Set DeclaringType here.
10495         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10496         instead of OperatorMethodBuilder.DeclaringType.
10497
10498 2004-03-20  Martin Baulig  <martin@ximian.com>
10499
10500         * cs-tokenizer.cs (xtoken): Return a special
10501         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10502
10503         * cs-parser.jay (default_value_expression): Switch to the new
10504         syntax (14.5.13).
10505
10506 2004-03-19  Martin Baulig  <martin@ximian.com>
10507
10508         * decl.cs (MemberName): New class.  We use this to "construct"
10509         namespace_or_type_name's.
10510
10511         * generics.cs (TypeArguments.GetDeclarations): New public method;
10512         returns the type arguments as a string[] and reports a CS0081 if
10513         one of them is not an identifier.
10514
10515         * class.cs (MemberBase): The .ctor now takes the name as a
10516         MemberName instead of a string.
10517         (MemberBase.ExplicitInterfaceName): Changed type from string to
10518         Expression.
10519         (MemberBase.DoDefine): If we're an explicit implementation, the
10520         InterfaceType may be a generic instance.
10521
10522         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10523         (namespace_name): Call MemberName.GetName () to transform the
10524         MemberName into a string and ensure we don't have any type
10525         arguments.
10526         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10527         MemberName into an expression.
10528         (method_header): Use namespace_or_type_name instead of member_name.     
10529
10530 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10531
10532         * rootcontext.cs: Add new types to the boot resolution.
10533
10534         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10535         MulticastDelegate is not allowed.
10536
10537         * typemanager.cs: Add new types to lookup: System.TypedReference
10538         and ArgIterator.
10539
10540         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10541         check for TypedReference or ArgIterator, they are not allowed. 
10542
10543         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10544         makes us properly catch 1510 in some conditions (see bug 56016 for
10545         details). 
10546
10547 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10548
10549         * CryptoConvert.cs: update from corlib version
10550         with endian fixes.
10551
10552 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10553
10554         * class.cs (Indexer.Define): Check indexername declaration
10555
10556 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10557
10558         * attribute.cs (IsClsCompliant): Fixed problem with handling
10559         all three states (compliant, not-compliant, undetected).
10560
10561 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10562
10563         * attribute.cs (Attribute): Location is now public.
10564         (Resolve): Store resolved arguments (pos_values) in attribute class.
10565         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10566         (GetClsCompliantAttributeValue): New method that gets
10567         CLSCompliantAttribute value.
10568         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10569         if exists else null.
10570         (AttributeTester): New class for CLS-Compliant verification routines.
10571
10572         * class.cs (Emit): Add CLS-Compliant verification.
10573         (Method.GetSignatureForError): Implemented.
10574         (Constructor.GetSignatureForError): Implemented
10575         (Constructor.HasCompliantArgs): Returns if constructor has
10576         CLS-Compliant arguments.
10577         (Constructor.Emit): Override.
10578         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10579         is needed to test only parameters.
10580         (FieldBase.GetSignatureForError): Implemented.
10581         (TypeContainer): New member for storing base interfaces.
10582         (TypeContainer.FindMembers): Search in base interfaces too.
10583
10584         * codegen.cs (GetClsComplianceAttribute): New method that gets
10585         assembly or module CLSCompliantAttribute value.
10586         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10587         for assembly.
10588         (ModuleClass.Emit): Add error 3012 test.
10589
10590         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10591
10592         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10593         state for all decl types.
10594         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10595         if CLS-Compliant tests are required.
10596         (IsClsCompliaceRequired): New method. Analyze whether code
10597         must be CLS-Compliant.
10598         (IsExposedFromAssembly): New method. Returns true when MemberCore
10599         is exposed from assembly.
10600         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10601         value or gets cached value.
10602         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10603         is explicitly marked with CLSCompliantAttribute.
10604         (IsIdentifierClsCompliant): New abstract method. This method is
10605         used to testing error 3005.
10606         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10607         for identifier and parameters CLS-Compliant testing.
10608         (VerifyClsCompliance): New method. The main virtual method for
10609         CLS-Compliant verifications.
10610         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10611         null. I don't know why is null (too many public members !).
10612         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10613         and get value of first CLSCompliantAttribute that found.
10614
10615         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10616         (VerifyClsCompliance): Override and add extra tests.
10617
10618         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10619         clscheck- disable CLS-Compliant verification event if assembly is has
10620         CLSCompliantAttribute(true).
10621
10622         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10623         ApllyAttribute is now called in emit section as in the other cases.
10624         Possible future Emit integration.
10625         (IsIdentifierClsCompliant): New override.
10626         (VerifyClsCompliance): New override.
10627         (GetEnumeratorName): Returns full enum name.
10628
10629         * parameter.cs (GetSignatureForError): Implemented.
10630
10631         * report.cs (WarningData): New struct for Warning message information.
10632         (LocationOfPreviousError): New method.
10633         (Warning): New method. Reports warning based on the warning table.
10634         (Error_T): New method. Reports error based on the error table.
10635
10636         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10637         verifications are done here.
10638
10639         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10640
10641         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10642         CLSCompliantAttribute.
10643         (all_imported_types): New member holds all imported types from other
10644         assemblies.
10645         (LoadAllImportedTypes): New method fills static table with exported types
10646         from all referenced assemblies.
10647         (Modules): New property returns all assembly modules.
10648
10649 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10650
10651         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10652         throwing a parser error.
10653
10654         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10655         which removes the hardcoded get_/set_ prefixes for properties, as
10656         IL allows for the properties to be named something else.  
10657
10658         Bug #56013
10659
10660         * expression.cs: Do not override operand before we know if it is
10661         non-null.  Fix 56207
10662
10663 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10664
10665         * typemanager.cs: support for pinned variables.
10666
10667 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10668
10669         * decl.cs, typemanager.cs: Avoid using an arraylist
10670         as a buffer if there is only one result set.
10671
10672 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10673
10674         * expression.cs: Make sure you cant call a static method
10675         with an instance expression, bug #56174.
10676
10677 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * class.cs (IsDuplicateImplementation): Improve error reporting to
10680         flag 663 (method only differs in parameter modifier).
10681
10682         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10683         in preprocessor directives.
10684
10685         * location.cs (LookupFile): Allow for the empty path.
10686
10687         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10688         better approach for some of that patch, but its failing with the
10689         CharSet enumeration.  For now try/catch will do.
10690
10691         * typemanager.cs: Do not crash if a struct does not have fields.
10692         Fixes 56150.
10693
10694 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10695
10696         * expression.cs: cs0213, cant fix a fixed expression.
10697         fixes 50231.
10698
10699 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10700
10701         * cs-parser.jay: detect invalid embeded statements gracefully.
10702         bug #51113.
10703
10704 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10705
10706         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10707         As a regex:
10708         s/
10709         the invocation type may not be a subclass of the tye of the item/
10710         The type of the item must be a subclass of the invocation item.
10711         /g
10712
10713         Fixes bug #50820.
10714
10715 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10716
10717         * attribute.cs: Added methods to get a string and a bool from an
10718         attribute. Required to information from AssemblyKeyFileAttribute,
10719         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10720         * codegen.cs: Modified AssemblyName creation to include support for
10721         strongnames. Catch additional exceptions to report them as CS1548.
10722         * compiler.csproj: Updated include CryptoConvert.cs.
10723         * compiler.csproj.user: Removed file - user specific configuration.
10724         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10725         Mono.Security assembly. The original class is maintained and tested in
10726         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10727         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10728         like CSC 8.0 (C# v2) supports.
10729         * Makefile: Added CryptoConvert.cs to mcs sources.
10730         * rootcontext.cs: Added new options for strongnames.
10731
10732 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10733
10734         * driver.cs: For --expect-error, report error code `2'
10735         if the program compiled with no errors, error code `1' if
10736         it compiled with an error other than the one expected.
10737
10738 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10739
10740         * compiler.csproj: Updated for Visual Studio .NET 2003.
10741         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10742         * compiler.sln: Updated for Visual Studio .NET 2003.
10743
10744 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10745
10746         * expression.cs: Fix bug #47234. We basically need to apply the
10747         rule that we prefer the conversion of null to a reference type
10748         when faced with a conversion to 'object' (csc behaviour).
10749
10750 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10751
10752         * statement.cs: Shorter form for foreach, eliminates
10753         a local variable. r=Martin.
10754
10755 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10756
10757         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10758         checks if we can use brtrue/brfalse to test for 0.
10759         * expression.cs: use the above in the test for using brtrue/brfalse.
10760         cleanup code a bit.
10761
10762 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10763
10764         * expression.cs: Rewrite string concat stuff. Benefits:
10765
10766         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10767         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10768         rather than a concat chain.
10769
10770         * typemanager.cs: Add lookups for more concat overloads.
10771
10772 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10773
10774         * expression.cs: Emit shorter il code for array init.
10775
10776         newarr
10777         dup
10778         // set 1
10779
10780         // set 2
10781
10782         newarr
10783         stloc.x
10784
10785         ldloc.x
10786         // set 1
10787
10788         ldloc.x
10789         // set 2
10790
10791 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10792
10793         * statement.cs: Before, two switch blocks would be merged if the
10794         total size of the blocks (end_item - begin_item + 1) was less than
10795         two times the combined sizes of the blocks.
10796
10797         Now, it will only merge if after the merge at least half of the
10798         slots are filled.
10799
10800         fixes 55885.
10801
10802 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10803
10804         * class.cs : csc build fix for GetMethods(). See bug #52503.
10805
10806 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10807
10808         * expression.cs: Make sure fp comparisons work with NaN.
10809         This fixes bug #54303. Mig approved this patch a long
10810         time ago, but we were not able to test b/c the runtime
10811         had a related bug.
10812
10813 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10814
10815         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10816
10817 2004-03-19  Martin Baulig  <martin@ximian.com>
10818
10819         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10820         two overloads may unify for some type parameter substitutions and
10821         report a CS0408 if appropriate.
10822
10823 2004-03-19  Martin Baulig  <martin@ximian.com>
10824
10825         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10826         error here and not in our caller.
10827
10828 2004-03-19  Martin Baulig  <martin@ximian.com>
10829
10830         * interface.cs: Completely killed this file.
10831         (Interface): We're now a TypeContainer and live in class.cs.
10832
10833         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10834         argument; we're now also called for interfaces.
10835         (TypeContainer.DefineMembers): Allow this method being called
10836         multiple times.
10837         (TypeContainer.GetMethods): New public method; formerly known as
10838         Interface.GetMethod().  This is used by PendingImplementation.
10839         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10840         it's now private and non-static.
10841         (Interface): Moved this here; it's now implemented similar to
10842         Class and Struct.
10843         (Method, Property, Event, Indexer): Added `bool is_interface'
10844         argument to their .ctor's.
10845         (MemberBase.IsInterface): New public field.
10846
10847         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10848         instances instead of InterfaceMethod, InterfaceProperty, etc.
10849         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10850         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10851
10852 2004-03-19  Martin Baulig  <martin@ximian.com>
10853
10854         * class.cs (MethodCore.IsDuplicateImplementation): New private
10855         method which does the CS0111 checking.
10856         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10857         Use IsDuplicateImplementation().
10858
10859 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10860
10861         * decl.cs (FindMemberToOverride): New method to find the correct
10862         method or property to override in the base class.
10863         * class.cs
10864             - Make Method/Property use the above method to find the
10865               version in the base class.
10866             - Remove the InheritableMemberSignatureCompare as it is now
10867               dead code.
10868
10869         This patch makes large code bases much faster to compile, as it is
10870         O(n) rather than O(n^2) to do this validation.
10871
10872         Also, it fixes bug 52458 which is that nested classes are not
10873         taken into account when finding the base class member.
10874
10875         Reviewed/Approved by Martin.
10876
10877 2004-03-17  Martin Baulig  <martin@ximian.com>
10878
10879         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10880         of type arguments into account; use the `real_num_type_args'
10881         approach like in DoResolveAsTypeStep().
10882
10883         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10884         nested types.
10885
10886 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10887
10888         * interface.cs: In all interface classes removed redundant
10889         member initialization.
10890
10891 2004-03-16  Martin Baulig  <martin@ximian.com>
10892
10893         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10894
10895 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10896
10897         * decl.cs (DefineTypeAndParents): New helper method to define a
10898         type's containers before the type itself is defined;  This is a
10899         bug exposed by the recent changes to Windows.Forms when an
10900         implemented interface was defined inside a class that had not been
10901         built yet.   
10902
10903         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10904
10905         (Check): Loop correctly to report errors modifiers
10906         (UNSAFE was not in the loop, since it was the same as TOP).
10907
10908         * interface.cs: Every interface member now takes a ModFlags,
10909         instead of a "is_new" bool, which we set on the base MemberCore. 
10910
10911         Every place where we called "UnsafeOk" in the interface, now we
10912         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10913         the unsafe settings from the member declaration instead of the
10914         container interface. 
10915
10916         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10917
10918         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10919         `set_indexer_name' to the pending bits (one per type).
10920
10921         We fixed a bug today that was picking the wrong method to
10922         override, since for properties the existing InterfaceMethod code
10923         basically ignored the method name.  Now we make sure that the
10924         method name is one of the valid indexer names.
10925
10926 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10927  
10928         * support.cs (SeekableStreamReader): Keep track of stream byte
10929         positions and don't mix them with character offsets to the buffer.
10930
10931         Patch from Gustavo Giráldez
10932
10933 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10934
10935         * interface.cs (InterfaceSetGetBase): Removed double member
10936         initialization, base class does it as well.
10937
10938 2004-03-13  Martin Baulig  <martin@ximian.com>
10939
10940         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10941         when compiling corlib.
10942
10943 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10944
10945         * convert.cs (ExplicitConversion): We were reporting an error on
10946         certain conversions (object_type source to a value type, when the
10947         expression was `null') before we had a chance to pass it through
10948         the user defined conversions.
10949
10950         * driver.cs: Replace / and \ in resource specifications to dots.
10951         Fixes 50752
10952
10953         * class.cs: Add check for duplicate operators.  Fixes 52477
10954
10955 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10956
10957         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10958         that are in the middle of the statements, not only at the end.
10959         Fixes #54987
10960
10961         * class.cs (TypeContainer.AddField): No longer set the
10962         `HaveStaticConstructor' flag, now we call it
10963         `UserDefineStaticConstructor' to diferentiate the slightly
10964         semantic difference.
10965
10966         The situation is that we were not adding BeforeFieldInit (from
10967         Modifiers.TypeAttr) to classes that could have it.
10968         BeforeFieldInit should be set to classes that have no static
10969         constructor. 
10970
10971         See:
10972
10973         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10974
10975         And most importantly Zoltan's comment:
10976
10977         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10978
10979         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10980          before its static fields are used', i.e. initialization does not need
10981          to be triggered by the first access to the type. Setting this flag
10982          helps the JIT to compile better code, since it can run the static
10983          constructor at JIT time, and does not need to generate code to call it
10984          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10985          this flag for lots of classes like String. 
10986          
10987          csc sets this flag if the type does not have an explicit static 
10988          constructor. The reasoning seems to be that if there are only static
10989          initalizers for a type, and no static constructor, then the programmer
10990          does not care when this initialization happens, so beforefieldinit
10991          can be used.
10992          
10993          This bug prevents the AOT compiler from being usable, since it 
10994          generates so many calls to mono_runtime_class_init that the AOT code
10995          is much slower than the JITted code. The JITted code is faster, 
10996          because it does not generate these calls if the vtable is type is
10997          already initialized, which is true in the majority of cases. But the
10998          AOT compiler can't do this."
10999
11000 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * class.cs (MethodData.Emit): Refactor the code so symbolic
11003         information is generated for destructors;  For some reasons we
11004         were taking a code path that did not generate symbolic information
11005         before. 
11006
11007 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11008
11009         * class.cs: Create a Constructor.CheckBase method that
11010         takes care of all validation type code. The method
11011         contains some code that was moved from Define.
11012
11013         It also includes new code that checks for duplicate ctors.
11014         This fixes bug #55148.
11015
11016 2004-03-09  Joshua Tauberer <tauberer@for.net>
11017
11018         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11019         a { ... }-style array creation invokes EmitStaticInitializers
11020         which is not good for reference-type arrays.  String, decimal
11021         and now null constants (NullCast) are not counted toward
11022         static initializers.
11023
11024 2004-03-05  Martin Baulig  <martin@ximian.com>
11025
11026         * location.cs (SourceFile.HasLineDirective): New public field;
11027         specifies whether the file contains or is referenced by a "#line"
11028         directive.
11029         (Location.DefineSymbolDocuments): Ignore source files which
11030         either contain or are referenced by a "#line" directive.        
11031
11032 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11033
11034         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11035         direct access to our parent, so check the method inline there.
11036
11037 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11038
11039         * expression.cs (Invocation.EmitCall): Miguel's last commit
11040         caused a regression. If you had:
11041
11042             T t = null;
11043             t.Foo ();
11044
11045         In Foo the implict this would be null.
11046
11047 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11048
11049         * expression.cs (Invocation.EmitCall): If the method is not
11050         virtual, do not emit a CallVirt to it, use Call.
11051
11052         * typemanager.cs (GetFullNameSignature): Improve the method to
11053         cope with ".ctor" and replace it with the type name.
11054
11055         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11056         as an argument the ConstructorBuilder where it is being defined,
11057         to catch the recursive constructor invocations.
11058
11059 2004-03-16  Martin Baulig  <martin@ximian.com>
11060
11061         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11062         ConstructedType, call ResolveType() on it to get the type rather
11063         than just using `expr.Type'.
11064
11065 2004-03-16  Martin Baulig  <martin@ximian.com>
11066
11067         * generics.cs (ConstructedType.GetMemberAccess): Take the
11068         EmitContext instead on the TypeExpr and use
11069         ec.TypeContainer.CurrentType/ec.ContainerType.
11070
11071 2004-03-16  Martin Baulig  <martin@ximian.com>
11072
11073         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11074         parameters before aliases.
11075
11076 2004-03-16  Martin Baulig  <martin@ximian.com>
11077
11078         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11079         New oublic function; checks whether two generic instances may become
11080         equal under some instantiations (26.3.1).
11081
11082         * class.cs (TypeContainer.Define): Call
11083         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11084         error.
11085
11086 2004-03-16  Martin Baulig  <martin@ximian.com>
11087
11088         * class.cs (TypeContainer.GetClassBases): Moved
11089         Error_TypeParameterAsBase() here and also check whether the base
11090         class is not an attribute.
11091
11092 2004-03-16  Martin Baulig  <martin@ximian.com>
11093
11094         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11095
11096 2004-03-16  Martin Baulig  <martin@ximian.com>
11097
11098         * class.cs (Error_TypeParameterAsBase): Use correct error number
11099         here (CS0689).  
11100
11101 2004-03-16  Martin Baulig  <martin@ximian.com>
11102
11103         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11104         for generics.
11105
11106         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11107         error reporting.
11108
11109 2004-03-15  Martin Baulig  <martin@ximian.com>
11110
11111         * typemanager.cs (TypeManager.GetFullName): New public method.
11112         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11113         argument; only return members with the correct number of type
11114         arguments.
11115         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11116         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11117         whether the number of type arguments matches.
11118
11119         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11120         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11121
11122         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11123         field; it's set by the protected .ctor when we're actually a
11124         GenericMemberAccess.
11125         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11126         arguments and pass it to MemberLookupFinal ().
11127
11128         * ecore.cs (Expression.MemberLookup): Added `int
11129         num_type_arguments' argument; only return members with the correct
11130         number of type arguments.
11131         (Expression.MemberLookupFailed): Check whether the MemberLookup
11132         failed because we did not have the correct number of type
11133         arguments; report CS0305 in this case.
11134
11135         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11136         `e.ResolveAsTypeTerminal()' already did so.
11137
11138 2004-03-15  Martin Baulig  <martin@ximian.com>
11139
11140         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11141         we're a ConstructedType; in this case, the caller must report an
11142         error (for instance CS0131).
11143
11144         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11145         (TypeArguments.Resolve): Actually report errors here.
11146
11147 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11148
11149         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11150         `set_indexer_name' to the pending bits (one per type).
11151
11152         We fixed a bug today that was picking the wrong method to
11153         override, since for properties the existing InterfaceMethod code
11154         basically ignored the method name.  Now we make sure that the
11155         method name is one of the valid indexer names.
11156
11157 2004-03-15  Martin Baulig  <martin@ximian.com>
11158
11159         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11160         for generic instances.
11161
11162 2004-03-13  Martin Baulig  <martin@ximian.com>
11163
11164         * class.cs (TypeContainer.DefineType): Call
11165         TypeManager.AddUserType() immediately after creating the
11166         TypeBuilder; pass all type parameters when creating the
11167         CurrentType.
11168
11169         * decl.cs (DeclSpace.FindNestedType): New public method.
11170         (DeclSpace.FindType): Added `int num_type_args' argument; only
11171         return types with the correct number of type parameters.
11172         (DeclSpace.CountTypeParams): New public property.
11173
11174         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11175         the number of type parameters; defaults to zero.
11176
11177         * generic.cs (TypeArguments.Count): New public property.
11178         (ConstructedType.DoResolveAsTypeStep): First call
11179         ds.FindNestedType() to find out whether we're nested in the
11180         current generic type; in this case, we inherit all type parameters
11181         from the current class.
11182
11183         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11184         num_type_args' argument.
11185         (RootContext.LookupType): Added overloaded version which takes the
11186         number of type arguments; only return types with the correct
11187         number of type arguments.
11188
11189         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11190         checks whether `Type t' has `int num_type_args'.
11191
11192 2004-03-13  Martin Baulig  <martin@ximian.com>
11193
11194         * generic.cs (GenericMethod.DefineType): New method; calls
11195         DefineType() on all the type parameters.
11196
11197         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11198         (MethodData.Define): If we're a generic method, call
11199         GenericMethod.DefineType() to define the type parameters.       
11200
11201 2004-03-10  Martin Baulig  <martin@ximian.com>
11202
11203         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11204         instead of IsAssignableFrom.    
11205
11206 2004-03-10  Martin Baulig  <martin@ximian.com>
11207
11208         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11209
11210         * support.cs (ParameterData.HasArrayParameter): New property.
11211         (ReflectionParameters.ctor): Take a MethodBase instead of a
11212         ParameterInfo[].  If we have any type parameters, get the generic
11213         method definition and ask it whether we have variable arguments.
11214
11215 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11216
11217         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11218         routines to check if a type is an enumerable/enumerator allow
11219         classes that implement the IEnumerable or IEnumerator interfaces.
11220
11221         * class.cs (Property, Operator): Implement IIteratorContainer, and
11222         implement SetYields.
11223
11224         (Property.Define): Do the block swapping for get_methods in the
11225         context of iterators.   We need to check if Properties also
11226         include indexers or not.
11227
11228         (Operator): Assign the Block before invoking the
11229         OperatorMethod.Define, so we can trigger the Iterator code
11230         replacement. 
11231
11232         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11233         Property and Operator classes are not created when we parse the
11234         declarator but until we have the block completed, so we use a
11235         singleton SimpleIteratorContainer.Simple to flag whether the
11236         SetYields has been invoked.
11237
11238         We propagate this setting then to the Property or the Operator to
11239         allow the `yield' to function.
11240
11241 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11242
11243         * codegen.cs: Implemented attribute support for modules.
11244         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11245         Assembly/Module functionality.
11246
11247         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11248         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11249         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11250
11251 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11252
11253         * interface.cs (FindMembers): The operation is performed on all base
11254         interfaces and not only on the first. It is required for future CLS Compliance patch.
11255
11256 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11257
11258         * statement.cs, codegen.cs:
11259         This patch deals with patterns such as:
11260
11261         public class List : IEnumerable {
11262
11263                 public MyEnumerator GetEnumerator () {
11264                         return new MyEnumerator(this);
11265                 }
11266
11267                 IEnumerator IEnumerable.GetEnumerator () {
11268                         ...
11269                 }
11270                 
11271                 public struct MyEnumerator : IEnumerator {
11272                         ...
11273                 }
11274         }
11275
11276         Before, there were a few things we did wrong:
11277         1) we would emit callvirt on a struct, which is illegal
11278         2) we emited ldarg when we needed to emit ldarga
11279         3) we would mistakenly call the interface methods on an enumerator
11280         type that derived from IEnumerator and was in another assembly. For example:
11281
11282         public class MyEnumerator : IEnumerator
11283
11284         Would have the interface methods called, even if there were public impls of the
11285         method. In a struct, this lead to invalid IL code.
11286
11287 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11288
11289         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11290           renamed to Emit.
11291
11292         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11293
11294 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11295
11296         * cs-parser.jay: Fix small regression: we were not testing V2
11297         compiler features correctly.
11298
11299         * interface.cs: If the emit context is null, then create one
11300
11301 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11302
11303         * decl.cs (GetSignatureForError): New virtual method to get full name
11304           for error messages.
11305
11306         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11307           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11308
11309         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11310           Duplicated members and code in these classes has been removed.
11311           Better encapsulation in these classes.
11312
11313 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11314
11315         * assign.cs (Assign.DoResolve): When dealing with compound
11316         assignments, there is a new rule in ECMA C# 2.4 (might have been
11317         there before, but it is documented here) that states that in:
11318
11319         a op= b;
11320
11321         If b is of type int, and the `op' is a shift-operator, then the
11322         above is evaluated as:
11323
11324         a = (int) a op b 
11325
11326         * expression.cs (Binary.ResolveOperator): Instead of testing for
11327         int/uint/long/ulong, try to implicitly convert to any of those
11328         types and use that in pointer arithmetic.
11329
11330         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11331         method to print information for from the type, not from the
11332         null-method we were given.
11333
11334 2004-02-01  Duncan Mak  <duncan@ximian.com>
11335
11336         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11337         parsing for cmd, fixes bug #53694.
11338
11339 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11340
11341         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11342         in the member name duplication tests. Property and operator name duplication
11343         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11344
11345 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11346
11347         * interface.cs (PopulateMethod): Fixed crash when interface method
11348         returns not existing type (error test cs0246-3.cs).
11349
11350 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11351
11352         * cs-parser.jay (interface_accessors): Re-write actions to also
11353         store attributes attached to get and set methods. Fix spelling
11354         while at it.
11355
11356         (inteface_property_declaration): Modify accordingly.
11357
11358         (InterfaceAccessorInfo): New helper class to store information to pass
11359         around between rules that use interface_accessors.
11360
11361         * interface.cs (Emit): Apply attributes on the get and set
11362         accessors of properties and indexers too.
11363
11364         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11365         right MethodBuilder when applying attributes to the get and set accessors.
11366
11367 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11368
11369         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11370
11371 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11372
11373         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11374
11375 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11376
11377         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11378         changes that treat `yield' specially when present before `break'
11379         or `return' tokens.
11380
11381         * cs-tokenizer.cs: yield is no longer a keyword.
11382
11383 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11384
11385         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11386         setting for default constructors.
11387         For default constructors are almost every time set wrong Modifier. The
11388         generated IL code has been alright. But inside mcs this values was
11389         wrong and this was reason why several of my CLS Compliance tests
11390         failed.
11391
11392 2004-02-27  Martin Baulig  <martin@ximian.com>
11393
11394         * generics.cs (ConstructedType.ResolveType): Make the nested type
11395         stuff actually work.
11396
11397 2004-02-25  Martin Baulig  <martin@ximian.com>
11398
11399         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11400         property; returns the type parameters just from the current type,
11401         ie. with the ones from outer classes.
11402         (DeclSpace.LookupGeneric): First search in the current class, then
11403         in outer classes.
11404         (DeclSpace.initialize_type_params): When hiding a type parameter
11405         from an outer class, put it into the `type_param_list' anyways.
11406
11407         * expression.cs (MemberAccess.expr): Made this field protected.
11408
11409         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11410         the type parameters from the current class.
11411
11412         * generic.cs (ConstructedType.ResolveType): Support nested generic
11413         types by taking the type parameters which we inherit from outer
11414         classes into account.
11415         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11416         support for nested generic types.
11417
11418 2004-02-23  Martin Baulig  <martin@ximian.com>
11419
11420         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11421         field and check whether we're nested inside a generic type.
11422         (DeclSpace.ResolveType): If we're resolving to a generic type
11423         definition, create a ConstructedType and return its resolved type.
11424         (DeclSpace.initialize_type_params): New private method;
11425         initializes the `type_param_list' field from the type parameters
11426         from this and all enclosing classes.
11427         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11428         we're already initialized.
11429
11430 2004-02-23  Martin Baulig  <martin@ximian.com>
11431
11432         * class.cs (Method.Define): Create the generic method before
11433         calling DoDefine().
11434         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11435         the TypeContainer one); we use this for generic methods.
11436
11437         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11438         parent's TypeBuilder.
11439
11440 2004-02-18  Martin Baulig  <martin@ximian.com>
11441
11442         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11443         to check for equality.
11444
11445 2004-02-05  Martin Baulig  <martin@ximian.com>
11446
11447         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11448         `ec.TypeContainer.CurrentType', use it instead of
11449         `ec.ContainerType' to check whether we're in the type's ctor.
11450
11451 2004-01-29  Martin Baulig  <martin@ximian.com>
11452
11453         * expression.cs (Invocation.DoResolve): If we're a
11454         `ConstructedType', then we're actually a generic method, so
11455         rewrite the expr as a GenericMemberAccess.
11456
11457         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11458         here; manually parse it into a string.
11459
11460 2004-01-28  Martin Baulig  <martin@ximian.com>
11461
11462         * typemanager.cs (TypeManager.IsEqual): New static method.
11463         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11464         check for equality instead of using `=='.
11465
11466 2004-01-26  Martin Baulig  <martin@ximian.com>
11467
11468         * decl.cs (DeclSpace.CurrentType): New public field.
11469
11470         * expression.cs (This.ResolveBase): If we have an
11471         `ec.TypeContainer.CurrentType', use it instead of
11472         `ec.ContainerType'.
11473
11474         * class.cs (TypeContainer.DefineType): If we're a generic type,
11475         create the `CurrentType' (unresolved).
11476         (TypeContainer.GenericType): New private field.
11477         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11478         it and store it in `GenericType' before creating the MemberCache.
11479         (TypeContainer.GetMembers): If we have a `GenericType', call
11480         TypeManager.FindMembers() on it.
11481
11482         * interface.cs (Interface.GenericType): New private field.
11483         (Interface.DefineType): If we're a generic type, create the
11484         `CurrentType' (unresolved).
11485         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11486         and store it in `GenericType' before creating the MemberCache.
11487         (Interface.GetMembers): If we have a `GenericType', call
11488         TypeManager.FindMembers() on it.
11489
11490 2004-01-22  Martin Baulig  <martin@ximian.com>
11491
11492         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11493         not a QualifiedIdentifier.  This is what `type_name_expression'
11494         was previously doing.
11495         (type_name_expression): Removed; the code is now in
11496         `namespace_or_type_name'.
11497         (qualified_identifier): Removed, use `namespace_or_type_name'
11498         instead.
11499         (QualifiedIdentifier): Removed this class.      
11500
11501 2004-01-22  Martin Baulig  <martin@ximian.com>
11502
11503         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11504         not a string as alias name.
11505
11506 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11507
11508         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11509         #52730 bug, and instead compute correctly the need to use a
11510         temporary variable when requesting an address based on the
11511         static/instace modified of the field and the constructor.
11512  
11513 2004-01-21  Martin Baulig  <martin@ximian.com>
11514
11515         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11516         class and namespace before looking up aliases.  Fixes #52517.
11517
11518 2004-01-21  Martin Baulig  <martin@ximian.com>
11519
11520         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11521         assinged in a 'try'; fixes exception4.cs.
11522
11523 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11524         * class.cs : Implemented parameter-less constructor for TypeContainer
11525
11526         * decl.cs: Attributes are now stored here. New property OptAttributes
11527
11528         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11529
11530         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11531
11532 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11533
11534         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11535           (CSharpSignature): New method for indexer and property signature.
11536
11537 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11538
11539         * pending.cs (IsVirtualFilter): Faster implementation.
11540
11541 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11542
11543         * typemanager.cs: Avoid inclusion of same assembly more than once.
11544
11545 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11546
11547         * cs-parser.jay: Fixed problem where the last assembly attribute
11548           has been applied also to following declaration (class, struct, etc.)
11549           
11550 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11551
11552         * class.cs: Added error CS0538, CS0539 reporting.
11553         Fixed crash on Microsoft runtime when field type is void.
11554
11555         * cs-parser.jay: Added error CS0537 reporting.
11556
11557         * pending.cs: Added error CS0535 reporting.
11558         Improved error report for errors CS0536, CS0534.
11559
11560 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11561
11562         Merge a few bits from the Anonymous Method MCS tree.
11563
11564         * statement.cs (ToplevelBlock): New class for toplevel methods,
11565         will hold anonymous methods, lifted variables.
11566
11567         * cs-parser.jay: Create toplevel blocks for delegates and for
11568         regular blocks of code. 
11569
11570 2004-01-20  Martin Baulig  <martin@ximian.com>
11571
11572         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11573         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11574         and `NeedExplicitReturn'; added `IsLastStatement'.
11575         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11576         have a `ReturnLabel' or we're not unreachable.
11577
11578         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11579         child's reachability; don't just override ours with it.  Fixes
11580         #58058 (lluis's example).
11581         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11582         InFinally(), InLoop(), InSwitch() and
11583         BreakCrossesTryCatchBoundary() methods.
11584
11585         * statement.cs (Return): Do all error checking in Resolve().
11586         Unless we are the last statement in a top-level block, always
11587         create a return label and jump to it.
11588         (Break, Continue): Do all error checking in Resolve(); also make
11589         sure we aren't leaving a `finally'.
11590         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11591         statement in a top-level block.
11592         (Block.Flags): Added `IsDestructor'.
11593         (Block.IsDestructor): New public property.
11594
11595 2004-01-20  Martin Baulig  <martin@ximian.com>
11596
11597         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11598
11599 2004-01-20  Martin Baulig  <martin@ximian.com>
11600
11601         * statement.cs (Statement.ResolveUnreachable): New public method.
11602         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11603         (Block.Resolve): Resolve unreachable statements.
11604
11605 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11606
11607         * expression.cs: We need to fix the case where we do
11608         not have a temp variable here.
11609
11610         * assign.cs: Only expression compound assignments need
11611         temporary variables.
11612
11613 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11614
11615         * flowanalysis.cs: Reduce memory allocation in a few ways:
11616           - A block with no variables should not allocate a bit
11617             vector for itself.
11618           - A method with no out parameters does not need any tracking
11619             for assignment of the parameters, so we need not allocate
11620             any data for it.
11621           - The arrays:
11622                 public readonly Type[] VariableTypes;
11623                 public readonly string[] VariableNames;
11624             Are redundant. The data is already stored in the variable
11625             map, so we need not allocate another array for it.
11626           - We need to add alot of checks for if (params | locals) == null
11627             due to the first two changes.
11628
11629 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11630
11631         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11632         implement IMemoryLocation, we store a copy on a local variable and
11633         take the address of it.  Patch from Benjamin Jemlich
11634
11635         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11636         to use a special "type_name_expression" rule which reduces the
11637         number of "QualifiedIdentifier" classes created, and instead
11638         directly creates MemberAccess expressions.
11639
11640 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11643         that fixes #52853.  Null literal assignment to ValueType
11644
11645         * class.cs (MethodData.Emit): Instead of checking the name of the
11646         method to determine if its a destructor, create a new derived
11647         class from Method called Destructor, and test for that.  
11648
11649         * cs-parser.jay: Create a Destructor object instead of a Method.  
11650
11651         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11652
11653         Fixes: 52933
11654
11655 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11656
11657         * expression.cs (Binary.ResolveOperator): Perform an implicit
11658         conversion from MethodGroups to their delegate types on the
11659         Addition operation.
11660
11661         * delegate.cs: Introduce a new class DelegateCreation that is the
11662         base class for `NewDelegate' and `ImplicitDelegateCreation',
11663         factor some code in here.
11664
11665         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11666         conversion from MethodGroups to compatible delegate types. 
11667
11668         * ecore.cs (Expression.Resolve): Do not flag error 654
11669         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11670         we allow conversions from MethodGroups to delegate types now.
11671
11672         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11673         assignments in v2 either.
11674
11675 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11676
11677         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11678         static read-only fields in ctors.
11679
11680         Applied patch from Benjamin Jemlich 
11681
11682         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11683
11684 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11685
11686         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11687         here to return true, as they can be used like this:
11688
11689                 (XXX) int.MEMBER ()
11690
11691         Fixed 49836 and all the other dups
11692
11693 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11694
11695         * driver.cs: Implement /win32res and /win32icon.
11696
11697 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11698
11699         * cs-parser.jay: Add a rule to improve error handling for the
11700         common mistake of placing modifiers after the type.
11701
11702 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11703
11704         * cs-parser.jay (interface_event_declaration): Catch
11705         initialization of events on interfaces, and report cs0068
11706
11707         * cs-parser.jay (interface_event_declaration): Catch
11708         initialization of events. 
11709
11710         * ecore.cs: Better report missing constructors.
11711
11712         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11713         the error reporting done in the wrong place.  Fix.
11714
11715         * expression.cs (Binary.ResolveOperator): Catch the 
11716         operator + (E x, E y) error earlier, and later allow for implicit
11717         conversions in operator +/- (E e, U x) from U to the underlying
11718         type of E.
11719
11720         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11721         52596, if the container class is abstract, the default constructor
11722         is protected otherwise its public (before, we were always public).
11723
11724         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11725         fixed statement.
11726
11727         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11728         Jemlich that fixes bug #52597, MCS was generating invalid code for
11729         idisposable structs.   Thanks to Ben for following up with this
11730         bug as well.
11731
11732 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11733
11734         * driver.cs: Allow assemblies without code to be generated, fixes
11735         52230.
11736
11737 2004-01-07  Nick Drochak <ndrochak@gol.com>
11738
11739         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11740
11741 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11742
11743         * cs-parser.jay: Add rules to improve error reporting if fields or
11744         methods are declared at the namespace level (error 116)
11745
11746         * Add rules to catch event add/remove
11747
11748 2004-01-04  David Sheldon <dave-mono@earth.li>
11749
11750   * expression.cs: Added matching ")" to error message for 
11751   CS0077
11752
11753 2004-01-03 Todd Berman <tberman@gentoo.org>
11754
11755         * ecore.cs, attribute.cs:
11756         Applying fix from #52429.
11757
11758 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11759
11760         * ecore.cs, expression.cs, statement.cs:
11761         Total rewrite of how we handle branching. We
11762         now handle complex boolean expressions with fewer
11763         jumps. As well if (x == 0) no longer emits a ceq.
11764
11765         if (x is Foo) is much faster now, because we generate
11766         better code.
11767
11768         Overall, we get a pretty big improvement on our benchmark
11769         tests. The code we generate is smaller and more readable.
11770
11771         I did a full two-stage bootstrap. The patch was reviewed
11772         by Martin and Miguel.
11773
11774 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11775
11776         * cs-parser.jay: Make primary_expression not take a QI.
11777         we dont need this because the member_access rule covers
11778         us here. So we replace the rule with just IDENTIFIER.
11779
11780         This has two good effects. First, we remove a s/r conflict.
11781         Second, we allocate many fewer QualifiedIdentifier objects.
11782
11783 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11784
11785         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11786         set the correct information via SRE. This prevents
11787         hanging on the MS runtime. Fixes #29374.
11788
11789 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11790
11791         * convert.cs: correctly handle conversions to value types
11792         from Enum and ValueType as unboxing conversions.
11793
11794         Fixes bug #52569. Patch by Benjamin Jemlich.
11795
11796 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11797
11798         * expression.cs (BetterConversion): Prefer int -> uint
11799         over int -> ulong (csc's behaviour). This fixed bug #52046.
11800
11801 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11802
11803         * decl.cs (MemberCache.FindMembers): now returns a
11804         MemberInfo [].
11805
11806         * typemanager.cs: In general, go with with ^^.
11807         (CopyNewMethods): take an IList.
11808         (RealMemberLookup): Only allocate an arraylist
11809         if we copy from two sets of methods.
11810
11811         This change basically does two things:
11812         1) Fewer array lists allocated due to CopyNewMethods.
11813         2) the explicit cast in MemberList costed ALOT.
11814
11815 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11816
11817         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11818         a hashtable to avoid needless string allocations when an identifier is
11819         used more than once (the common case).
11820
11821 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11822
11823         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11824         is broken, it will not return anything. So, we
11825         have to use the information we have in mcs to
11826         do the task.
11827
11828         * typemanager.cs: Add a cache for GetInterfaces,
11829         since this will now be used more often (due to ^^)
11830
11831         (GetExplicitInterfaces) New method that gets the
11832         declared, not effective, interfaces on a type
11833         builder (eg, if you have interface IFoo, interface
11834         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11835         { IBar }.
11836
11837         This patch makes MCS able to bootstrap itself on
11838         Windows again.
11839
11840 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11841
11842         * expression.cs: Remove the Nop's that Miguel put
11843         in by mistake.
11844
11845 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11846
11847         * report.cs, codegen.cs: Give the real stack trace to
11848         the error when an exception is thrown.
11849
11850 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11851
11852         * decl.cs: only allocate hashtables for ifaces if 
11853         it is an iface!
11854
11855 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11856
11857         * expression.cs: fix the error from cs0121-2.cs
11858         (a parent interface has two child interfaces that
11859         have a function with the same name and 0 params
11860         and the function is called through the parent).
11861
11862 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11863
11864         * class.cs, rootcontext.cs, typmanager.cs: do not
11865         leak pointers.
11866
11867 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11868
11869         * codegen.cs: remove stack for the ec flow branching.
11870         It is already a linked list, so no need.
11871
11872 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11873
11874         * Makefile: Allow custom profiler here.
11875
11876 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11877
11878         * typemanager.cs (LookupType):
11879           - Use a static char [], because split takes
11880             a param array for args, so it was allocating
11881             every time.
11882           - Do not store true in a hashtable, it boxes.
11883
11884 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11885
11886         * flowanalysis.cs: bytify common enums.
11887
11888 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11889
11890         * modifiers.cs: Add a new set of flags for the
11891         flags allowed on explicit interface impls.
11892         * cs-parser.jay: catch the use of modifiers in
11893         interfaces correctly.
11894         * class.cs: catch private void IFoo.Blah ().
11895
11896         All related to bug #50572.
11897
11898 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11899
11900         * decl.cs: Rewrite the consistant accessability checking.
11901         Accessability is not linear, it must be implemented in
11902         a tableish way. Fixes #49704.
11903
11904 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11905
11906         * expression.cs: Handle negation in a checked context.
11907         We must use subtraction from zero. Fixes #38674.
11908
11909 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11910
11911         * class.cs: Ignore static void main in DLLs.
11912         * rootcontext.cs: Handle the target type here,
11913         since we are have to access it from class.cs
11914         * driver.cs: account for the above.
11915
11916 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11917
11918         * report.cs: Give line numbers and files if available.
11919
11920 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11921
11922         * driver.cs: Implement /addmodule.
11923
11924         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11925         ModuleBuilders.
11926
11927 2003-12-20  Martin Baulig  <martin@ximian.com>
11928
11929         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11930         (FieldBase.IsAssigned): Removed this field.
11931         (FieldBase.SetAssigned): New public method.
11932         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11933
11934 2003-12-20  Martin Baulig  <martin@ximian.com>
11935
11936         * expression.cs (LocalVariableReference.DoResolve): Don't set
11937         `vi.Used' if we're called from DoResolveLValue().
11938
11939         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11940         returns the usage vector it just merged into the current one -
11941         pass this one to UsageWarning().
11942         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11943         of the `EmitContext', don't call this recursively on our children.
11944
11945 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11946
11947         * driver.cs: Implement /target:module.
11948
11949 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11950
11951         * support.cs (CharArrayHashtable): New helper class.
11952
11953         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11954         char arrays, not strings, so we can avoid creating a string in
11955         consume_identifier if the identifier is a keyword.
11956
11957 2003-12-16  Martin Baulig  <martin@ximian.com>
11958
11959         * statement.cs (LocalInfo.Assigned): Removed this property.
11960         (LocalInfo.Flags): Removed `Assigned'.
11961         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11962         and uses flow analysis.
11963         (Block.UsageWarning): Made this method private.
11964         (Block.Resolve): Call UsageWarning() if appropriate.
11965
11966         * expression.cs (LocalVariableReference.DoResolve): Always set
11967         LocalInfo.Used here.
11968
11969 2003-12-13  Martin Baulig  <martin@ximian.com>
11970
11971         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11972         any value here; we're now using flow analysis to figure out
11973         whether a statement/block returns a value.
11974
11975 2003-12-13  Martin Baulig  <martin@ximian.com>
11976
11977         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11978         working again.
11979         (FlowBranching.MergeFinally): Don't call
11980         `branching.CheckOutParameters()' here, this is called in
11981         MergeTopBlock().
11982         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11983         when adding the `finally' vector.       
11984
11985 2003-12-13  Martin Baulig  <martin@ximian.com>
11986
11987         * flowanalysis.cs
11988         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11989         actually work and also fix #48962.
11990
11991 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11992
11993         * decl.cs: Do not check System.Object for nested types,
11994         since we know it does not have any. Big bang for buck:
11995
11996         BEFORE:
11997            Run 1:   8.35 seconds
11998            Run 2:   8.32 seconds
11999            corlib:  17.99 seconds
12000         AFTER:
12001            Run 1:   8.17 seconds
12002            Run 2:   8.17 seconds
12003            corlib:  17.39 seconds
12004
12005 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12006
12007         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12008         time we are returning 0 members, so we save alot here.
12009
12010 2003-12-11  Martin Baulig  <martin@ximian.com>
12011
12012         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12013         `MergeChild()', also just take the `FlowBranching' as argument;
12014         call Merge() on it and return the result.
12015         (FlowBranching.Merge): We don't need to do anything if we just
12016         have one sibling.
12017
12018 2003-12-11  Martin Baulig  <martin@ximian.com>
12019
12020         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12021         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12022         Maurer for this idea.
12023
12024 2003-12-11  Martin Baulig  <martin@ximian.com>
12025
12026         * flowanalysis.cs (MergeResult): This class is now gone; we now
12027         use the `UsageVector' for this.  The reason for this is that if a
12028         branching just has one sibling, we don't need to "merge" them at
12029         all - that's the next step to do.
12030         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12031         `MergeResult'.
12032
12033 2003-12-11  Martin Baulig  <martin@ximian.com>
12034
12035         Reworked flow analyis and made it more precise and bug-free.  The
12036         most important change is that we're now using a special `Reachability'
12037         class instead of having "magic" meanings of `FlowReturns'.  I'll
12038         do some more cleanups and optimizations and also add some more
12039         documentation this week.
12040
12041         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12042         largely reworked this class.
12043         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12044         the new `Reachability' class instead of having "magic" values here.
12045         (FlowBranching): We're now using an instance of `Reachability'
12046         instead of having separate `Returns', `Breaks' etc. fields.
12047
12048         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12049         based on flow analysis; ignore the return value of block.Emit ().
12050
12051 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12052
12053         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12054         if they are private.
12055
12056 2003-12-09  Martin Baulig  <martin@ximian.com>
12057
12058         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12059         call them directly on the UsageVector.
12060
12061 2003-12-09  Martin Baulig  <martin@ximian.com>
12062
12063         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12064         Changed return type from `FlowReturns' to `Reachability'.
12065
12066 2003-12-09  Martin Baulig  <martin@ximian.com>
12067
12068         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12069         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12070         `Reachable' fields with a single `Reachability' one.
12071
12072 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12073
12074         * class.cs (FindMembers): Remove foreach's.
12075
12076         Bootstrap times:
12077
12078         BEFORE
12079                 Run 1:   8.74 seconds
12080                 Run 2:   8.71 seconds
12081
12082         AFTER
12083                 Run 1:   8.64 seconds
12084                 Run 2:   8.58 seconds
12085
12086
12087 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12088
12089         * cs-parser.jay:
12090         * gen-treedump.cs:
12091         * statement.cs:
12092         This patch does a few things:
12093                 1. EmptyStatement is now a singleton, so it is never reallocated.
12094                 2. All blah is EmptyStatement constructs have been changed to
12095                    blah == EmptyStatement.Value, which is much faster and valid
12096                    now that EmptyStatement is a singleton.
12097                 3. When resolving a block, rather than allocating a new array for
12098                    the non-empty statements, empty statements are replaced with
12099                    EmptyStatement.Value
12100                 4. Some recursive functions have been made non-recursive.
12101         Mainly the performance impact is from (3), however (1) and (2) are needed for
12102         this to work. (4) does not make a big difference in normal situations, however
12103         it makes the profile look saner.
12104
12105         Bootstrap times:
12106
12107         BEFORE
12108         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12109         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12110         Total memory allocated: 56397 KB
12111
12112         AFTER
12113         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12114         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12115         Total memory allocated: 55666 KB
12116
12117 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12118
12119         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12120         than the hashtable in a hashtable version
12121
12122         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12123         we always end up concating a string. This results in a huge perf
12124         loss, because many strings have to be tracked by the GC. In this
12125         patch, we first use a hashtable that works with two keys, so that
12126         the strings do not need to be concat'ed.
12127
12128         Bootstrap times:
12129         BEFORE
12130                 Run 1:   8.74 seconds
12131                 Run 2:   8.71 seconds
12132
12133         AFTER
12134                 Run 1:   8.65 seconds
12135                 Run 2:   8.56 seconds
12136
12137 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12138
12139         * Makefile: Add a new target `do-time' that does a quick and simple
12140         profile, leaving easy to parse output.
12141
12142 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12143
12144         * codegen.cs (Init): Create the dynamic assembly with 
12145         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12146
12147 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12148
12149         * support.cs: Make the PtrHashtable use only one
12150         instance of its comparer.
12151
12152 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12153
12154         * typemanager.cs: Fix lookup of GetNamespaces.
12155
12156 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * expression.cs: Removed redundant line.
12159
12160         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12161         ArrayLists, use for loops with bounds.  
12162
12163         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12164         arraylist.
12165
12166         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12167         arraylists, use for loop with bounds.
12168
12169         The above three changes give us a 0.071 second performance
12170         improvement out of 3.294 seconds down to 3.223.  On my machine
12171         the above changes reduced the memory usage by 1,387 KB during
12172         compiler bootstrap.
12173
12174         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12175         QualifiedIdentifiers.  Before we created a new string through
12176         concatenation, and mostly later on, the result would be
12177         manipulated by DecomposeQI through string manipulation.
12178
12179         This reduced the compiler memory usage for bootstrapping from
12180         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12181         compile times in 0.05 seconds.
12182
12183 2003-11-28  Dick Porter  <dick@ximian.com>
12184
12185         * support.cs: Do string compares with the Invariant culture.
12186
12187         * rootcontext.cs: 
12188         * gen-treedump.cs: 
12189         * expression.cs: 
12190         * driver.cs: 
12191         * decl.cs: 
12192         * codegen.cs: 
12193         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12194         the comparison is done with the Invariant culture.
12195
12196 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12197
12198         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12199         GetEnumerator method.
12200
12201         (ProbeCollectionType): Iterate starting at the most specific type
12202         upwards looking for a GetEnumerator
12203
12204         * expression.cs: Shift count can be up to 31 for int/uint and 63
12205         for long/ulong.
12206
12207 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12208
12209         * statement.cs (Block.LookupLabel): Also look for the label on the
12210         children blocks.  Use a hash table to keep track of visited
12211         nodes. 
12212
12213         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12214         we actually did transform the other operand, otherwise fall back
12215         to the common codepath that casts to long.
12216
12217         * cs-tokenizer.cs: Use the same code pattern as the int case.
12218         Maybe I should do the parsing myself, and avoid depending on the
12219         Parse routines to get this done.
12220
12221 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12222
12223         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12224         which fixes bug 51347.  This time test it.
12225
12226         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12227         attributes for example can not tell the difference between these.
12228         The difference was only a syntax feature of the language. 
12229
12230         * attribute.cs: Apply attributes to delegates.
12231
12232         * delegate.cs: Call the apply attributes method.
12233
12234 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12237         comparing 0 vs Byte.MinValue, not the value
12238
12239         (ImplicitConversionRequired): When reporting a conversion error,
12240         use error 31 to print out the constant error instead of the
12241         simpler 29.
12242
12243         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12244         which fixes bug 51347.
12245
12246 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12247
12248         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12249         which fixes the -warnaserror command line option.
12250
12251 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12252
12253         * cfold.cs (DoNumericPromotions): During constant folding of
12254         additions on UIntConstant, special case intconstants with
12255         IntConstants like we do on the expression binary operator. 
12256
12257 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12258
12259         * convert.cs (ImplicitReferenceConversion): We were missing a case
12260         (System.Enum are not value types or class types, so we need to
12261         classify them separatedly).
12262
12263         * driver.cs: We do not support error 2007.
12264
12265 2003-11-12 Jackson Harper <jackson@ximian.com>
12266
12267         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12268         system directory. Also use the full file name so users can
12269         libraries names mscorlib-o-tron.dll in a non system dir.
12270         
12271 2004-01-04  David Sheldon <dave-mono@earth.li>
12272
12273         * expression.cs: Added matching ")" to error message for CS0077.
12274
12275 2003-12-19  Martin Baulig  <martin@ximian.com>
12276
12277         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12278         static method; see documentation in the method.
12279         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12280
12281         * convert.cs (Convert.ImplicitReferenceConversion,
12282         Convert.ImplicitReferenceConversionExists): Add support for
12283         generic type declarations; see gen-36.cs.
12284
12285 2003-12-19  Martin Baulig  <martin@ximian.com>
12286
12287         * pending.cs (Pending.InterfaceMethod): Use
12288         `Type.IsAssignableFrom()' instead of `=='.
12289
12290 2003-12-18  Martin Baulig  <martin@ximian.com>
12291
12292         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12293         byref types first.
12294
12295         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12296         `expr_type.Equals (target_type)' instead of `=='.
12297
12298 2003-12-08  Martin Baulig  <martin@ximian.com>
12299
12300         * generics.cs (Constraints.Types): Removed.
12301         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12302         to Type's.
12303         (Constraints.ResolveTypes): New public method; resolves the
12304         TypeExpr's to Type's.
12305         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12306         longer takes the constraints.
12307         (TypeParameter.DefineMethod): Likewise.
12308         (TypeParameter.DefineType): New public method.  Calls
12309         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12310         the constraints.
12311
12312 2003-12-08  Martin Baulig  <martin@ximian.com>
12313
12314         * convert.cs (Convert.ImplicitConversionStandard): Use
12315         `expr_type.Equals (target_type)' instead of `=='.
12316
12317 2003-12-08  Martin Baulig  <martin@ximian.com>
12318
12319         * typemanager.cs (TypeManager.GetReferenceType): Call
12320         `Type.MakeByRefType ()'.
12321
12322 2003-12-08  Martin Baulig  <martin@ximian.com>
12323
12324         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12325         just has some special meaning in some situations.  For instance,
12326         it is allowed to use `where' as the name of a variable etc.
12327
12328 2003-12-04  Martin Baulig  <martin@ximian.com>
12329
12330         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12331         `Type.MakeArrayType()' for array types.
12332
12333 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12334
12335         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12336         debugging message.
12337
12338         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12339         corlib to compile.
12340
12341 2003-11-16  Martin Baulig  <martin@ximian.com>
12342
12343         * codegen.cs (EmitContext.IsGeneric): Removed.
12344
12345         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12346         ResolveGeneric() on the DeclSpace.
12347
12348 2003-11-16  Martin Baulig  <martin@ximian.com>
12349
12350         * generic.cs (TypeArguments.Resolve):
12351         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12352         `ResolveType()' on it to get the Type.
12353
12354 2003-11-15  Martin Baulig  <martin@ximian.com>
12355
12356         * generic.cs (ConstructedType.GetInterfaces): Override this.
12357
12358 2003-11-14  Martin Baulig  <martin@ximian.com>
12359
12360         * interface.cs (Interface.DefineType): Define all type parameters
12361         before adding the interfaces we inherit.
12362
12363 2003-11-11  Martin Baulig  <martin@ximian.com>
12364
12365         * generic.cs (ConstructedType.ResolveType): Always call
12366         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12367
12368 2003-11-10  Martin Baulig  <martin@ximian.com>
12369
12370         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12371         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12372         calling `ResolveType()' on them, directly assign their `Type'.
12373
12374 2003-11-08  Martin Baulig  <martin@ximian.com>
12375
12376         * generic.cs (ConstructedType): Override `IsClass' etc.
12377
12378 2003-11-08  Martin Baulig  <martin@ximian.com>
12379
12380         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12381         return value and the `out parent' parameter.
12382         (TypeContainer.DefineType): Moved the CS0644 check into
12383         GetClassBases().  Don't pass the interface types to the
12384         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12385         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12386
12387         * ecore.cs (TypeExpr.IsAttribute): New property.
12388         (TypeExpr.GetInterfaces): New method.
12389
12390         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12391         TypeExpr instead of a Type.
12392         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12393         (Interface.DefineType): Don't pass the interface types to the
12394         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12395         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12396
12397         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12398         instead of a `Type[]'.
12399         (TypeManager.RegisterBuilder): Likewise.
12400         (TypeManager.AddUserInterface): Likewise.
12401         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12402         `Type[]' and also return a `TypeExpr[]'.
12403         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12404
12405 2003-11-08  Martin Baulig  <martin@ximian.com>
12406
12407         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12408         Expression.     
12409
12410 2003-11-08  Martin Baulig  <martin@ximian.com>
12411
12412         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12413         TypeManager.ResolveExpressionTypes().
12414
12415         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12416         instead of an Expression.
12417         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12418         (TypeExpression): New public class; formerly known as `TypeExpr'.
12419
12420         * expression.cs (ComposedCast): Derive from TypeExpr.
12421
12422         * typemanager.cs (TypeManager.system_*_expr): These are now
12423         TypExpr's instead of Expression's.
12424         (TypeManager.ResolveExpressionTypes): New public static function;
12425         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12426         of them.        
12427
12428 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12429
12430         * expression.cs (New.DoResolve): Do not dereference value that
12431         might be a null return.
12432
12433         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12434         sure that the constant value has the right type.  Fixes an
12435         unreported bug, similar to 50425.
12436
12437         * const.cs (Const.LookupConstantValue): Call
12438         ImplicitStandardConversionExists before doing a conversion to
12439         avoid havng the TypeManager.ChangeType do conversions.
12440
12441         Reduced the number of casts used
12442
12443         (Const.ChangeType): New routine to enable reuse of the constant
12444         type changing code from statement.
12445
12446         * typemanager.cs (ChangeType): Move common initialization to
12447         static global variables.
12448
12449         Fixes #50425.
12450
12451         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12452         every value type to go through, even if it was void.  Fix that. 
12453
12454         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12455         character of the define, and the is_identifier_part_character for
12456         the rest of the string.
12457
12458 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12459
12460         * expression.cs (UnaryMutator.EmitCode): When I updated
12461         LocalVariableReference.DoResolve, I overdid it, and dropped an
12462         optimization done on local variable references.
12463
12464 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12465
12466         * ecore.cs: Convert the return from Ldlen into an int.
12467
12468 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12469
12470         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12471         the accessibility, this is a special case for toplevel non-public
12472         classes (internal for instance).
12473
12474 2003-10-20  Nick Drochak <ndrochak@gol.com>
12475
12476         * ecore.cs: Fix typo and build.  Needed another right paren.
12477
12478 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12479
12480         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12481         `internal' case regular and protected, but not allowing protected
12482         to be evaluated later.  Bug 49840
12483
12484 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12487         to kb.Nlast, and not the kb.nFirst to isolate the switch
12488         statement.
12489
12490         Extract the underlying type, so enumerations of long/ulong are
12491         treated like long/ulong.
12492
12493 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12494
12495         * expression.cs (New): Overload the meaning of RequestedType to
12496         track the possible creation of the NewDelegate type, since
12497         DoResolve is invoked more than once for new constructors on field
12498         initialization.
12499
12500         See bugs: #48800 and #37014
12501
12502         * cs-parser.jay (declare_local_constants): Take an arraylist
12503         instead of a single constant.
12504
12505         (local_constant_declaration): It should take a
12506         constant_declarators, not a constant_declarator.  Fixes 49487
12507
12508         * convert.cs: Fix error report.
12509
12510 2003-10-13 Jackson Harper <jackson@ximian.com>
12511
12512         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12513         bug #49611
12514         
12515 2003-11-03  Martin Baulig  <martin@ximian.com>
12516
12517         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12518         `out bool has_type_arg'; if set, we need to pass the type to
12519         ig.Emit().
12520         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12521         Stelem_Any/Ldelem_Any for generic parameters.   
12522
12523 2003-11-02  Martin Baulig  <martin@ximian.com>
12524
12525         * expression.cs (Invocation.EmitCall): Use
12526         `TypeManager.IsValueType()' to check whether it's a value type.
12527         Don't set `struct_call' when calling a method on a type parameter.
12528
12529 2003-11-02  Martin Baulig  <martin@ximian.com>
12530
12531         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12532         and removed the TypeBuilder argument.
12533
12534         * typemanager.cs (TypeManager.IsValueType): Return
12535         `t.IsGenericParameter || t.IsValueType'.
12536
12537 2003-10-25  Martin Baulig  <martin@ximian.com>
12538
12539         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12540         call ConstructedType.Resolve() on it.
12541
12542         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12543
12544 2003-10-25  Martin Baulig  <martin@ximian.com>
12545
12546         * class.cs (TypeContainer.GetClassBases): Changed
12547         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12548         CS8214 reporting here.
12549         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12550         instead of a `Type' for our parent.  In case of a recursive
12551         declaration (see tests/gen-23.cs for an example), our parent is a
12552         ConstructedType and it doesn't have its type set.  So, first
12553         create our own TypeBuilder, then call constructed.Resolve() to get
12554         the parent's type and finally TypeBuilder.SetParent() it.
12555
12556         * ecore.cs (TypeExpr.Name): New public virtual property.
12557
12558         * generic.cs
12559         (ConstructedType): We're now a TypeExpr and not just an Expression.
12560         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12561         arguments here; this is done later.
12562         (ConstructedType.Resolve): New public method to resolve the type
12563         arguments and bind them.
12564
12565 2003-10-21  Martin Baulig  <martin@ximian.com>
12566
12567         * convert.cs: Use `TypeManager.IsValueType' instead of
12568         'type.IsValueType' everywhere.
12569
12570         * typemanager.cs (TypeManager.IsValueType): Return true for type
12571         parameters.  The reason for this is that we need to box a type
12572         parameter when converting it to a reference type.
12573
12574         * cs-parser.jay: Added support for default value expressions.
12575
12576         * generics.cs (DefaultValueExpression): New public class.       
12577
12578 2003-10-17  Martin Baulig  <martin@ximian.com>
12579
12580         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12581         TypeContainer so we can also use this for Interfaces.
12582         (TypeParameter.Resolve): Likewise.
12583
12584         * interface.cs (Interface.DefineType): Added support for generic
12585         interfaces.
12586
12587         * cs-parser.jay: Added support for generic structs and interfaces.
12588
12589 2003-10-17  Martin Baulig  <martin@ximian.com>
12590
12591         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12592         call generic methods :-)
12593
12594 2003-10-16  Martin Baulig  <martin@ximian.com>
12595
12596         * cs-parser.jay (namespace_or_type_name): Only create a
12597         GenericMemberAccess if we actually have type arguments.
12598
12599 2003-10-13  Martin Baulig  <martin@ximian.com>
12600
12601         * class.cs (Method.Define): If we're a generic method, call
12602         TypeBuilder.DefineGenericMethod () before resolving
12603         the parameters.
12604         (MethodData): Added .ctor which takes an additional MethodBuilder
12605         argument; this is used for generic methods.
12606         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12607         we already have a MethodBuilder.
12608
12609 2003-10-10  Martin Baulig  <martin@ximian.com>
12610
12611         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12612         instead of a `DeclSpace'.  This is used for generic methods.
12613
12614         * cs-parser.jay (method_header): Added support for generic
12615         methods; create a `GenericMethod' instance and pass it to the
12616         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12617         parameters and locals.
12618
12619         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12620         since we already have the location.  Check whether we're a generic
12621         type declaration or a generic method and create the correct type
12622         parameter.
12623
12624         * generic.cs (TypeParameter.DefineMethod): New public method.
12625         (GenericMethod): New public class; derives from DeclSpace and is
12626         used for generic methods.       
12627
12628 2003-10-09  Martin Baulig  <martin@ximian.com>
12629
12630         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12631         to the .ctor.
12632         (MethodCore.DoDefineParameters): Removed the TypeContainer
12633         argument; use the DeclSpace which was passed to the .ctor instead.
12634         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12635         TypeContainer; we only need a DeclSpace here.
12636
12637 2003-10-09  Martin Baulig  <martin@ximian.com>
12638
12639         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12640         to the .ctor.
12641         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12642         EmitContext's .ctor.    
12643
12644 2003-10-09  Martin Baulig  <martin@ximian.com>
12645
12646         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12647         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12648         AsAccessible(), moved them as well.
12649
12650         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12651
12652 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12653
12654         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12655         generation for >=, as spotted by Paolo, bug 48679.  
12656         Patch from David Waite.
12657
12658         * cs-tokenizer.cs: Add handling for #pragma.
12659
12660         * cs-parser.jay: Allow for both yield and yield return in the
12661         syntax.  The anti-cobolization of C# fight will go on!
12662
12663         * class.cs (TypeBuilder.DefineType): Catch error condition here
12664         (Parent.DefineType erroring out and returning null).
12665
12666         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12667         coping with enumerations variables, we were mistakenly processing
12668         them as a regular value type instead of built-in types.  Fixes the
12669         bug #48063
12670
12671         * typemanager.cs (IsBuiltinOrEnum): New method.
12672
12673 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12674
12675         * cs-parser.jay: Upgrade: yield now needs the return clause.
12676
12677 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12678
12679         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12680
12681 2003-09-29  Martin Baulig  <martin@ximian.com>
12682
12683         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12684         inflated generic methods.
12685
12686         * generics.cs (ConstructedType): Distinguish between open and
12687         closed constructed types; correctly resolve the arguments.
12688
12689 2003-09-22  Martin Baulig  <martin@ximian.com>
12690
12691         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12692         all type arguments meet their constraints.
12693
12694 2003-09-19  Martin Baulig  <martin@ximian.com>
12695
12696         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12697         `MemberCache parent' argument.  Normally, an interface doesn't
12698         have a parent type except System.Object, but we use this in gmcs
12699         for generic type parameters.
12700
12701 2003-09-18  Martin Baulig  <martin@ximian.com>
12702
12703         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12704         on `type.IsInterface'; don't check whether the type has a parent
12705         to determine whether it's an interface.
12706
12707 2003-09-17  Martin Baulig  <martin@ximian.com>
12708
12709         * generic.cs (ConstructedType.ToString): Always use `name' as the
12710         type name.
12711
12712 2003-09-15  Martin Baulig  <martin@ximian.com>
12713
12714         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12715
12716         * generic.cs (Constraints.Resolve): New public method; this is
12717         called to resolve the constraint types and to check whether all
12718         the constraints are correct.
12719         (Constraints.Types): New public property.
12720         (TypeParameter.Resolve): New public method; resolves all the
12721         type's constraints.
12722
12723         * class.cs (TypeContainer.DefineType): Call
12724         TypeParameter.Resolve() before actually defining the type.
12725
12726 2003-09-15  Martin Baulig  <martin@ximian.com>
12727
12728         * class.cs (TypeContainer.DefineType): Added an error flag to
12729         avoid reporting duplicate CS0146's ("class definition is
12730         circular.").
12731
12732         * driver.cs (Driver.MainDriver): Abort if
12733         RootContext.ResolveTree() reported any errors.
12734
12735 2003-09-07  Martin Baulig  <martin@ximian.com>
12736
12737         * report.cs (Error, Warning): Added overloaded versions which take
12738         a `params object[] args' and call String.Format().
12739
12740 2003-09-07  Martin Baulig  <martin@ximian.com>
12741
12742         * decl.cs (DeclSpace..ctor): Don't call
12743         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12744         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12745         (DeclSpace.RecordDecl): New method.
12746
12747         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12748
12749 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12750
12751         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12752         value attributes to be applied to ParameterBuilders.
12753
12754         * class.cs (MethodCore.LabelParameters): Make static and more
12755         generic so that it can be used from other places - like interface
12756         methods, for instance.
12757
12758         * interface.cs (Interface.Emit): Call LabelParameters before
12759         emitting attributes on the InterfaceMethod.
12760
12761 2003-09-07  Martin Baulig  <martin@ximian.com>
12762
12763         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12764         if the number of type parameters doesn't match.
12765
12766 2003-09-04  Martin Baulig  <martin@ximian.com>
12767
12768         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12769         for arrays of generic type params (ie. `!0[]').
12770
12771 2003-09-04  Martin Baulig  <martin@ximian.com>
12772
12773         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12774         for the moment.
12775
12776 2003-09-04  Martin Baulig  <martin@ximian.com>
12777
12778         * decl.cs (DeclSpace.LookupGeneric): New method.
12779         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12780         moment.
12781
12782         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12783         argument, not just a string.
12784         (TypeParameter.Define): New public method; this is called to
12785         actually define the generic parameter; after this, you can use the
12786         new `Type' property to get the type.
12787
12788 2003-09-04  Martin Baulig  <martin@ximian.com>
12789
12790         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12791         is now an ArrayList; initialize the result of the `TypeParameters'
12792         property here.
12793         (DeclSpace.GetGenericData): Removed.
12794         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12795         implement this in a different way.
12796         (DeclSpace.GetTypeParameters): Removed; there's now a
12797         `TypeParameters' property.
12798         (DeclSpace.TypeParameters): New public property.
12799
12800         * generic.cs (Constraints): Make this class public.
12801         (TypeParameter): New public class.
12802
12803 2003-09-04  Martin Baulig  <martin@ximian.com>
12804
12805         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12806         generic parameters.
12807
12808         * class.cs (TypeContainer.DefineType): Call
12809         TypeBuilder.DefineGenericParameter () on all generic parameters if
12810         this is a generic type.
12811
12812 2003-08-28  Martin Baulig  <martin@ximian.com>
12813
12814         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12815         sample-stack.il".
12816
12817         * sample-hello.cs: Compile this with gmcs: "gmcs
12818         /r:sample-stack.dll sample-hello.cs".
12819
12820 2003-08-28  Martin Baulig  <martin@ximian.com>
12821
12822         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12823         the parameters to the generic type.
12824
12825 2003-08-28  Martin Baulig  <martin@ximian.com>
12826
12827         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12828
12829 2003-08-28  Martin Baulig  <martin@ximian.com>
12830
12831         * cs-parser.jay (opt_type_argument_list): Use
12832         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12833         (primary_expression): Replace `qualified_identifier' with `type_name'.
12834         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12835
12836         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12837         parser to check whether it is syntactically a type parameter list;
12838         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12839         this case.
12840
12841 2003-08-26  Martin Baulig  <martin@ximian.com>
12842
12843         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12844         resolving aliases; fixes #47927.
12845
12846 2003-08-26  Martin Baulig  <martin@ximian.com>
12847
12848         * statement.cs (Using.DoResolve): This is internally emitting a
12849         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12850         do not always return.  Fixes #47681.
12851
12852 2003-08-26  Martin Baulig  <martin@ximian.com>
12853
12854         * decl.cs (MemberCore): Moved WarningNotHiding(),
12855         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12856         into MemberBase.
12857         (AdditionResult): Make this nested in DeclSpace.
12858         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12859         argument; call NamespaceEntry.Define() unless we're nested in a
12860         class or struct.
12861
12862         * namespace.cs (Namespace.DefineName): New public function.  This
12863         is called from DeclSpace's .ctor to add 
12864         (Namespace.Lookup): Include DeclSpaces in the lookup.
12865
12866         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12867
12868         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12869
12870 2003-08-25  Martin Baulig  <martin@ximian.com>
12871
12872         * convert.cs (Convert.ExplicitReferenceConversion): When
12873         converting from an interface type to a class, unbox if the target
12874         type is a struct type.  Fixes #47822.
12875
12876 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12877
12878         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12879         #47854.
12880
12881 2003-08-22  Martin Baulig  <martin@ximian.com>
12882
12883         * class.cs (TypeManager.DefineType): When defining a nested type,
12884         call DefineType() on our parent; fixes #47801.
12885
12886 2003-08-22  Martin Baulig  <martin@ximian.com>
12887
12888         * class.cs (MethodData.Define): While checking if a method is an
12889         interface implementation, improve the test a bit more to fix #47654.
12890
12891 2003-08-22  Martin Baulig  <martin@ximian.com>
12892
12893         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12894         correctly; fixes #47722.
12895
12896 2003-08-22  Martin Baulig  <martin@ximian.com>
12897
12898         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12899         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12900
12901         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12902
12903 2003-08-22  Martin Baulig  <martin@ximian.com>
12904
12905         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12906         can only be assigned in static constructors.  Fixes #47161.
12907
12908 2003-08-22  Martin Baulig  <martin@ximian.com>
12909
12910         Rewrote and improved the flow analysis code.
12911
12912         * flowbranching.cs (FlowBranching): Make this class abstract.
12913         (FlowBranching.CreateBranching): New static function to create a
12914         new flow branching.
12915         (FlowBranchingBlock, FlowBranchingException): New classes.
12916         (FlowBranching.UsageVector.Type): New public readonly field.
12917         (FlowBranching.UsageVector.Breaks): Removed the setter.
12918         (FlowBranching.UsageVector.Returns): Removed the setter.
12919         (FlowBranching.UsageVector): Added Break(), Return(),
12920         NeverReachable() and Throw() methods to modify the reachability.
12921         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12922         done by FlowBranching.Merge().
12923         (FlowBranching.UsageVector.MergeChild): New method; merges the
12924         merge result into the current vector.
12925         (FlowBranching.Merge): New abstract method to merge a branching.
12926
12927 2003-08-12  Martin Baulig  <martin@ximian.com>
12928
12929         * expression.cs (Indirection.CacheTemporaries): Create the
12930         LocalTemporary with the pointer type, not its element type.
12931
12932 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12933
12934         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12935         token was a keyword or not.
12936
12937         Add `error' options where an IDENTIFIER was expected;  Provide
12938         CheckToken and CheckIdentifierToken convenience error reporting
12939         functions. 
12940
12941         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12942
12943         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12944         NameSpaceEntry NameSpaceEntry.
12945
12946         (LookupInterfaceOrClass): Avoid creating a full qualified name
12947         from namespace and name: avoid doing lookups when we know the
12948         namespace is non-existant.   Use new Tree.LookupByNamespace which
12949         looks up DeclSpaces based on their namespace, name pair.
12950
12951         * driver.cs: Provide a new `parser verbose' to display the
12952         exception thrown during parsing.  This is turned off by default
12953         now, so the output of a failure from mcs is more graceful.
12954
12955         * namespace.cs: Track all the namespaces defined in a hashtable
12956         for quick lookup.
12957
12958         (IsNamespace): New method
12959
12960 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12961
12962         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12963         we know that we need to concatenate (full typename can never be
12964         null). 
12965
12966         * class.cs: ditto.
12967
12968         * statement.cs: Use a bitfield;  Do not initialize to null things
12969         which are done by the constructor by default.
12970
12971         * cs-parser.jay: bug fix, parameter was 4, not 3.
12972
12973         * expression.cs: Just use the property;
12974
12975         * statement.cs: No need for GetVariableInfo method.
12976
12977 2003-08-08  Martin Baulig  <martin@ximian.com>
12978
12979         * flowanalysis.cs (FlowReturns): This is now nested in the
12980         `FlowBranching' class.
12981         (MyBitVector): Moved this here from statement.cs.
12982         (FlowBranching.SiblingType): New enum type.
12983         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12984
12985 2003-08-07  Martin Baulig  <martin@ximian.com>
12986
12987         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12988         `FlowBranching' class and called `BranchingType'.
12989
12990 2003-08-07  Martin Baulig  <martin@ximian.com>
12991
12992         * flowanalysis.cs: Moved all the control flow analysis code into
12993         its own file.
12994
12995 2003-08-07  Martin Baulig  <martin@ximian.com>
12996
12997         * assign.cs (Assign.DoResolve): `target' must either be an
12998         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12999         #37319.
13000
13001 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13002
13003         * expression.cs (BinaryMethod): This kind of expression is created by the
13004         Binary class if it determines that the operator has to be handled
13005         by a method.
13006
13007         (BinaryDelegate): This kind of expression is created if we are
13008         dealing with a + or - operator on delegates.
13009
13010         (Binary): remove method, argumetns, and DelegateOperator: when
13011         dealing with methods, 
13012
13013         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13014
13015         * statement.cs (Block): use bitfields for the three extra booleans
13016         we had in use.   Remove unused topblock parameter.
13017
13018         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13019
13020         * assign.cs: Drop extra unneeded tests.
13021
13022 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13023
13024         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13025
13026         * statement.cs (Foreach): Use VariableStorage instead of
13027         LocalBuilders.   
13028
13029         * codegen.cs (VariableStorage): New class used by clients that
13030         require a variable stored: locals or fields for variables that
13031         need to live across yield.
13032
13033         Maybe provide a convenience api for EmitThis+EmitLoad?
13034
13035         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13036         these bad boys.
13037
13038 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13039
13040         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13041         RemapParameterLValue): New methods that are used to turn a
13042         precomputed FieldInfo into an expression like this:
13043
13044                 instance.FieldInfo
13045
13046         The idea is to use this instead of making LocalVariableReference
13047         have more than one meaning.
13048
13049         * cs-parser.jay: Add error production to BASE.
13050
13051         * ecore.cs: Deal with TypeManager.GetField returning null, which
13052         is now a valid return value.
13053
13054         (FieldExprNoAddress): New expression for Fields whose address can
13055         not be taken.
13056
13057         * expression.cs (LocalVariableReference): During the resolve
13058         phases, create new expressions if we are in a remapping context.
13059         Remove code that dealt with remapping here.
13060
13061         (ParameterReference): same.
13062
13063         (ProxyInstance): New expression, like the `This' expression, but
13064         it is born fully resolved.  We know what we are doing, so remove
13065         the errors that are targeted to user-provided uses of `this'.
13066
13067         * statement.cs (Foreach): our variable is now stored as an
13068         Expression;  During resolution, follow the protocol, dont just
13069         assume it will return this.
13070
13071 2003-08-06  Martin Baulig  <martin@ximian.com>
13072
13073         * support.cs (SeekableStreamReader.cs): New public class.
13074
13075         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13076         SeekableStreamReader instead of the normal StreamReader.
13077
13078 2003-08-04  Martin Baulig  <martin@ximian.com>
13079
13080         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13081         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13082         deambiguate casts and delegate invocations.
13083         (parenthesized_expression): Use the new tokens to ensure this is
13084         not a cast of method invocation.
13085
13086         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13087         when reading a `)' and Deambiguate_CloseParens () was previously
13088         called.
13089
13090         * expression.cs (ParenthesizedExpression): New class.  This is
13091         just used for the CS0075 test.
13092         (Binary.DoResolve): Check for CS0075.   
13093
13094 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13095
13096         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13097         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13098         reference comparison.
13099
13100         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13101         examine the ReturnType for equality - this is necessary in the
13102         cases of implicit and explicit operators whose signature also
13103         includes the return type.
13104
13105 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * namespace.cs: Cache the result of the namespace computation,
13108         instead of computing it every time.
13109
13110 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13111
13112         * decl.cs: Use a global arraylist that we reuse over invocations
13113         to avoid excesive memory consumption.  Reduces memory usage on an
13114         mcs compile by one meg (45 average).
13115
13116         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13117         private, work around that.
13118
13119 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13120
13121         * literal.cs (IntLiteral): Define Zero and One static literals. 
13122
13123         * cs-parser.jay (integer_literal): use static literals to reduce
13124         memory usage for the most used literals (0, 1 and -1).  211kb
13125         reduced in memory usage.
13126
13127         Replace all calls to `new ArrayList' with `new
13128         ArrayList(4)' which is a good average number for most allocations,
13129         and also requires only 16 bytes of memory for its buffer by
13130         default. 
13131
13132         This reduced MCS memory usage in seven megabytes for the RSS after
13133         bootstrapping.
13134
13135 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13136
13137         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13138         handle params methods the correct way by forming only one
13139         applicable set with params and normal methods in them. Earlier we
13140         were looking at params methods only if we found no normal methods
13141         which was not the correct thing to do.
13142
13143         (Invocation.BetterFunction): Take separate arguments indicating
13144         when candidate and the best method are params methods in their
13145         expanded form.
13146
13147         This fixes bugs #43367 and #46199.
13148
13149         * attribute.cs: Documentation updates.
13150
13151         (CheckAttribute): Rename to CheckAttributeTarget.
13152         (GetValidPlaces): Rename to GetValidTargets.
13153
13154         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13155         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13156
13157         Fixes bug #44468.
13158
13159 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13160
13161         * codegen.cs: Compute IsGeneric correctly.
13162
13163         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13164         resolution. 
13165
13166         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13167         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13168         regressions, and I was chasing more bugs than I required.
13169
13170         * interface.cs: Use expressions for base type names (like classes
13171         and structs have been doing for a while now), and resolve that.
13172         This patch should probably go into head as well.
13173
13174         This makes it one less user of FindType.
13175
13176 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13177
13178         This compiler can not self host currently.  Need to fix that.
13179         
13180         * Makefile: compile to `gmcs.exe'
13181
13182         * driver.cs: Turn on v2 by default on gmcs.
13183
13184         * generic.cs (ConstructedType): Does no longer take a container
13185         type argument;  That will be taken care of later.
13186
13187         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13188         Use SimpleName to resolve for now, so we can continue the work on
13189         the parser, until we get Type.GetType that understands generics.
13190
13191         (ConstructedType.ToString): Implement
13192
13193         (TypeArguments.Resolve): Resolve the child expressions as types. 
13194         
13195         * cs-parser.jay: Rename interface_constraints to
13196         type_parameter_constraints
13197
13198         (namespace_or_type_name): Only use constructed types for the basic
13199         construction, we will deal with identifier<...> later.
13200
13201         (type/type_name): No longer call DecomposeQI, as
13202         namespace_or_type_name is always decoded now.
13203         
13204 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13205
13206         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13207         closely: we eliminate methods in base types when we have an
13208         applicable method in a top-level type.
13209
13210         Please see section 14.5.5.1 for an exact description of what goes
13211         on. 
13212
13213         This fixes bug #45127 and a host of other related to corlib compilation.
13214
13215         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13216         array is the method corresponding to the top-level type (this is
13217         because of the changes made to icall.c) so we change this
13218         accordingly.
13219
13220         (MethodGroupExpr.Name): This too.
13221
13222         * typemanager.cs (GetElementType): New method which does the right
13223         thing when compiling corlib. 
13224
13225         * everywhere: Make use of the above in the relevant places.
13226
13227 2003-07-22  Martin Baulig  <martin@ximian.com>
13228
13229         * cs-parser.jay (invocation_expression): Moved
13230         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13231         `cast_expression', but create a InvocationOrCast which later
13232         resolves to either an Invocation or a Cast.
13233
13234         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13235         method; call this before EmitStatement() to make sure that this
13236         expression can be used as a statement.
13237
13238         * expression.cs (InvocationOrCast): New class; resolves to either
13239         an Invocation or a Cast.
13240
13241         * statement.cs (StatementExpression): Call ResolveStatement() on
13242         the ExpressionStatement before emitting it.
13243
13244 2003-07-21  Martin Baulig  <martin@ximian.com>
13245
13246         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13247         `ref' and `out' attributes match; fixes #46220.
13248         (MemberAccess.ResolveMemberAccess): You can't reference a type
13249         through an expression; fixes #33180.
13250         (Indexers.GetIndexersForType): Don't return the indexers from
13251         interfaces the class implements; fixes #46502.
13252
13253 2003-07-21  Martin Baulig  <martin@ximian.com>
13254
13255         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13256         CS0661 checks; fixes bug #30442.
13257
13258 2003-07-21  Martin Baulig  <martin@ximian.com>
13259
13260         * decl.cs (AdditionResult): Added `Error'.
13261
13262         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13263
13264         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13265         cs0031.cs actually work.
13266
13267  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13268  
13269         * cs-parser.jay (namespace_name): do not use
13270         namespace_or_type_name, use qualified_identifier, because
13271         namespace_or_type_name will soon return a composed expression
13272         instead of a string.
13273  
13274         (namespace_or_type_name): Instead of returning a string, now this
13275         production returns an expression.
13276  
13277         * codegen.cs (EmitContext): Setup IsGeneric property based on
13278         whether our DeclSpace is generic, our the method is generic.
13279  
13280         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13281         the method is generic.
13282  
13283         * cs-parser.jay (type_arguments, opt_type_argument_list,
13284         type_parameters, type_parameter_list, opt_type_parameter_list,
13285         type_parameter,, opt_type_parameter_constraints_clauses,
13286         type_parameter_constraints_clauses,
13287         type_parameter_constraint_clause, type_parameter_constraint,
13288         interface_constraints): Add new production
13289  
13290         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13291         DeclSpace is generic or not.
13292  
13293         (DeclSpace.SetParameterInfo): New routine, used to set the
13294         parameter info for a type.
13295  
13296         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13297         returns a GenericTypeExpr
13298  
13299         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13300         generic, lookup the generic argument.
13301  
13302         * attribute.cs: Do not allow TypeParameterExpressions in
13303         Attributes.
13304  
13305         * class.cs: Do not allow the Main method to be defined in a
13306         Generic container.
13307  
13308         * expression.cs (SizeOf): Do not allow generic types to be used as
13309         arguments to sizeof.
13310  
13311         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13312         it: whether a type is generic or not.  Only works for types we are
13313         currently building for now.
13314         
13315 2003-07-20  Martin Baulig  <martin@ximian.com>
13316
13317         * namespace.cs: Fixed that bug which caused a crash when compiling
13318         the debugger's GUI.
13319
13320 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13321
13322         * typemanager.cs (LookupTypeReflection): Never expose types which
13323         are NotPublic, NestedPrivate, NestedAssembly, or
13324         NestedFamANDAssem.  We used to return these, and later do a check
13325         that would report a meaningful error, but the problem is that we
13326         would not get the real match, if there was a name override.
13327
13328 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13329
13330         * namespace.cs (Namespace, Name): Do not compute the namespace
13331         name dynamically, compute it in the constructor.  This reduced
13332         memory usage by 1697 KB.
13333
13334         * driver.cs: Use --pause to pause at the end.
13335
13336 2003-07-17  Peter Williams  <peter@newton.cx>
13337
13338         * Makefile: Change the name of the test target so that it doesn't
13339         conflict with the recursive test target.
13340
13341 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13342
13343         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13344         AddressOf): Do not use EmitThis, that was wrong, use the actual
13345         this pointer.
13346
13347 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13348
13349         * class.cs (MethodData.Define): While checking if a method is an
13350         interface implementation, improve the test: If we are not public
13351         (use new test here: use the computed MethodAttributes directly,
13352         instead of the parsed modifier flags) check if the `implementing'
13353         method comes from an interface or not.
13354
13355         * pending.cs (VerifyPendingMethods): Slightly better error
13356         message.
13357
13358         * makefile: add test target that does the mcs bootstrap.
13359
13360 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13361
13362         * interface.cs (Define): Do nothing here since there are no
13363         members to populate etc. Move the attribute emission out of here
13364         since this was just totally the wrong place to put it. Attribute
13365         application happens during the 'Emit' phase, not in the 'Define'
13366         phase.
13367
13368         (Emit): Add this method and move the attribute emission here
13369
13370         * rootcontext.cs (EmitCode): Call the Emit method on interface
13371         types too.
13372
13373 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13374
13375         * expression.cs (OverloadResolve): Report error only if Location
13376         is not 'Null' which means that there was a probe going on.
13377
13378 2003-07-14  Martin Baulig  <martin@ximian.com>
13379
13380         * expression.cs (ConditionalLogicalOperator): New public class to
13381         implement user defined conditional logical operators.
13382         This is section 14.11.2 in the spec and bug #40505.
13383
13384 2003-07-14  Martin Baulig  <martin@ximian.com>
13385
13386         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13387
13388 2003-07-14  Martin Baulig  <martin@ximian.com>
13389
13390         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13391
13392         * ecore.cs (IVariable.VerifyFixed): New interface method.
13393
13394         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13395         operator, check whether the variable is actually fixed.  Fixes bug
13396         #36055.  Set a variable definitely assigned when taking its
13397         address as required by the spec.
13398
13399         * statement.cs (LocalInfo.IsFixed): New field.
13400         (LocalInfo.MakePinned): Set `IsFixed' to true.
13401
13402 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13403
13404         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13405         for .ctors, ensure that we only ask for members declared in the
13406         attribute type (BindingFlags.DeclaredOnly).
13407
13408         Fixes bug #43632.
13409
13410         * expression.cs (Error_WrongNumArguments): Report error 1501
13411         correctly the way CSC does.
13412
13413 2003-07-13  Martin Baulig  <martin@ximian.com>
13414
13415         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13416         lookup on the fully qualified name, to make things like "X.X" work
13417         where "X.X" is a fully qualified type name, but we also have a
13418         namespace "X" in the using list.  Fixes #41975.
13419
13420 2003-07-13  Martin Baulig  <martin@ximian.com>
13421
13422         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13423         function. If we're a CompoundAssign, we need to create an embedded
13424         CompoundAssign, not an embedded Assign.
13425         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13426         Fixes #45854.
13427
13428 2003-07-13  Martin Baulig  <martin@ximian.com>
13429
13430         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13431         work to fix bug #46088.
13432
13433 2003-07-13  Ravi Pratap <ravi@ximian.com>
13434
13435         * class.cs (Operator.Emit): Do not emit attributes here - it is
13436         taken care of by the Method class that we delegate too. This takes
13437         care of bug #45876.
13438
13439 2003-07-10  Martin Baulig  <martin@ximian.com>
13440
13441         * expression.cs (TypeOfVoid): New class.
13442         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13443
13444 2003-07-10  Martin Baulig  <martin@ximian.com>
13445
13446         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13447         bug #35957.
13448
13449 2003-07-10  Martin Baulig  <martin@ximian.com>
13450
13451         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13452         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13453
13454         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13455
13456         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13457
13458 2003-07-10  Martin Baulig  <martin@ximian.com>
13459
13460         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13461         of decimal.  Fixes #42850.
13462
13463         NOTE: I also fixed the created byte blob, but this doesn't work on
13464         the MS runtime and csc never produces any byte blobs for decimal
13465         arrays.
13466
13467 2003-07-10  Martin Baulig  <martin@ximian.com>
13468
13469         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13470         structs; fixes #32068.
13471         (Block.AddChildVariableNames): Fixed #44302.
13472
13473 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13474
13475         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13476
13477 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13478
13479         * attribute.cs: And this test is onger needed.
13480
13481 2003-07-08  Martin Baulig  <martin@ximian.com>
13482
13483         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13484         inaccessible types.  Fixes #36313.
13485
13486         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13487
13488         * namespace.cs (NamespaceEntry): Create implicit entries for all
13489         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13490         implicit entries for N1.N2 and N1.
13491
13492 2003-07-08  Martin Baulig  <martin@ximian.com>
13493
13494         Rewrote the handling of namespaces to fix a lot of the issues
13495         wrt. `using' aliases etc.
13496
13497         * namespace.cs (Namespace): Splitted this class into a
13498         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13499
13500         * typemanager.cs (TypeManager.IsNamespace): Removed.
13501         (TypeManager.ComputeNamespaces): Only compute namespaces from
13502         loaded assemblies here, not the namespaces from the assembly we're
13503         currently compiling.
13504
13505 2003-07-08  Martin Baulig  <martin@ximian.com>
13506
13507         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13508
13509 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13510
13511         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13512         already fixed it.  
13513
13514         I thought about the memory savings here, but LookupTypeReflection
13515         is used under already very constrained scenarios.  Compiling
13516         corlib or mcs only exposes one hit, so it would not really reduce
13517         any memory consumption.
13518
13519 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13520
13521         * typemanager.cs: fixes bug #45889 by only adding public types from
13522         other assemblies to the list of known types.
13523
13524 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13525
13526         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13527         on the type we resolved.
13528
13529 2003-07-05  Martin Baulig  <martin@ximian.com>
13530
13531         * pending.cs (PendingImplementation.ParentImplements): Don't
13532         create the proxy if the parent is abstract.
13533
13534         * class.cs (TypeContainer.DefineIndexers): Process explicit
13535         interface implementations first.  Fixes #37714.
13536
13537 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13538
13539         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13540         defined recursively;  but since we modify the input parameters
13541         (left is set to `this' temporarily), we reset this value if the
13542         left_is_explicit is false, which gives the original semantics to
13543         the code.  
13544
13545         * literal.cs (NullPointer): new class used to represent a null
13546         literal in a pointer context.
13547
13548         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13549         type is a pointer, use a NullPointer object instead of a
13550         NullLiteral.   Closes 43687
13551
13552         (ExplicitConversion): Convert pointer values using
13553         the conv opcode to the proper type.
13554
13555         * ecore.cs (New): change ValueTypeVariable property into a method,
13556         that returns whether the valuetype is suitable for being used.
13557
13558         * expression.cs (Binary.DoNumericPromotions): Only return if we
13559         the int constant was a valid uint, and we can return both left and
13560         right as uints.  If not, we continue processing, to trigger the
13561         type conversion.  This fixes 39018.
13562
13563         * statement.cs (Block.EmitMeta): During constant resolution, set
13564         the CurrentBlock property on the emitcontext, so that we resolve
13565         constants propertly.
13566
13567 2003-07-02  Martin Baulig  <martin@ximian.com>
13568
13569         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13570         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13571
13572         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13573         than emitting it here.
13574
13575         * statement.cs: Fixed some more flow analysis bugs.
13576
13577 2003-07-02  Martin Baulig  <martin@ximian.com>
13578
13579         * class.cs (MethodData.Define): When implementing interface
13580         methods, set Final unless we're Virtual.
13581
13582         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13583         check work for interface methods.
13584
13585 2003-07-01  Martin Baulig  <martin@ximian.com>
13586
13587         * ecore.cs (EmitContext.This): Replaced this property with a
13588         GetThis() method which takes a Location argument.  This ensures
13589         that we get the correct error location for a CS0188.
13590
13591 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13594         ImplicitStandardConversion.
13595
13596         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13597
13598 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13599
13600         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13601         optimization.
13602
13603 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13604
13605         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13606         constructors.
13607
13608         (MethodData.Define): Turn off initlocals for unsafe methods.
13609
13610 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13613         complete;  Fixes #37521.
13614
13615         * delegate.cs: Use Modifiers.TypeAttr to compute the
13616         TypeAttributes, instead of rolling our own.  This makes the flags
13617         correct for the delegates.
13618
13619 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * class.cs (Constructor.Define): Set the private flag for static
13622         constructors as well.
13623
13624         * cs-parser.jay (statement_expression): Set the return value to
13625         null, to avoid a crash when we catch an error.
13626
13627 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13628
13629         * cs-parser.jay: Applied patch from Jackson that adds support for
13630         extern and unsafe modifiers to destructor declarations.
13631
13632         * expression.cs: Report error 21 if the user is trying to index a
13633         System.Array.
13634
13635         * driver.cs: Add an error message, suggested by the bug report.
13636
13637         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13638         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13639
13640 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13641
13642         * namespace.cs: Add some information to reduce FAQs.
13643
13644 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13645
13646         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13647         underlying enumeration types.  Fixes #43915.
13648
13649         * expression.cs: Treat ushort/short as legal values to be used in
13650         bitwise operations.
13651
13652 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13653
13654         * delegate.cs: transfer custom attributes for paramenters from
13655         the delegate declaration to Invoke and BeginInvoke.
13656
13657 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13658
13659         * attribute.cs: handle custom marshalers and emit marshal info
13660         for fields, too.
13661
13662 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13663
13664         * makefile.gnu: Added anonymous.cs to the compiler sources.
13665
13666 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13667
13668         * iterators.cs: Change the name of the proxy class to include two
13669         underscores.
13670
13671         * cs-parser.jay: Update grammar to include anonymous methods.
13672
13673         * anonymous.cs: new file.
13674
13675 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * class.cs (Field.Define): Add missing test for pointers and
13678         safety. 
13679
13680 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13681
13682         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13683         we use the stobj opcode.
13684
13685         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13686         since it wasn't the correct fix. 
13687
13688         It still is puzzling that we are required to use stobj for IntPtr
13689         which seems to be a ValueType.
13690
13691 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13692
13693         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13694         during regular simple name resolution.   Now, the trick is that
13695         instead of returning for processing the simplename, we do a
13696         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13697         contextual lookup type).   If a match is found, return that, if
13698         not, return for further composition.
13699
13700         This fixes long-standing 30485.
13701
13702         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13703         using the address to initialize an object, do an Stobj instead of
13704         using the regular Stelem.
13705
13706         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13707         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13708         Because if we are a BaseIndexerAccess that value will be true.
13709         Fixes 43643.
13710
13711         * statement.cs (GotoCase.Resolve): Return after reporting an
13712         error, do not attempt to continue. 
13713
13714         * expression.cs (PointerArithmetic.Emit): If our operand is a
13715         long, convert our constants to match the operand before
13716         multiplying.  Convert to I type before adding.   Fixes 43670.
13717
13718 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13719
13720         * enum.cs (ImplicitConversionExists) : Rename to
13721         ImplicitEnumConversionExists to remove ambiguity. 
13722
13723         * ecore.cs (NullCast): New type of cast expression class which
13724         basically is very similar to EmptyCast with the difference being
13725         it still is a constant since it is used only to cast a null to
13726         something else
13727         (eg. (string) null)
13728
13729         * convert.cs (ImplicitReferenceConversion): When casting a null
13730         literal, we return a NullCast.
13731
13732         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13733         should be around anymore.
13734
13735         The renaming (reported was slightly wrong). Corrections:
13736
13737         ConvertImplicitStandard -> ImplicitConversionStandard
13738         ConvertExplicitStandard -> ExplicitConversionStandard
13739
13740         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13741         before passing them in !
13742
13743         * convert.cs (ImplicitConversionStandard): When comparing for
13744         equal expr and target types, ensure that expr is not a
13745         NullLiteral.
13746
13747         In general, we must not be checking (expr_type ==
13748         target_type) in the top level conversion methods
13749         (ImplicitConversion, ExplicitConversion etc). This checking is
13750         done in the methods that they delegate to.
13751
13752 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13753
13754         * convert.cs: Move Error_CannotConvertType,
13755         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13756         ImplicitNumericConversion, ImplicitConversionExists,
13757         ImplicitUserConversionExists, StandardConversionExists,
13758         FindMostEncompassedType, FindMostSpecificSource,
13759         FindMostSpecificTarget, ImplicitUserConversion,
13760         ExplicitUserConversion, GetConversionOperators,
13761         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13762         TryImplicitIntConversion, Error_CannotConvertImplicit,
13763         ConvertImplicitRequired, ConvertNumericExplicit,
13764         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13765         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13766         its own file.
13767
13768         Perform the following renames:
13769
13770         StandardConversionExists -> ImplicitStandardConversionExists
13771         ConvertImplicit -> ImplicitConversion
13772         ConvertImplicitStandard -> ImplicitStandardConversion
13773         TryImplicitIntConversion -> ImplicitIntConversion
13774         ConvertImplicitRequired -> ImplicitConversionRequired
13775         ConvertNumericExplicit -> ExplicitNumericConversion
13776         ConvertReferenceExplicit -> ExplicitReferenceConversion
13777         ConvertExplicit -> ExplicitConversion
13778         ConvertExplicitStandard -> ExplicitStandardConversion
13779
13780 2003-05-19  Martin Baulig  <martin@ximian.com>
13781
13782         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13783         (TypeInfo): Added support for structs having structs as fields.
13784
13785         * ecore.cs (FieldExpr): Implement IVariable.
13786         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13787         VariableInfo for the field.
13788
13789 2003-05-18  Martin Baulig  <martin@ximian.com>
13790
13791         * expression.cs (This.DoResolve): Report a CS0027 if we're
13792         emitting a field initializer.
13793
13794 2003-05-18  Martin Baulig  <martin@ximian.com>
13795
13796         * expression.cs (This.ResolveBase): New public function.
13797         (This.DoResolve): Check for CS0188.
13798
13799         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13800         This.Resolve().
13801
13802         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13803         `instance_expression' to null if we don't have any non-static
13804         methods.
13805
13806 2003-05-18  Martin Baulig  <martin@ximian.com>
13807
13808         Reworked the way how local variables and parameters are handled by
13809         the flow analysis code.
13810
13811         * statement.cs (TypeInfo, VariableMap): New public classes.
13812         (VariableInfo): New public class.  This is now responsible for
13813         checking whether a variable has been assigned.  It is used for
13814         parameters and local variables.
13815         (Block.EmitMeta): Take the InternalParameters as argument; compute
13816         the layout of the flow vectors here.
13817         (Block.LocalMap, Block.ParameterMap): New public properties.
13818         (FlowBranching): The .ctor doesn't get the InternalParameters
13819         anymore since Block.EmitMeta() now computes the layout of the flow
13820         vector.
13821         (MyStructInfo): This class is now known as `StructInfo' and nested
13822         in `TypeInfo'; we don't access this directly anymore.
13823
13824         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13825         property and removed IsAssigned(), IsFieldAssigned(),
13826         SetAssigned() and SetFieldAssigned(); we now call them on the
13827         VariableInfo so we don't need to duplicate this code everywhere.
13828
13829         * expression.cs (ParameterReference): Added `Block block' argument
13830         to the .ctor.
13831         (LocalVariableReference, ParameterReference, This): The new
13832         VariableInfo class is now responsible for all the definite
13833         assignment stuff.
13834
13835         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13836         IsParameterAssigned, SetParameterAssigned): Removed.
13837
13838 2003-05-18  Martin Baulig  <martin@ximian.com>
13839
13840         * typemanager.cs (InitCoreTypes): Try calling
13841         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13842         the 3-args-version.  Corlib now also needs our `void_type'.
13843         (GetMethod): Added overloaded version which takes an optional
13844         `bool report_errors' to allow lookups of optional methods.
13845
13846 2003-05-12  Martin Baulig  <martin@ximian.com>
13847
13848         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13849         only used for locals and not for parameters.
13850
13851 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13852
13853         * support.cs (InternalParameters.ParameterType): Return the
13854         ExternalType of the parameter.
13855
13856         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13857         they were unused.
13858
13859 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * class.cs (MethodData.Define): Do not set the `newslot' on
13862         interface members, if they are also flagged as "override".
13863
13864         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13865         better code for ++i and i++.  This only works for static fields
13866         and local variables.
13867
13868         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13869         want to pull the DeclSpace out of the builder_to_declspace instead
13870         of the TypeBuilder (like in TypeContainer.FindMembers).
13871
13872         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13873         instead of LookupTypeContainer.  Fixes the crash on .NET for
13874         looking up interface members.
13875
13876         * const.cs: Create our own emit context during the Definition
13877         stage, so that constants are evaluated in the proper context, when
13878         a recursive definition happens.
13879
13880 2003-05-11  Martin Baulig  <martin@ximian.com>
13881
13882         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13883         new block for a switch section.
13884         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13885         the adding/lookup in the switch block.  Fixes #39828.
13886
13887 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13888
13889         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13890         functionality: I needed to convert the data after I had performed
13891         the add/sub operation into the operands type size.
13892
13893         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13894         pass the type for the box operation, otherwise the resulting
13895         object would have been of type object.
13896
13897         (BoxedCast): Add constructor to specify the type to box as.
13898
13899 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * iterators.cs: I was reusing the `count' variable inadvertently,
13902         take steps to not allow this to happen.
13903
13904 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13907         by creating an array at the point where the params starts and
13908         putting all those arguments there, then adjusting the size of the
13909         array.
13910
13911 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * expression.cs (New.AddressOf): Implement interface
13914         IMemoryLocation.  This is used when the `new' operator is used in
13915         the context of an invocation to a method on a value type.
13916
13917         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13918         example. 
13919
13920         * namespace.cs: Also check the using aliases here.
13921
13922         * driver.cs: Move the test for using validity after the types have
13923         been entered, so we do a single pass that also includes the using
13924         aliases. 
13925
13926         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13927         in the regular case.   CreateSiblingForFinally is doing extra
13928         error checking.
13929
13930         * attribute.cs (GetAttributeArgumentExpression): Store the result
13931         on an out value, and use the return value to indicate failure
13932         instead of using null (which is a valid return for Constant.GetValue).
13933
13934         * statement.cs: Perform the analysis flow for the increment
13935         portion after the statement, because this will be the real flow of
13936         execution.  Fixes #42385
13937
13938         * codegen.cs (EmitContext.EmitArgument,
13939         EmitContext.EmitStoreArgument): New helper functions when the
13940         RemapToProxy flag is set.
13941
13942         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13943         function.
13944
13945         Add support for remapping parameters. 
13946
13947         * iterators.cs: Propagate parameter values;  Store parameter
13948         values in the proxy classes.
13949
13950 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13951
13952         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13953         need a proxy reference;  I do not know what I was thinking
13954
13955         * cs-parser.jay (constructor_initializer): catch another error,
13956         and display nice message.
13957
13958         (field_declaration): catch void field declaration
13959         to flag a better error. 
13960
13961         * class.cs (MemberBase.CheckBase): Report an error instead of a
13962         warning if a new protected member is declared in a struct. 
13963         (Field.Define): catch the error of readonly/volatile.
13964
13965         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13966
13967         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13968         volatile variable is taken
13969
13970 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13971
13972         * statement.cs (Fixed.Resolve): Report an error if we are not in
13973         an unsafe context.
13974
13975 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * typemanager.cs: reuse the code that handles type clashes for
13978         delegates and enumerations.
13979
13980         * class.cs (Report28): Always report.
13981
13982         * expression.cs (EncodeAsAttribute): Allow nulls here.
13983
13984 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13985
13986         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13987         the functionality for testing whether an expression is valid for
13988         an attribute here.  Also handle the case of arrays of elements
13989         being stored. 
13990
13991         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13992         encoding a linear array into an array of objects that are suitable
13993         to be passed to an CustomAttributeBuilder.
13994
13995         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13996
13997         * ecore.cs: (FieldExpr): Handle field remapping here.
13998
13999         * iteratators.cs: Pass the instance variable (if the method is an
14000         instance method) to the constructors, so we can access the field
14001         variables on the class.
14002
14003         TODO: Test this with structs.  I think the THIS variable on
14004         structs might have to be a pointer, and not a refenrece
14005
14006 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14007
14008         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14009         local variables to fields in a proxy class.
14010
14011         * iterators.cs (PopulateProxy): Rename our internal fields to
14012         <XXX>.  
14013         Create a <THIS> field if we are an instance method, so we can
14014         reference our parent container variables.
14015         (MapVariable): Called back from the EmitContext code to enter a
14016         new variable to field mapping into the proxy class (we just create
14017         a FieldBuilder).
14018
14019         * expression.cs
14020         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14021         for using the remapped locals to fields.
14022
14023         I placed the code here, because that gives the same semantics to
14024         local variables, and only changes the Emit code.
14025
14026         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14027         statements inside iterators.
14028         (VariableInfo): Add a FieldBuilder for the cases when we are
14029         remapping local variables to fields in a proxy class
14030
14031         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14032         current_block != null.
14033
14034         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14035         not cope with strings, as it has been moved to the
14036         TableSwitchEmit.  Fixed bug in switch generation.
14037
14038         * expression.cs (New.DoResolve): Provide more context for the user
14039         when reporting an error.
14040
14041         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14042         pointers. 
14043
14044         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14045         check the permissions for it.  Note than in a type-resolution
14046         context the check was already present in DeclSpace.ResolveType,
14047         but was missing from the MemberAccess.
14048
14049         (ArrayCreation.CheckIndices): warn if the user has
14050         more nested levels of expressions, but there are no more
14051         dimensions specified.  Avoids crash on bug 41906.
14052
14053 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14054
14055         * statement.cs (Block): replace Implicit bool, for a generic
14056         flags.   
14057         New flag: `Unchecked'.  This is used during the EmitMeta phase
14058         (which is out-of-line with the regular Resolve/Emit process for a
14059         statement, as this is done ahead of time, but still gets a chance
14060         to call constant resolve).
14061
14062         (Block.Flags): new enum for adding a new flag.
14063
14064         (Block.EmitMeta): track the state of unchecked.
14065
14066         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14067         to enable constant resolution to work there as well.
14068
14069 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14070
14071         * typemanager.cs (ienumerable_type): Also look up
14072         System.Collections.IEnumerable. 
14073
14074 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14075
14076         TODO: Test more than one conditional per method.
14077
14078         * class.cs (Indexer.Define): Report the location where the user is
14079         referencing the unsupported feature.
14080
14081         (MethodData): Overload the use of `conditionals' to
14082         minimize the creation of needless ArrayLists.   This saves roughly
14083         212kb on my machine.
14084
14085         (Method): Implement the new IIteratorContainer interface.
14086         (Method.SetYields): Implement the method by setting the ModFlags
14087         to contain METHOD_YIELDS.
14088
14089         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14090         which just got set to null.
14091
14092         * iterators.cs: New file.
14093
14094         (Yield, YieldBreak): New statements.
14095
14096         * statement.cs (Return.Resolve): Flag an error if we are used in
14097         an iterator method.
14098
14099         * codegen.cs (InIterator): New flag set if the code is being
14100         compiled in an iterator method.
14101
14102         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14103         internal modifier, and we just use it to avoid adding extra
14104         fields, as this is seldom used.  
14105
14106         * cs-parser.jay: Add yield_statement (yield and yield break).
14107
14108         * driver.cs: New flag -v2 to turn on version 2 features. 
14109
14110         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14111         hashtable when v2 is enabled.
14112
14113 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14114
14115         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14116         there is already a namespace defined with this name.
14117
14118         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14119         people upgraded their corlibs.
14120
14121         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14122         always use fully qualified types, no need to use the compiler
14123         front end.
14124
14125         (TypeManager.IsNamespace): Use binarysearch.
14126
14127         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14128         AddDelegate): I did not quite use the new IsValid API properly: I
14129         have to pass the short-name and the fullname.  I was passing only
14130         the basename instead of the fullname sometimes. 
14131
14132         (TypeContainer.DefineType): call NamespaceClash.
14133
14134         * interface.cs (Interface.DefineType): use NamespaceClash before
14135         defining the type.
14136
14137         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14138         defining the type.
14139
14140         * enum.cs: (Enum.DefineType): use NamespaceClash before
14141         defining the type.
14142
14143         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14144         speed increase.  First, use the negative_hits cache when we get a
14145         negative.  Second, add the type with its full original name
14146         instead of the new . and + encoded name (reflection uses + to
14147         separate type from a nested type).  Use LookupTypeReflection
14148         directly which bypasses the type->name hashtable (that we already
14149         know does not contain the type.
14150
14151         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14152         location/container type. 
14153
14154         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14155
14156 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14157
14158         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14159
14160         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14161         method is being referenced in the method group from a static
14162         context, and report error 120 if so.
14163
14164         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14165         Error118. 
14166
14167         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14168         is created, we create the A namespace).
14169
14170         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14171         Fixes #41591
14172
14173 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14174
14175         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14176         invocation to ModuleBuilder.GetType with the same values will
14177         return a new type instance, so we need to cache its return
14178         values. 
14179
14180         * expression.cs (Binary.ResolveOperator): Only allow the compare
14181         operators on enums if they are of the same type.
14182
14183         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14184         types of ValueType on their own case.  Before we were giving them
14185         the same treatment as objects.
14186
14187         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14188         fullname.  Short name is used to compare against container name.
14189         Fullname is used to check against defined namespace names.
14190
14191         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14192         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14193
14194         (Method.CheckBase): Call parent.
14195         (MemberBase.CheckBase): Check for protected members on sealed
14196         classes.
14197         (PropertyBase.CheckBase): Call parent.
14198         (Field.Define): Call parent.
14199
14200         * report.cs: Negative error codes are now mapped to 8000 - code,
14201         so that the display is render more nicely.
14202
14203         * typemanager.cs: Do not use try/catch, instead report a regular
14204         error. 
14205
14206         (GetPointerType, GetReferenceType): These methods provide
14207         mechanisms to obtain the T* and T& from a T.  We had the code
14208         previously scattered around the code base, and it also used
14209         TypeManager.LookupType that would go through plenty of caches.
14210         This one goes directly to the type source.
14211
14212         In some places we did the Type.GetType followed by
14213         ModuleBuilder.GetType, but not in others, so this unifies the
14214         processing as well.
14215
14216         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14217         statements now that we have namespace information.
14218
14219         * typemanager.cs (IsNamespace): New method, returns whether the
14220         string presented is a namespace or not.
14221
14222         (ComputeNamespaces): New public entry point, computes the list of
14223         available namespaces, using the GetNamespaces API call in Mono, or
14224         the slower version in MS.NET.   
14225
14226         Now before we start the semantic analysis phase, we have a
14227         complete list of namespaces including everything that the user has
14228         provided.
14229
14230         Deleted old code to cache namespaces in .nsc files.
14231
14232 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14233
14234         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14235         class/struct location definition Location for the implicit
14236         constructor location.
14237
14238         (Operator.Define): Use the location of the operator for the
14239         implicit Method definition.
14240
14241         (Constructor.Emit): use the constructor location for the implicit
14242         base initializer constructor.
14243
14244         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14245         and the Expression class now contains two new methods:
14246
14247         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14248         isolate type lookup from the rest of the resolution process.
14249
14250         Since we use Expressions to hold type definitions due to the way
14251         we parse the input we have historically overloaded Resolve to
14252         perform the Type lookups if a special flag is passed.  Now this is
14253         eliminated and two methods take their place. 
14254
14255         The differences in the two methods between xStep and xTerminal is
14256         that xStep is involved in our current lookup system that uses
14257         SimpleNames to compose a name, while xTerminal is used just to
14258         catch the case where the simplename lookup failed.
14259
14260 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14261
14262         * expression.cs (ResolveMemberAccess): Remove redundant code.
14263         TypeExpr expressions are always born fully resolved.
14264
14265         * interface.cs (PopulateMethod): Do not lookup the types twice.
14266         We were doing it once during SemanticAnalysis and once during
14267         PopulateMethod.
14268
14269         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14270         in local variable type definitions, were being returned as a
14271         SimpleName (we decomposed everything into a string), that is
14272         because primary_expression was being used instead of a type in the
14273         grammar (reduce/reduce conflicts).
14274
14275         The part that was wrong is that we converted the expression into a
14276         string (an oversimplification in one hand, compounded with primary
14277         expressions doing string concatenation).
14278
14279         So things like:
14280
14281         A.B.C [] x;
14282
14283         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14284         using clauses from working on this particular context.  And a type
14285         was being matched directly against "A.B.C[]".
14286
14287         We now use the correct approach, and allow for ComposedCast to be
14288         part of the unary expression.  So the "A.B.C []" become a composed
14289         cast of "A.B.C" (as a nested group of MemberAccess with a
14290         SimpleName at the end) plus the rank composition "[]". 
14291
14292         Also fixes 35567
14293
14294 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14295
14296         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14297         for the access level checking.
14298
14299         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14300         `TypeContainer container', because I kept getting confused when I
14301         was debugging this code.
14302
14303         * expression.cs (Indexers): Instead of tracking getters/setters,
14304         we now track them in parallel.  We create one arraylist less, but
14305         most importantly it is possible now for the LValue code to find a
14306         matching get for a set.
14307
14308         (IndexerAccess.DoResolveLValue): Update the code.
14309         GetIndexersForType has been modified already to extract all the
14310         indexers from a type.  The code assumed it did not.
14311
14312         Also make the code set the correct return type for the indexer.
14313         This was fixed a long time ago for properties, but was missing for
14314         indexers.  It used to be void_type.
14315
14316         (Binary.Emit): Test first for doubles instead of
14317         floats, as they are more common.
14318
14319         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14320         when dealing with floats and the <=, >= operators.  This fixes bug
14321         #39314 
14322
14323         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14324         to load the array value by emitting a load on the foreach variable
14325         type.  This was incorrect.  
14326
14327         We now emit the code to load an element using the the array
14328         variable type, and then we emit the conversion operator.
14329
14330         Fixed #40176
14331
14332 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14333
14334         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14335
14336 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14337
14338         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14339         test for protection before we test for signatures. 
14340
14341         (MethodSignature.ToString): implement.
14342
14343         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14344         to the case where we reduced into a LongConstant.
14345
14346         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14347         depend on whether the information is acurrate, because the
14348         Microsoft runtime will always claim that the array type is public,
14349         regardless of the real state.
14350
14351         If the type is a pointer, another problem happens: the type is
14352         reported as non-public in Microsoft.  
14353
14354         In both cases we have to call CheckAccessLevel recursively with
14355         the underlying type as the argument to be tested.
14356
14357 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14358
14359         * assign.cs (Assign.Emit): If we are dealing with a compound
14360         assignment expression, we should use the code path that stores the
14361         intermediate result in a temporary value.  This fixes #40903.
14362
14363         *expression.cs (Indirection.ToString): Provide ToString method for
14364         debugging. 
14365
14366 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14367
14368         * class.cs: Null out fields holding references to Block objects so
14369         they can be garbage collected.
14370
14371         * expression.cs (OverloadResolve): Remove unused local.
14372
14373 2003-04-07  Martin Baulig  <martin@ximian.com>
14374
14375         * codegen.cs (EmitContext.CurrentFile): New public field.
14376         (EmitContext.Mark): Use the CurrentFile to check whether the
14377         location is in the correct file.
14378         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14379
14380 2003-04-07  Martin Baulig  <martin@ximian.com>
14381
14382         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14383
14384         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14385         location.  [FIXME: The location argument which gets passed to this
14386         method is sometimes wrong!]
14387
14388 2003-04-07  Nick Drochak <ndrochak@gol.com>
14389
14390         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14391
14392 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14393
14394         * expression.cs (Indirection.EmitAssign): We were using the
14395         temporary, but returning immediately instead of continuing the
14396         EmitAssing flow.
14397
14398 2003-04-06  Martin Baulig  <martin@ximian.com>
14399
14400         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14401         if it's a nested child, but also deriving from the outer class.
14402         See test 190.cs.
14403
14404         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14405         nested child, but also deriving from the outer class.  See
14406         test-190.cs.
14407         (FilterWithClosure): We may access private members of the outer
14408         class if we're a nested child and deriving from the outer class.
14409         (RealMemberLookup): Only set `closure_private_ok' if the
14410         `original_bf' contained BindingFlags.NonPublic.
14411
14412 2003-04-05  Martin Baulig  <martin@ximian.com>
14413
14414         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14415         probe if its a type parameter, and if so, flag an error.
14416
14417         * decl.cs: Move here the SetParameterInfo code from class.cs.
14418         Handle IsGeneric here.
14419
14420         Handle a variety of errors in the parameter info definition.
14421
14422         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14423         type parameters here.
14424
14425         * cs-parser.jay (class_declaration): report errors for parameters
14426         here as well.
14427
14428 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * generic.cs: New file, contains support code for generics.
14431
14432         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14433         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14434
14435         Update parser for the above removals.
14436
14437         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14438         now taken care of in the parser.
14439
14440 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * class.cs (Event.Define): Do not allow abstract events to have
14443         initializers. 
14444
14445 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14446
14447         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14448         block in event declarations.
14449
14450         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14451         value type, get its address.
14452
14453         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14454         leaving a class on the stack instead of a boolean value (int
14455         0/1).  Change the code so we compare against null, and then the
14456         result against zero.
14457
14458         * class.cs (TypeContainer.GetClassBases): We were checking for the
14459         parent class being sealed too late.
14460
14461         * expression.cs (Binary.Emit): For <= and >= when dealing with
14462         floating point values, use cgt.un and clt.un instead of cgt and
14463         clt alone.
14464
14465 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14466
14467         * statement.cs: Apply the same optimization as MS: skip the 
14468         GetEnumerator returning an IEnumerator, and use the one returning a 
14469         CharEnumerator instead. This allows us to avoid the try-finally block 
14470         and the boxing.
14471
14472 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14473
14474         * cs-parser.jay: Attributes cannot be applied to
14475                          namespaces. Fixes #40473
14476
14477 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14478
14479         * class.cs:
14480         (Add*): check if the name is valid using the full name for constants,
14481         fields, properties and events.
14482
14483 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14484
14485         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14486         char constants to be part of the enumeration.
14487
14488         * expression.cs (Conditional.DoResolve): Add support for operator
14489         true. Implements the missing functionality from 14.12
14490
14491         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14492         operator true/false as required by the spec.
14493
14494         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14495         implicit conversion to boolean.
14496
14497         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14498         also one where the type implements `operator true'. 
14499
14500         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14501         get an expression that will invoke operator true based on an
14502         expression.  
14503
14504         (GetConversionOperators): Removed the hack that called op_True
14505         here.  
14506
14507         (Expression.ResolveBoolean): Move this from Statement.
14508
14509 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14510
14511         * ecore.cs (FieldExpr): do not allow initialization of initonly
14512         fields on derived classes
14513
14514 2003-03-13  Martin Baulig  <martin@ximian.com>
14515
14516         * statement.cs (Block.Emit): Call ig.BeginScope() and
14517         ig.EndScope() when compiling with debugging info; call
14518         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14519
14520 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14521
14522         * expression.cs (Indexers): Do not construct immediately, allow
14523         for new members to be appended as we go.  Fixes 38143
14524
14525 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14526
14527         * expression.cs: save/restore context when resolving an unchecked
14528         expression.
14529
14530 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * cfold.cs: Catch division by zero in modulus operator during
14533         constant folding.
14534
14535 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * interface.cs (Interface.DefineMembers): Avoid defining members
14538         twice. 
14539
14540 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * driver.cs: handle the +/- options for -noconfig
14543
14544         * statement.cs (Unckeched.Resolve): Also track the state of
14545         unchecked in the Resolve phase.
14546
14547 2003-02-27  Martin Baulig  <martin@ximian.com>
14548
14549         * ecore.cs (Expression.MemberLookup): Don't create a
14550         MethodGroupExpr for something which is not a method.  Fixes #38291.
14551
14552 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14553
14554         * class.cs (MemberBase.CheckParameters): Also check that the type
14555         is unmanaged if it is a pointer.
14556
14557         * expression.cs (SizeOf.Resolve): Add location information.
14558
14559         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14560         a managed type is declared.
14561
14562         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14563         parameter modifiers as well.  Fixes bug 38606
14564
14565         * class.cs: Very sad.  Am backing out the speed up changes
14566         introduced by the ArrayList -> Array in the TypeContainer, as they
14567         were not actually that much faster, and introduced a bug (no error
14568         reports on duplicated methods).
14569
14570         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14571         source first, this will guarantee that we have a valid expression
14572         before calling in lower levels functions that will require a
14573         resolved object.  Then use this original_source in the
14574         target.ResolveLValue instead of the original source that was
14575         passed to us.
14576
14577         Another change.  Use target.Resolve instead of LValueResolve.
14578         Although we are resolving for LValues, we will let the Assign code
14579         take care of that (it will be called again from Resolve).  This
14580         basically allows code like this:
14581
14582         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14583         class Y { void A (X x) { x [0] += o; }
14584
14585         The problem was that the indexer was trying to resolve for
14586         set_Item (idx, object o) and never finding one.  The real set_Item
14587         was set_Item (idx, X).  By delaying the process we get the right
14588         semantics. 
14589
14590         Fixes bug 36505
14591
14592 2003-02-23  Martin Baulig  <martin@ximian.com>
14593
14594         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14595         while calling DoEmit ().
14596
14597         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14598         source files; if you use the #line directive inside a method, the
14599         compiler stops emitting line numbers for the debugger until it
14600         reaches the end of the method or another #line directive which
14601         restores the original file.
14602
14603 2003-02-23  Martin Baulig  <martin@ximian.com>
14604
14605         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14606
14607 2003-02-23  Martin Baulig  <martin@ximian.com>
14608
14609         * statement.cs (Block.AddChildVariableNames): We need to call this
14610         recursively, not just for our immediate children.
14611
14612 2003-02-23  Martin Baulig  <martin@ximian.com>
14613
14614         * class.cs (Event.Define): Always make the field private, like csc does.
14615
14616         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14617         actually work, fixes bug #37521.
14618
14619 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14620
14621         * delegate.cs: When creating the various temporary "Parameters"
14622         classes, make sure that we call the ComputeAndDefineParameterTypes
14623         on those new parameters (just like we do with the formal ones), to
14624         allow them to be resolved in the context of the DeclSpace.
14625
14626         This fixes the bug that Dick observed in Bugzilla #38530.
14627
14628 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14629
14630         * expression.cs (ResolveMemberAccess): When resolving a constant,
14631         do not attempt to pull a constant if the value was not able to
14632         generate a valid constant.
14633
14634         * const.cs (LookupConstantValue): Do not report more errors than required.
14635
14636 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14637
14638         * expression.cs: fixes bug #38328.
14639
14640 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14641
14642         * class.cs: Changed all the various members that can be part of a
14643         class from being an ArrayList to be an Array of the right type.
14644         During the DefineType type_list, interface_list, delegate_list and
14645         enum_list are turned into types, interfaces, delegates and enums
14646         arrays.  
14647
14648         And during the member population, indexer_list, event_list,
14649         constant_list, field_list, instance_constructor_list, method_list,
14650         operator_list and property_list are turned into their real arrays.
14651
14652         Although we could probably perform this operation earlier, for
14653         good error reporting we need to keep the lists and remove the
14654         lists for longer than required.
14655
14656         This optimization was triggered by Paolo profiling the compiler
14657         speed on the output of `gen-sample-program.pl' perl script. 
14658
14659         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14660         not crash in methods like MemberLookupFailed that use this field.  
14661
14662         This problem arises when the compiler fails to resolve a type
14663         during interface type definition for example.
14664
14665 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14666
14667         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14668         inherit from System.Object, so we have to stop at null, not only
14669         when reaching System.Object.
14670
14671 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14672
14673         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14674         DeclaredOnly because the parent indexer might have had a different
14675         name, but did not loop until the top of the hierarchy was reached.
14676
14677         The problem this one fixes is 35492: when a class implemented an
14678         indexer from an interface, we were getting the interface method
14679         (which was abstract) and we were flagging an error (can not invoke
14680         abstract method).
14681
14682         This also keeps bug 33089 functioning, and test-148 functioning.
14683
14684         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14685         out if a method is special is to see if it is declared in a
14686         property or event, or whether it is one of the predefined operator
14687         names.   This should fix correctly #36804.
14688
14689 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14690
14691         The goal here is to remove the dependency on EmptyCast.Peel ().
14692         Killing it completely.
14693
14694         The problem is that currently in a number of places where
14695         constants are expected, we have to "probe" for an EmptyCast, and
14696         Peel, which is not the correct thing to do, as this will be
14697         repetitive and will likely lead to errors. 
14698
14699         The idea is to remove any EmptyCasts that are used in casts that
14700         can be reduced to constants, so we only have to cope with
14701         constants. 
14702
14703         This bug hunt was triggered by Bug 37363 and the desire to remove
14704         the duplicate pattern where we were "peeling" emptycasts to check
14705         whether they were constants.  Now constants will always be
14706         constants.
14707
14708         * ecore.cs: Use an enumconstant here instead of wrapping with
14709         EmptyCast.  
14710
14711         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14712         throwing me off.  By handling this we can get rid of a few hacks.
14713
14714         * statement.cs (Switch): Removed Peel() code.
14715
14716 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14717
14718         * class.cs: Location information for error 508
14719
14720         * expression.cs (New.DoResolve): Add a guard against double
14721         resolution of an expression.  
14722
14723         The New DoResolve might be called twice when initializing field
14724         expressions (see EmitFieldInitializers, the call to
14725         GetInitializerExpression will perform a resolve on the expression,
14726         and later the assign will trigger another resolution
14727
14728         This leads to bugs (#37014)
14729
14730         * delegate.cs: The signature for EndInvoke should contain any ref
14731         or out parameters as well.  We were not doing this in the past. 
14732
14733         * class.cs (Field.Define): Do not overwrite the type definition
14734         inside the `volatile' group.  Turns out that volatile enumerations
14735         were changing the type here to perform a validity test, which
14736         broke conversions. 
14737
14738 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14739
14740         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14741         and structs, we do not want to load the instance variable
14742
14743         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14744         enum_type has to be handled like an object reference (implicit
14745         conversions exists from this to object), but the regular IsClass
14746         and IsValueType tests will never return true for this one.
14747
14748         Also we use TypeManager.IsValueType instead of type.IsValueType,
14749         just for consistency with the rest of the code (this is only
14750         needed if we ever use the construct exposed by test-180.cs inside
14751         corlib, which we dont today).
14752
14753 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14754
14755         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14756         just InternalCall.
14757
14758 2003-02-09  Martin Baulig  <martin@ximian.com>
14759
14760         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14761         (Namespace.DefineNamespaces): New static public method; this is
14762         called when we're compiling with debugging to add all namespaces
14763         to the symbol file.
14764
14765         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14766         pass it to the Namespace's .ctor.
14767
14768         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14769         and MethodBase arguments; pass the namespace ID to the symwriter;
14770         pass the MethodBase instead of the token to the symwriter.
14771         (SymbolWriter.DefineNamespace): New method to add a namespace to
14772         the symbol file.
14773
14774 2003-02-09  Martin Baulig  <martin@ximian.com>
14775
14776         * symbolwriter.cs: New file.  This is a wrapper around
14777         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14778         methods here in near future.
14779
14780 2003-02-09  Martin Baulig  <martin@ximian.com>
14781
14782         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14783         ILGenerator.MarkSequencePoint() which are actually used by the
14784         symbol writer.
14785
14786 2003-02-09  Martin Baulig  <martin@ximian.com>
14787
14788         * location.cs (SourceFile): New public sealed class.  This
14789         contains the name and an index which is used in the location's token.
14790         (Location): Reserve an appropriate number of bits in the token for
14791         the source file instead of walking over that list, this gives us a
14792         really huge performance improvement when compiling with debugging.
14793
14794         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14795         `SourceFile' argument instead of a string.
14796         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14797         but don't parse/tokenize here, we need to generate the list of all
14798         source files before we do that.
14799         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14800         the files.
14801
14802         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14803         instead of a string.
14804
14805         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14806         of a string.
14807
14808 2003-02-09  Martin Baulig  <martin@ximian.com>
14809
14810         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14811         filename on `#line default'.
14812
14813 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14814
14815         * statement.cs: don't clear the pinned var when the fixed statement
14816         returns from the method (fixes bug#37752).
14817
14818 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14819
14820         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14821         to IsValueType.
14822
14823 2003-02-07  Martin Baulig  <martin@ximian.com>
14824
14825         * driver.cs: Removed the `--debug-args' command line argument.
14826
14827         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14828         automatically by the AsssemblyBuilder.
14829         (CodeGen.InitializeSymbolWriter): We don't need to call any
14830         initialization function on the symbol writer anymore.  This method
14831         doesn't take any arguments.
14832
14833 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14834
14835         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14836         from referenced assemblies as well.
14837
14838 2003-02-02  Martin Baulig  <martin@ximian.com>
14839
14840         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14841
14842 2003-02-02  Martin Baulig  <martin@ximian.com>
14843
14844         * class.cs (Constructor.Emit): Open the symbol writer before
14845         emitting the constructor initializer.
14846         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14847         single-stepping through constructor initializers.
14848
14849 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14850
14851         * class.cs: Handle error 549: do not allow virtual methods in
14852         sealed classes. 
14853
14854 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14855
14856         * decl.cs: Check access levels when resolving types
14857
14858 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14859
14860         * statement.cs: Add parameters and locals set in catch blocks that might 
14861         return to set vector
14862
14863 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * class.cs (Operator): Set the SpecialName flags for operators.
14866
14867         * expression.cs (Invocation.DoResolve): Only block calls to
14868         accessors and operators on SpecialName methods.
14869
14870         (Cast.TryReduce): Handle conversions from char constants.
14871
14872
14873 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14874
14875         * statement.cs: small memory and time optimization in FlowBranching.
14876
14877 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14878
14879         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14880         problem that the last fix but in the other sid (Set).
14881
14882         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14883         access when there is no indexer in the hierarchy.
14884
14885 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14886
14887         * class.cs: Combine some if statements.
14888
14889 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14890
14891         * driver.cs: fixed bug #37187.
14892
14893 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14894
14895         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14896         any indexer, it's needed to build a list with all the indexers in the
14897         hierarchy (AllGetters), else we have problems. Fixes #35653.
14898
14899 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * class.cs (MethodData.Define): It is wrong for an interface
14902         implementation to be static in both cases: explicit and implicit.
14903         We were only handling this in one case.
14904
14905         Improve the if situation there to not have negations.
14906
14907         * class.cs (Field.Define): Turns out that we do not need to check
14908         the unsafe bit on field definition, only on usage.  Remove the test.
14909
14910 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14911
14912         * driver.cs: use assembly.Location instead of Codebase (the latest
14913         patch made mcs fail when using MS assemblies).
14914
14915 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14916
14917         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14918         get the path to *corlib.dll.
14919
14920 2003-01-21  Nick Drochak <ndrochak@gol.com>
14921
14922         * cs-tokenizer.cs:
14923         * pending.cs:
14924         * typemanager.cs: Remove compiler warnings
14925
14926 2003-01-20  Duncan Mak  <duncan@ximian.com>
14927
14928         * AssemblyInfo.cs: Bump the version number to 0.19.
14929
14930 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14931
14932         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14933
14934 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14935
14936         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14937
14938 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14939
14940         * cs-parser.jay: Small fix: we were not comparing the constructor
14941         name correctly.   Thanks to Zoltan for the initial pointer.
14942
14943 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14944
14945         * cs-tokenizer.cs: Set file name when specified with #line
14946
14947 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14948
14949         * cs-parser.jay: Only perform the constructor checks here if we
14950         are named like the class;  This will help provider a better
14951         error.  The constructor path is taken when a type definition is
14952         not found, but most likely the user forgot to add the type, so
14953         report that rather than the constructor error.
14954
14955 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14956
14957         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14958         allocations.
14959
14960 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14961
14962         * cs-parser.jay: Add cleanup call.
14963
14964 2003-01-13  Duncan Mak  <duncan@ximian.com>
14965
14966         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14967         consistent with other methods.
14968
14969 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14970
14971         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14972
14973 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14974
14975         * attribute.cs: only set GuidAttr to true when we have a
14976         GuidAttribute.
14977
14978 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14979
14980         * ecore.cs:
14981         * expression.cs:
14982         * typemanager.cs: fixes to allow mcs compile corlib with the new
14983         Type.IsSubclassOf fix.
14984
14985 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14986
14987         * expression.cs (LocalVariableReference.DoResolve): Classify a
14988         constant as a value, not as a variable.   Also, set the type for
14989         the variable.
14990
14991         * cs-parser.jay (fixed_statement): take a type instead of a
14992         pointer_type, so we can produce a better error message later.
14993
14994         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14995         as an error.  
14996
14997         (For.DoEmit): Make inifinite loops have a
14998         non-conditional branch back.
14999
15000         (Fixed.DoEmit): First populate the pinned variables, then emit the
15001         statement, then clear the variables.  Before I was emitting the
15002         code once for each fixed piece.
15003
15004
15005 2003-01-08  Martin Baulig  <martin@ximian.com>
15006
15007         * statement.cs (FlowBranching.MergeChild): A break in a
15008         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15009
15010 2003-01-08  Martin Baulig  <martin@ximian.com>
15011
15012         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15013         lives in the same number space than `param_map'.  Fixes #36154.
15014
15015 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15016
15017         * cs-parser.jay (constructor_declaration): Set the
15018         Constructor.ModFlags before probing for it.  This makes the
15019         compiler report 514, 515 and 132 (the code was there, but got
15020         broken). 
15021
15022         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15023         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15024         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15025
15026 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15027
15028         * enum.cs: create the enum static fields using the enum type.
15029
15030 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15031
15032         * class.cs: don't try to create the ParamBuilder for the return
15033         type if it's not needed (and handle it breaking for the ms runtime
15034         anyway).
15035
15036 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15037
15038         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15039
15040 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15041
15042         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15043         the command.   This showed up while compiling the JANET source
15044         code, which used \r as its only newline separator.
15045
15046 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15047
15048         * class.cs (Method.Define): If we are an operator (because it
15049         reuses our code), then set the SpecialName and HideBySig.  #36128
15050
15051 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15052
15053         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15054         exception, report error 120 `object reference required'.
15055
15056         * driver.cs: Add --pause option, used during to measure the size
15057         of the process as it goes with --timestamp.
15058
15059         * expression.cs (Invocation.DoResolve): Do not allow methods with
15060         SpecialName to be invoked.
15061
15062 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15065         number before adding it.
15066
15067 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15068
15069         * ecore.cs (StandardImplicitConversion): When in an unsafe
15070         context, we allow conversion between void * to any other pointer
15071         type. This fixes bug #35973.
15072
15073 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15074
15075         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15076         is not thrown when extensionless outputs are used 
15077
15078 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15079
15080         * rootcontext.cs: fixed compilation of corlib.
15081
15082 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15083
15084         * attribute.cs (Attributes.Contains): Add new method.
15085
15086         * class.cs (MethodCore.LabelParameters): if the parameter is an
15087         `out' parameter, check that no attribute `[In]' has been passed.
15088
15089         * enum.cs: Handle the `value__' name in an enumeration.
15090
15091 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15092
15093         * decl.cs: Added special case to allow overrides on "protected
15094         internal" methods
15095
15096 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15097
15098         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15099         since it makes much more sense.
15100
15101         (Attributes.ctor): Don't require a Location parameter.
15102
15103         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15104
15105         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15106         since we already have that information per attribute.
15107
15108         * everywhere : make appropriate changes.
15109
15110         * class.cs (LabelParameters): Write the code which actually
15111         applies attributes to the return type. We can't do this on the MS
15112         .NET runtime so we flag a warning in the case an exception is
15113         thrown.
15114
15115 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15116
15117         * const.cs: Handle implicit null conversions here too.
15118
15119 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15120
15121         * class.cs (MethodCore.LabelParameters): Remove the extra
15122         Type [] parameter since it is completely unnecessary. Instead
15123         pass in the method's attributes so that we can extract
15124         the "return" attribute.
15125
15126 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15127
15128         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15129         of ignoring it and letting the compile continue.
15130
15131         * typemanager.cs (ChangeType): use an extra argument to return an
15132         error condition instead of throwing an exception.
15133
15134 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * expression.cs (Unary.TryReduce): mimic the code for the regular
15137         code path.  Perform an implicit cast in the cases where we can
15138         implicitly convert to one of the integral types, and then reduce
15139         based on that constant.   This fixes bug #35483.
15140
15141 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15142
15143         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15144
15145 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15146
15147         * namespace.cs: fixed bug #35489.
15148
15149 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15150
15151         * class.cs: Remove some dead code.
15152
15153         * cs-parser.jay: Estimate the number of methods needed
15154         (RootContext.MethodCount);
15155
15156         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15157         numbers instead of StringBuilders.
15158
15159         * support.cs (PtrHashtable): Add constructor with initial size;
15160         We can now reduce reallocations of the method table.
15161
15162 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15163
15164         * attribute.cs (ApplyAttributes): Keep track of the emitted
15165         attributes on a per-target basis. This fixes bug #35413.
15166
15167 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15168
15169         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15170         default to the Windows 1252 encoding.
15171
15172         (UnixParseOption): Support version, thanks to Alp for the missing
15173         pointer. 
15174
15175         * AssemblyInfo.cs: Add nice assembly information.
15176
15177         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15178         (bug 35169).
15179
15180         * cs-parser.jay: Allow a trailing comma before the close bracked
15181         in the attribute_section production.
15182
15183         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15184         address of the instance was being taken, I will take this out,
15185         because we take the address of the object immediately here.
15186
15187 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15188
15189         * typemanager.cs (AreMultipleAllowed): Take care of the most
15190         obvious case where attribute type is not in the current assembly -
15191         stupid me ;-)
15192
15193 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15194
15195         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15196         definitions, instead of doing that afterwards.  
15197
15198         Also we use a nice little hack, depending on the constructor, we
15199         know if we are a "composed" name or a simple name.  Hence, we
15200         avoid the IndexOf test, and we avoid 
15201
15202         * codegen.cs: Add code to assist in a bug reporter to track down
15203         the source of a compiler crash. 
15204
15205 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15206
15207         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15208         types have been emitted for a given element and flag an error
15209         if something which does not have AllowMultiple set is used more
15210         than once.
15211
15212         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15213         attribute types and their corresponding AllowMultiple properties
15214
15215         (AreMultipleAllowed): Check the property for a given type.
15216
15217         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15218         property in the case we have a TypeContainer.
15219
15220         (Attributes.AddAttribute): Detect duplicates and just skip on
15221         adding them. This trivial fix catches a pretty gross error in our
15222         attribute emission - global attributes were being emitted twice!
15223
15224         Bugzilla bug #33187 is now fixed.
15225
15226 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15229         instead of pp_and).
15230
15231         * expression.cs (Binary.ResolveOperator): I can only use the
15232         Concat (string, string, string) and Concat (string, string,
15233         string, string) if the child is actually a concatenation of
15234         strings. 
15235
15236 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15237
15238         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15239         context where we need a 2-character lookahead.
15240
15241         * pending.cs (PendingImplementation): Rework so we can keep track
15242         of interface types all the time, and flag those which were
15243         implemented by parents as optional.
15244
15245 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * expression.cs (Binary.ResolveOperator): Use
15248         String.Concat(string,string,string) or
15249         String.Concat(string,string,string,string) when possible. 
15250
15251         * typemanager: More helper methods.
15252
15253
15254 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15255
15256         * pending.cs: remove the bogus return from GetMissingInterfaces()
15257         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15258
15259 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15260
15261         * namespace.cs: avoid duplicated 'using xxx' being added to
15262         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15263         when we get more than one 'using' statement for the same namespace.
15264         Report a CS0105 warning for it.
15265
15266 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15267
15268         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15269         of calling getChar/putback, uses internal knowledge of it.    
15270
15271         (xtoken): Reorder tokenizer so most common patterns are checked
15272         first.  This reduces the compilation time in another 5% (from 8.11s
15273         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15274
15275         The parsing time is 22% of the compilation in mcs, and from that
15276         64% is spent on the tokenization process.  
15277
15278         I tried using a binary search for keywords, but this is slower
15279         than the hashtable.  Another option would be to do a couple of
15280         things:
15281
15282                 * Not use a StringBuilder, instead use an array of chars,
15283                   with a set value.  Notice that this way we could catch
15284                   the 645 error without having to do it *afterwards*.
15285
15286                 * We could write a hand-parser to avoid the hashtable
15287                   compares altogether.
15288
15289         The identifier consumption process takes 37% of the tokenization
15290         time.  Another 15% is spent on is_number.  56% of the time spent
15291         on is_number is spent on Int64.Parse:
15292
15293                 * We could probably choose based on the string length to
15294                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15295                   computations. 
15296
15297         Another 3% is spend on wrapping `xtoken' in the `token' function.
15298
15299         Handle 0xa0 as whitespace (#34752)
15300
15301 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15302
15303         * typemanager.cs (IsCLRType): New routine to tell whether a type
15304         is one of the builtin types.  
15305
15306         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15307         typecode in more places instead of doing pointer comparissions.
15308         We could leverage some knowledge about the way the typecodes are
15309         laid out.
15310
15311         New code to cache namespaces in assemblies, it is currently not
15312         invoked, to be used soon.
15313
15314         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15315
15316         * expression.cs (Binary.ResolveOperator): specially handle
15317         strings, and do not perform user-defined operator overloading for
15318         built-in types.
15319
15320 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15323         internalcall as it is a pretty simple operation;  Avoid whenever
15324         possible to call Char.IsLetter.
15325
15326         (consume_identifier): Cut by half the number of
15327         hashtable calls by merging the is_keyword and GetKeyword behavior.
15328
15329         Do not short-circuit, because if we do, we
15330         report errors (ie, #if false && true would produce an invalid
15331         directive error);
15332
15333
15334 2002-11-24  Martin Baulig  <martin@ximian.com>
15335
15336         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15337         check constant ranges and report a CS0221.  Fixes #33186.
15338
15339 2002-11-24  Martin Baulig  <martin@ximian.com>
15340
15341         * cs-parser.jay: Make this work for uninitialized variable
15342         declarations in the `for' initializer.  Fixes #32416.
15343
15344 2002-11-24  Martin Baulig  <martin@ximian.com>
15345
15346         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15347         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15348
15349 2002-11-24  Martin Baulig  <martin@ximian.com>
15350
15351         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15352         argument; if true, we also check for user-defined conversions.
15353         This is only needed if both arguments are of a user-defined type.
15354         Fixes #30443, added test-175.cs.
15355         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15356
15357         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15358
15359 2002-11-24  Martin Baulig  <martin@ximian.com>
15360
15361         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15362         function to get the store opcode.
15363         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15364         only emit the Ldelema if the store opcode is Stobj.  You must run
15365         both test-34 and test-167 to test this.  Fixes #34529.
15366
15367 2002-11-23  Martin Baulig  <martin@ximian.com>
15368
15369         * ecore.cs (Expression.MemberLookup): Added additional
15370         `qualifier_type' argument which is used when we're being called
15371         from MemberAccess.DoResolve() and null if we're called from a
15372         SimpleName lookup.
15373         (Expression.MemberLookupFailed): New method to report errors; this
15374         does the CS1540 check and reports the correct error message.
15375
15376         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15377         argument for the CS1540 check and redone the way how we're dealing
15378         with private members.  See the comment in the source code for details.
15379         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15380         `closure_start_type' to `closure_qualifier_type' and check whether
15381         it's not null.  It was not this filter being broken, it was just
15382         being called with the wrong arguments.
15383
15384         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15385         and pass it the correct `qualifier_type'; this also does the error
15386         handling for us.
15387
15388 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15389
15390         * expression.cs (Invocation.EmitParams): If the we are dealing
15391         with a non-built-in value type, load its address as well.
15392
15393         (ArrayCreation): Use a a pretty constant instead
15394         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15395         static initializers.  
15396
15397         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15398         because they are not really value types, just glorified integers. 
15399
15400         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15401
15402         * ecore.cs: Remove redundant code for enumerations, make them use
15403         the same code path as everything else, fixes the casting issue
15404         with enumerations in Windows.Forms.
15405
15406         * attribute.cs: Do only cast to string if it is a string, the
15407         validation happens later.
15408
15409         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15410         people upgrade their corlibs.
15411
15412         * ecore.cs: Oops, enumerations were not following the entire code path
15413
15414 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15415
15416         * typemanager.cs (FilterWithClosure): Commented out the test for
15417         1540 in typemanager.cs, as it has problems when accessing
15418         protected methods from a parent class (see test-174.cs). 
15419
15420         * attribute.cs (Attribute.ValidateGuid): new method.
15421         (Attribute.Resolve): Use above.
15422
15423 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15424
15425         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15426
15427         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15428         handling for enumerations, as we only needed the TypeContainer
15429         functionality to begin with (this is required for the fix below to
15430         work for enums that reference constants in a container class for
15431         example). 
15432
15433         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15434
15435         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15436         a valid TypeBuilder to perform lookups on.o
15437
15438         * class.cs (InheritableMemberSignatureCompare): Use true in the
15439         call to GetGetMethod and GetSetMethod, because we are comparing
15440         the signature, and we need to get the methods *even* if they are
15441         private. 
15442
15443         (PropertyBase.CheckBase): ditto.
15444
15445         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15446         GotoCase.Resolve): Use Peel on EmpytCasts.
15447
15448         * ecore.cs (EmptyCast): drop child, add Peel method.
15449
15450 2002-11-17  Martin Baulig  <martin@ximian.com>
15451
15452         * ecore.cs (EmptyCast.Child): New public property.
15453
15454         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15455         label resolved to an EmptyCast.  Fixes #34162.
15456         (GotoCase.Resolve): Likewise.
15457         (Block.EmitMeta): Likewise.
15458
15459 2002-11-17  Martin Baulig  <martin@ximian.com>
15460
15461         * expression.cs (Invocation.BetterConversion): Prefer int over
15462         uint; short over ushort; long over ulong for integer literals.
15463         Use ImplicitConversionExists instead of StandardConversionExists
15464         since we also need to check for user-defined implicit conversions.
15465         Fixes #34165.  Added test-173.cs.
15466
15467 2002-11-16  Martin Baulig  <martin@ximian.com>
15468
15469         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15470         with the `true' and `false' literals.  Fixes #33151.
15471
15472 2002-11-16  Martin Baulig  <martin@ximian.com>
15473
15474         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15475         October 22nd; don't do the cs1540 check for static members.
15476
15477         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15478         now using our own filter here and doing the cs1540 check again.
15479
15480 2002-11-16  Martin Baulig  <martin@ximian.com>
15481
15482         * support.cs (InternalParameters): Don't crash if we don't have
15483         any fixed parameters.  Fixes #33532.
15484
15485 2002-11-16  Martin Baulig  <martin@ximian.com>
15486
15487         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15488         when looking up static methods to make this work on Windows.
15489         Fixes #33773.
15490
15491 2002-11-16  Martin Baulig  <martin@ximian.com>
15492
15493         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15494         a setter rather than using PropertyInfo.CanWrite.
15495
15496 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15497
15498         * class.cs: Allow acces to block member by subclasses. Fixes build
15499         breaker.
15500
15501 2002-11-14  Martin Baulig  <martin@ximian.com>
15502
15503         * class.cs (Constructor.Emit): Added the extern/block check.
15504         Fixes bug #33678.
15505
15506 2002-11-14  Martin Baulig  <martin@ximian.com>
15507
15508         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15509         iteration while looking for indexers, this is needed because the
15510         indexer may have a different name in our base classes.  Fixed the
15511         error reporting (no indexers at all, not get accessor, no
15512         overloaded match).  Fixes bug #33089.
15513         (IndexerAccess.DoResolveLValue): Likewise.
15514
15515 2002-11-14  Martin Baulig  <martin@ximian.com>
15516
15517         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15518         indexers.  Fixes the first part of bug #33089.
15519         (MethodSignature.InheritableMemberSignatureCompare): Added support
15520         for properties.
15521
15522 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15523
15524         * attribute.cs (Attribute.Resolve): Catch the
15525         NullReferenceException and report it since it isn't supposed to
15526         happen. 
15527
15528 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15529
15530         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15531         LogicalOr and LogicalAnd that can benefit from recursively
15532         handling EmitBranchable.  The code now should be nice for Paolo.
15533
15534 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15537         the Type lookups, as we perform quite a number of lookups on
15538         non-Types.  This can be removed once we can deterministically tell
15539         whether we have a type or a namespace in advance.
15540
15541         But this might require special hacks from our corlib.
15542
15543         * TODO: updated.
15544
15545         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15546         and double which avoids a conversion from an integer to a double.
15547
15548         * expression.cs: tiny optimization, avoid calling IsConstant,
15549         because it effectively performs the lookup twice.
15550
15551 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15552
15553         But a bogus return here to keep the semantics of the old code
15554         until the Mono runtime is fixed.
15555
15556         * pending.cs (GetMissingInterfaces): New method used to remove all
15557         the interfaces that are already implemented by our parent
15558         classes from the list of pending methods. 
15559
15560         * interface.cs: Add checks for calls after ResolveTypeExpr.
15561
15562 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15563
15564         * class.cs (Class.Emit): Report warning 67: event not used if the
15565         warning level is beyond 3.
15566
15567         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15568         being a NullLiteral.
15569
15570         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15571         specifiers. 
15572
15573         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15574         path that might fail if a type can not be resolved.
15575
15576         * expression.cs (Binary.Emit): Emit unsigned versions of the
15577         operators. 
15578
15579         * driver.cs: use error 5.
15580
15581 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15582
15583         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15584
15585 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * cs-parser.jay (switch_section): A beautiful patch from Martin
15588         Baulig that fixed 33094.
15589
15590 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15593         Check whether the base is abstract and report an error if so.
15594
15595         * expression.cs (IndexerAccess.DoResolveLValue,
15596         IndexerAccess.DoResolve): ditto. 
15597
15598         (Invocation.DoResolve): ditto.
15599
15600         (Invocation.FullMethodDesc): Improve the report string.
15601
15602         * statement.cs (Block): Eliminate IsVariableDefined as it is
15603         basically just a wrapper for GetVariableInfo.
15604
15605         * ecore.cs (SimpleName): Use new 
15606
15607         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15608         type, as we return the actual parameter ref/unref state on a
15609         different call.
15610
15611 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15612
15613         * support.cs: Return proper flags REF/OUT fixing the previous
15614         commit.  
15615
15616         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15617         not used to mean `ref' but `ref or out' in ParameterReference
15618
15619         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15620         full type signature instead of calling TypeManger.CSharpName
15621         ourselves. 
15622
15623         * support.cs (InternalParameters.ParameterDesc): Do not compare
15624         directly to the modflags, because REF/OUT will actually be bitsets
15625         if set. 
15626
15627         * delegate.cs (VerifyMethod): Check also the modifiers.
15628
15629         * cs-tokenizer.cs: Fix bug where floating point values with an
15630         exponent where a sign was missing was ignored.
15631
15632         * driver.cs: Allow multiple assemblies to be specified in a single
15633         /r: argument
15634
15635 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15638         because identifiers after a parenthesis would end up in this kind
15639         of production, and we needed to desamiguate it for having casts
15640         like:
15641
15642                 (UserDefinedType *) xxx
15643
15644 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15645
15646         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15647         we should set on the Bindingflags.NonPublic, but not turn on
15648         private_ok.  private_ok controls whether a Private member is
15649         returned (this is chekced on the filter routine), while the
15650         BindingFlags.NonPublic just controls whether private/protected
15651         will be allowed.   This fixes the problem part of the problem of
15652         private properties being allowed to be used in derived classes.
15653
15654         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15655         so we can call the children DoResolveLValue method (this will
15656         properly signal errors on lvalue assignments to base properties)
15657
15658         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15659         getter are null, and we have a property info, we know that this
15660         happened because the lookup failed, so we report an error 122 for
15661         protection level violation.
15662
15663         We also silently return if setter and getter are null in the
15664         resolve functions, this condition only happens if we have flagged
15665         the error before.  This is the other half of the problem. 
15666
15667         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15668         not have accessibility information, that is why we were returning
15669         true in the filter function in typemanager.cs.
15670
15671         To properly report 122 (property is inaccessible because of its
15672         protection level) correctly, we report this error in ResolveAccess
15673         by failing if both the setter and the getter are lacking (ie, the
15674         lookup failed). 
15675
15676         DoResolve and DoLResolve have been modified to check for both
15677         setter/getter being null and returning silently, the reason being
15678         that I did not want to put the knowledge about this error in upper
15679         layers, like:
15680
15681         int old = Report.Errors;
15682         x = new PropertyExpr (...);
15683         if (old != Report.Errors)
15684                 return null;
15685         else
15686                 return x;
15687
15688         So the property expr is returned, but it is invalid, so the error
15689         will be flagged during the resolve process. 
15690
15691         * class.cs: Remove InheritablePropertySignatureCompare from the
15692         class, as we no longer depend on the property signature to compute
15693         whether it is possible to implement a method or not.
15694
15695         The reason is that calling PropertyInfo.GetGetMethod will return
15696         null (in .NET, in Mono it works, and we should change this), in
15697         cases where the Get Method does not exist in that particular
15698         class.
15699
15700         So this code:
15701
15702         class X { public virtual int A { get { return 1; } } }
15703         class Y : X { }
15704         class Z : Y { public override int A { get { return 2; } } }
15705
15706         Would fail in Z because the parent (Y) would not have the property
15707         defined.  So we avoid this completely now (because the alternative
15708         fix was ugly and slow), and we now depend exclusively on the
15709         method names.
15710
15711         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15712         reference method, instead of using the property.
15713
15714         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15715         routines are gone now.
15716
15717         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15718         names, they were incorrectly named.
15719
15720         * cs-tokenizer.cs: Return are more gentle token on failure. 
15721
15722         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15723         had an out-of-sync index variable, which caused it to remove from
15724         the list of pending methods the wrong method sometimes.
15725
15726 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15727
15728         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15729         CanWrite, because those refer to this particular instance of the
15730         property, and do not take into account the fact that we can
15731         override single members of a property.
15732
15733         Constructor requires an EmitContext.  The resolution process does
15734         not happen here, but we need to compute the accessors before,
15735         because the resolution does not always happen for properties.
15736
15737         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15738         subclass, before we did not update this flag, but we did update
15739         bindingflags. 
15740
15741         (GetAccessors): Drop this routine, as it did not work in the
15742         presence of partially overwritten set/get methods. 
15743
15744         Notice that this broke the cs1540 detection, but that will require
15745         more thinking. 
15746
15747 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15748
15749         * class.cs:
15750         * codegen.cs:
15751         * driver.cs: issue a warning instead of an error if we don't support
15752         debugging for the platform. Also ignore a couple of errors that may
15753         arise when trying to write the symbols. Undo my previous patch.
15754
15755 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15756
15757         * driver.cs: ignore /debug switch except for Unix platforms.
15758
15759 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15760
15761         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15762
15763 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * driver.cs: Do not make mcs-debug conditional, so we do not break
15766         builds that use it.
15767
15768         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15769         review this patch.  But basically after all the children variables
15770         have been merged, the value of "Breaks" was not being set to
15771         new_breaks for Switch blocks.  I think that it should be set after
15772         it has executed.  Currently I set this to the value of new_breaks,
15773         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15774         conservative, but I do not understand this code very well.
15775
15776         I did not break anything in the build, so that is good ;-)
15777
15778         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15779
15780 2002-10-20  Mark Crichton  <crichton@gimp.org>
15781
15782         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15783
15784 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15785
15786         * cfold.cs: Fixed compile blocker.
15787
15788 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * driver.cs: I was chekcing the key, not the file.
15791
15792 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15793
15794         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15795         message that we were generating - we just need to silently return
15796         a null.
15797
15798 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15799
15800         * class.cs (Event.Define): Change my previous commit, as this
15801         breaks the debugger.  This is a temporary hack, as it seems like
15802         the compiler is generating events incorrectly to begin with.
15803
15804         * expression.cs (Binary.ResolveOperator): Added support for 
15805         "U operator - (E x, E y)"
15806
15807         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15808         y)".
15809
15810         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15811         init-only variables, but this path did not take into account that
15812         there might be also instance readonly variables.  Correct this
15813         problem. 
15814
15815         This fixes bug 32253
15816
15817         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15818         delegates as well.
15819
15820         * driver.cs: Change the extension for modules to `netmodule'
15821
15822         * cs-parser.jay: Improved slightly the location tracking for
15823         the debugger symbols.
15824
15825         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15826         modifiers that were specified instead of the hardcoded value
15827         (FamAndAssem).  This was basically ignoring the static modifier,
15828         and others.  Fixes 32429.
15829
15830         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15831         fixed a bug in the process (32476)
15832
15833         * expression.cs (ArrayAccess.EmitAssign): Patch from
15834         hwang_rob@yahoo.ca that fixes bug 31834.3
15835
15836 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15837
15838         * driver.cs: Make the module extension .netmodule.
15839
15840 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15841
15842         * driver.cs: Report an error if the resource file is not found
15843         instead of crashing.
15844
15845         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15846         false, like Emit does.
15847
15848 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15849
15850         * typemanager.cs: Remove unused private member.  Also reported mcs
15851         bug to report this as a warning like csc.
15852
15853 2002-10-15  Martin Baulig  <martin@gnome.org>
15854
15855         * statement.cs (Statement.Emit): Made this a virtual method; emits
15856         the line number info and calls DoEmit().
15857         (Statement.DoEmit): New protected abstract method, formerly knows
15858         as Statement.Emit().
15859
15860         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15861
15862 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15863
15864         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15865         have fixed a remaining problem: not every AddXXXX was adding a
15866         fully qualified name.  
15867
15868         Now everyone registers a fully qualified name in the DeclSpace as
15869         being defined instead of the partial name.  
15870
15871         Downsides: we are slower than we need to be due to the excess
15872         copies and the names being registered this way.  
15873
15874         The reason for this is that we currently depend (on the corlib
15875         bootstrap for instance) that types are fully qualified, because
15876         we dump all the types in the namespace, and we should really have
15877         types inserted into the proper namespace, so we can only store the
15878         basenames in the defined_names array.
15879
15880 2002-10-10  Martin Baulig  <martin@gnome.org>
15881
15882         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15883         from bug #31834, see the bug report for a testcase which is
15884         miscompiled.
15885
15886 2002-10-10  Martin Baulig  <martin@gnome.org>
15887
15888         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15889         flow analysis code for this.
15890
15891         * statement.cs (Do, While, For): Tell the flow analysis code about
15892         infinite loops.
15893         (FlowBranching.UsageVector): Added support for infinite loops.
15894         (Block.Resolve): Moved the dead code elimination here and use flow
15895         analysis to do it.
15896
15897 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15898
15899         * class.cs (Field.Define): Catch cycles on struct type
15900         definitions. 
15901
15902         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15903         fields if the fields are static.  We only need to check instance
15904         fields. 
15905
15906         * expression.cs (As.DoResolve): Test for reference type.
15907
15908         * statement.cs (Using.ResolveExpression): Use
15909         ConvertImplicitRequired, not ConvertImplicit which reports an
15910         error on failture
15911         (Using.ResolveLocalVariableDecls): ditto.
15912
15913         * expression.cs (Binary.ResolveOperator): Report errors in a few
15914         places where we had to.
15915
15916         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15917
15918 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15919
15920         * expression.cs: Use StoreFromPtr instead of extracting the type
15921         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15922
15923         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15924         an enumeration value to a System.Enum, but System.Enum is not a
15925         value type, but an class type, so we need to box.
15926
15927         (Expression.ConvertExplicit): One codepath could return
15928         errors but not flag them.  Fix this.  Fixes #31853
15929
15930         * parameter.cs (Resolve): Do not allow void as a parameter type.
15931
15932 2002-10-06  Martin Baulig  <martin@gnome.org>
15933
15934         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15935         if it's a class type and not a struct.  Fixes #31815.
15936
15937 2002-10-06  Martin Baulig  <martin@gnome.org>
15938
15939         * statement.cs: Reworked the flow analysis code a bit to make it
15940         usable for dead code elimination.
15941
15942 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15943
15944         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15945
15946 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15947
15948         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15949         to fix the test 165, will investigate deeper.
15950
15951 2002-10-04  Martin Baulig  <martin@gnome.org>
15952
15953         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15954         finally blocks actually work.
15955         (Try.Resolve): We don't need to create a sibling for `finally' if
15956         there is no finally block.
15957
15958 2002-10-04  Martin Baulig  <martin@gnome.org>
15959
15960         * class.cs (Constructor.Define): The default accessibility for a
15961         non-default constructor is private, not public.
15962
15963 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15964
15965         * class.cs (Constructor): Make AllowedModifiers public, add
15966         EXTERN.
15967
15968         * cs-parser.jay: Perform the modifiers test here, as the
15969         constructor for the Constructor class usually receives a zero
15970         because of the way we create it (first we create, later we
15971         customize, and we were never checking the modifiers).
15972
15973         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15974         is a version of LookupTypeReflection that includes the type-name
15975         cache.  This can be used as a fast path for functions that know
15976         the fully qualified name and are only calling into *.GetType() to
15977         obtain a composed type.
15978
15979         This is also used by TypeManager.LookupType during its type
15980         composition.
15981
15982         (LookupType): We now also track the real type name, as sometimes
15983         we can get a quey for the real type name from things like
15984         ComposedCast.  This fixes bug 31422.
15985
15986         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15987         complete type fullname, it does not have to go through the type
15988         resolution system to obtain the composed version of the type (for
15989         obtaining arrays or pointers).
15990
15991         (Conditional.Emit): Use the EmitBoolExpression to
15992         generate nicer code, as requested by Paolo.
15993
15994         (ArrayCreation.CheckIndices): Use the patch from
15995         hwang_rob@yahoo.ca to validate the array initializers. 
15996
15997 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15998
15999         * class.cs (ConstructorInitializer.Emit): simplify code by using
16000         Invocation.EmitCall, and at the same time, fix the bugs in calling
16001         parent constructors that took variable arguments. 
16002
16003         * ecore.cs (Expression.ConvertNumericExplicit,
16004         Expression.ImplicitNumericConversion): Remove the code that
16005         manually wrapped decimal (InternalTypeConstructor call is now gone
16006         as well).
16007
16008         * expression.cs (Cast.TryReduce): Also handle decimal types when
16009         trying to perform a constant fold on the type.
16010
16011         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16012
16013         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16014         that only turned off an error report, and did nothing else. 
16015
16016 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16017
16018         * driver.cs: Handle and ignore /fullpaths
16019
16020 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16021
16022         * expression.cs (Binary.ResolveOperator): Catch the case where
16023         DoNumericPromotions returns true, 
16024
16025         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16026
16027 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16030         report error 70.
16031
16032 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16035         conversion exists, but it is also required that the conversion be
16036         performed.  This manifested in "(Type64Enum) 2".  
16037
16038         * class.cs (TypeManager.AddMethod): The fix is not to change
16039         AddEnum, because that one was using a fully qualified name (every
16040         DeclSpace derivative does), but to change the AddMethod routine
16041         that was using an un-namespaced name.  This now correctly reports
16042         the duplicated name.
16043
16044         Revert patch until I can properly fix it.  The issue
16045         is that we have a shared Type space across all namespaces
16046         currently, which is wrong.
16047
16048         Options include making the Namespace a DeclSpace, and merge
16049         current_namespace/current_container in the parser.
16050
16051 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * cs-parser.jay: Improve error reporting when we get a different
16054         kind of expression in local_variable_type and
16055         local_variable_pointer_type. 
16056
16057         Propagate this to avoid missleading errors being reported.
16058
16059         * ecore.cs (ImplicitReferenceConversion): treat
16060         TypeManager.value_type as a target just like object_type.   As
16061         code like this:
16062
16063         ValueType v = 1;
16064
16065         Is valid, and needs to result in the int 1 being boxed before it
16066         is assigned to the value type v.
16067
16068         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16069         to validate the enumeration name.
16070
16071         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16072         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16073         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16074
16075         * ecore.cs (TryImplicitIntConversion): When doing an
16076         implicit-enumeration-conversion, check if the type is 64-bits and
16077         perform a conversion before passing to EnumConstant.
16078
16079 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16080
16081         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16082         report ambiguous type references.  Unlike the MS version, we
16083         report what the ambiguity is.   Innovation at work ;-)
16084
16085         (DeclSpace.FindType): Require a location argument to
16086         display when we display an ambiguous error.
16087
16088         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16089
16090         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16091
16092         * expression.cs (EmitDynamicInitializers): Apply patch from
16093         hwang_rob@yahoo.ca that fixes the order in which we emit our
16094         initializers. 
16095
16096 2002-09-21  Martin Baulig  <martin@gnome.org>
16097
16098         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16099         delegate takes no arguments.
16100
16101 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16102
16103         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16104         from integers.
16105
16106         * expression.cs: Extract the underlying type.
16107
16108         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16109
16110         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16111
16112 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16113
16114         * class.cs (TypeContainer.DefineType): We can not use the nice
16115         PackingSize with the size set to 1 DefineType method, because it
16116         will not allow us to define the interfaces that the struct
16117         implements.
16118
16119         This completes the fixing of bug 27287
16120
16121         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16122         means also structs.  This fixes part of the problem. 
16123         (Expresion.ImplicitReferenceConversionExists): ditto.
16124
16125         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16126         error if there were no errors reported during the type lookup
16127         process, to avoid duplicates or redundant errors.  Without this
16128         you would get an ambiguous errors plus a type not found.  We have
16129         beaten the user enough with the first error.  
16130
16131         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16132         reference. 
16133
16134         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16135         during the resolution process, stop the lookup, this avoids
16136         repeated error reports (same error twice).
16137
16138         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16139
16140         * typemanager.cs (LookupType): Redo the type lookup code to match
16141         the needs of System.Reflection.  
16142
16143         The issue is that System.Reflection requires references to nested
16144         types to begin with a "+" sign instead of a dot.  So toplevel
16145         types look like: "NameSpace.TopLevelClass", and nested ones look
16146         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16147         levels. 
16148
16149 2002-09-19  Martin Baulig  <martin@gnome.org>
16150
16151         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16152         says that a method always returns or always throws an exception,
16153         don't report the CS0161.
16154
16155         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16156         set `Returns = new_returns'.
16157
16158 2002-09-19  Martin Baulig  <martin@gnome.org>
16159
16160         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16161         to an enum constant, check for a CS0176.
16162
16163 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16164
16165         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16166         for operators that must be in pairs and report errors.
16167
16168         * ecore.cs (SimpleName.DoResolveType): During the initial type
16169         resolution process, when we define types recursively, we must
16170         check first for types in our current scope before we perform
16171         lookups in the enclosing scopes.
16172
16173         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16174
16175         (Invocation.VerifyArgumentsCompat): Call
16176         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16177         I thought we were supposed to always call this, but there are a
16178         few places in the code where we dont do it.
16179
16180 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16181
16182         * driver.cs: Add support in -linkres and -resource to specify the
16183         name of the identifier.
16184
16185 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16186
16187         * ecore.cs (StandardConversionExists): Sync with the conversion
16188         code: allow anything-* to void* conversions.
16189
16190         (FindMostSpecificSource): Use an Expression argument
16191         instead of a Type, because we might be handed over a Literal which
16192         gets a few more implicit conversions that plain types do not.  So
16193         this information was being lost.
16194
16195         Also, we drop the temporary type-holder expression when not
16196         required.
16197
16198 2002-09-17  Martin Baulig  <martin@gnome.org>
16199
16200         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16201         this is an explicit interface implementation.
16202
16203 2002-09-17  Martin Baulig  <martin@gnome.org>
16204
16205         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16206         different `IndexerName' attributes.
16207
16208         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16209         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16210         virtual CommonResolve().
16211
16212 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16213
16214         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16215         and convert that to the UnderlyingType.
16216
16217         * statement.cs (Foreach.Resolve): Indexers are just like variables
16218         or PropertyAccesses.
16219
16220         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16221         inside quoted strings, we were not doing this before.
16222
16223 2002-09-16  Martin Baulig  <martin@gnome.org>
16224
16225         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16226         resolve it.  This is needed for the definite assignment check of the
16227         instance expression, fixes bug #29846.
16228         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16229
16230 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16231
16232         * parameter.cs: Fix compile error.  Cannot reference static member
16233         from an instance object.  Is this an mcs bug?
16234
16235 2002-09-14  Martin Baulig  <martin@gnome.org>
16236
16237         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16238         multiple times.  Fixes bug #30295, added test-166.cs.
16239
16240 2002-09-14  Martin Baulig  <martin@gnome.org>
16241
16242         * statement.cs (Block.Emit): Don't emit unreachable code.
16243         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16244         `break' statements.
16245         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16246
16247 2002-09-14  Martin Baulig  <martin@gnome.org>
16248
16249         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16250         is set.
16251
16252 2002-09-14  Martin Baulig  <martin@gnome.org>
16253
16254         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16255         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16256         be false on the ms runtime.
16257
16258 2002-09-13  Martin Baulig  <martin@gnome.org>
16259
16260         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16261         the CS0038 error message.
16262
16263 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16266         constant inside, return it.
16267
16268 2002-09-12  Martin Baulig  <martin@gnome.org>
16269
16270         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16271         implicit conversion can be done between enum types.
16272
16273         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16274         check whether an implicit conversion to the current enum's UnderlyingType
16275         exists and report an error if not.
16276
16277         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16278         without debugging support.
16279
16280         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16281         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16282
16283 2002-09-12  Martin Baulig  <martin@gnome.org>
16284
16285         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16286
16287         * ecore.cs (IMemberExpr.DeclaringType): New property.
16288         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16289         nonstatic member of an outer type (CS0038).
16290
16291 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16292
16293         * driver.cs: Activate the using-error detector at warning level
16294         4 (at least for MS-compatible APIs).
16295
16296         * namespace.cs (VerifyUsing): Small buglett fix.
16297
16298         * pending.cs (PendingImplementation): pass the container pointer. 
16299
16300         * interface.cs (GetMethods): Allow for recursive definition.  Long
16301         term, I would like to move every type to support recursive
16302         definitions, not the current ordering mechanism that we have right
16303         now.
16304
16305         The situation is this: Attributes are handled before interfaces,
16306         so we can apply attributes to interfaces.  But some attributes
16307         implement interfaces, we will now handle the simple cases
16308         (recursive definitions will just get an error).  
16309
16310         * parameter.cs: Only invalidate types at the end if we fail to
16311         lookup all types.  
16312
16313 2002-09-09  Martin Baulig  <martin@gnome.org>
16314
16315         * ecore.cs (PropertyExpr.Emit): Also check for
16316         TypeManager.system_int_array_get_length so this'll also work when
16317         compiling corlib.  Fixes #30003.
16318
16319 2002-09-09  Martin Baulig  <martin@gnome.org>
16320
16321         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16322         and throw an exception if we can't get the type's size.  Fixed #30040,
16323         added test-165.cs.
16324
16325 2002-09-09  Martin Baulig  <martin@gnome.org>
16326
16327         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16328
16329         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16330         context.  Fixes bug #30027.
16331
16332         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16333         virtual functions.  Fixes bug #30043, added test-164.cs.
16334
16335 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16336
16337         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16338
16339 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16340
16341         * driver.cs: Use an object to get the windows codepage since it's not a
16342         static property.
16343
16344 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16345
16346         * statement.cs (For.Emit): for infinite loops (test == null)
16347         return whether there is a break inside, not always "true".
16348
16349         * namespace.cs (UsingEntry): New struct to hold the name of the
16350         using definition, the location where it is defined, and whether it
16351         has been used in a successful type lookup.
16352
16353         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16354         strings.
16355
16356         * decl.cs: ditto.
16357
16358 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16359
16360         * attribute.cs : Fix incorrect code which relied on catching
16361         a NullReferenceException to detect a null being passed in
16362         where an object was expected.
16363
16364 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16365
16366         * statement.cs (Try): flag the catch variable as assigned
16367
16368         * expression.cs (Cast): Simplified by using ResolveType instead of
16369         manually resolving.
16370
16371         * statement.cs (Catch): Fix bug by using ResolveType.
16372
16373 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16374
16375         * expression.cs (BetterConversion): Special case for when we have
16376         a NullLiteral as the argument and we have to choose between string
16377         and object types - we choose string the way csc does.
16378
16379         * attribute.cs (Attribute.Resolve): Catch the
16380         NullReferenceException and report error #182 since the Mono
16381         runtime no more has the bug and having this exception raised means
16382         we tried to select a constructor which takes an object and is
16383         passed a null.
16384
16385 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16386
16387         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16388         message (1502, 1503) when we can't locate a method after overload
16389         resolution. This is much more informative and closes the bug
16390         Miguel reported.
16391
16392         * interface.cs (PopulateMethod): Return if there are no argument
16393         types. Fixes a NullReferenceException bug.
16394
16395         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16396         expressions too. Previously we were checking only in one place for
16397         positional arguments leaving out named arguments.
16398
16399         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16400         type to the enum type is not allowed. Remove code corresponding to
16401         that.
16402
16403         (ConvertNumericExplicit): Allow explicit conversions from
16404         the underlying type to enum type. This precisely follows the spec
16405         and closes a bug filed by Gonzalo.
16406
16407 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16408
16409         * compiler.csproj:
16410         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16411
16412 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16413
16414         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16415         it was important that we stored the right value after the
16416         reduction in `converted'.
16417
16418 2002-09-04  Martin Baulig  <martin@gnome.org>
16419
16420         * location.cs (Location.SymbolDocument): Use full pathnames for the
16421         source files.
16422
16423 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16426         of the expression resolve mechanism, because that will catch the
16427         SimpleName error failures.
16428
16429         (Conditional): If we can not resolve the
16430         expression, return, do not crash.
16431
16432 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16433
16434         * cs-tokenizer.cs:
16435         (location): display token name instead of its number.
16436
16437 2002-08-28  Martin Baulig  <martin@gnome.org>
16438
16439         * expression.cs (Binary.ResolveOperator): Don't silently return
16440         but return an error if an operator cannot be applied between two
16441         enum types.
16442
16443 2002-08-28  Martin Baulig  <martin@gnome.org>
16444
16445         * class.cs (Constructor.Define): Set the permission attributes
16446         correctly instead of making all constructors public.
16447
16448 2002-08-28  Martin Baulig  <martin@gnome.org>
16449
16450         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16451         for private members before reporting a CS0103; if we find anything,
16452         it's a CS0122.
16453
16454 2002-08-28  Martin Baulig  <martin@gnome.org>
16455
16456         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16457         to check whether `closure_start_type == closure_invocation_type',
16458         we also need to check whether `m.DeclaringType == closure_invocation_type'
16459         before bypassing the permission checks.  We might be accessing
16460         protected/private members from the base class.
16461         (TypeManager.RealMemberLookup): Only set private_ok if private
16462         members were requested via BindingFlags.NonPublic.
16463
16464         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16465
16466         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16467         MethodGroupExpr.IsExplicitImpl if appropriate.
16468         (Invocation.DoResolve): Don't report the CS0120 for explicit
16469         interface implementations.
16470
16471 2002-08-27  Martin Baulig  <martin@gnome.org>
16472
16473         * expression.cs (Invocation.DoResolve): If this is a static
16474         method and we don't have an InstanceExpression, we must report
16475         a CS0120.
16476
16477 2002-08-25  Martin Baulig  <martin@gnome.org>
16478
16479         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16480         `==' between a valuetype and an object.
16481
16482 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16483
16484         * ecore.cs (TypeExpr): Provide a ToString method.
16485
16486 2002-08-24  Martin Baulig  <martin@gnome.org>
16487
16488         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16489         now called proggie.dbg and it's a binary file.
16490
16491 2002-08-23  Martin Baulig  <martin@gnome.org>
16492
16493         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16494
16495 2002-08-23  Martin Baulig  <martin@gnome.org>
16496
16497         * struct.cs (MyStructInfo.ctor): Make this work with empty
16498         structs; it's not allowed to use foreach() on null.
16499
16500 2002-08-23  Martin Baulig  <martin@gnome.org>
16501
16502         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16503         writer the full pathname of the generated assembly.
16504
16505 2002-08-23  Martin Baulig  <martin@gnome.org>
16506
16507         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16508         A `finally' block never returns or breaks; improved handling of
16509         unreachable code.
16510
16511 2002-08-23  Martin Baulig  <martin@gnome.org>
16512
16513         * statement.cs (Throw.Resolve): Allow `throw null'.
16514
16515 2002-08-23  Martin Baulig  <martin@gnome.org>
16516
16517         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16518         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16519         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16520         MemberLookup would return a wrong event if this is an explicit
16521         interface implementation and the class has an event with the same
16522         name.
16523
16524 2002-08-23  Martin Baulig  <martin@gnome.org>
16525
16526         * statement.cs (Block.AddChildVariableNames): New public method.
16527         (Block.AddChildVariableName): Likewise.
16528         (Block.IsVariableNameUsedInChildBlock): Likewise.
16529         (Block.AddVariable): Check whether a variable name has already
16530         been used in a child block.
16531
16532         * cs-parser.jay (declare_local_variables): Mark all variable names
16533         from the current block as being used in a child block in the
16534         implicit block.
16535
16536 2002-08-23  Martin Baulig  <martin@gnome.org>
16537
16538         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16539         find the symbol writer.
16540
16541         * driver.cs: csc also allows the arguments to /define being
16542         separated by commas, not only by semicolons.
16543
16544 2002-08-23  Martin Baulig  <martin@gnome.org>
16545
16546         * interface.cs (Interface.GetMembers): Added static check for events.
16547
16548 2002-08-15  Martin Baulig  <martin@gnome.org>
16549
16550         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16551         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16552
16553         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16554         why the MethodData.EmitDestructor() change was necessary.
16555
16556 2002-08-20  Martin Baulig  <martin@gnome.org>
16557
16558         * class.cs (TypeContainer.FindMembers): Added static check for events.
16559
16560         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16561
16562         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16563         use Type.GetEvents(), not Type.FindMembers().
16564
16565 2002-08-20  Martin Baulig  <martin@gnome.org>
16566
16567         * decl.cs (MemberCache): Added a special method cache which will
16568         be used for method-only searched.  This ensures that a method
16569         search will return a MethodInfo with the correct ReflectedType for
16570         inherited methods.      
16571
16572 2002-08-20  Martin Baulig  <martin@gnome.org>
16573
16574         * decl.cs (DeclSpace.FindMembers): Made this public.
16575
16576 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16577
16578         * delegate.cs: fixed build on windows.
16579         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16580
16581 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16582
16583         * ecore.cs (StandardConversionExists): Return a false
16584         if we are trying to convert the void type to anything else
16585         since that is not allowed.
16586
16587         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16588         we flag error 70 in the event an event is trying to be accessed
16589         directly from outside the declaring type.
16590
16591 2002-08-20  Martin Baulig  <martin@gnome.org>
16592
16593         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16594         MemberCache from typemanager.cs to decl.cs.
16595
16596 2002-08-19  Martin Baulig  <martin@gnome.org>
16597
16598         * class.cs (TypeContainer): Implement IMemberContainer.
16599         (TypeContainer.DefineMembers): Create the MemberCache.
16600         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16601         return public members if BindingFlags.Public was given, check
16602         whether members are static.
16603
16604 2002-08-16  Martin Baulig  <martin@gnome.org>
16605
16606         * decl.cs (DeclSpace.Define): Splitted this in Define and
16607         DefineMembers.  DefineMembers is called first and initializes the
16608         MemberCache.
16609
16610         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16611         DefineMembers() on all our DeclSpaces.
16612
16613         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16614         but call DefineMembers() on all nested interfaces.  We call their
16615         Define() in our new Define() function.
16616
16617         * interface.cs (Interface): Implement IMemberContainer.
16618         (Interface.Define): Moved all code except the attribute stuf to
16619         DefineMembers().
16620         (Interface.DefineMembers): Initialize the member cache.
16621
16622         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16623         need this anymore since we can use MemberCache.FindMembers directly.
16624
16625 2002-08-19  Martin Baulig  <martin@gnome.org>
16626
16627         * typemanager.cs (MemberCache): When creating the cache for an
16628         interface type, add all inherited members.
16629         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16630         to `out bool used_cache' and documented it.
16631         (TypeManager.MemberLookup): If we already used the cache in the first
16632         iteration, we don't need to do the interfaces check.
16633
16634 2002-08-19  Martin Baulig  <martin@gnome.org>
16635
16636         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16637         here from IMemberFinder and don't implement this interface anymore.
16638         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16639
16640         * typemanager.cs (IMemberFinder): This interface is now only used by
16641         classes which actually support the member cache.
16642         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16643         since we only put DeclSpaces into this Hashtable.
16644         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16645         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16646
16647 2002-08-16  Martin Baulig  <martin@gnome.org>
16648
16649         * typemanager.cs (ICachingMemberFinder): Removed.
16650         (IMemberFinder.MemberCache): New property.
16651         (TypeManager.FindMembers): Merged this with RealFindMembers().
16652         This function will never be called from TypeManager.MemberLookup()
16653         so we can't use the cache here, just the IMemberFinder.
16654         (TypeManager.MemberLookup_FindMembers): Check whether the
16655         IMemberFinder has a MemberCache and call the cache's FindMembers
16656         function.
16657         (MemberCache): Rewrote larger parts of this yet another time and
16658         cleaned it up a bit.
16659
16660 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16661
16662         * driver.cs (LoadArgs): Support quoting.
16663
16664         (Usage): Show the CSC-like command line arguments.
16665
16666         Improved a few error messages.
16667
16668 2002-08-15  Martin Baulig  <martin@gnome.org>
16669
16670         * typemanager.cs (IMemberContainer.Type): New property.
16671         (IMemberContainer.IsInterface): New property.
16672
16673         The following changes are conditional to BROKEN_RUNTIME, which is
16674         defined at the top of the file.
16675
16676         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16677         class'es members, but add all members from TypeHandle.ObjectType
16678         if we're an interface.
16679         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16680         is the current type.
16681         (MemberCache.CacheEntry.Container): Removed this field.
16682         (TypeHandle.GetMembers): Include inherited members.
16683
16684 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16685
16686         * typemanager.cs: fixed compilation and added a comment on a field that
16687         is never used.
16688
16689 2002-08-15  Martin Baulig  <martin@gnome.org>
16690
16691         * class.cs (ConstructorInitializer.Resolve): In the
16692         Expression.MemberLookup call, use the queried_type as
16693         invocation_type.
16694
16695         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16696         declared' attribute, it's always true.
16697         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16698         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16699         temporary wrapper for FindMembers which tells MemberLookup whether
16700         members from the base classes are included in the return value.
16701         This will go away soon.
16702         (TypeManager.MemberLookup): Use this temporary hack here; once the
16703         new MemberCache is completed, we don't need to do the DeclaredOnly
16704         looping here anymore since the MemberCache will take care of this.
16705         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16706         (MemberCache): When creating the MemberCache for a class, get
16707         members from the current class and all its base classes.
16708         (MemberCache.CacheEntry.Container): New field.  This is a
16709         temporary hack until the Mono runtime is fixed to distinguish
16710         between ReflectedType and DeclaringType.  It allows us to use MCS
16711         with both the MS runtime and the unfixed Mono runtime without
16712         problems and without accecting performance.
16713         (MemberCache.SearchMembers): The DeclaredOnly looping from
16714         TypeManager.MemberLookup is now done here.      
16715
16716 2002-08-14  Martin Baulig  <martin@gnome.org>
16717
16718         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16719         Type.GetFields on dynamic types but get the fields from the
16720         corresponding TypeContainer.
16721         (MyStructInfo.GetStructInfo): Added check for enum types.
16722
16723         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16724         (MemberList.SyncRoot): Implemented.
16725         (TypeManager.FilterWithClosure): No need to check permissions if
16726         closure_start_type == closure_invocation_type, don't crash if
16727         closure_invocation_type is null.
16728
16729 2002-08-13  Martin Baulig  <martin@gnome.org>
16730
16731         Rewrote TypeContainer.FindMembers to use a member cache.  This
16732         gives us a speed increase of about 35% for the self-hosting MCS
16733         build and of about 15-20% for the class libs (both on GNU/Linux).
16734
16735         * report.cs (Timer): New class to get enhanced profiling.  This
16736         whole class is "TIMER" conditional since it remarkably slows down
16737         compilation speed.
16738
16739         * class.cs (MemberList): New class.  This is an IList wrapper
16740         which we're now using instead of passing MemberInfo[]'s around to
16741         avoid copying this array unnecessarily.
16742         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16743         (ICachingMemberFinder, IMemberContainer): New interface.
16744         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16745         has already been checked, otherwise use it for the name comparision.
16746         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16747         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16748         if possible.  Returns a MemberList, not a MemberInfo [].
16749         (TypeHandle): New class, implements IMemberContainer.  We create
16750         one instance of this class per type, it contains a MemberCache
16751         which is used to do the member lookups.
16752         (MemberCache): New class.  Each instance of this class contains
16753         all members of a type and a name-based hash table.
16754         (MemberCache.FindMembers): This is our new member lookup
16755         function.  First, it looks up all members of the requested name in
16756         the hash table.  Then, it walks this list and sorts out all
16757         applicable members and returns them.
16758
16759 2002-08-13  Martin Baulig  <martin@gnome.org>
16760
16761         In addition to a nice code cleanup, this gives us a performance
16762         increase of about 1.4% on GNU/Linux - not much, but it's already
16763         half a second for the self-hosting MCS compilation.
16764
16765         * typemanager.cs (IMemberFinder): New interface.  It is used by
16766         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16767         Enum, Delegate or Interface.
16768         (TypeManager.finder_to_member_finder): New PtrHashtable.
16769         (TypeManager.finder_to_container): Removed.
16770         (TypeManager.finder_to_delegate): Removed.
16771         (TypeManager.finder_to_interface): Removed.
16772         (TypeManager.finder_to_enum): Removed.
16773
16774         * interface.cs (Interface): Implement IMemberFinder.
16775
16776         * delegate.cs (Delegate): Implement IMemberFinder.
16777
16778         * enum.cs (Enum): Implement IMemberFinder.
16779
16780         * class.cs (TypeContainer): Implement IMemberFinder.
16781
16782 2002-08-12  Martin Baulig  <martin@gnome.org>
16783
16784         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16785
16786 2002-08-12  Martin Baulig  <martin@gnome.org>
16787
16788         * ecore.cs (ITypeExpression): New interface for expressions which
16789         resolve to a type.
16790         (TypeExpression): Renamed to TypeLookupExpression.
16791         (Expression.DoResolve): If we're doing a types-only lookup, the
16792         expression must implement the ITypeExpression interface and we
16793         call DoResolveType() on it.
16794         (SimpleName): Implement the new ITypeExpression interface.
16795         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16796         hack, the situation that we're only looking up types can't happen
16797         anymore when this method is called.  Moved the type lookup code to
16798         DoResolveType() and call it.
16799         (SimpleName.DoResolveType): This ITypeExpression interface method
16800         is now doing the types-only lookup.
16801         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16802         (ResolveFlags): Added MaskExprClass.
16803
16804         * expression.cs (MemberAccess): Implement the ITypeExpression
16805         interface.
16806         (MemberAccess.DoResolve): Added support for a types-only lookup
16807         when we're called via ITypeExpression.DoResolveType().
16808         (ComposedCast): Implement the ITypeExpression interface.
16809
16810         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16811         Expression.Resolve() with ResolveFlags.Type instead.
16812
16813 2002-08-12  Martin Baulig  <martin@gnome.org>
16814
16815         * interface.cs (Interface.Define): Apply attributes.
16816
16817         * attribute.cs (Attribute.ApplyAttributes): Added support for
16818         interface attributes.
16819
16820 2002-08-11  Martin Baulig  <martin@gnome.org>
16821
16822         * statement.cs (Block.Emit): Only check the "this" variable if we
16823         do not always throw an exception.
16824
16825         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16826         whether the property has a set accessor.
16827
16828 2002-08-11  Martin Baulig  <martin@gnome.org>
16829
16830         Added control flow analysis support for structs.
16831
16832         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16833         with control flow analysis turned off.
16834         (IVariable): New interface.
16835         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16836         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16837         (FieldExpr.DoResolve): Resolve the instance expression with flow
16838         analysis turned off and do the definite assignment check after the
16839         resolving when we know what the expression will resolve to.
16840
16841         * expression.cs (LocalVariableReference, ParameterReference):
16842         Implement the new IVariable interface, only call the flow analysis
16843         code if ec.DoFlowAnalysis is true.
16844         (This): Added constructor which takes a Block argument.  Implement
16845         the new IVariable interface.
16846         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16847         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16848         This does the definite assignment checks for struct members.
16849
16850         * class.cs (Constructor.Emit): If this is a non-static `struct'
16851         constructor which doesn't have any initializer, call
16852         Block.AddThisVariable() to tell the flow analysis code that all
16853         struct elements must be initialized before control returns from
16854         the constructor.
16855
16856         * statement.cs (MyStructInfo): New public class.
16857         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16858         argument to this indexer.  If non-zero, check an individual struct
16859         member, not the whole struct.
16860         (FlowBranching.CheckOutParameters): Check struct members.
16861         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16862         overloaded versions of these methods which take an additional
16863         `int field_idx' argument to check struct members.
16864         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16865         overloaded versions of these methods which take an additional
16866         `string field_name' argument to check struct member.s
16867         (VariableInfo): Implement the IVariable interface.
16868         (VariableInfo.StructInfo): New public property.  Returns the
16869         MyStructInfo instance of the variable if it's a struct or null.
16870         (Block.AddThisVariable): New public method.  This is called from
16871         Constructor.Emit() for non-static `struct' constructor which do
16872         not have any initializer.  It creates a special variable for the
16873         "this" instance variable which will be checked by the flow
16874         analysis code to ensure that all of the struct's fields are
16875         initialized before control returns from the constructor.
16876         (UsageVector): Added support for struct members.  If a
16877         variable/parameter is a struct with N members, we reserve a slot
16878         in the usage vector for each member.  A struct is considered fully
16879         initialized if either the struct itself (slot 0) or all its
16880         members are initialized.
16881
16882 2002-08-08  Martin Baulig  <martin@gnome.org>
16883
16884         * driver.cs (Driver.MainDriver): Only report an error CS5001
16885         if there were no compilation errors.
16886
16887         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16888         `UnsafeContext' property to determine whether the parent is in
16889         unsafe context rather than checking the parent's ModFlags:
16890         classes nested in an unsafe class are unsafe as well.
16891
16892 2002-08-08  Martin Baulig  <martin@gnome.org>
16893
16894         * statement.cs (UsageVector.MergeChildren): Distinguish between
16895         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16896         we return.  Added test17() and test18() to test-154.cs.
16897
16898 2002-08-08  Martin Baulig  <martin@gnome.org>
16899
16900         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16901         Family access, make sure the invoking type isn't a subclass of the
16902         queried type (that'd be a CS1540).
16903
16904         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16905         this method which takes an additional `Type invocation_type'.
16906
16907         * expression.cs (BaseAccess.DoResolve): Use the base type as
16908         invocation and query type.
16909         (MemberAccess.DoResolve): If the lookup failed and we're about to
16910         report a CS0122, try a lookup with the ec.ContainerType - if this
16911         succeeds, we must report a CS1540.
16912
16913 2002-08-08  Martin Baulig  <martin@gnome.org>
16914
16915         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16916         (MethodGroupExpr): Implement the IMemberExpr interface.
16917
16918         * expression (MemberAccess.ResolveMemberAccess): No need to have
16919         any special code for MethodGroupExprs anymore, they're now
16920         IMemberExprs.   
16921
16922 2002-08-08  Martin Baulig  <martin@gnome.org>
16923
16924         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16925         Family, FamANDAssem and FamORAssem permissions.
16926         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16927
16928 2002-08-08  Martin Baulig  <martin@gnome.org>
16929
16930         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16931         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16932         or loop block.
16933
16934 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16935
16936         * driver.cs: implemented /resource option to embed managed resources.
16937
16938 2002-08-07  Martin Baulig  <martin@gnome.org>
16939
16940         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16941         (FieldBase.HasFieldInitializer): New public property.
16942         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16943         returns the field initializer and makes sure it is only resolved once.
16944         (TypeContainer.EmitFieldInitializers): Call
16945         FieldBase.GetInitializerExpression to get the initializer, this ensures
16946         that it isn't resolved multiple times.
16947
16948         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16949         the resolving process (SimpleName/MemberLookup) that we're currently
16950         emitting a field initializer (which must not access any instance members,
16951         this is an error CS0236).
16952
16953         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16954         argument, if the `IsFieldInitializer' flag is set, we must report and
16955         error CS0236 and not an error CS0120.   
16956
16957 2002-08-07  Martin Baulig  <martin@gnome.org>
16958
16959         * ecore.cs (IMemberExpr): New public interface.
16960         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16961         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16962         if the expression is an IMemberExpr.
16963
16964         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16965         to be null, implicitly default to `this' if we're non-static in
16966         this case.  Simplified the code a lot by using the new IMemberExpr
16967         interface.  Also fixed bug #28176 here.
16968
16969 2002-08-06  Martin Baulig  <martin@gnome.org>
16970
16971         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16972         ParameterReferences during semantic analysis so that we can do a
16973         type-only search when resolving Cast, TypeOf and SizeOf.
16974         (block): Pass the `current_local_parameters' to the Block's
16975         constructor.
16976
16977         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16978         argument to the constructor.
16979         (ConstructorInitializer.Resolve): Create a temporary implicit
16980         block with the parameters.
16981
16982         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16983         references here if we aren't doing a type-only search.
16984
16985         * statement.cs (Block): Added constructor which takes a
16986         `Parameters parameters' argument.
16987         (Block.Parameters): New public property.
16988
16989         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16990         to `Parameters' and made it public readonly.
16991
16992 2002-08-06  Martin Baulig  <martin@gnome.org>
16993
16994         * ecore.cs (Expression.Warning): Made this public as well.
16995
16996         * report.cs (Report.Debug): Print the contents of collections.
16997
16998 2002-08-06  Martin Baulig  <martin@gnome.org>
16999
17000         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17001         used to tell Resolve() which kinds of expressions it may return.
17002         (Expression.Resolve): Added overloaded version of this method which
17003         takes a `ResolveFlags flags' argument.  This can be used to tell
17004         Resolve() which kinds of expressions it may return.  Reports a
17005         CS0118 on error.
17006         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17007         ResolveFlags.SimpleName.
17008         (Expression.Error118): Added overloaded version of this method which
17009         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17010         which kinds of expressions are allowed.
17011
17012         * expression.cs (Argument.ResolveMethodGroup): New public method.
17013         Resolves an argument, but allows a MethodGroup to be returned.
17014         This is used when invoking a delegate.
17015
17016         * TODO: Updated a bit.
17017
17018 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17019
17020         Fixed compilation with csc.
17021
17022         * ecore.cs: Expression.Error made public. Is this correct? Should
17023         Warning be made public too?
17024
17025         * expression.cs: use ea.Location instead of ea.loc.
17026         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17027
17028 2002-08-06  Martin Baulig  <martin@gnome.org>
17029
17030         * ecore.cs (Expression.loc): Moved the location here instead of
17031         duplicating it in all derived classes.
17032         (Expression.Location): New public property.
17033         (Expression.Error, Expression.Warning): Made them non-static and
17034         removed the location argument.
17035         (Expression.Warning): Added overloaded version which takes an
17036         `int level' argument.
17037         (Expression.Error118): Make this non-static and removed the
17038         expression and location arguments.
17039         (TypeExpr): Added location argument to the constructor.
17040
17041         * expression.cs (StaticCallExpr): Added location argument to
17042         the constructor.
17043         (Indirection, PointerArithmetic): Likewise.
17044         (CheckedExpr, UnCheckedExpr): Likewise.
17045         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17046         (StringPtr): Likewise.
17047
17048
17049 2002-08-05  Martin Baulig  <martin@gnome.org>
17050
17051         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17052
17053         * assign.cs (Assign.DoResolve): Check whether the source
17054         expression is a value or variable.
17055
17056         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17057         while resolving the corresponding blocks.
17058
17059         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17060         an error, don't silently return null.
17061
17062         * statement.cs (Block.AddVariable): Do the error reporting here
17063         and distinguish between CS0128 and CS0136.
17064         (Block.DoResolve): Report all unused labels (warning CS0164).
17065         (LabeledStatement): Pass the location to the constructor.
17066         (LabeledStatement.HasBeenReferenced): New property.
17067         (LabeledStatement.Resolve): Set it to true here.
17068
17069         * statement.cs (Return.Emit): Return success even after reporting
17070         a type mismatch error (CS0126 or CS0127), this is what csc does and
17071         it avoids confusing the users with any consecutive errors.
17072
17073 2002-08-05  Martin Baulig  <martin@gnome.org>
17074
17075         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17076
17077         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17078
17079         * expression.cs (MemberAccess.DoResolve): Silently return if an
17080         error has already been reported.
17081
17082         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17083         error has already been reported.
17084
17085 2002-08-05  Martin Baulig  <martin@gnome.org>
17086
17087         * statement.cs (UsageVector): Only initialize the `parameters'
17088         vector if we actually have any "out" parameters.
17089
17090 2002-08-05  Martin Baulig  <martin@gnome.org>
17091
17092         * expression.cs (Binary.ResolveOperator): When combining delegates,
17093         they must have the same type.
17094
17095 2002-08-05  Martin Baulig  <martin@gnome.org>
17096
17097         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17098         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17099         work with the ms runtime and we also don't need it: if we're a
17100         PropertyBuilder and not in the `indexer_arguments' hash, then we
17101         are a property and not an indexer.
17102
17103         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17104         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17105         since the latter one doesn't work with the ms runtime.
17106
17107 2002-08-03  Martin Baulig  <martin@gnome.org>
17108
17109         Fixed bugs #27998 and #22735.
17110
17111         * class.cs (Method.IsOperator): New public field.
17112         (Method.CheckBase): Report CS0111 if there's already a method
17113         with the same parameters in the current class.  Report CS0508 when
17114         attempting to change the return type of an inherited method.
17115         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17116         and it's not marked abstract or extern.
17117         (PropertyBase): New abstract base class for Property and Indexer.
17118         (PropertyBase.CheckBase): Moved here from Property and made it work
17119         for indexers.
17120         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17121         the same so we can reuse it there.
17122         (Property, Indexer): Derive from PropertyBase.
17123         (MethodSignature.inheritable_property_signature_filter): New delegate
17124         to find properties and indexers.
17125
17126         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17127         argument and improved error reporting.
17128
17129         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17130         EmptyReadOnlyParameters and made it a property.
17131
17132         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17133         version of this method which takes a `PropertyInfo indexer'.
17134         (TypeManager.RegisterIndexer): New method.
17135
17136         * class.cs: Added myself as author of this file :-)
17137
17138 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17139
17140         * class.cs: fixed compilation on windoze.
17141
17142 2002-08-03  Martin Baulig  <martin@gnome.org>
17143
17144         * interface.cs (Interface.GetInterfaceBases): Check whether all
17145         base interfaces are at least as accessible than the current one.
17146
17147         * class.cs (TypeContainer.GetClassBases): Check whether base types
17148         are at least as accessible than the current type.
17149         (TypeContainer.AsAccessible): Implemented and made non-static.
17150         (MemberBase.CheckParameters): Report errors if the accessibility
17151         checks fail.
17152
17153         * delegate.cs (Delegate.Delegate): The default visibility is
17154         internal for top-level types and private for nested types.
17155         (Delegate.Define): Report errors if the accessibility checks fail.
17156
17157         * enum.cs (Enum.Enum): The default visibility is internal for
17158         top-level types and private for nested types.
17159         (Enum.DefineType): Compute the correct visibility.
17160
17161         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17162         function which takes a `bool is_toplevel' instead of a TypeContainer.
17163
17164         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17165         builtin type.
17166
17167 2002-08-02  Martin Baulig  <martin@gnome.org>
17168
17169         * expression.cs (LocalVariableReferenc): Added constructor which
17170         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17171         (LocalVariableReference.IsReadOnly): New property.
17172         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17173         variable is readonly, use our own readonly flag to do this; you can
17174         use the new constructor to get a writable reference to a read-only
17175         variable.
17176
17177         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17178         reference to the local variable.
17179
17180 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17181
17182         * rootcontext.cs (ResolveCore): Also include System.Exception
17183
17184         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17185         we reach an EmptyStatement.
17186
17187         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17188         is also fine.
17189
17190         * expression.cs (Binary.ResolveOperator): Check error result in
17191         two places.
17192
17193         use brtrue/brfalse directly and avoid compares to null.
17194
17195 2002-08-02  Martin Baulig  <martin@gnome.org>
17196
17197         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17198         Fixes bug #28407, added test-155.cs.
17199
17200 2002-08-01  Martin Baulig  <martin@gnome.org>
17201
17202         * class.cs (Event.EmitDefaultMethod): Make this work with static
17203         events.  Fixes #28311, added verify-3.cs.
17204
17205 2002-08-01  Martin Baulig  <martin@gnome.org>
17206
17207         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17208         `is_disposable' fields.
17209         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17210         `hm.is_disposable' if we're using the collection pattern.
17211         (Foreach.EmitCollectionForeach): Use the correct type for the
17212         enumerator's local variable, only emit the try/finally block if
17213         necessary (fixes #27713).
17214
17215 2002-08-01  Martin Baulig  <martin@gnome.org>
17216
17217         * ecore.cs (Expression.report118): Renamed to Error118 and made
17218         it public static.
17219
17220         * statement.cs (Throw.Resolve): Check whether the expression is of
17221         the correct type (CS0118) and whether the type derives from
17222         System.Exception (CS0155).
17223         (Catch.Resolve): New method.  Do the type lookup here and check
17224         whether it derives from System.Exception (CS0155).
17225         (Catch.CatchType, Catch.IsGeneral): New public properties.
17226
17227         * typemanager.cs (TypeManager.exception_type): Added.
17228
17229 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17230
17231         * driver.cs: Updated About function.
17232
17233 2002-07-31  Martin Baulig  <martin@gnome.org>
17234
17235         Implemented Control Flow Analysis.
17236
17237         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17238         (EmitContext.CurrentBranching): Added.
17239         (EmitContext.StartFlowBranching): Added.
17240         (EmitContext.EndFlowBranching): Added.
17241         (EmitContext.KillFlowBranching): Added.
17242         (EmitContext.IsVariableAssigned): Added.
17243         (EmitContext.SetVariableAssigned): Added.
17244         (EmitContext.IsParameterAssigned): Added.
17245         (EmitContext.SetParameterAssigned): Added.
17246         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17247         Added control flow analysis stuff here.
17248
17249         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17250         resolve the expression as lvalue.
17251         (LocalVariableReference.DoResolve): Check whether the variable has
17252         already been assigned.
17253         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17254         the parameter as assigned here.
17255         (ParameterReference.DoResolve): Check whether the parameter has already
17256         been assigned.
17257         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17258         expression as lvalue.
17259
17260         * statement.cs (FlowBranching): New class for the flow analysis code.
17261         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17262         (LabeledStatement.IsDefined): New public property.
17263         (LabeledStatement.AddUsageVector): New public method to tell flow
17264         analyis that the label may be reached via a forward jump.
17265         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17266         flow analysis.
17267         (VariableInfo.Number): New public field.  This is used by flow analysis
17268         to number all locals of a block.
17269         (Block.CountVariables): New public property.  This is the number of
17270         local variables in this block (including the locals from all parent
17271         blocks).
17272         (Block.EmitMeta): Number all the variables.
17273
17274         * statement.cs: Added flow analysis support to all classes.
17275
17276 2002-07-31  Martin Baulig  <martin@gnome.org>
17277
17278         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17279         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17280         then use this argument.
17281
17282         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17283
17284         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17285         use this to specify /define options.
17286
17287 2002-07-29  Martin Baulig  <martin@gnome.org>
17288
17289         * statement.cs (Fixed): Moved all code that does variable lookups
17290         and resolvings from Emit to Resolve.
17291
17292         * statement.cs (For): Moved all code that does variable lookups
17293         and resolvings from Emit to Resolve.
17294
17295         * statement.cs (Using): Moved all code that does variable lookups
17296         and resolvings from Emit to Resolve.
17297
17298 2002-07-29  Martin Baulig  <martin@gnome.org>
17299
17300         * attribute.cs (Attribute.Resolve): Explicitly catch a
17301         System.NullReferenceException when creating the
17302         CustromAttributeBuilder and report a different warning message.
17303
17304 2002-07-29  Martin Baulig  <martin@gnome.org>
17305
17306         * support.cs (ParameterData.ParameterName): Added method to
17307         get the name of a parameter.
17308
17309         * typemanager.cs (TypeManager.IsValueType): New public method.
17310
17311 2002-07-29  Martin Baulig  <martin@gnome.org>
17312
17313         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17314         is a flag which specifies that it's either ref or out.
17315         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17316         the out parameter to `out Parameter.Modifier mod', also set the
17317         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17318
17319         * support.cs (InternalParameters.ParameterModifier): Distinguish
17320         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17321         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17322
17323         * expression.cs (Argument.GetParameterModifier): Distinguish
17324         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17325         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17326
17327 2002-07-29  Martin Baulig  <martin@gnome.org>
17328
17329         * expression.cs (ParameterReference.ParameterReference): Added
17330         `Location loc' argument to the constructor.
17331
17332         * cs-parser.jay: Pass location to ParameterReference.
17333
17334 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17335
17336         * statement.cs (Try): Initialize the location.
17337
17338         * cs-parser.jay: pass location to Try.
17339
17340         * expression.cs (Unary.Reduce): Change the prototype to return
17341         whether a constant fold could be performed or not.  The result is
17342         returned in an out parameters.  In the case of Indirection and
17343         AddressOf, we want to perform the full tests.
17344
17345 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17346
17347         * statement.cs (Statement.Emit): Flag dead code.
17348
17349 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17350
17351         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17352
17353 2002-07-27  Martin Baulig  <martin@gnome.org>
17354
17355         * class.cs (MethodData.Define): Put back call to
17356         TypeManager.AddMethod(), accidentally commented this out.
17357
17358         * report.cs (Debug): New public method to print debugging information,
17359         this is `[Conditional ("DEBUG")]'.
17360
17361 2002-07-26  Martin Baulig  <martin@gnome.org>
17362
17363         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17364         (switch_statement): Push the current_block to the switch_stack and
17365         pop it again when we're done with the switch.
17366         (switch_section): The new block is a child of the current_block.
17367         Fixes bug #24007, added test-152.cs.
17368
17369 2002-07-27  Martin Baulig  <martin@gnome.org>
17370
17371         * expression.cs (Invocation.EmitArguments): When calling a varargs
17372         function with only its fixed arguments, we need to pass an empty
17373         array.
17374
17375 2002-07-27  Martin Baulig  <martin@gnome.org>
17376
17377         Mono 0.13 has been released.
17378
17379 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17380
17381         * driver.cs: Rename --resource to --linkres, because that is what
17382         we do currently, we dont support --resource yet.
17383
17384         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17385
17386 2002-07-25  Martin Baulig  <martin@gnome.org>
17387
17388         * class.cs (MethodData): New public class.  This is a `method builder'
17389         class for a method or one accessor of a Property/Indexer/Event.
17390         (MethodData.GetMethodFlags): Moved here from MemberBase.
17391         (MethodData.ApplyAttributes): Likewise.
17392         (MethodData.ApplyObsoleteAttribute): Likewise.
17393         (MethodData.ApplyConditionalAttribute): Likewise.
17394         (MethodData.ApplyDllImportAttribute): Likewise.
17395         (MethodData.CheckAbstractAndExternal): Likewise.
17396         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17397         (MethodData.Emit): Formerly known as Method.Emit().
17398         (MemberBase): Moved everything which was specific to a single
17399         accessor/method to MethodData.
17400         (Method): Create a new MethodData and call Define() and Emit() on it.
17401         (Property, Indexer, Event): Create a new MethodData objects for each
17402         accessor and call Define() and Emit() on them.
17403
17404 2002-07-25  Martin Baulig  <martin@gnome.org>
17405
17406         Made MethodCore derive from MemberBase to reuse the code from there.
17407         MemberBase now also checks for attributes.
17408
17409         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17410         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17411         as virtual.
17412         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17413         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17414         (MemberBase.ApplyAttributes): New virtual method; applies the
17415         attributes to a method or accessor.
17416         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17417         (MemberBase.ApplyConditionalAttribute): Likewise.
17418         (MemberBase.ApplyDllImportAttribute): Likewise.
17419         (MemberBase.CheckAbstractAndExternal): Likewise.
17420         (MethodCore.ParameterTypes): This is now a property instead of a
17421         method, it's initialized from DoDefineParameters().
17422         (MethodCore.ParameterInfo): Removed the set accessor.
17423         (MethodCore.DoDefineParameters): New protected virtual method to
17424         initialize ParameterTypes and ParameterInfo.
17425         (Method.GetReturnType): We can now simply return the MemberType.
17426         (Method.GetMethodFlags): Override the MemberBase version and add
17427         the conditional flags.
17428         (Method.CheckBase): Moved some code from Define() here, call
17429         DoDefineParameters() here.
17430         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17431         here to avoid some larger code duplication.
17432         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17433         ensure that abstract and external accessors don't declare a body.
17434
17435         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17436         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17437         lookup in the attribute's parent classes, so we need to abort as soon
17438         as we found the first match.
17439         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17440         the attribute has no arguments.
17441
17442         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17443         of a Method.
17444
17445 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17446
17447         * cs-parser.jay: reverted previous patch.
17448
17449 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17450
17451         * cs-parser.jay: fixed bug #22119.
17452
17453 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17454
17455         * attribute.cs: fixed compilation. The error was:
17456         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17457         be assigned to before control leaves the current method."
17458         [FIXME:  Filed as bug #28186: MCS must report this error.]
17459
17460 2002-07-25  Martin Baulig  <martin@gnome.org>
17461
17462         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17463         method to pull the condition name ouf of a Conditional attribute.
17464         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17465         the obsolete message and error flag out of an Obsolete attribute.
17466
17467         * class.cs (Method.GetMethodFlags): New public method to get the
17468         TypeManager.MethodFlags for this method.
17469         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17470         private methods.
17471         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17472         if we're overriding a virtual function, set the new private variable
17473         `parent_method'; call the new TypeManager.AddMethod().
17474
17475         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17476         the MethodBuilder and the Method in a PtrHashtable.
17477         (TypeManager.builder_to_method): Added for this purpose.
17478         (TypeManager.MethodFlags): Added IsObsoleteError.
17479         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17480         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17481         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17482         the message from the attribute.
17483
17484 2002-07-24  Martin Baulig  <martin@gnome.org>
17485
17486         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17487         preprocessor directives, ensure that the argument to #define/#undef is
17488         exactly one identifier and that it's actually an identifier.
17489
17490         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17491         did not work ....
17492
17493 2002-07-24  Martin Baulig  <martin@gnome.org>
17494
17495         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17496         initialize it to TypeManager.object_type in the constructor.
17497         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17498         of the `hm.get_current' method if we're using the collection pattern.
17499         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17500         for the explicit conversion to make it work when we're using the collection
17501         pattern and the `Current' property has a different return type than `object'.
17502         Fixes #27713.
17503
17504 2002-07-24  Martin Baulig  <martin@gnome.org>
17505
17506         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17507         does not match, but don't report any errors.  This method is called in
17508         order for all methods in a MethodGroupExpr until a matching method is
17509         found, so we don't want to bail out if the first method doesn't match.
17510         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17511         matches, report the 123.  Fixes #28070.
17512
17513 2002-07-24  Martin Baulig  <martin@gnome.org>
17514
17515         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17516         TypeManager.TypeToCoreType() to the top of the method so the
17517         following equality checks will work.  Fixes #28107.
17518
17519 2002-07-24  Martin Baulig  <martin@gnome.org>
17520
17521         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17522         operand is of type uint, and the other operand is of type sbyte,
17523         short or int, the operands are converted to type long." -
17524         Actually do what this comment already told us.  Fixes bug #28106,
17525         added test-150.cs.
17526
17527 2002-07-24  Martin Baulig  <martin@gnome.org>
17528
17529         * class.cs (MethodBase): New abstract class.  This is now a base
17530         class for Property, Indexer and Event to avoid some code duplication
17531         in their Define() and DefineMethods() methods.
17532         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17533         generic methods for Define() and DefineMethods().
17534         (FieldBase): Derive from MemberBase, not MemberCore.
17535         (Property): Derive from MemberBase, not MemberCore.
17536         (Property.DefineMethod): Moved all the code from this method to the
17537         new MethodBase.DefineAccessor(), just call it with appropriate
17538         argumetnts.
17539         (Property.Define): Call the new Property.DoDefine(), this does some
17540         sanity checks and we don't need to duplicate the code everywhere.
17541         (Event): Derive from MemberBase, not MemberCore.
17542         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17543         accessors, this will also make them work with interface events.
17544         (Indexer): Derive from MemberBase, not MemberCore.
17545         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17546         (Indexer.Define): Use the new MethodBase functions.
17547
17548         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17549         argument to the constructor.
17550         (Interface.FindMembers): Added support for interface events.
17551         (Interface.PopluateEvent): Implemented.
17552
17553         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17554
17555 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17556
17557         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17558         but this is required to check for a method name being the same as
17559         the containing class.  
17560
17561         Handle this now.
17562
17563 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17564
17565         * interface.cs: initialize variable.
17566
17567 2002-07-23  Martin Baulig  <martin@gnome.org>
17568
17569         Implemented the IndexerName attribute in interfaces.
17570
17571         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17572         name if this is an explicit interface implementation.
17573         (Indexer.InterfaceIndexerName): New public variable.  If we're
17574         implementing an interface indexer, this is the IndexerName in that
17575         interface.  Otherwise, it's the IndexerName.
17576         (Indexer.DefineMethod): If we're implementing interface indexer,
17577         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17578         and Pending.ImplementIndexer methods.
17579         (Indexer.Define): Also define the PropertyBuilder if we're
17580         implementing an interface indexer and this is neither an explicit
17581         interface implementation nor do the IndexerName match the one in
17582         the interface.
17583
17584         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17585         If a method is defined here, then we always need to create a proxy
17586         for it.  This is used when implementing interface indexers.
17587         (Pending.IsInterfaceIndexer): New public method.
17588         (Pending.ImplementIndexer): New public method.
17589         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17590         This is used when implementing interface indexers to define a proxy
17591         if necessary.
17592         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17593         define a proxy if necessary.
17594
17595         * interface.cs (Interface.IndexerName): New public variable.
17596         (Interface.PopulateIndexer): Set the IndexerName.
17597         (Interface.DefineIndexers): New private method.  Populate all the
17598         indexers and make sure their IndexerNames match.
17599
17600         * typemanager.cs (IndexerPropertyName): Added support for interface
17601         indexers.
17602
17603 2002-07-22  Martin Baulig  <martin@gnome.org>
17604
17605         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17606         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17607         ret if HasReturnLabel.
17608         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17609         variables.
17610
17611         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17612         and set the ec.LoopBeginTryCatchLevel.
17613         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17614         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17615         the current ec.TryCatchLevel, the branch goes out of an exception
17616         block.  In this case, we need to use Leave and not Br.
17617
17618 2002-07-22  Martin Baulig  <martin@gnome.org>
17619
17620         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17621         block unless the block does not always return or it is contained in
17622         another try { ... } catch { ... } block.  Fixes bug #26506.
17623         Added verify-1.cs to the test suite.
17624
17625 2002-07-22  Martin Baulig  <martin@gnome.org>
17626
17627         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17628         then we do not always return.  Fixes bug #24985.
17629
17630 2002-07-22  Martin Baulig  <martin@gnome.org>
17631
17632         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17633         lookup on a per-class level; ie. walk up the class hierarchy until we
17634         found at least one applicable method, then choose the best among them.
17635         Fixes bug #24463 and test-29.cs.
17636
17637 2002-07-22  Martin Baulig  <martin@gnome.org>
17638
17639         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17640         return types of the methods.  The return type is not part of the
17641         signature and we must not check it to make the `new' modifier work.
17642         Fixes bug #27999, also added test-147.cs.
17643         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17644
17645         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17646         on the method's return type.
17647
17648 2002-07-21  Martin Baulig  <martin@gnome.org>
17649
17650         * assign.cs: Make this work if the rightmost source is a constant and
17651         we need to do an implicit type conversion.  Also adding a few more tests
17652         to test-38.cs which should have caught this.
17653
17654         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17655         target in the makefile for this.  The makefile.gnu is primarily intended
17656         for end-users who don't want to debug the compiler.
17657
17658 2002-07-21  Martin Baulig  <martin@gnome.org>
17659
17660         * assign.cs: Improved the Assign class so it can now handle embedded
17661         assignments (X = Y = Z = something).  As a side-effect this'll now also
17662         consume less local variables.  test-38.cs now passes with MCS, added
17663         a few new test cases to that test.
17664
17665 2002-07-20  Martin Baulig  <martin@gnome.org>
17666
17667         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17668         instructions.  Fixes bug #27977, also added test-146.cs.
17669
17670 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17671
17672         * cs-tokenizer.cs: fixed getHex ().
17673
17674 2002-07-19  Martin Baulig  <martin@gnome.org>
17675
17676         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17677         not Type.GetType() to lookup the array type.  This is needed when
17678         we're constructing an array of a user-defined type.
17679         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17680         single-dimensional arrays, but also for single-dimensial arrays of
17681         type decimal.
17682
17683 2002-07-19  Martin Baulig  <martin@gnome.org>
17684
17685         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17686         this function is called, it's not allowed to share LocalBuilders
17687         among ILGenerators.
17688
17689 2002-07-19  Martin Baulig  <martin@gnome.org>
17690
17691         * expression.cs (Argument.Resolve): Report an error 118 when trying
17692         to pass a type as argument.
17693
17694 2002-07-18  Martin Baulig  <martin@gnome.org>
17695
17696         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17697         Conv_R_Un for the signed `long' type.
17698
17699 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17702         `expr' for the temporary result, as that will fail if we do
17703         multiple resolves on the same expression.
17704
17705 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17706
17707         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17708         ec.TypeContainer for looking up aliases. 
17709
17710         * class.cs (TypeContainer): Remove LookupAlias from here.
17711
17712         * decl.cs (DeclSpace); Move here.
17713
17714 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17715
17716         * class.cs (FindMembers): Only call filter if the constructor
17717         bulider is not null.
17718
17719         Also handle delegates in `NestedTypes' now.  Now we will perform
17720         type lookups using the standard resolution process.  This also
17721         fixes a bug.
17722
17723         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17724         This uses Expressions (the limited kind that can be parsed by the
17725         tree) instead of strings.
17726
17727         * expression.cs (ComposedCast.ToString): Implement, used to flag
17728         errors since now we have to render expressions.
17729
17730         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17731         FormArrayType. 
17732
17733         * ecore.cs (SimpleName.ToString): ditto.
17734
17735         * cs-parser.jay: Instead of using strings to assemble types, use
17736         Expressions to assemble the type (using SimpleName, ComposedCast,
17737         MemberAccess).  This should fix the type lookups in declarations,
17738         because we were using a different code path for this.
17739
17740         * statement.cs (Block.Resolve): Continue processing statements
17741         even when there is an error.
17742
17743 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * class.cs (Event.Define): Also remove the `remove' method from
17746         the list of pending items.
17747
17748         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17749         generate more compact code. 
17750
17751 2002-07-17  Martin Baulig  <martin@gnome.org>
17752
17753         * const.cs (Const.LookupConstantValue): Add support for constant
17754         `unchecked' and `checked' expressions.
17755         Also adding test case test-140.cs for this.
17756
17757 2002-07-17  Martin Baulig  <martin@gnome.org>
17758
17759         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17760         check whether mi.ReturnType implements the IEnumerator interface; the
17761         `==' and the IsAssignableFrom() will fail in this situation.
17762
17763 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17764
17765         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17766         here too.
17767
17768 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17769
17770         * expression.cs: fixed bug #27811.
17771
17772 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17773
17774         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17775         Molaro: when we are a ref, the value already contains a pointer
17776         value, do not take the address of it.
17777
17778 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17779         * removed mb-parser.jay and mb-tokenizer.cs
17780
17781 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17782
17783         * expression.cs: check against the building corlib void type.
17784
17785 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17786
17787         * ecore.cs: fix for valuetype static readonly fields: when 
17788         initializing them, we need their address, not the address of a copy.
17789
17790 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17791
17792         * typemanager.cs: register also enum_type in corlib.
17793
17794 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17795
17796         * class.cs: allow calling this (but not base) initializers in structs.
17797
17798 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17799
17800         * ecore.cs: make sure we compare against the building base types
17801         in GetTypeSize ().
17802
17803 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17804
17805         * typemanager.cs: fix TypeToCoreType() to handle void and object
17806         (corlib gets no more typerefs after this change).
17807
17808 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17809
17810         * expression.cs (ArrayCreation.EmitArrayArguments): use
17811         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17812
17813         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17814         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17815         array indexes, the runtime actually forbids them.
17816
17817         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17818         for array arguments here.
17819
17820         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17821         instead of the default for ValueTypes.
17822
17823         (New.DoEmit): Use IsValueType instead of
17824         IsSubclassOf (value_type)
17825         (New.DoResolve): ditto.
17826         (Invocation.EmitCall): ditto.
17827
17828         * assign.cs (Assign): ditto.
17829
17830         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17831         Statements *are* currently doing part of their resolution during
17832         Emit.  
17833
17834         Expressions do always resolve during resolve, but statements are
17835         only required to propagate resolution to their children.
17836
17837 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17838
17839         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17840
17841         (LoadAssembly): Do not add the dll if it is already specified
17842
17843         (MainDriver): Add the System directory to the link path at the end,
17844         after all the other -L arguments. 
17845
17846         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17847         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17848         ldelem.u1) and using the opposite for sbytes.
17849
17850         This fixes Digger, and we can finally run it.
17851
17852         * driver.cs (UnixParseOption): Move the option parsing here.  
17853         (CSCParseOption): Implement CSC-like parsing of options.
17854
17855         We now support both modes of operation, the old Unix way, and the
17856         new CSC-like way.  This should help those who wanted to make cross
17857         platform makefiles.
17858
17859         The only thing broken is that /r:, /reference: and /lib: are not
17860         implemented, because I want to make those have the same semantics
17861         as the CSC compiler has, and kill once and for all the confussion
17862         around this.   Will be doing this tomorrow.
17863
17864         * statement.cs (Unsafe.Resolve): The state is checked during
17865         resolve, not emit, so we have to set the flags for IsUnsfe here.
17866
17867 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17868
17869         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17870         not catch the Error_ObjectRefRequired in SimpleName (as it is
17871         possible to have a class/instance variable name that later gets
17872         deambiguated), we have to check this here.      
17873
17874 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17875
17876         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17877         make static and put into Expression.
17878
17879         (Event.Define): Register the private field of the event with the 
17880         TypeManager so that GetFieldFromEvent can get at it.
17881
17882         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17883         keep track of the private field associated with an event which
17884         has no accessors.
17885
17886         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17887         private field.
17888
17889         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17890
17891 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17892
17893         * expression.cs (Binary.EmitBranchable): this routine emits the
17894         Binary expression in a branchable context.  This basically means:
17895         we need to branch somewhere, not just get the value on the stack.
17896
17897         This works together with Statement.EmitBoolExpression.
17898
17899         * statement.cs (Statement.EmitBoolExpression): Use
17900         EmitBranchable. 
17901
17902 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17903
17904         * statement.cs (For): Reduce the number of jumps in loops.
17905
17906         (For): Implement loop inversion for the For statement.
17907
17908         (Break): We can be breaking out of a Try/Catch controlled section
17909         (foreach might have an implicit try/catch clause), so we need to
17910         use Leave instead of Br.
17911
17912         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17913         now).  If the instace expression supports IMemoryLocation, we use
17914         the AddressOf method from the IMemoryLocation to extract the
17915         address instead of emitting the instance.
17916
17917         This showed up with `This', as we were emitting the instance
17918         always (Emit) instead of the Address of This.  Particularly
17919         interesting when This is a value type, as we dont want the Emit
17920         effect (which was to load the object).
17921
17922 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17923
17924         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17925
17926         * statement.cs (Checked): Set the CheckedState during the resolve
17927         process too, as the ConvCast operations track the checked state on
17928         the resolve process, and not emit.
17929
17930         * cs-parser.jay (namespace_member_declaration): Flag that we have
17931         found a declaration when we do.  This is used to flag error 1529
17932
17933         * driver.cs: Report ok when we display the help only.
17934
17935 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17936
17937         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17938
17939 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17940
17941         * cs-tokenizer.cs (define): We also have to track locally the
17942         defines.  AllDefines is just used for the Conditional Attribute,
17943         but we also need the local defines for the current source code. 
17944
17945 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17946
17947         * statement.cs (While, For, Do): These loops can exit through a
17948         Break statement, use this information to tell whether the
17949         statement is the last piece of code.
17950
17951         (Break): Flag that we break.
17952
17953         * codegen.cs (EmitContexts): New `Breaks' state variable.
17954
17955 2002-07-03  Martin Baulig  <martin@gnome.org>
17956
17957         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17958         modifiers in method declarations in structs.  Otherwise, you won't
17959         be able to override things like Object.Equals().
17960
17961 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * class.cs (Method, Property, Indexer): Do not allow the public
17964         modifier to be used in explicit interface implementations.
17965
17966         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17967         override modifiers in method declarations in structs
17968
17969 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17970
17971         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17972         integer or real overflow, report an error
17973
17974 2002-07-02  Martin Baulig  <martin@gnome.org>
17975
17976         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17977         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17978         to tell the runtime about our newly created System.Object and
17979         System.ValueType types.
17980
17981 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17982
17983         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17984         struct instead of Ldarg/Starg.
17985
17986 2002-07-02  Martin Baulig  <martin@gnome.org>
17987
17988         * expression.cs (Indirection.Indirection): Call
17989         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17990
17991 2002-07-02  Martin Baulig  <martin@gnome.org>
17992
17993         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17994         ValueType, call TypeManager.TypeToCoreType() on it.
17995         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17996         the OpCodes.Newarr argument.
17997
17998 2002-07-02  Martin Baulig  <martin@gnome.org>
17999
18000         * expression.cs (Invocation.EmitCall): When compiling corlib,
18001         replace all calls to the system's System.Array type to calls to
18002         the newly created one.
18003
18004         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18005         System.Array methods.
18006         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18007         from the system's System.Array type which must be replaced.
18008
18009 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18010
18011         * typemanager.cs: load unverifiable_code_ctor so we can build
18012         corlib using the correct type. Avoid using GetTypeCode() with
18013         TypeBuilders.
18014         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18015         TypeManager.object_type to allow building corlib.
18016
18017 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18018
18019         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18020
18021 2002-07-01  Martin Baulig  <martin@gnome.org>
18022
18023         * class.cs: Make the last change actually work, we need to check
18024         whether `ifaces != null' to avoid a crash.
18025
18026 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18027
18028         * class.cs: when we build structs without fields that implement
18029         interfaces, we need to add the interfaces separately, since there is
18030         no API to both set the size and add the interfaces at type creation
18031         time.
18032
18033 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18034
18035         * expression.cs: the dimension arguments to the array constructors
18036         need to be converted if they are a long.
18037
18038 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18039
18040         * class.cs: don't emit ldarg.0 if there is no parent constructor
18041         (fixes showstopper for corlib).
18042
18043 2002-06-29  Martin Baulig  <martin@gnome.org>
18044
18045         MCS now compiles corlib on GNU/Linux :-)
18046
18047         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18048         ie. check for MethodImplOptions.InternalCall.
18049
18050         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18051         and TypeManager.attribute_type are null, so we must explicitly check
18052         whether parent is not null to find out whether it's an attribute type.
18053         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18054         and SetBuilder, not only if the property is neither abstract nor external.
18055         This is necessary to set the MethodImplOptions on the accessor methods.
18056         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18057         SetBuilder, see Property.Emit().
18058
18059         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18060         populate "System.Object", "System.ValueType" and "System.Attribute" since
18061         they've already been populated from BootCorlib_PopulateCoreTypes().
18062
18063 2002-06-29  Martin Baulig  <martin@gnome.org>
18064
18065         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18066         is the NullLiteral, we also need to make sure that target_type is not
18067         an enum type.   
18068
18069 2002-06-29  Martin Baulig  <martin@gnome.org>
18070
18071         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18072         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18073         before calling BootstrapCorlib_ResolveDelegate ().
18074
18075 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18076
18077         * statement.cs: fixed build-breaker. All tests passed ok.
18078
18079 2002-06-27  Martin Baulig  <martin@gnome.org>
18080
18081         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18082         for System.Decimal when compiling corlib.
18083
18084 2002-06-27  Martin Baulig  <martin@gnome.org>
18085
18086         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18087         switch blocks which contain nothing but a default clause.
18088
18089 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18090
18091        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18092
18093 2002-06-27  Martin Baulig  <martin@gnome.org>
18094
18095         * ecore.cs (PropertyExpr.PropertyExpr): Call
18096         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18097
18098         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18099         is already a TypeBuilder.
18100
18101 2002-06-27  Martin Baulig  <martin@gnome.org>
18102
18103         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18104         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18105         the "from an array-type to System.Array" case.  This makes it work
18106         when compiling corlib.
18107
18108 2002-06-27  Martin Baulig  <martin@gnome.org>
18109
18110         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18111         non-static PropertyExpr, set its InstanceExpression.  This makes
18112         the `ICollection.Count' property work in System/Array.cs.
18113
18114 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18115
18116         * driver.cs: Made error handling more consistent.  Errors now
18117         tracked by Report class, so many methods which used to return int
18118         now return void.  Main() now prints success/failure and 
18119         errors/warnings message.
18120
18121         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18122         the magic number return values (123 and 124).  Now, if the
18123         expected error occurs, the compiler exits with success (exit value
18124         0).  If the compilation completes without seeing that particular
18125         error, the compiler exits with failure (exit value 1).  The
18126         makefile in mcs/errors has been changed to handle the new behaviour.
18127
18128         * report.cs: Made 'expected error' number a property and renamed
18129         it from 'Probe' to 'ExpectedError'.
18130
18131         * genericparser.cs: Removed error handling support, since it is
18132         now all done by Report class.
18133
18134         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18135         class, so parse() no longer returns an int.
18136
18137         * namespace.cs: Use Report.Error instead of GenericParser.error
18138
18139 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18142         TypeContainer.AddOperator): At the front of the list put the
18143         explicit implementations, so they get resolved/defined first. 
18144
18145 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18146
18147         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18148         interface type is implemented by this TypeContainer.  Used during
18149         explicit interface implementation.
18150
18151         (Property.Define, Indexer.Define, Method.Define): Validate that
18152         the given interface in the explicit implementation is one of the
18153         base classes for the containing type.
18154
18155         Also if we are explicitly implementing an interface, but there is
18156         no match in the pending implementation table, report an error.
18157
18158         (Property.Define): Only define the property if we are
18159         not explicitly implementing a property from an interface.  Use the
18160         correct name also for those properties (the same CSC uses,
18161         although that is really not needed).
18162
18163         (Property.Emit): Do not emit attributes for explicitly implemented
18164         properties, as there is no TypeBuilder.
18165
18166         (Indexer.Emit): ditto.
18167
18168         Hiding then means that we do not really *implement* a pending
18169         implementation, which makes code fail.
18170
18171 2002-06-22  Martin Baulig  <martin@gnome.org>
18172
18173         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18174         the return value of Object.GetType().  [FIXME: we need to do this whenever
18175         we get a type back from the reflection library].
18176
18177 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18178
18179         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18180
18181 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18182
18183         * attribute.cs: Return null if we can not look up the type.
18184
18185         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18186         the interface types found.
18187
18188         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18189         interface types found.
18190
18191         * typemanager.cs (GetInterfaces): Make this routine returns alll
18192         the interfaces and work around the lame differences between
18193         System.Type and System.Reflection.Emit.TypeBuilder in the results
18194         result for GetInterfaces.
18195
18196         (ExpandInterfaces): Given an array of interface types, expand and
18197         eliminate repeated ocurrences of an interface.  This expands in
18198         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18199         be IA, IB, IC.
18200
18201 2002-06-21  Martin Baulig  <martin@gnome.org>
18202
18203         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18204         on System.Enum.
18205
18206 2002-06-21  Martin Baulig  <martin@gnome.org>
18207
18208         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18209         and called with one of the core types, return the corresponding typebuilder for
18210         that type.
18211
18212         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18213         element type.
18214
18215 2002-06-21  Martin Baulig  <martin@gnome.org>
18216
18217         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18218         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18219         (Expression.ConvertReferenceExplicit): Likewise.
18220
18221         * expression.cs (ElementAccess.DoResolve): Likewise.
18222         (ElementAccess.DoResolveLValue): Likewise.
18223
18224 2002-06-10  Martin Baulig  <martin@gnome.org>
18225
18226         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18227         add the "value" parameter to the parameter list.
18228
18229         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18230         to our caller.
18231
18232 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18235         the argument to an int, uint, long or ulong, per the spec.  Also
18236         catch negative constants in array creation.
18237
18238 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18239
18240         * class.cs: do not allow the same interface to appear twice in
18241         the definition list.
18242
18243 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18244
18245         * ecore.cs: don't use ldlen with System.Array.
18246
18247 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18248
18249         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18250
18251 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18252
18253         * modifiers.cs: produce correct field attributes for protected
18254         internal. Easy fix so miguel can work on ther harder stuff:-)
18255
18256 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18257
18258         * pending.cs: New file.  Move the code from class.cs here.
18259         Support clearning the pending flag for all methods (when not doing
18260         explicit interface implementation).
18261
18262 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18263
18264         * rootcontext.cs: added a couple more types needed to bootstrap.
18265
18266 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18267
18268         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18269         constructor in the type, instead of any constructor in the type
18270         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18271         a bug in the Mono runtime when applying the params attribute). 
18272
18273 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18274         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18275
18276 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18277
18278         * expression.cs (Unary.ResolveOperator): Use TypeManager
18279         to resolve the type.
18280
18281 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18282
18283         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18284         attached.
18285
18286         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18287         with each member too.
18288
18289         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18290         field builders too - this takes care of the enum member case.
18291
18292 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18293
18294         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18295         address-of operator on both value types and pointers.
18296
18297 2002-06-10  Martin Baulig  <martin@gnome.org>
18298
18299         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18300         PropertyBuilder to the `property_builders' list.
18301
18302         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18303         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18304         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18305         find any indexers which are inherited from an interface.
18306
18307 2002-06-09  Martin Baulig  <martin@gnome.org>
18308
18309         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18310         the same type as the constant if necessary.  There's also a test-130.cs
18311         for this.
18312
18313         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18314
18315         * typemanager.cs (TypeManager.ChangeType): Previously known as
18316         Enum.ChangeEnumType().
18317
18318 2002-06-09  Martin Baulig  <martin@gnome.org>
18319
18320         * expression.cs (Cast.TryReduce): Added support for consts.
18321
18322 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18323
18324         * class.cs (Accessor): Hold attributes information so we can pass
18325         it along.
18326
18327         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18328         Modify to pass in attributes attached to the methods.
18329
18330         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18331
18332         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18333         to handle the Accessor kind :-)
18334
18335         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18336
18337 2002-06-08  Martin Baulig  <martin@gnome.org>
18338
18339         * expression.cs (Unary.TryReduceNegative): Added support for
18340         ULongConstants.
18341
18342 2002-06-08  Martin Baulig  <martin@gnome.org>
18343
18344         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18345         name can't be found in the `defined_names' - the caller will do a
18346         MemberLookup in this case and thus find methods in System.Enum
18347         such as Enum.IsDefined().
18348
18349 2002-06-08  Martin Baulig  <martin@gnome.org>
18350
18351         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18352         Convert.ChangeType() which works with TypeBuilder created types.
18353         (Enum.LookupEnumValue, Enum.Define): Use it here.
18354
18355         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18356         `TypeBuilder.BaseType != null' check.
18357         (TypeContainer.FindMembers): Only lookup parent members if we
18358         actually have a parent.
18359         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18360         (ConstructorInitializer.Resolve): Likewise.
18361
18362         * interface.cs (Interface.FindMembers): Added
18363         `TypeBuilder.BaseType != null' check.
18364
18365         * rootcontext.cs (RootContext.ResolveCore): Added
18366         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18367         classes_second_stage.
18368
18369         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18370         debug_type and trace_type when compiling with --nostdlib.       
18371
18372 2002-06-07  Martin Baulig  <martin@gnome.org>
18373
18374         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18375         (AddField): Set it to true when adding a non-static field.
18376         (DefineType): Use `have_nonstatic_fields' to find out whether we
18377         have non-static fields, not `Fields != null'.
18378
18379 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18380
18381         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18382         dereferencing a null on the static-field code path)
18383
18384 2002-05-30  Martin Baulig  <martin@gnome.org>
18385
18386         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18387         to take command line arguments.  Use reflection to call the new
18388         custom `Initialize' function on the symbol writer and pass it the
18389         command line arguments.
18390
18391         * driver.cs (--debug-args): New command line argument to pass command
18392         line arguments to the symbol writer.
18393
18394 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18397         the target type for indexers and properties.  Thanks to Joe for
18398         catching this.
18399
18400 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18401
18402         * typemanager.cs (MethodFlags): returns the method flags
18403         (Obsolete/ShouldIgnore) that control warning emission and whether
18404         the invocation should be made, or ignored. 
18405
18406         * expression.cs (Invocation.Emit): Remove previous hack, we should
18407         not do this on matching a base type, we should do this based on an attribute
18408
18409         Only emit calls to System.Diagnostics.Debug and
18410         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18411         on the command line.
18412
18413         * rootcontext.cs: Global settings for tracing and debugging.
18414
18415         * cs-tokenizer.cs (define): New utility function to track
18416         defines.   Set the global settings for TRACE and DEBUG if found.
18417
18418 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18419
18420         * interface.cs (Populate*): Pass in the TypeContainer as well as
18421         the DeclSpace as parameters so that we can create EmitContexts and
18422         then use that to apply attributes etc.
18423
18424         (PopulateMethod, PopulateEvent, PopulateProperty)
18425         (PopulateIndexer): Apply attributes everywhere.
18426
18427         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18428         etc.
18429
18430         (ApplyAttributes): Update accordingly.
18431
18432         We now apply interface attributes for all members too.
18433
18434 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * class.cs (Indexer.Define); Correctly check if we are explicit
18437         implementation (instead of checking the Name for a ".", we
18438         directly look up if the InterfaceType was specified).
18439
18440         Delay the creation of the PropertyBuilder.
18441
18442         Only create the PropertyBuilder if we are not an explicit
18443         interface implementation.   This means that explicit interface
18444         implementation members do not participate in regular function
18445         lookups, and hence fixes another major ambiguity problem in
18446         overload resolution (that was the visible effect).
18447
18448         (DefineMethod): Return whether we are doing an interface
18449         implementation. 
18450
18451         * typemanager.cs: Temporary hack until we get attributes in
18452         interfaces (Ravi is working on that) and we get IndexerName
18453         support in interfaces.
18454
18455         * interface.cs: Register the indexers as properties.
18456
18457         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18458         warning, I have verified that this is a bug in the .NET runtime
18459         (JavaScript suffers of the same problem).
18460
18461         * typemanager.cs (MemberLookup): When looking up members for
18462         interfaces, the parent of an interface is the implicit
18463         System.Object (so we succeed in searches of Object methods in an
18464         interface method invocation.  Example:  IEnumerable x;  x.ToString
18465         ()) 
18466
18467 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18468
18469         * class.cs (Event): Events should also register if they do
18470         implement the methods that an interface requires.
18471
18472         * typemanager.cs (MemberLookup); use the new GetInterfaces
18473         method. 
18474
18475         (GetInterfaces): The code used to lookup interfaces for a type is
18476         used in more than one place, factor it here. 
18477
18478         * driver.cs: Track the errors at the bottom of the file, we kept
18479         on going.
18480
18481         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18482         instance if the method we are calling is static!
18483
18484 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18485
18486         * attribute.cs (ApplyAttributes): Make this function filter out
18487         the IndexerName attribute (as that attribute in reality is never
18488         applied) and return the string constant for the IndexerName
18489         attribute. 
18490
18491         * class.cs (TypeContainer.Emit): Validate that all the indexers
18492         have the same IndexerName attribute, and if so, set the
18493         DefaultName attribute on the class. 
18494
18495         * typemanager.cs: The return value might contain other stuff (not
18496         only methods).  For instance, consider a method with an "Item"
18497         property and an Item method.
18498
18499         * class.cs: If there is a problem with the parameter types,
18500         return. 
18501
18502 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18503
18504         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18505         looks at user defined conversion after making a call to 
18506         StandardConversionExists - we need this for overload resolution.
18507
18508         * expression.cs : Update accordingly the various method calls.
18509
18510         This fixes 2 bugs filed against implicit user defined conversions 
18511
18512 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18513
18514         * statement.cs: Track the result of the assignment.
18515
18516 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18517
18518         * expression.cs (MemberAccess): Improved error reporting for
18519         inaccessible members.
18520
18521 2002-05-22  Martin Baulig  <martin@gnome.org>
18522
18523         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18524         itself with debugging support.
18525
18526 2002-05-22  Martin Baulig  <martin@gnome.org>
18527
18528         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18529         Removed, this isn't needed anymore.
18530
18531 2002-05-20  Martin Baulig  <martin@gnome.org>
18532
18533         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18534         be underlying type for an enum.
18535
18536 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18539         that splits out the loading of just the core types.
18540
18541         * rootcontext.cs (ResolveCore): Split the struct resolution in
18542         two, so we can load the enumeration underlying types before any
18543         enums are used.
18544
18545         * expression.cs (Is): Bandaid until we fix properly Switch (see
18546         bug #24985 for details).
18547
18548         * typemanager.cs (ImplementsInterface): The hashtable will contain
18549         a null if there are no interfaces implemented.
18550
18551 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18552
18553         * cs-parser.jay (indexer_declarator): It is fine to have array
18554         parameters
18555
18556 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18557
18558         * typemanager.cs: (RegisterBuilder): New function used to register
18559         TypeBuilders that implement interfaces.  Since
18560         TypeBuilder.GetInterfaces (as usual) does not work with lame
18561         Reflection.Emit. 
18562         (AddUserType): register interfaces.
18563
18564         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18565         dealing with TypeBuilder.  Also, arrays are showing up as
18566         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18567         methods can not be invoked on them!
18568
18569         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18570         (ImplicitReferenceConversionExists): Split out from
18571         StandardConversionExists. 
18572
18573         * expression.cs (As): We were only implementing one of the three
18574         cases for the as operator.  We now implement them all.
18575         (Is): Implement the various other cases for Is as well.
18576
18577         * typemanager.cs (CACHE): New define used to control if we want or
18578         not the FindMembers cache.  Seems to have a negative impact on
18579         performance currently
18580
18581         (MemberLookup): Nested types have full acess to
18582         enclosing type members
18583
18584         Remove code that coped with instance/static returns for events, we
18585         now catch this in RealFindMembers.
18586
18587         (RealFindMembers): only perform static lookup if the instance
18588         lookup did not return a type or an event.  
18589
18590 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18591
18592         * assign.cs (CompoundAssign): We pass more semantic information
18593         now to Compound Assignments than we did before: now we have all
18594         the information at hand, and now we resolve the target *before* we
18595         do the expression expansion, which allows the "CacheValue" method
18596         to have the effect we intended (before, a [x] += 1 would generate
18597         two differen ArrayAccess expressions from the ElementAccess,
18598         during the resolution process).
18599
18600         (CompoundAssign.DoResolve): Resolve target and original_source here.
18601
18602 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * expression.cs (ArrayAccess): dropped debugging information. 
18605
18606         * typemanager.cs: Small bug fix: I was always returning i_members,
18607         instead of one of i_members or s_members (depending on which had
18608         the content).
18609
18610         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18611         method is invoked before any code generation takes place, and it
18612         is a mechanism to inform that the expression will be invoked more
18613         than once, and that the method should use temporary values to
18614         avoid having side effects
18615
18616         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18617
18618         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18619         implementation.
18620
18621         * expression.cs (Indirection, ArrayAccess): Add support for
18622         CacheTemporaries in these two bad boys. 
18623
18624         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18625         ldobj or ldind_ref.  
18626         (StoreFromPtr): Handle stobj as well.
18627
18628         * expression.cs (UnaryMutator): Share more code.
18629
18630         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18631         down: I was not tracking the Filter function as well, which
18632         was affecting the results of the cache.
18633
18634 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18635
18636         * attribute.cs: Remove the hack to handle the CharSet property on
18637         StructLayouts. 
18638
18639 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18640
18641         * attribute.cs (DoResolve): More uglyness, we now only try to
18642         resolve the attribute partially, to extract the CharSet
18643         information (only if we are a StructLayout attribute).  Otherwise 
18644
18645         (GetExtraTypeInfo): Add some code to conditionally kill in the
18646         future this.   I am more and more convinced that the .NET
18647         framework has special code to handle the attribute setting on
18648         certain elements.
18649
18650         * expression.cs (IsParamsMethodApplicable): Revert my previous
18651         foreach change here, it was wrong.
18652
18653 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18654
18655         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18656         (pp_expr): do not abort on unknown input, just return.
18657         (eval): abort if there are pending chars.
18658
18659         * attribute.cs (Attribute.Resolve): Positional parameters are
18660         optional.  Deal with that case.
18661
18662         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18663         the Ansi/Unicode/Auto information for the type.
18664
18665         (TypeContainer.DefineType): instantiate the EmitContext here, as
18666         we will be using it during the type definition (to resolve
18667         attributes) and during the emit phase.
18668
18669         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18670         to pull type information out of the attributes
18671
18672         (Attribute.Resolve): track the constructor builder, and allow for
18673         multiple invocations (structs and classes will use this).
18674
18675         * ecore.cs (MemberLookupFinal): new version with all the
18676         parameters customizable.
18677
18678         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18679         constructors.  Return if the result value is null (as the error
18680         would have been flagged already by MemberLookupFinal)
18681
18682         Do not allow instances of abstract classes or interfaces to be
18683         created.
18684
18685         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18686         We have to compare the assembly property here when dealing with
18687         FamANDAssem and Assembly access modifiers, because we might be
18688         creating an assembly from *modules* (that means that we are not
18689         getting TypeBuilders for types defined in other modules that are
18690         part of this assembly).
18691
18692         (Method.Emit): If the method is marked abstract and has a body,
18693         emit an error. 
18694
18695         (TypeContainer.DefineMembers): If both the defined member and the
18696         parent name match are methods, then do not emit any warnings: let
18697         the Method.Define routine take care of flagging warnings.  But if
18698         there is a mismatch (method overrides something else, or method is
18699         overriwritten by something, then emit warning).
18700
18701         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18702         set to null, this means `do not check for the return type on the
18703         signature'. 
18704
18705         (Method.Define): set the return type for the method signature to
18706         null, so that we get methods with the same name and parameters and
18707         different return types.  This is used to flag warning 114 (you are
18708         hiding a method, and you probably want to use the new/override
18709         keywords instead).
18710
18711         * typemanager.cs (MemberLookup): Implemented proper access
18712         control, closing a long standing set of bug reports.  The problem
18713         was that the Framework only has two bits: Public and NonPublic,
18714         and NonPublic includes private and protected methods, but we need
18715         to enforce the FamANDAssem, FamOrAssem and Family. 
18716
18717 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * statement.cs (GotoCase): Return true: Ammounts to giving up
18720         knowledge on whether we return or not, and letting the other case
18721         be responsible for it.
18722
18723 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18724
18725         * driver.cs: Do not load directories for each file processed, only
18726         do it if there is a pattern.
18727
18728         * ecore.cs: Report readonly assigns here as well, as we might have
18729         been resolved only by MemberAccess.
18730
18731         (SimpleName.SimpleNameResolve): Also be useful for LValue
18732         resolution.   We need this to propagate assign to local readonly variables
18733
18734         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18735         do not want to reuse potential criteria memory.
18736
18737         * class.cs (MyEventBuilder): Set reflected_type;
18738
18739         * ecore.cs (Constantify): Added support for constifying bools.
18740
18741         (RootContext.LookupType): Added a cache for values looked up in
18742         the declaration space.
18743
18744         * typemanager.cs (FindMembers): Now is a front-end to
18745         RealFindMembers, and provides a two-level hashtable-based cache to
18746         the request.  
18747
18748         15% performance improvement: from 22.5 to 19.2 seconds.
18749
18750         * expression.cs (IsParamsMethodApplicable): use foreach.
18751         (Invocation.DoResolve): ditto.
18752         (New.DoResolve): ditto.
18753         (ArrayCreation.DoResolve): ditto.
18754
18755         * ecore.cs (FindMostEncompassingType): use foreach.
18756
18757         * delegate.cs (NewDelegate.DoResolve): Use foreach
18758
18759         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18760         (RemoveMethods): use foreach.
18761
18762         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18763         nested foreach statements instead of for, and also break out of
18764         the inner loop once a match is found.
18765
18766         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18767
18768 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18769
18770         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18771         we actually unwrap the expression to allow for extra information
18772         to be extracted. 
18773
18774         * expression.cs: Use Shr_Un on unsigned operations. 
18775
18776 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18777
18778         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18779         applicable operators was not being considered correctly. This closes
18780         the bug Miguel reported.
18781
18782 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18783
18784         * attribute.cs: check that the type derives from System.Attribute
18785         and report the correct error in that case (moved the duplicate code to
18786         its own method, too).
18787
18788 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18789
18790         * attribute.cs: lookup attribute type name as the spec says: first the
18791         bare attribute name and then name + "Attribute" (nant compiles with
18792         mcs after this fix).
18793
18794 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18797         Because of the way we parse things, we should try to see if a
18798         UIntConstant can fit in an integer.
18799
18800 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18801
18802         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18803         when we are in an explicit context.
18804
18805         (ConvertReferenceExplicit): When converting from Iface type S to Class
18806         T make sure the rules are implemented as an OR.
18807
18808         * parameter.cs (ParameterType): Make it a property for now although the
18809         purpose really isn't anything immediate.
18810
18811         * expression.cs (Is*Applicable): Do better checking on the parameter type
18812         of a ref/out parameter. The ones from the system assemblies are already 
18813         marked with the correct type so we don't need to do any correction.
18814
18815         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18816         the object type is standard too so include that.
18817
18818 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * ecore.cs (StandardConversionExists): Augment with missing code:
18821         deal with IntConstant, LongConstants and Enumerations.
18822
18823         * assign.cs: Report the error, instead of failing silently
18824
18825         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18826         typecontainer that they are declared, because the
18827         typecontainer/namespace will have the list of using clauses that
18828         need to be applied.
18829
18830         Assembly Attributes were escaping the normal registration
18831         mechanism. 
18832
18833         (EmitCode): Apply attributes within an EmitContext that represents
18834         the container they were declared on.
18835
18836         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18837
18838 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18839
18840         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18841         Revamp completely - make much cleaner as we now operate only
18842         on a set of Types.
18843
18844         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18845         to implement the logic detailed in the spec more correctly.
18846
18847         (UserDefinedConversion): Update accordingly.
18848
18849 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * statement.cs: Return flow analysis information up.
18852
18853         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18854         and the default.
18855
18856         (token): Do not consume an extra character before calling
18857         decimal_digits.
18858
18859 2002-05-06  Piers Haken <piersh@friskit.com>
18860
18861         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18862
18863 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18866         EmitContext during the instance constructor initializer
18867         resolution, to stop access to instance variables.
18868
18869         This is mandated by the spec, last paragraph of the `constructor
18870         initializers' section. 
18871
18872 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18873
18874         * cs-parser.jay, class.cs (Accessor): new class used to represent
18875         an accessor (get or set).  In the past we used `null' to represent
18876         a missing accessor.  But this is ambiguous because there was no
18877         way to tell in abstract indexers/properties if one of them was
18878         specified.
18879
18880         Now there is a way of addressing that.
18881
18882         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18883         instead of FindMembers.
18884
18885         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18886         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18887
18888         * attribute.cs: Treat indexers and properties as the same in terms
18889         of applying attributes
18890
18891         * ecore.cs (FindMostEncompassedType): Use statically initialized
18892         EmptyExpressions()s like we do elsewhere to avoid creating useless
18893         objects (and we take this out of the tight loop).
18894
18895         (GetConversionOperators): Move the code to extract the actual
18896         operators to a separate routine to clean things up.
18897
18898 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18899
18900         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18901         events are always registered FieldBuilders.
18902
18903         * class.cs (FieldBase): New class shared by Fields 
18904
18905         * delegate.cs: If we are a toplevel delegate, use our full name.
18906         If we are a nested delegate, then only use our tail name.
18907
18908 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18909
18910         * expression.cs (IsApplicable): Ensure that we add the "&" to
18911         ref/out types before comparing it with the type of the argument.
18912
18913         (IsParamsMethodApplicable): Ditto.
18914
18915         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18916         silly me ;-)
18917
18918         * delegate.cs : Handle the case when we have more than one applicable
18919         method. Flag an error only when we finish checking all.
18920
18921 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18922
18923         * expression.cs: Add support for boolean static initializers.
18924
18925 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18926
18927         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18928
18929         * parameter.cs (ComputeParameterTypes,
18930         ComputeAndDefineParameterTypes): Better error handling: now we
18931         clear the `types' cache if we fail during any of the type lookups.
18932         We also return the status code correctly to our caller
18933
18934         * delegate.cs: If we fail to define a delegate, abort the extra
18935         steps. 
18936
18937         * expression.cs (Binary.ResolveOperator): for
18938         operator==(object,object) and operator !=(object, object) we also
18939         have to verify that there is an implicit conversion from one to
18940         the other.
18941
18942         (ArrayAccess.DoResolve): Array Access can operate on
18943         non-variables. 
18944
18945 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * assign.cs (CompoundAssign): A new class used as a "flag" that
18948         the assignment actually is happening as part of a compound
18949         assignment operator.
18950
18951         During compound assignment, a few new rules exist to enable things
18952         like:
18953
18954         byte b |= 1 + 2
18955
18956         From the spec:
18957
18958         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18959         to the type of x) if y is implicitly convertible to the type of x,
18960         and the operator is a builtin operator and the return type of the
18961         operator is explicitly convertible to the type of x. 
18962
18963         * rootcontext.cs: Reset warning level to 2.  4 catches various
18964         "interesting" features in mcs, we must clean this up at some
18965         point, but currently am trying to kill other bugs ;-)
18966
18967         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18968         in container classes as well.  
18969
18970         * expression.cs (Binary.ResolveOperator): Handle string case
18971         before anything else (as operator overloading does emit an error
18972         before doing anything else).
18973
18974         This code could go away when we move to a table driven model, but
18975         i could not come up with a good plan last night.
18976
18977 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18978
18979         * typemanager.cs (CSharpName): reimplementation using regex.
18980         * class.cs: added null check for fields in Emit
18981         * rootcontext.cs: set warninglevel to 4
18982
18983 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18984
18985         * typemanager.cs (CSharpName): reimplemented with Lupus
18986         suggestion.
18987
18988 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * statement.cs (If): correclty implement Resolve, because we were
18991         not catching sem errors in there.  The same process is needed
18992         everywhere else. 
18993         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18994
18995
18996         (Statement.Warning_DeadCodeFound): Factorize code.
18997         (While): Report dead code here too.
18998
18999         (Statement): Added Resolve virtual method to allow
19000         for resolution split from the emit code.
19001
19002 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19003
19004         * statement.cs (EmitBoolExpression): No longer try to resolve the
19005         expression here.    
19006         (MakeBoolean): New utility function that resolve, implicitly
19007         converts to boolean and tags the expression. 
19008
19009
19010         (If, Do): Implement dead code elimination.
19011         (While): Implement loop inversion
19012
19013         (Do, While, For, If): Resolve the expression prior to calling our
19014         code generation.
19015
19016 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19017
19018         * class.cs:
19019           - added method Report28 (warning: program has more than one entry point)
19020           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19021           - modified method Method.Define, the part at the end of the method
19022
19023         * rootcontext.cs: added static public Location EntryPointLocation;
19024           
19025         * ../errors/cs0028.cs : Add test case for the above warning.              
19026
19027         * typemanager.cs:
19028           - modified method CSharpName to allow arrays of primitive type to
19029             be printed nicely (e.g. instead of System.Int32[][] it now prints
19030             int[][])
19031           - added method CSharpSignature: returns the signature of a method
19032             in string format to be used in reporting errors, warnings, etc.
19033
19034         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19035         with String.Empty.
19036
19037 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19038
19039         * delegate.cs (Define): Fix extremely silly bug where I was
19040         setting the type of the 'object' parameter of the BeginInvoke
19041         method to System.IAsyncResult instead of System.Object ;-)
19042
19043 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19046         here. 
19047
19048         (Constructor.Emit): return if we fail to initialize the
19049         constructor.  Another door closed!  
19050
19051         * expression.cs (New.DoResolve): Improve error message (from -6 to
19052         1501).  Use DeclaredOnly lookup to find the exact constructor.
19053
19054         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19055         loop.  This is useful.
19056
19057         * cs-parser.jay: Adjust the default parameters so that destructors
19058         have the proper signature.
19059
19060 2002-04-26  Martin Baulig  <martin@gnome.org>
19061
19062         * driver.cs (LoadAssembly): If `assembly' contains any characters
19063         which are only valid in path names and not in assembly names
19064         (currently slash, backslash and point), use Assembly.LoadFrom ()
19065         instead of Assembly.Load () on the `assembly' (before iteration
19066         over the link_paths).
19067
19068 2002-04-26  Martin Baulig  <martin@gnome.org>
19069
19070         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19071
19072 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19073
19074         * class.cs (Property): use the new typemanager.MemberLookup
19075
19076         (TypeContainer.MemberLookup): Implement using the
19077         TypeManager.MemberLookup now. 
19078
19079         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19080         and return MemberInfos, so that these can be used without an
19081         EmitContext (what we had before).
19082
19083 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * expression.cs: Fix the case where the argument to params if the
19086         type of the params.  I omitted handling this before.   Fixed
19087
19088 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19089
19090         * driver.cs: Call BootCorlib_PopulateCoreType
19091
19092         * class.cs (Property.CheckBase): Check for properties only, not
19093         for all members. 
19094
19095         * interface.cs: Temporary hack: try/catch around the
19096         CustomAttributeBuilder, because I am getting an exception that I
19097         do not understand.
19098
19099         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19100         types whose definitions are required to be there (attributes are
19101         defined before standard types).
19102
19103         Compute definitions as we boot the various types, as they are used
19104         immediately (value_type class will need object_type, but if we do
19105         not initialize object_type, we will pass a null, which will let
19106         the runtime pick the System.Object from the existing corlib, which
19107         is not what we want).
19108
19109 2002-04-22  Patrik Torstensson <totte@labs2.com>
19110
19111         * cs-tokenizer.cs: fixed a number of trim() issues.
19112
19113 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19114
19115         * expression.cs (Argument.Type): Ensure that we return the correct
19116         type when we have out or ref parameters [in which case we 
19117         append a "&"].
19118
19119 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19120
19121         * class.cs (Property, Indexer): Allow extern modifier in there. 
19122
19123         * typemanager.cs (InitBaseTypes): Initializes object_type and
19124         value_type, since those will be used early on during the bootstrap
19125         process to compile corlib.
19126
19127         (InitCoreTypes): Move code from here to InitBaseTypes.
19128
19129 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19130
19131         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19132         single-dimension arrays as using the ldlen opcode.  
19133
19134         Daniel Lewis discovered this optimization.  
19135
19136         * typemanager.cs: Add signature for System.Array::get_Length
19137
19138 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19139
19140         * statement.cs: report the error when the foreach does not apply to an
19141         array nor a collection.
19142
19143 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * expression.cs: Add implicit conversions to the operator ~.
19146
19147         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19148
19149         * typemanager.cs: Locate the decimal constructor.
19150
19151 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19152
19153         * attribute.cs: use the new property of TypeOf.
19154         * expression.cs: added 'get' property around typearg.
19155
19156         These changes fix a build breaker reported by NickD. Is this the
19157         correct way to fix?  If not, please, revert my changes and make it
19158         work :-).
19159
19160 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * attribute.cs: Add support for typeof in attribute invocations.
19163         I am not sure that this is right though.
19164
19165 2002-04-14  Duncan Mak  <duncan@ximian.com>
19166
19167         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19168         Binary.Operator.Division case.
19169
19170 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19171
19172         * class.cs (DefineType): Ensure that we do a proper check on
19173         attribute types and also register it with the TypeManager.
19174
19175         (TypeContainer.Targets): The default for attribute types is
19176         AttributeTargets.All.
19177
19178         * attribute.cs (ApplyAttributes): Registering the attribute type
19179         is done elsewhere, not when we discover we have a Usage attribute.
19180
19181 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19182
19183         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19184         and get rid of is_delegate parameter.
19185
19186         * everywhere : update.
19187
19188 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19189
19190         * cs-parser.jay (compilation_unit): Revamp completely to use
19191         some new ideas that I got from Rhys' grammar to solve the problems
19192         with assembly level attributes.
19193
19194         (outer_declaration): New grammar production.
19195
19196         (attribute_sections): Add.
19197
19198         (opt_attributes): Base on attribute_sections
19199
19200         (namespace_declaration): Allow opt_attributes to tackle the case
19201         when we have assembly level attributes - we are clever in this
19202         regard now ;-)
19203
19204         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19205         attributes in the non-global context.
19206
19207         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19208         instead of SetGlobalAttributes.
19209
19210         * class.cs, rootcontext.cs : Ensure we define and generate 
19211         attribute types before anything else.
19212
19213         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19214         and flag the new error -20 for the case when the attribute type
19215         does not have valid targets specified. csc does not catch this.
19216
19217         * ../errors/errors.txt : update for error # -20
19218
19219 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19220
19221         * support.cs (InternalParameters.ParameterModifier): Do some null
19222         checking and return sane values.
19223
19224         * class.cs (Method.Define): If we are a PInvoke method, ensure
19225         that we are static and extern. Report error # 601
19226
19227         * ../errors/cs0601.cs : Add test case for the above error.
19228
19229 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19230
19231         * rootcontext.cs (attribute_types): We need to keep type of
19232         all attribute types separately and emit code for them first.
19233
19234         (RegisterAttribute) : Implement.
19235
19236         * class.cs (DefineType): Check if the current Type is a custom
19237         attribute type and register it accordingly.
19238
19239         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19240         adding the first attribute twice and rename to
19241
19242         (SetGlobalAttributes): this.
19243
19244         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19245         lookups.
19246
19247         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19248         if we are processing global arguments. Hmm, I am unsure of this.
19249
19250 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19251
19252         * expression.cs: added static array of strings to avoid calling
19253         Enum.ToString () for Operator in Binary. Significant recover of
19254         performance.
19255
19256 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19257
19258         * class.cs (FindMembers): Allow the Builders of the various
19259         members to be null.  If they are skip them.  This only happens
19260         during the PInvoke declaration.
19261
19262 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19265         failure, so we do not keep going afterwards.
19266
19267         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19268         wanted to pass `false' as the `is_delegate' argument.  If this is
19269         the case, why not use delegate_type == null to mean `is_delegate =
19270         false' and anything else as is_delegate = true.
19271
19272 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19273
19274         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19275         code for the section, not the beginning of the tests.
19276
19277 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19278
19279         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19280
19281         * expression.cs (Binary): same.  Warn about errors where we have
19282         Enum/Enum in operator + as well.
19283
19284 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19285
19286         * statement.cs:
19287                 - added support for switch(bool)
19288                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19289                 - add TableSwitchEmit() to handle table-based switch statements
19290
19291 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19292
19293         * expression.cs (Invocation.OverloadResolve): Factor out code which
19294         does parameter compatibility checking with arguments so that we can 
19295         re-use the code even from Delegate.VerifyApplicability
19296
19297         (VerifyArgumentsCompat): Move above code here.
19298
19299         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19300         and instead make a call to the above method.
19301
19302 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19303
19304         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19305         We use it to keep track of classes which are attribute types.
19306
19307 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19308
19309         * delegate.cs (Delegate.Define): Correctly define the types in the
19310         presence of fixed and array parameters.
19311
19312         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19313         doing FindMembers.
19314
19315         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19316         include NonPublic after the first iteration.
19317
19318         * class.cs (Indexer.CheckBase): Only check if both parents are
19319         non-null. 
19320
19321         * cs-parser.jay (accessor_body): If empty, set to null.
19322
19323         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19324         same code path here to resolve constants names that we did have in
19325         MemberAccess.DoResolve.  There is too much code duplicated here.
19326
19327 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19328
19329         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19330
19331         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19332         to MakeUnionSet.
19333
19334         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19335         tokens, numbers and strings.
19336
19337         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19338         parenthesis.
19339
19340         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19341         asyncronous parameters and the regular parameters.  
19342
19343         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19344         specify the target directory.
19345
19346         * expression.cs: (This.DoResolve): Simplify
19347         (As.Emit): Optimize, do not generate IsInst if the expression is
19348         always of the given type.
19349
19350         (Is.DoResolve): Bug fix, we were reporting both always/never for
19351         the is expression.
19352
19353         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19354         creating too many unnecessary arrays.
19355
19356 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19359         fields instead of rolling our own initializer.   Takes care of all
19360         implicit conversions, and drops unnecessary static checks/argument.
19361
19362 2002-03-31  Dick Porter  <dick@ximian.com>
19363
19364         * driver.cs: use the GetDirectories() return values properly, and
19365         use "/" as path separator.
19366
19367 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19368
19369         * expression.cs (Unary): Optimize - - expr into expr.
19370         (Binary): Optimize a + (-b) into a -b.
19371
19372         * codegen.cs (CodeGen): Made all methods static.
19373
19374 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19375
19376         * rootcontext.cs: 
19377
19378         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19379         TypeBuilder property.
19380
19381         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19382         instead. 
19383
19384         * tree.cs: Removed the various RecordXXXX, and replaced with a
19385         single RecordDecl.  Removed all the accessor methods, and just
19386         left a single access point Type 
19387
19388         * enum.cs: Rename DefineEnum to DefineType.
19389
19390         * decl.cs: New abstract method `DefineType' used to unify the
19391         Defines for Enumerations, Interfaces, TypeContainers and
19392         Delegates.
19393
19394         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19395         LookupBaseClasses method that used to live in class.cs and
19396         interface.cs here, and renamed to FindType.
19397
19398         * delegate.cs: Implement DefineType.  Take advantage of the
19399         refactored pattern for locating the parent builder without taking
19400         the parent_builder argument (which we know does not work if we are
19401         nested, and triggering a toplevel definition).
19402
19403 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19404
19405         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19406         accessibility of a member has changed during override and report
19407         an error if so.
19408
19409         * class.cs (Method.Define, Property.Define): Only complain on
19410         overrides if the method is private, any other accessibility is
19411         fine (and since we just checked the permission is the same, we are
19412         good to go).
19413
19414         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19415         and elif are processed always.  The other pre-processing
19416         directives are only processed if we are "taking" the path
19417
19418 2002-03-29  Martin Baulig  <martin@gnome.org>
19419
19420         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19421         current location is not Null.
19422
19423         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19424         a separate method so we can profile it.
19425
19426         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19427         `span.Seconds' are just seconds, but no minutes or hours.
19428         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19429
19430 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19433         Remove the gratuitous set of Final:
19434
19435                                 // If an interface implementation, then we can set Final.
19436                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19437                                     implementing.DeclaringType.IsInterface)
19438                                         flags |= MethodAttributes.Final;
19439
19440         I do not know what I was smoking when I used that.
19441
19442
19443         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19444         step into fixing the name resolution issues for delegates and
19445         unifying the toplevel name resolution.
19446
19447 2002-03-28  Martin Baulig  <martin@gnome.org>
19448
19449         * class.cs (Method.Emit): If we have a symbol writer, call its
19450         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19451         tell it about the current method.
19452
19453         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19454         writer that we're going to emit the first byte of IL code for a new
19455         statement (a new source line).
19456         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19457         EmitContext.Mark() before emitting any code.
19458
19459         * location.cs (SymbolDocument): Return null when we're Null.
19460
19461         * statement.cs (Statement): Moved the `Location loc' variable here.
19462         (Statement.EmitBoolExpression): If we have a symbol writer, call
19463         ec.Mark() before emitting any code to tell it that we're at the
19464         beginning of a new statement.
19465         (StatementExpression): Added `Location' argument to the constructor.
19466         (Block): Added public readonly variable `StartLocation' and public
19467         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19468         (Block): Added constructor which takes a start and end location.
19469         (Block.SetEndLocation): New method. This sets the end location.
19470         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19471         local variables we create.
19472         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19473         each statement and do also mark the begin and end of the block.
19474
19475         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19476         tell it the current lexer.Location, use Location.Null for the end of the
19477         block.
19478         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19479         current block, set its end location using SetEndLocation().
19480         (statement_expression): StatementExpression constructor now takes the
19481         lexer.Location as additional argument.
19482         (for_statement, declare_local_variables): Likewise.
19483         (declare_local_variables): When creating a new implicit block, use the
19484         new Block constructor and pass it the lexer.Location.
19485
19486 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19489         members also on the parent interfaces recursively.
19490
19491 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19492
19493         * report.cs: Use new formats, since Gonzalo finished the missing
19494         bits. 
19495
19496         * expression.cs (Binary.ResolveOperator): added missing operator|
19497         operator& and operator^ for bool/bool.
19498
19499         * cs-parser.jay: CheckDef now takes a Location argument that is
19500         used to report errors more precisly (instead of reporting the end
19501         of a definition, we try to track something which is a lot closer
19502         to the source of the problem).
19503
19504         * cs-tokenizer.cs: Track global token use, so we can properly flag
19505         the use of #define/#undef after the first token has been seen.
19506
19507         Also, rename the reportXXXX to Error_DescriptiveName
19508
19509         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19510         TypeContainer, so that Enum and Interface can use this too.
19511
19512         * class.cs (TypeContainer.LookupInterfaceOrClass,
19513         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19514         `builder' argument.  Typically this was used to pass the parent
19515         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19516         the definition).  
19517
19518         The problem is that a nested class could trigger the definition of
19519         a toplevel class, and the builder would be obviously wrong in that
19520         case. 
19521
19522         So we drop this argument, and we compute dynamically the
19523         TypeBuilder/ModuleBuilder (the correct information was available
19524         to us anyways from DeclSpace.Parent)
19525
19526         * interface.cs (Interface.DefineInterface): Drop builder
19527         parameter cleanup like class.cs
19528
19529         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19530         like class.cs
19531
19532         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19533         values. 
19534
19535         (Try.Emit): Propagate the returns value from the statement.
19536
19537         (Return.Emit): Even if we are leavning 
19538
19539         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19540
19541         * modifiers.cs: Fix the computation of MethodAttributes flags.
19542
19543 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19544
19545         * driver.cs: allow compilation of files that start with '/'.
19546         Add a default case when checking the argument of --target.
19547
19548 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19549
19550         * interface.cs: Implement the same search algorithm for types in
19551         the interface code.
19552
19553         * delegate.cs: Do not allow multiple definition.
19554
19555         * Recovered ChangeLog that got accidentally amputated
19556
19557         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19558
19559         * rootcontext.cs: Load manually enum to allow core classes to
19560         contain enumerations.
19561
19562         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19563         Update to new static methods in TypeManager.
19564
19565         * typemanager.cs (GetMethod, GetConstructor): Use our
19566         implementation of FindMembers to find the members, since during
19567         corlib compilation, the types are TypeBuilders and GetMethod and
19568         GetConstructor do not work.
19569
19570         Make all methods in TypeManager static.
19571
19572         (InitCodeHelpers): Split the functionality from
19573         the InitCodeTypes function.
19574
19575         * driver.cs: Call InitCodeHelpers after we have populated the
19576         types. 
19577
19578         * cs-parser.jay (delegate_declaration): we did not used to compute
19579         the delegate name correctly for void delegates.
19580
19581 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19582
19583         * rootcontext.cs (RootContext): Init the interface_resolve_order
19584         and type_container_resolve_order always.
19585
19586         (ResolveCore, BootstrapCorlib_ResolveClass,
19587         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19588         compiler when compiling with --nostdlib
19589
19590         * class.cs (TypeContainer.DefineType): Check that our parent is
19591         not null.  This test is most important when we are bootstraping
19592         the core types.
19593
19594         * codegen.cs: Split out the symbol writing code.
19595
19596 2002-03-25  Martin Baulig  <martin@gnome.org>
19597
19598         * driver.cs (-g): Made -g an alias for --debug.
19599
19600 2002-03-24  Martin Baulig  <martin@gnome.org>
19601
19602         * codegen.cs (SymbolWriter): New public variable. Returns the
19603         current symbol writer.
19604         (CodeGen): Added `bool want_debugging_support' argument to the
19605          constructor. If true, tell the ModuleBuild that we want debugging
19606         support and ask it for the ISymbolWriter.
19607         (Save): If we have a symbol writer, call it's Close() method after
19608         saving the assembly.
19609
19610         * driver.c (--debug): New command line argument to create a
19611         debugger information file.
19612
19613         * location.cs (SymbolDocument): New public property. Returns an
19614         ISymbolDocumentWriter object for the current source file or null
19615         if we don't have a symbol writer.
19616
19617 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19618
19619         * driver.cs (LoadAssembly): Correctly return when all the paths
19620         have been tried and not before.
19621
19622         * statement.cs (Switch.Emit): return the actual coverage for this
19623         statement (returns/not-returns)
19624
19625         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19626         switch of the statement if we are the last switch section.  That
19627         kills two problems: try/catch problems (we used to emit an empty
19628         nop at the end) and switch statements where all branches would
19629         return. 
19630
19631 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19632
19633         * driver.cs: Add default assemblies (the equivalent to the
19634         Microsoft CSC.RSP file)
19635
19636         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19637         also update tokens_seen and set it to false.
19638
19639         * driver.cs: Implement --recurse for Mike.
19640
19641         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19642         correctly splitting out the paths.
19643
19644 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19645
19646         * interface.cs (Interface.PopulateProperty): Instead of using
19647         `parent' as the declaration space for the set parameters, use
19648         `this' 
19649
19650         * support.cs (InternalParameters): InternalParameters constructor
19651         takes a DeclSpace instead of a TypeContainer.
19652
19653         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19654         types are being initialized, load the address of it before calling
19655         the function.  
19656
19657         (New): Provide a mechanism to disable the generation of local
19658         value type temporaries when the caller will be providing us with
19659         an address to store it.
19660
19661         (ArrayCreation.EmitDynamicInitializers): Use it.
19662
19663 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19664
19665         * expression.cs (Invocation.EmitArguments): Only probe for array
19666         property if there is more than one argument.  Sorry about that.
19667
19668         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19669         empty param arrays.
19670
19671         * class.cs (Method.LabelParameters): Fix incorrect code path that
19672         prevented the `ParamArrayAttribute' from being applied to the
19673         params attribute.
19674
19675 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19676
19677         * support.cs (ReflectionParameters): Correctly compute whether the
19678         last argument is a params array.  Fixes the problem with
19679         string.Split ('a')
19680
19681         * typemanager.cs: Make the assemblies array always be non-null
19682         (empty, but non-null)
19683
19684         * tree.cs (RecordDecl): New function that abstracts the recording
19685         of names.  This reports error 101, and provides a pointer to the
19686         previous declaration.  Fixes a crash in the compiler.
19687
19688         * cs-parser.jay (constructor_declaration): Update to new grammar,
19689         and provide a constructor_body that can be empty.
19690
19691 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19692
19693         * driver.cs: Add support for --resources.
19694
19695         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19696         Make all types for the various array helper methods be integer.
19697
19698         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19699         CheckState to ConvCast.
19700
19701         (ConvCast): Now it takes a `checked' state argument, to avoid
19702         depending on the emit context for the conversion, and just using
19703         the resolve time setting.
19704
19705         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19706         instead of Invocation.EmitArguments.  We do not emit the original
19707         arguments, instead we emit those which have been converted to
19708         unsigned int expressions.
19709
19710         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19711
19712         * codegen.cs: ditto.
19713
19714         * expression.cs (LocalVariableReference): Drop the use of the
19715         Store function that depended on the variable index.
19716
19717         * statement.cs (VariableInfo): Drop the `Idx' property from this
19718         class, as this is not taking into account the indexes for
19719         temporaries tat we generate during the execution, getting the
19720         indexes wrong.
19721
19722         * class.cs: First emit class initializers, then call the parent
19723         constructor. 
19724
19725         * expression.cs (Binary): Fix opcode emision.
19726         (UnaryMutator.EmitCode): Support checked code generation
19727
19728         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19729         matches for events for both the Static and Instance scans,
19730         pointing to the same element.   Fix that.
19731
19732 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19733
19734         * rootcontext.cs (ResolveTree): Always set the
19735         interface_resolve_order, because nested interfaces will be calling
19736         into us.
19737
19738         * class.cs (GetInterfaceOrClass): Track the same resolution
19739         process used by TypeManager.LookupType.  This fixes the nested
19740         type lookups in class declarations (separate path from
19741         LookupType). 
19742
19743         (TypeContainer.DefineType): Also define nested interfaces.
19744         (TypeContainer.RegisterOrder): New public function used to
19745         register the order in which child interfaces need to be closed.
19746
19747         Nested interfaces need to be closed after their parents have been
19748         created. 
19749
19750         * interface.cs (InterfaceAttr): Put all the logic for computing
19751         the interface attribute here. 
19752
19753         (DefineInterface): Register our interface order with the
19754         RootContext or with the TypeContainer depending on the case.
19755
19756 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19757
19758         * cs-parser.jay: rework foreach statement to work with the new
19759         changes to the policy on SimpleNames.
19760
19761         * report.cs: support Stacktrace on warnings as well.
19762
19763         * makefile: drop --unsafe and /unsafe from the compile.
19764
19765 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19766
19767         * ecore.cs (StandardConversionExists): Modify to take an Expression
19768         as the first parameter. Ensure we do null -> reference type conversion
19769         checking.
19770
19771         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19772         temporary Expression objects.
19773
19774 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19775
19776         * interface.cs: workaround bug in method overloading resolution
19777         (there is already a bugzilla bug for it).
19778
19779 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19780
19781         We could also solve this problem by having a separate path for
19782         performing type lookups, instead of DoResolve, we could have a
19783         ResolveType entry point, and only participating pieces of the
19784         production (simplename, deref, array) would implement this. 
19785
19786         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19787         signal SimpleName to only resolve type names and not attempt to
19788         resolve anything else.
19789
19790         * expression.cs (Cast): Set the flag.
19791
19792         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19793
19794         * class.cs: Only report 108 if there is no `new' modifier.
19795
19796         * cs-parser.jay: rework foreach statement to work with the new
19797         changes to the policy on SimpleNames.
19798         
19799         * report.cs: support Stacktrace on warnings as well.
19800
19801         * makefile: drop --unsafe and /unsafe from the compile.
19802
19803 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19804
19805         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19806         lookups here, instead of doing that at parse time.  This means
19807         that our grammar will not introduce `LocalVariableReferences' as
19808         expressions at this point.  That solves the problem of code like
19809         this:
19810
19811         class X {
19812            static void Main ()
19813            { int X = 1;
19814             { X x = null }}}
19815
19816         This is only half the fix.  The full fix requires parameters to
19817         also be handled in this way.
19818
19819         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19820         makes the use more obvious of the DeclSpace.  The
19821         ec.TypeContainer.TypeBuilder is now only used to pull the
19822         TypeBuilder for it.
19823
19824         My theory is that I can get rid of the TypeBuilder completely from
19825         the EmitContext, and have typecasts where it is used (from
19826         DeclSpace to where it matters).  
19827
19828         The only pending problem is that the code that implements Aliases
19829         is on TypeContainer, and probably should go in DeclSpace.
19830
19831         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19832         lookups here, instead of doing that at parse time.  This means
19833         that our grammar will not introduce `LocalVariableReferences' as
19834         expressions at this point.  That solves the problem of code like
19835         this:
19836
19837         class X {
19838            static void Main ()
19839            { int X = 1;
19840             { X x = null }}}
19841
19842         This is only half the fix.  The full fix requires parameters to
19843         also be handled in this way.
19844
19845         * class.cs (Property.DefineMethod): When implementing an interface
19846         method, set newslot, when implementing an abstract method, do not
19847         set the flag (before we tried never setting it, or always setting
19848         it, which is the difference).
19849         (Indexer.DefineMethod): same.
19850         (Method.DefineMethod): same.
19851
19852         * ecore.cs: Only set the status used flag if we get back a Field.
19853
19854         * attribute.cs: Temporary hack, so Paolo can keep working.
19855
19856 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19857
19858         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19859         the unmanaged type in the case we have a MarshalAs attribute.
19860
19861         (Resolve): Handle the case when we are parsing the special MarshalAs
19862         attribute [we need to store the unmanaged type to use later]
19863
19864         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19865         MarshalAs Attribute.
19866
19867         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19868         on parameters and accordingly set the marshalling info.
19869
19870 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * class.cs: Optimizing slightly by removing redundant code after
19873         we switched to the `NoTypes' return value.
19874         (Property.DefineMethod): use NoTypes here too.
19875
19876         This fixes the bug I introduced in my last batch of changes.
19877
19878 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19879
19880         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19881
19882         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19883         Enums since those are types too. 
19884
19885         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19886
19887         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19888         thanks to a call during the lookup process.
19889
19890 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19891
19892         * statement.cs (Foreach): Lots of work to accomodate a particular
19893         kind of foreach statement that I had not kept in mind.  It is
19894         possible to have foreachs on classes that provide a GetEnumerator
19895         method that return objects that implement the "pattern" for using
19896         a foreach, there is no need to support GetEnumerator
19897         specifically. 
19898
19899         This is needed to compile nant.
19900
19901         * decl.cs: Only report 114 if the member is not `Finalize' and if
19902         the warning level is at least 2.
19903
19904         * class.cs: Moved the compare function from Method to
19905         MethodSignature. 
19906
19907         (MethodSignature.InheritableMemberSignatureCompare): Add new
19908         filter function that is used to extract inheritable methods from a
19909         class. 
19910
19911         (Method.Define): Use the new `inheritable_method_signature_filter'
19912         delegate
19913
19914         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19915         command. 
19916
19917 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19918
19919         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19920
19921         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19922
19923         * expression.cs: Pass location information to
19924         ConvertImplicitStandard. 
19925
19926         * class.cs: Added debugging code to track return values from
19927         interfaces. 
19928
19929 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19930
19931         * expression.cs (Is.DoResolve): If either side of the `is' is an
19932         interface, do not flag the warning.
19933
19934         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19935         for interfaces
19936
19937         * report.cs: Allow for --fatal to be used with --probe.
19938
19939         * typemanager.cs (NoTypes): Move the definition for the empty Type
19940         array here. 
19941
19942         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19943         properties. 
19944         (TypeContainer.DefineProxy): New function used to proxy to parent
19945         implementations when implementing interfaces.
19946         (TypeContainer.ParentImplements): used to lookup if our parent
19947         implements a public function that is required by an interface.
19948         (TypeContainer.VerifyPendingMethods): Hook this up.
19949
19950         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19951         `modules' and `assemblies' arraylists into arrays.  We only grow
19952         these are the very early start up of the program, so this improves
19953         the speedof LookupType (nicely measured).
19954
19955         * expression.cs (MakeByteBlob): Replaced unsafe code with
19956         BitConverter, as suggested by Paolo.
19957
19958         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19959         folding of string concatenation, but if either side is a string,
19960         and the other is not, then return null, and let the runtime use
19961         the concatenation on the string plus the object (using
19962         `Object.ToString'). 
19963
19964 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19965
19966         Constant Folding has been implemented now.
19967
19968         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19969         the error instead on types that are not supported in one's
19970         complement. 
19971
19972         * constant.cs (Constant and all children): New set of functions to
19973         perform implict and explicit conversions.
19974
19975         * ecore.cs (EnumConstant): Implement the new functions to perform
19976         conversion by proxying to the child expression.
19977
19978         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19979         own separate setting that can not be turned off from the command
19980         line using --unchecked or --checked and is only controlled using
19981         the checked/unchecked statements and expressions.  This setting is
19982         used by the constant folder to flag errors.
19983
19984         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19985         ConstantCheckState as well.   
19986
19987         During Resolve, they also have to flag the state, because the
19988         constant folder runs completely in the Resolve phase.
19989
19990         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19991         well.
19992
19993 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19994
19995         * cfold.cs: New file, this file contains the constant folder.
19996
19997         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19998         argument to track whether we are using the resulting address to
19999         load or store a value and provide better error messages. 
20000
20001         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20002         new AddressOf arguments.
20003
20004         * statement.cs (Foreach.EmitCollectionForeach): Update
20005
20006         * expression.cs (Argument.Emit): Call AddressOf with proper
20007         arguments to track usage.
20008
20009         (New.DoEmit): Call AddressOf with new arguments.
20010
20011         (Unary.Emit): Adjust AddressOf call.
20012
20013 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20014
20015         * cs-parser.jay (member_access): Change the case for pre-defined types
20016         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20017         this suggestion.
20018
20019         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20020         a method body.
20021
20022         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20023         essentially like methods and apply attributes like MethodImplOptions to them too.
20024
20025         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20026         not being null.
20027
20028         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20029         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20030         is the DeclSpace.
20031
20032         * Update code everywhere accordingly.
20033
20034         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20035
20036         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20037
20038 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20039
20040         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20041         try performing lookups against those instead of jumping straight into using
20042         the 'using' clauses.
20043
20044         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20045
20046         (LookupType): Perform lookups in implicit parents too.
20047
20048         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20049         sequence as RootContext.LookupType. 
20050
20051         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20052         the various cases of namespace lookups into this method.
20053
20054 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20055
20056         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20057         in positional arguments)
20058
20059         * class.cs (Operator): Update the AllowedModifiers to contain
20060         extern. 
20061
20062         * cs-parser.jay: Update operator declaration to allow for the
20063         operator body to be empty.
20064
20065         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20066         values. 
20067
20068 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20069
20070         * class.cs (Method.Emit): Label parameters.
20071
20072         * driver.cs: Return 1 or 0 as the program exit code.
20073
20074 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20075
20076         * expression.cs: Special case the `null' object when trying to
20077         auto-compute the type, as anything can be explicitly converted to
20078         that. 
20079
20080         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20081         spotting this Paolo.
20082
20083         (Expression.ImplicitNumericConversion): Perform comparissions of
20084         the type using the underlying type in the case of an enumeration
20085         rather than using the enumeration type for the compare.
20086
20087         Cope with the underlying == type case, which is not possible to
20088         catch before. 
20089
20090         (Expression.ConvertNumericExplicit): Perform comparissions of
20091         the type using the underlying type in the case of an enumeration
20092         rather than using the enumeration type for the compare.
20093
20094         * driver.cs: If the user does not supply an extension, assume .exe
20095
20096         * cs-parser.jay (if_statement): Rewrote so that we can track the
20097         location for the if statement.
20098
20099         * expression.cs (Binary.ConstantFold): Only concat strings when
20100         the operation is "+", not everything ;-)
20101
20102         * statement.cs (Statement.EmitBoolExpression): Take a location
20103         argument. 
20104         (If, While, Do): Track location.
20105
20106         * expression.cs (Binary.ResolveOperator): In the object + string
20107         case, I was missing a call to ConvertImplicit
20108
20109 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20110
20111         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20112         Location arguments. Ensure we use RootContext.LookupType to do our work
20113         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20114
20115         * interface.cs (PopulateMethod): Handle the type of the parameter being
20116         null gracefully.
20117
20118         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20119         have a params method with no fixed arguments and a call is made with no
20120         arguments.
20121
20122 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20125         the verbatim-string-literal
20126
20127         * support.cs (InternalParameters.ParameterModifier): handle null
20128         fixed parameters.
20129         (InternalParameters.ParameterType): ditto.
20130
20131         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20132         duplicating the name of the variable parameter.
20133         (GetParameterByName): Fix bug where we were not looking up array
20134         paramters if they were the only present (thanks Paolo!).
20135         (GetParameterInfo): We only have an empty set of types if both
20136         fixed and array are set to null.
20137         (GetParameterInfo-idx): Handle FixedParameter == null
20138
20139         * cs-parser.jay: Handle the case where there is no catch
20140         statements (missing null test).
20141
20142 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20143
20144         * driver.cs (MainDriver): Be conservative on our command line
20145         handling.
20146
20147         Catch DirectoryNotFoundException when calling GetFiles.
20148
20149         (SplitPathAndPattern): Used to split the input specification into
20150         a path and a pattern that we can feed to Directory.GetFiles.
20151
20152 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20153
20154         * statement.cs (Fixed): Implement the last case of the Fixed
20155         statement (string handling).
20156
20157         * expression.cs (StringPtr): New class used to return a char * to
20158         a string;  Used by the Fixed statement.
20159
20160         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20161
20162         * expression.cs (Binary.ResolveOperator): Remove redundant
20163         MemberLookup pn parent type.
20164         Optimize union call, we do not need a union if the types are the same.
20165         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20166         type.
20167
20168         Specialize the use of MemberLookup everywhere, instead of using
20169         the default settings. 
20170
20171         (StackAlloc): Implement stackalloc keyword.
20172
20173         * cs-parser.jay: Add rule to parse stackalloc.
20174
20175         * driver.cs: Handle /h, /help, /?
20176
20177         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20178         before we supported unsafe code.
20179
20180         * makefile: add --unsafe to the self compilation of mcs.
20181
20182 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20183
20184         * expression.cs (PointerArithmetic): New class that is used to
20185         perform pointer arithmetic.
20186         (Binary.Resolve): Handle pointer arithmetic
20187         Handle pointer comparission.
20188         (ArrayPtr): Utility expression class that is used to take the
20189         address of an array.
20190
20191         (ElementAccess): Implement array access for pointers
20192
20193         * statement.cs (Fixed): Implement fixed statement for arrays, we
20194         are missing one more case before we are done.
20195
20196         * expression.cs (Indirection): Implement EmitAssign and set the
20197         ExprClass to Variable.  This allows pointer dereferences to be
20198         treated as variables, and to have values assigned to them.
20199
20200         * ecore.cs (Expression.StoreFromPtr): New utility function to
20201         store values dereferencing.
20202
20203 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20204
20205         * expression.cs (Binary.ResolveOperator): Ensure that we are
20206         not trying to operate on a void type - this fixes the reported
20207         bug.
20208
20209         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20210         the parent implementation is sealed.
20211
20212         * ../errors/cs0239.cs : Add.
20213
20214         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20215
20216         * typemanager.cs (unverifiable_code_type): Corresponds to 
20217         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20218         which have unsafe code in them.
20219
20220         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20221         unsafe context.
20222
20223 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * cs-tokenizer.cs: Add support for @"litreal strings"
20226
20227         Make tokenizer accept pre-processor directives
20228         on any column (remove the old C-like limitation). 
20229
20230         * rootcontext.cs (EmitCode): Emit any global attributes.
20231         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20232
20233         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20234
20235         * cs-parser.jay: Add support for global attributes.  
20236
20237 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20238
20239         * expression.cs (Indirection): New helper class.  Unary will
20240         create Indirection classes to be able to implement the
20241         IMemoryLocation interface on it.
20242
20243 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20244
20245         * cs-parser.jay (fixed_statement): reference the right statement.
20246
20247         * statement.cs (Fixed.Emit): Finish implementing the fixed
20248         statement for the &x case.
20249
20250 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20251
20252         * class.cs (Property.Define, Method.Define): Remove newslot when
20253         `implementing'.  
20254
20255         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20256         wrong.  NewSlot should only be used if the `new' keyword is present.
20257
20258         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20259         locating our system dir.  Sorry about this.
20260
20261 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20262
20263         * driver.cs (GetSystemDir): Compute correctly the location of our
20264         system assemblies.  I was using the compiler directory instead of
20265         the library directory.
20266
20267 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20268
20269         * expression.cs (BetterFunction): Put back in what Miguel commented out
20270         since it is the correct fix. The problem is elsewhere ;-)
20271
20272         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20273         parameters of the parms method are themselves compatible or not !
20274
20275         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20276         to check that a class implements an interface before saying that an implicit
20277         conversion was allowed. Use ImplementsInterface to do the checking.
20278
20279 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20280
20281         * class.cs (Method.Define): Track whether we are an explicit
20282         implementation or not.  And only call DefineMethodOverride if we
20283         are an explicit implementation.
20284
20285         (Property.DefineMethod): Ditto.
20286
20287 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20288
20289         * expression.cs (BetterFunction): Catch hideous bug which was
20290          preventing us from detecting ambiguous calls due to implicit casts i.e
20291         cs0121.
20292
20293 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20294
20295         * support.cs (Pair): Remove un-needed method.  I figured why I was
20296         getting the error in cs-parser.jay, the variable in a foreach loop
20297         is readonly, and the compiler does not really treat this as a variable.
20298
20299         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20300         instead of EQUALS in grammar.  
20301
20302         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20303
20304         * expression.cs (Unary.DoResolve): Check whether the argument is
20305         managed or not.
20306
20307 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20308
20309         * support.cs: Api for Pair to set a value.  Despite the fact that
20310         the variables are public the MS C# compiler refuses to compile
20311         code that accesses the field if the variable is part of a foreach
20312         statement. 
20313
20314         * statement.cs (Fixed): Begin implementation of the fixed
20315         statement.
20316
20317         (Block.AddVariable): Return the VariableInfo on success and null
20318         on failure instead of true/false. 
20319
20320         * cs-parser.jay (foreach): Catch errors on variables already
20321         defined (we were ignoring this value before) and properly unwind
20322         the block hierarchy
20323
20324         (fixed_statement): grammar for the fixed statement.
20325
20326 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20329         pointer types to be incretemented.
20330
20331         (SizeOf): Implement.
20332
20333         * cs-parser.jay (pointer_member_access): Implement
20334         expr->IDENTIFIER production.
20335
20336         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20337         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20338         on safe contexts.
20339
20340         (Unary): Implement indirection.
20341
20342         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20343         use in non-unsafe context).
20344
20345         (SimpleName.DoResolve): Check for pointers in field access on safe
20346         contexts. 
20347
20348         (Expression.LoadFromPtr): Factor the load-indirect code in this
20349         function.  This was duplicated in UnboxCast and ParameterReference
20350
20351 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20352
20353         * expression.cs (ComposedCast): report an error if a pointer cast
20354         is used in a safe region.
20355
20356         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20357         pointer type casts in unsafe context.
20358
20359         * codegen.cs (EmitContext): Set up IsUnsafe.
20360
20361         * cs-parser.jay (non_expression_type): Add productions for pointer
20362         casts. 
20363
20364         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20365         code.  We should not use force into static mode if the method is
20366         not virtual.  Fixes bug in MIS
20367
20368         * statement.cs (Do.Emit, While.Emit, For.Emit,
20369         Statement.EmitBoolExpression): Add support to Do and While to
20370         propagate infinite loop as `I do return' semantics.
20371
20372         Improve the For case to also test for boolean constants.
20373
20374         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20375         to the list of attributes we can add.
20376
20377         Remove `EmitContext' argument.
20378
20379         * class.cs (Method.Define): Apply parameter attributes.
20380         (Constructor.Define): Apply parameter attributes.
20381         (MethodCore.LabelParameters): Move here the core of labeling
20382         parameters. 
20383
20384         * support.cs (ReflectionParameters.ParameterModifier,
20385         InternalParameters.ParameterModifier): Use IsByRef on the type and
20386         only return the OUT bit for these parameters instead of in/out/ref
20387         flags.
20388
20389         This is because I miss-understood things.  The ParameterInfo.IsIn
20390         and IsOut represent whether the parameter has the [In] and [Out]
20391         attributes set.  
20392
20393 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20394
20395         * ecore.cs (FieldExpr.Emit): Release temporaries.
20396
20397         * assign.cs (LocalTemporary.Release): new function.
20398
20399         * codegen.cs (EmitContext.GetTemporaryStorage,
20400         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20401         temporary storage.  Now we can "put back" localbuilders when we
20402         are done with them
20403
20404 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20405
20406         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20407         need to make a copy of the variable to generate verifiable code.
20408
20409 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20410
20411         * driver.cs: Compute dynamically the system directory.
20412
20413         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20414         Slower, but more generally useful.  Used by the abstract
20415         registering implementation. 
20416
20417         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20418         the rules for the special rule on Type/instances.  First check if
20419         we have the same name, and if so, try that special static path
20420         rather than the instance path.
20421
20422 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20423
20424         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20425         for, while and if.
20426
20427         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20428         Enum, ValueType, Delegate or Array for non-corlib compiles.
20429
20430         * cs-tokenizer.cs: Catch long identifiers (645)
20431
20432         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20433         piece of code.
20434
20435         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20436         fix, we were returning too early, so we were not registering
20437         pending methods from abstract classes.
20438
20439         Do not register pending methods if the class is abstract.
20440
20441         * expression.cs (Conditional.DoResolve): Report circular implicit
20442         conversions when we neecd to compute it for conditional
20443         expressions. 
20444
20445         (Is.DoResolve): If the expression is always of the provided type,
20446         flag warning 183.  If the expression can not ever be of the
20447         provided type flag warning 184.
20448
20449         * class.cs: Catch 169 as well.
20450
20451         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20452         read. 
20453
20454 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20455
20456         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20457
20458 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20459
20460         * interface.cs: (PopulateMethod): Check for pointers being defined
20461         only if the unsafe context is active.
20462         (PopulateProperty): ditto.
20463         (PopulateIndexer): ditto.
20464
20465         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20466         specified.  If pointers are present, make sure that they are
20467         present in an unsafe context.
20468         (Constructor, Constructor.Define): ditto.
20469         (Field, Field.Define): ditto.
20470         (Property, Property.Define): ditto.
20471         (Event, Event.Define): ditto.
20472
20473         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20474         hashtable if there are classes or structs defined.
20475
20476         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20477         code, as the constant resolution moved.
20478
20479         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20480         the metadata, so we can flag error 133. 
20481
20482         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20483         pointer is being declared in an unsafe context.
20484
20485 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20486
20487         * modifiers.cs (Modifiers.Check): Require a Location argument.
20488         Report error 227 for Unsafe use.
20489
20490         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20491
20492         * statement.cs (For.Emit): If the test is null, then report that
20493         we do `return', as we wont reach anything afterwards.
20494
20495         (Switch.SwitchGoverningType): Track the expression that matched
20496         the conversion.
20497
20498         * driver.cs: Allow negative numbers as an error code to flag.
20499
20500         * cs-parser.jay: Handle 1551.
20501
20502         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20503
20504 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20505
20506         * cs-parser.jay: Report 1518 (type declaration can only contain
20507         class, struct, interface, enum or delegate)
20508
20509         (switch_label): Report 1523 (keywords `case' or `default' must
20510         preced code)
20511
20512         (opt_switch_sections): Report 1522 (empty switch)
20513
20514         * driver.cs: Report 1515 (response file specified multiple times)
20515         Report 1516 (Source file specified multiple times).
20516
20517         * expression.cs (Argument.Resolve): Signal 1510
20518
20519         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20520         access not allowed in static code)
20521
20522 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20523
20524         * typemanager.cs (IsPointerType): Utility method which we are going
20525         to need a lot.
20526
20527         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20528         the object type, so we take care of that.
20529
20530         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20531
20532         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20533         added to non-params parameters :-)
20534
20535         * typemanager.cs (CSharpName): Include 'void' type too. 
20536
20537         (void_ptr_type): Include in the set of core types.
20538
20539         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20540         duplicating code.
20541
20542         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20543         an unsafe context.
20544
20545         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20546         completely forgotten about it.
20547
20548 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20549
20550         * cs-parser.jay (pointer_type): Add. This begins our implementation
20551         of parsing rules for unsafe code.
20552
20553         (unsafe_statement): Implement.
20554
20555         (embedded_statement): Modify to include the above.
20556
20557         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20558
20559         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20560         if the current context is an unsafe one.
20561
20562         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20563         are handled differently, we need separate rules for them.
20564
20565         (local_variable_declaration): Update to use local_variable_pointer_type
20566         to allow variable declarations of unmanaged pointer types.
20567
20568         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20569         in unsafe contexts.
20570
20571         * ../errors/cs0214.cs : Add.
20572
20573 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20574
20575         * makefile: remove 'response' file when cleaning.
20576
20577 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20578
20579         * cs-parser.jay: Report 1524.
20580
20581 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20582
20583         * typemanager.cs (RegisterMethod): drop checking if we have
20584         registered this from here
20585
20586 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * class.cs (Method.EmitDestructor): Implement calling our base
20589         destructor. 
20590
20591         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20592         value of InFinally.
20593
20594         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20595         this routine and will wrap the call in a try/catch block.  Deal
20596         with the case.
20597
20598 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20599
20600         * ecore.cs (Expression.MemberLookup): instead of taking a
20601         parameter `same_type' that was used to tell whether we could
20602         access private members we compute our containing type from the
20603         EmitContext.
20604
20605         (FieldExpr): Added partial support for volatile fields.  This does
20606         not work for volatile fields exposed from assemblies, as I can not
20607         figure out how to extract the modreq from it.
20608
20609         Updated all the source files to use this.
20610
20611         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20612         because it is referenced by MemberLookup very often. 
20613
20614 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20615
20616         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20617         TypeBuilder.GetCustomAttributes to retrieve what we need.
20618
20619         Get rid of redundant default_member_attr_type as this is the same as
20620         default_member_type which already exists.
20621
20622         * interface.cs, attribute.cs : Update accordingly.
20623
20624 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20625
20626         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20627         work for TYpeBuilders though.  Ravi, can you please fix this?
20628
20629         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20630
20631         * expression.cs (Argument.Emit): Handle the case of ref objects
20632         being passed to ref functions;  
20633
20634         (ParameterReference.EmitLoad): Loads the content of the pointer
20635         without dereferencing.
20636
20637 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20638
20639         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20640
20641 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20642
20643         * class.cs (Indexer.DefineMethod): Incorporate the interface
20644         type in the name of the method if we are doing explicit interface
20645         implementation.
20646
20647         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20648
20649         (BetterConversion): Fix extremely trivial bug where we were referring to
20650         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20651         again !
20652
20653         * ../errors/bug16.cs : Add although we have fixed it.
20654
20655 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20656
20657         * expression.cs (BaseIndexer): Begin implementation.
20658
20659         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20660
20661         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20662         production directly to remove a shift/reduce, and implement
20663         explicit interface implementation.
20664
20665         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20666         after a floating point suffix.
20667
20668         * expression.cs (DoNumericPromotions): Improved the conversion for
20669         uint/uint.  If we have a constant, we avoid doing a typecast to a
20670         larger type.
20671
20672         * class.cs (Indexer): Implement explicit interface implementation
20673         for indexers.
20674
20675 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20676
20677         * class.cs: make the default instance constructor public and hidebysig.
20678
20679 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20680
20681         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20682         so we can call it from elsewhere.
20683
20684         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20685         we emit it internally if the class has a defined indexer; otherwise the user
20686         emits it by decorating the class definition with the DefaultMemberAttribute.
20687
20688         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20689         attribute is not used on a type which defines an indexer.
20690
20691         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20692         character when we skip whitespace.
20693
20694         * ../errors/cs0646.cs : Add.
20695
20696 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20697
20698         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20699         again. 
20700
20701         * makefile: Add practical target `mcs3.exe' which builds the third
20702         generation compiler. 
20703
20704         * expression.cs (New): Fix structures constructor calling.
20705
20706         * class.cs (Property, Method, Indexer): Emit Final flag on the
20707         method if we are an interface implementation and we are not
20708         abstract. 
20709
20710         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20711         whether this property is referencing a `base' method.
20712
20713         * expression.cs (Invocation.EmitCall): take an extra argument:
20714         is_base, this is used to determine whether the `call' or
20715         `callvirt' opcode should be used.
20716
20717
20718         * delegate.cs: update EmitCall.
20719
20720         * class.cs (Method.Define): Set NewSlot for the cases where we are
20721         not implementing an interface method.
20722
20723         (Property.Define): ditto.
20724
20725 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20728         'r'.  Allows mcs to parse itself fully.
20729
20730 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20731
20732         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20733         of the number of initializers that require the InitializeArray method.
20734
20735         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20736         update the above field where necessary.
20737
20738         (MakeByteBlob): Update accordingly.
20739
20740         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20741         greater than 2.
20742
20743         (EmitDynamicInitializers): Update in accordance with the new optimization.
20744
20745         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20746         same OpCode applies.
20747
20748         * cs-parser.jay : Fix some glaring errors I introduced.
20749
20750 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20751
20752         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20753         so that we can check for name clashes there too.
20754
20755         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20756         for interface indexers.
20757
20758         * interfaces.cs (Define): Emit the default member attribute.
20759
20760         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20761         variable was being referred to while setting the value ;-)
20762
20763 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20764
20765         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20766         byte-by-byte information when we know the data is zero.
20767
20768         Make the block always a multiple of 4, because
20769         DefineInitializedData has a bug.
20770
20771         * assign.cs: Fix, we should assign from the temporary, not from
20772         the source. 
20773
20774         * expression.cs (MakeByteBlob): Fix my incorrect code.
20775
20776 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20777
20778         * typemanager.cs (EnumToUnderlying): This function is used to get
20779         the underlying type from an enumeration, because it does not
20780         always work. 
20781
20782         * constant.cs: Use the I4_S form for values between -128 and 127.
20783
20784         * statement.cs (Block.LookupLabel): Looks up a label.
20785         (Block): Drop support for labeled blocks.
20786
20787         (LabeledStatement): New kind of statement that represents a label
20788         only.
20789
20790         (Goto): Finally implement this bad boy.
20791
20792         * cs-parser.jay: Update to reflect new mechanism to implement
20793         labels.
20794
20795 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20796
20797         * codegen.cs (EmitContext.This): a codegen property that keeps the
20798         a single instance of this instead of creating many different this
20799         instances. 
20800
20801         * delegate.cs (Delegate.DoResolve): Update to use the property;
20802
20803         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20804
20805         * expression.cs (BaseAccess.DoResolve): Ditto.
20806
20807 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20808
20809         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20810         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20811
20812         (InitCoreTypes): Update accordingly.
20813
20814         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20815         so we can quickly store the state.
20816
20817         (ApplyAttributes): Set the correct implementation flags
20818         for InternalCall methods.
20819
20820 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20821
20822         * expression.cs (EmitCall): if a method is not virtual, then do
20823         not use callvirt on it.
20824
20825         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20826         user defined stuff) requires the use of stobj, which takes an
20827         address on the stack instead of an array and an index.  So emit
20828         the Ldelema operation for it.
20829
20830         (EmitStoreOpcode): Use stobj for valuetypes.
20831
20832         (UnaryMutator.EmitCode): Use the right 1 value depending on
20833         whether we are dealing with int64/uint64, float or doubles.
20834
20835         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20836         constructors that I implemented last night.
20837
20838         (Constructor.IsDefault): Fix to work properly for static
20839         constructors.
20840
20841         * cs-parser.jay (CheckDef): report method signature errors.
20842         Update error number 103 to be 132.
20843
20844         * decl.cs: New AdditionResult enumeration value: MethodExists.
20845         Although we do this check for methods later on in the semantic
20846         analysis, catching repeated default constructors is so easy that
20847         we catch these here. 
20848
20849         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20850         promotions code.
20851
20852         (ParameterReference.EmitAssign, Emit): handle
20853         bools as bytes.
20854
20855         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20856         (ArrayAccess.EmitStoreOpcode): ditto.
20857
20858         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20859
20860         * expression.cs (MakeByteBlob): Complete all the missing types
20861         (uint, short, ushort, byte, sbyte)
20862
20863         * class.cs: Only init instance field initializers on instance
20864         constructors. 
20865
20866         Rename `constructors' to instance_constructors. 
20867
20868         (TypeContainer.AddConstructor): Only add constructors to the list
20869         if it is not static.
20870
20871         Make sure that we handle default_static_constructor independently
20872         everywhere where we handle instance_constructors
20873
20874 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20875
20876         * class.cs: Do not lookup or create a base initializer for a
20877         static constructor.
20878
20879         (ConstructorInitializer.Resolve): use the proper type to lookup
20880         for constructors.
20881
20882         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20883
20884         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20885         in DeclSpace. 
20886
20887         * decl.cs: CloseType is now an virtual method, the default
20888         implementation just closes this type.
20889
20890 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20891
20892         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20893         to PreserveSig by default. Also emit HideBySig on such methods.
20894
20895         Basically, set the defaults to standard values.
20896
20897         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20898         argument, if candidate is better, it can't be worse than the best !
20899
20900         (Invocation): Re-write bits to differentiate between methods being
20901         applicable in their expanded form and their normal form - for params
20902         methods of course.
20903
20904         Get rid of use_standard everywhere as only standard conversions are allowed
20905         in overload resolution. 
20906
20907         More spec conformance.
20908
20909 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20910
20911         * driver.cs: Add --timestamp, to see where the compiler spends
20912         most of its time.
20913
20914         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20915         `this' in static code.
20916
20917         (SimpleName.DoResolve): Implement in terms of a helper function
20918         that allows static-references to be passed upstream to
20919         MemberAccess.
20920
20921         (Expression.ResolveWithSimpleName): Resolve specially simple
20922         names when called by MemberAccess to implement the special
20923         semantics. 
20924
20925         (Expression.ImplicitReferenceConversion): Handle conversions from
20926         Null to reference types before others, as Null's type is
20927         System.Object. 
20928
20929         * expression.cs (Invocation.EmitCall): Handle the special case of
20930         calling methods declared on a reference type from a ValueType
20931         (Base classes System.Object and System.Enum)
20932
20933         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20934         the left hand side is a TypeExpr, not on every enumeration. 
20935
20936         (Binary.Resolve): If types are reference types, then do a cast to
20937         object on operators != and == of both arguments.
20938
20939         * typemanager.cs (FindMembers): Extract instance and static
20940         members if requested.
20941
20942         * interface.cs (PopulateProperty): Use void_type instead of null
20943         as the return type for the setter method.
20944
20945         (PopulateIndexer): ditto.
20946
20947 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20948
20949         * support.cs (ReflectionParameters): Fix minor bug where we
20950         were examining the wrong parameter for the ParamArray attribute.
20951
20952         Cope with requests for the type of the parameter at position
20953         greater than the params parameter's. We now return the element
20954         type of the params array as that makes more sense.
20955
20956         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20957         accordingly as we no longer have to extract the element type
20958         ourselves.
20959
20960         (Invocation.OverloadResolve): Update.
20961
20962 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20963
20964         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20965         against IEnumerator, test whether the return value is a descendant
20966         of the IEnumerator interface.
20967
20968         * class.cs (Indexer.Define): Use an auxiliary method to implement
20969         the other bits of the method definition.  Begin support for
20970         explicit interface implementation.
20971
20972         (Property.DefineMethod): Use TypeManager.void_type instead of null
20973         for an empty return value.
20974
20975 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20976
20977         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20978         dealing with a FieldExpr which is composed of a FieldBuilder, in
20979         the code path we did extract the constant, but we should have
20980         obtained the underlying value to be able to cast it (otherwise we
20981         end up in an infinite loop, this is what Ravi was running into).
20982
20983         (ArrayCreation.UpdateIndices): Arrays might be empty.
20984
20985         (MemberAccess.ResolveMemberAccess): Add support for section
20986         14.5.4.1 that deals with the special case of E.I when E is a type
20987         and something else, that I can be a reference to a static member.
20988
20989         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20990         handle a particular array type to create byte blobs, it is just
20991         something we dont generate byteblobs for.
20992
20993         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20994         arguments. 
20995
20996         * location.cs (Push): remove the key from the hashtable that we
20997         are about to add.   This happens for empty files.
20998
20999         * driver.cs: Dispose files after we have parsed them.
21000
21001         (tokenize): new function that only runs the tokenizer on its
21002         input, for speed testing.
21003
21004 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21005
21006         * class.cs (Event.Define): Define the private field only if there
21007         are no accessors defined.
21008
21009         * expression.cs (ResolveMemberAccess): If there is no associated
21010         field with the event, that means we have an event defined with its
21011         own accessors and we should flag error cs0070 since transforming
21012         ourselves into a field is not valid in that case.
21013
21014         * ecore.cs (SimpleName.DoResolve): Same as above.
21015
21016         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21017         and charset to sane values.
21018
21019 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21020
21021         * assign.cs (DoResolve): Perform check on events only if they 
21022         are being accessed outside the declaring type.
21023
21024         * cs-parser.jay (event_declarations): Update rules to correctly
21025         set the type of the implicit parameter etc.
21026
21027         (add_accessor, remove_accessor): Set current local parameters.
21028
21029         * expression.cs (Binary): For delegate addition and subtraction,
21030         cast the return value from the method into the appropriate delegate
21031         type.
21032
21033 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21034
21035         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21036         of these as the workaround is unnecessary.
21037
21038         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21039         delegate data - none of that is needed at all.
21040
21041         Re-write bits to extract the instance expression and the delegate method
21042         correctly.
21043
21044         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21045         on delegates too.
21046
21047         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21048         of attaching attributes instead of duplicating code everywhere.
21049
21050         * everywhere : Update code to do attribute emission using the above method.
21051
21052 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21053
21054         * expression.cs (IsParamsMethodApplicable): if there are not
21055         parameters, return immediately.
21056
21057         * ecore.cs: The 0 literal can be implicity converted to an enum
21058         type. 
21059
21060         (SimpleName.DoResolve): First lookup the type, then lookup the
21061         members. 
21062
21063         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21064         want to get its address.  If the InstanceExpression is not
21065         addressable, store the result in a temporary variable, then get
21066         the address of it.
21067
21068         * codegen.cs: Only display 219 errors on warning level or above. 
21069
21070         * expression.cs (ArrayAccess): Make it implement the
21071         IMemoryLocation interface.
21072
21073         (Binary.DoResolve): handle the operator == (object a, object b)
21074         and operator != (object a, object b) without incurring into a
21075         BoxedCast (because 5 != o should never be performed).
21076
21077         Handle binary enumerator operators.
21078
21079         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21080         value type, otherwise use Ldelem_ref.
21081
21082         Use precomputed names;
21083
21084         (AddressOf): Implement address of
21085
21086         * cs-parser.jay (labeled_statement): Fix recursive block
21087         addition by reworking the production.
21088
21089         * expression.cs (New.DoEmit): New has a special case:
21090                 
21091                  If we are dealing with a ValueType, we have a few
21092                  situations to deal with:
21093                 
21094                     * The target of New is a ValueType variable, that is
21095                       easy, we just pass this as the variable reference
21096                 
21097                     * The target of New is being passed as an argument,
21098                       to a boxing operation or a function that takes a
21099                       ValueType.
21100                 
21101                       In this case, we need to create a temporary variable
21102                       that is the argument of New.
21103
21104
21105 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21106
21107         * rootcontext.cs (LookupType): Check that current_type is not null before
21108         going about looking at nested types.
21109
21110         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21111         not implement the IAssignMethod interface any more.
21112
21113         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21114         where we tranform them into FieldExprs if they are being resolved from within
21115         the declaring type.
21116
21117         * ecore.cs (SimpleName.DoResolve): Do the same here.
21118
21119         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21120
21121         * ../errors/bug10.cs : Add.
21122
21123         * ../errors/cs0070.cs : Add.
21124
21125         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21126
21127         * assign.cs : Get rid of EventIsLocal everywhere.
21128
21129 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21130
21131         * ecore.cs (ConvertIntLiteral): finished the implementation.
21132
21133         * statement.cs (SwitchLabel): Convert the value we are using as a
21134         key before looking up the table.
21135
21136 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21137
21138         * codegen.cs (EmitTopBlock): Require a Location argument now.
21139
21140         * cs-parser.jay (constructor_declarator): We need to setup
21141         current_local_parameters before we parse the
21142         opt_constructor_initializer, to allow the variables to be bound
21143         to the constructor arguments.
21144
21145         * rootcontext.cs (LookupType): First lookup nested classes in our
21146         class and our parents before we go looking outside our class.
21147
21148         * expression.cs (ConstantFold): Extract/debox the values at the
21149         beginnning. 
21150
21151         * rootcontext.cs (EmitCode): Resolve the constants first before we
21152         resolve the types.  This is not really needed, but it helps debugging.
21153
21154         * statement.cs: report location.
21155
21156         * cs-parser.jay: pass location to throw statement.
21157
21158         * driver.cs: Small bug fix.
21159
21160         * report.cs: Updated format to be 4-zero filled digits.
21161
21162 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21163
21164         * expression.cs (CheckIndices): Fix minor bug where the wrong
21165         variable was being referred to ;-)
21166
21167         (DoEmit): Do not call EmitStaticInitializers when the 
21168         underlying type is System.Object.
21169
21170 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21171
21172         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21173         and do the usual workaround for SRE.
21174
21175         * class.cs (MyEventBuilder.EventType): New member to get at the type
21176         of the event, quickly.
21177
21178         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21179
21180         * assign.cs (Assign.DoResolve): Handle the case when the target
21181         is an EventExpr and perform the necessary checks.
21182
21183         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21184         interface.
21185
21186         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21187
21188         (EventExpr): Set the type in the constructor itself since we 
21189         are meant to be born fully resolved.
21190
21191         (EventExpr.Define): Revert code I wrote earlier.
21192                 
21193         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21194         instance expression is null. The instance expression is a This in that case
21195         or a null, depending on whether it is a static method or not.
21196
21197         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21198         refers to more than one method.
21199
21200         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21201         and accordingly flag errors.
21202
21203 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21204
21205         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21206
21207 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21208
21209         * location.cs (ToString): Provide useful rutine.
21210
21211 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21212
21213         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21214         objects, return the actual integral boxed.
21215
21216         * statement.cs (SwitchLabel): define an ILLabel for each
21217         SwitchLabel. 
21218
21219         (Switch.CheckSwitch): If the value is a Literal, extract
21220         the underlying literal.
21221
21222         Also in the unused hashtable we had, add the SwitchLabel so we can
21223         quickly look this value up.
21224
21225         * constant.cs: Implement a bunch of new constants.  Rewrite
21226         Literal based on this.  Made changes everywhere to adapt to this.
21227
21228         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21229         dereferencing array only once, and also copes with enumrations.
21230
21231         bytes are two bytes wide, not one.
21232
21233         (Cast): Perform constant conversions.
21234
21235         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21236         wrappers to the literals here.
21237
21238         * expression.cs (DoNumericPromotions): long literals can converted
21239         to ulong implicity (this is taken care of elsewhere, but I was
21240         missing this spot).
21241
21242         * ecore.cs (Expression.Literalize): Make the return type Literal,
21243         to improve type checking.
21244
21245         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21246
21247 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21248
21249         * literal.cs: Revert code from ravi that checked the bounds.  The
21250         bounds are sane by the definition of the type itself. 
21251
21252         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21253         need to actually look up in our parent hierarchy for interfaces
21254         implemented. 
21255
21256         * const.cs: Use the underlying type for enumerations
21257
21258         * delegate.cs: Compute the basename for the delegate creation,
21259         that should fix the delegate test case, and restore the correct
21260         Type Lookup semantics in rootcontext
21261
21262         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21263         referencing a nested type with the Reflection API is using the "+"
21264         sign. 
21265
21266         * cs-parser.jay: Do not require EOF token at the end.
21267
21268 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21269
21270         * rootcontext.cs (LookupType): Concatenate type names with
21271         a '.' instead of a '+' The test suite passes again.
21272
21273         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21274         field of the enumeration.
21275
21276         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21277         the case when the member is an EventExpr.
21278
21279         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21280         static has an associated instance expression.
21281
21282         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21283
21284         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21285
21286         * class.cs (Event.Define): Register event and perform appropriate checks
21287         for error #111.
21288
21289         We define the Add and Remove methods even if the use provides none because
21290         in that case, we provide default implementations ourselves.
21291
21292         Define a private field of the type of the event. This is done by the CSC compiler
21293         and we should be doing it too ;-)
21294
21295         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21296         More methods we use in code we generate.
21297
21298         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21299         is important.
21300
21301         (InitCoreTypes): Update accordingly for the above.
21302
21303         * class.cs (Event.Emit): Generate code for default accessors that we provide
21304
21305         (EmitDefaultMethod): Do the job in the above.
21306
21307         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21308         appropriate place.
21309
21310 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21311
21312         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21313         builders even if we were missing one.
21314
21315         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21316         pass the Basename as our class name instead of the Name.  The
21317         basename will be correctly composed for us.
21318
21319         * parameter.cs (Paramters): Now takes a Location argument.
21320
21321         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21322         make all the code call directly LookupType in RootContext and take
21323         this chance to pass the Location information everywhere.
21324
21325         * Everywhere: pass Location information.
21326
21327 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21328
21329         * class.cs (Constructor.Define): Updated way of detecting the
21330         length of the parameters.
21331
21332         (TypeContainer.DefineType): Use basename as the type name for
21333         nested types.
21334
21335         (TypeContainer.Define): Do not recursively define types here, as
21336         definition is taken care in order by the RootContext.
21337
21338         * tree.cs: Keep track of namespaces in a per-file basis.
21339
21340         * parameter.cs (Parameter.ComputeSignature): Update to use
21341         DeclSpace. 
21342
21343         (Parameters.GetSignature): ditto.
21344
21345         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21346         instead of a TypeContainer.
21347
21348         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21349         resolve names.  Because we need to be resolve in our context, not
21350         our parents.
21351
21352         * driver.cs: Implement response files.
21353
21354         * class.cs (TypeContainer.DefineType): If we are defined, do not
21355         redefine ourselves.
21356
21357         (Event.Emit): Emit the code for add/remove handlers.
21358         (Event.Define): Save the MethodBuilders for add/remove.
21359
21360         * typemanager.cs: Use pair here too.
21361
21362         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21363         DictionaryEntry requires the first argument to be non-null.  
21364
21365         (enum_declaration): Compute full name for registering the
21366         enumeration.
21367
21368         (delegate_declaration): Instead of using
21369         formal_parameter_list, use opt_formal_parameter_list as the list
21370         can be empty.
21371
21372         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21373         (EventParsing): New property that controls whether `add' and
21374         `remove' are returned as tokens or identifiers (for events);
21375
21376 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21377
21378         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21379         use MyEventBuilder only and let it wrap the real builder for us.
21380
21381         (MyEventBuilder): Revamp constructor etc.
21382
21383         Implement all operations that we perform on EventBuilder in precisely the same
21384         way here too.
21385
21386         (FindMembers): Update to use the EventBuilder member.
21387
21388         (Event.Emit): Update accordingly.
21389
21390 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21391
21392         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21393         by calling the appropriate methods.
21394
21395         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21396         useful.
21397
21398         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21399
21400 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21401
21402         * delegate.cs (Delegate.Populate): Check that the return type
21403         and various parameters types are indeed accessible.
21404
21405         * class.cs (Constructor.Define): Same here.
21406
21407         (Field.Define): Ditto.
21408
21409         (Event.Define): Ditto.
21410
21411         (Operator.Define): Check that the underlying Method defined itself
21412         correctly - so it's MethodBuilder should not be null.
21413
21414         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21415         expression happens to be null.
21416
21417         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21418         members but as of now we don't seem to be able to do anything really useful with it.
21419
21420         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21421         not the EventBuilder.
21422
21423 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21424
21425         * cs-tokenizer.cs: Add support for defines.
21426         Add support for #if, #elif, #else, #endif
21427
21428         (eval_var): evaluates a variable.
21429         (eval): stubbed for evaluating functions.
21430
21431         * cs-parser.jay: Pass the defines information
21432
21433         * driver.cs: Add --define command line option.
21434
21435         * decl.cs: Move MemberCore here.
21436
21437         Make it the base class for DeclSpace.  This allows us to catch and
21438         report 108 and 109 for everything now.
21439
21440         * class.cs (TypeContainer.Define): Extract all the members
21441         before populating and emit the warning 108 (new keyword required
21442         to override) instead of having each member implement this.
21443
21444         (MemberCore.Define): New abstract method, we will be using this in
21445         the warning reporting engine in Populate.
21446
21447         (Operator.Define): Adjust to new MemberCore protocol. 
21448
21449         * const.cs (Const): This does not derive from Expression, it is a
21450         temporary object we use to create fields, it is a MemberCore. 
21451
21452         * class.cs (Method.Define): Allow the entry point to be in a
21453         specific class.
21454
21455         * driver.cs: Rewrite the argument handler to clean it up a bit.
21456
21457         * rootcontext.cs: Made it just an auxiliary namespace feature by
21458         making everything static.
21459
21460         * driver.cs: Adapt code to use RootContext type name instead of
21461         instance variable.
21462
21463         * delegate.cs: Remove RootContext argument.
21464
21465         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21466         argument. 
21467
21468         * class.cs (Event.Define): The lookup can fail.
21469
21470         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21471
21472         * expression.cs: Resolve the this instance before invoking the code.
21473
21474 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21475
21476         * cs-parser.jay: Add a production in element_access that allows
21477         the thing to become a "type" reference.  This way we can parse
21478         things like "(string [])" as a type.
21479
21480         Note that this still does not handle the more complex rules of
21481         casts. 
21482
21483
21484         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21485
21486         * ecore.cs: (CopyNewMethods): new utility function used to
21487         assemble the list of methods from running FindMembers.
21488
21489         (MemberLookup): Rework FindMembers so that 
21490
21491 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21492
21493         * class.cs (TypeContainer): Remove Delegates who fail to be
21494         defined.
21495
21496         * delegate.cs (Populate): Verify that we dont get null return
21497         values.   TODO: Check for AsAccessible.
21498
21499         * cs-parser.jay: Use basename to emit error 574 (destructor should
21500         have the same name as container class), not the full name.
21501
21502         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21503         possible representation.  
21504
21505         Also implements integer type suffixes U and L.
21506
21507 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21508
21509         * expression.cs (ArrayCreation.DoResolve): We need to do the
21510         argument resolution *always*.
21511
21512         * decl.cs: Make this hold the namespace.  Hold the root context as
21513         well.
21514         (LookupType): Move here.
21515
21516         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21517
21518         * location.cs (Row, Name): Fixed the code, it was always returning
21519         references to the first file.
21520
21521         * interface.cs: Register properties defined through interfaces.
21522
21523         * driver.cs: Add support for globbing on the command line
21524
21525         * class.cs (Field): Make it derive from MemberCore as well.
21526         (Event): ditto.
21527
21528 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21529
21530         * class.cs (Event::Define): Check that the type of the event is a delegate
21531         type else flag error #66.
21532
21533         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21534         same.
21535
21536         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21537         values of EntryPoint, CharSet etc etc.
21538
21539         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21540
21541         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21542         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21543         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21544         which needs this to do its work.
21545
21546         * ../errors/cs0066.cs : Add.
21547
21548 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21549
21550         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21551         helper functions.
21552
21553         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21554         clears out the parameters field.
21555         (MemberSignatureCompare): Cleanup
21556
21557         (MemberCore): New base class used to share code between MethodCore
21558         and Property.
21559
21560         (RegisterRequiredImplementations) BindingFlags.Public requires
21561         either BindingFlags.Instace or Static.  Use instance here.
21562
21563         (Property): Refactored code to cope better with the full spec.
21564
21565         * parameter.cs (GetParameterInfo): Return an empty array instead
21566         of null on error.
21567
21568         * class.cs (Property): Abstract or extern properties have no bodies.
21569
21570         * parameter.cs (GetParameterInfo): return a zero-sized array.
21571
21572         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21573         method modifier validation to the typecontainer so we can reuse
21574         this on properties.
21575
21576         (MethodCore.ParameterTypes): return an empty sized array of types.
21577
21578         (Property.Define): Test property modifier validity.
21579
21580         Add tests for sealed/override too.
21581
21582         (Method.Emit): abstract or extern methods have no bodies.
21583
21584 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21585
21586         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21587         thing.
21588
21589         (Method::Define, ::Emit): Modify accordingly.
21590
21591         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21592
21593         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21594
21595         * makefile: Pass in /unsafe.
21596
21597 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21598
21599         * class.cs (MakeKey): Kill routine.
21600
21601         * class.cs (TypeContainer.Define): Correctly define explicit
21602         method implementations (they require the full interface name plus
21603         the method name).
21604
21605         * typemanager.cs: Deply the PtrHashtable here and stop using the
21606         lame keys.  Things work so much better.
21607
21608         This of course broke everyone who depended on `RegisterMethod' to
21609         do the `test for existance' test.  This has to be done elsewhere.
21610
21611         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21612         the object stupid Equals method (because, that like fails all over
21613         the place).  We still do not use it.
21614
21615         * class.cs (TypeContainer.SetRequiredInterface,
21616         TypeContainer.RequireMethods): Killed these two routines and moved
21617         all the functionality to RegisterRequiredImplementations.
21618
21619         (TypeContainer.RegisterRequiredImplementations): This routine now
21620         registers all the implementations required in an array for the
21621         interfaces and abstract methods.  We use an array of structures
21622         which can be computed ahead of time to reduce memory usage and we
21623         also assume that lookups are cheap as most classes will not
21624         implement too many interfaces.
21625
21626         We also avoid creating too many MethodSignatures.
21627
21628         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21629         clear the "pending" bit if we find that there are problems with
21630         the declaration.
21631
21632         (TypeContainer.VerifyPendingMethods): Update to report errors of
21633         methods that look like implementations but are not.
21634
21635         (TypeContainer.Define): Add support for explicit interface method
21636         implementation. 
21637
21638 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * typemanager.cs: Keep track of the parameters here instead of
21641         being a feature of the TypeContainer.
21642
21643         * class.cs: Drop the registration of parameters here, as
21644         InterfaceMethods are also interface declarations.
21645
21646         * delegate.cs: Register methods with the TypeManager not only with
21647         the TypeContainer.  This code was buggy.
21648
21649         * interface.cs: Full registation here.
21650
21651 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21652
21653         * expression.cs: Remove reducer for binary expressions, it can not
21654         be done this way.
21655
21656         * const.cs: Put here the code that used to go into constant.cs
21657
21658         * constant.cs: Put here the code for constants, this is a new base
21659         class for Literals.
21660
21661         * literal.cs: Make Literal derive from Constant.
21662
21663 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * statement.cs (Return.Emit): Report error 157 if the user
21666         attempts to return from a finally block.
21667
21668         (Return.Emit): Instead of emitting a return, jump to the end of
21669         the function.
21670
21671         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21672         LocalBuilder to store the result of the function.  ReturnLabel is
21673         the target where we jump.
21674
21675
21676 2001-12-09  Radek Doulik  <rodo@ximian.com>
21677
21678         * cs-parser.jay: remember alias in current namespace
21679
21680         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21681         namespaces
21682
21683         * class.cs (LookupAlias): lookup alias in my_namespace
21684
21685         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21686         aliases hashtable
21687         (LookupAlias): lookup alias in this and if needed in parent
21688         namespaces
21689
21690 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21691
21692         * support.cs: 
21693
21694         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21695         making things static.  I need this to avoid passing the
21696         TypeContainer when calling ParameterType.
21697
21698         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21699         that did string manipulation to compute the type and then call
21700         GetType.  Use Parameter.ParameterType instead.
21701
21702         * cs-tokenizer.cs: Consume the suffix for floating values.
21703
21704         * expression.cs (ParameterReference): figure out whether this is a
21705         reference parameter or not.  Kill an extra variable by computing
21706         the arg_idx during emission.
21707
21708         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21709         function that returns whether a parameter is an out/ref value or not.
21710
21711         (Parameter.ParameterType): The type of the parameter (base,
21712         without ref/out applied).
21713
21714         (Parameter.Resolve): Perform resolution here.
21715         (Parameter.ExternalType): The full type (with ref/out applied).
21716
21717         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21718         support for expressions on the using statement.
21719
21720 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21721
21722         * statement.cs (Using.EmitLocalVariableDecls): Split the
21723         localvariable handling of the using statement.
21724
21725         (Block.EmitMeta): Keep track of variable count across blocks.  We
21726         were reusing slots on separate branches of blocks.
21727
21728         (Try.Emit): Emit the general code block, we were not emitting it. 
21729
21730         Check the type of the declaration to be an IDisposable or
21731         something that can be implicity converted to it. 
21732
21733         Emit conversions if required.
21734
21735         * ecore.cs (EmptyExpression): New utility class.
21736         (Expression.ImplicitConversionExists): New utility function.
21737
21738 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21739
21740         * statement.cs (Using): Implement.
21741
21742         * expression.cs (LocalVariableReference): Support read only variables.
21743
21744         * statement.cs: Remove the explicit emit for the Leave opcode.
21745         (VariableInfo): Add a readonly field.
21746
21747 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * ecore.cs (ConvCast): new class used to encapsulate the various
21750         explicit integer conversions that works in both checked and
21751         unchecked contexts.
21752
21753         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21754         properly generate the overflow opcodes.
21755
21756 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21757
21758         * statement.cs: The correct type for the EmptyExpression is the
21759         element_type, not the variable type.  Ravi pointed this out.
21760
21761 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21762
21763         * class.cs (Method::Define): Handle PInvoke methods specially
21764         by using DefinePInvokeMethod instead of the usual one.
21765
21766         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21767         above to do the task of extracting information and defining the method.
21768
21769 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21770
21771         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21772         of the condition for string type.
21773
21774         (Emit): Move that here. 
21775
21776         (ArrayCreation::CheckIndices): Keep string literals in their expression
21777         form.
21778
21779         (EmitDynamicInitializers): Handle strings appropriately.
21780
21781 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21782
21783         * codegen.cs (EmitContext): Replace multiple variables with a
21784         single pointer to the current Switch statement.
21785
21786         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21787         EmitContext.
21788
21789 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21790
21791         * statement.cs 
21792
21793         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21794         default'.
21795
21796         (Foreach.Emit): Foreach on arrays was not setting
21797         up the loop variables (for break/continue).
21798
21799         (GotoCase): Semi-implented.
21800
21801 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21802
21803         * attribute.cs (CheckAttribute): Handle system attributes by using
21804         Attribute.GetAttributes to examine information we need.
21805
21806         (GetValidPlaces): Same here.
21807
21808         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21809
21810         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21811
21812         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21813
21814         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21815
21816         (Method::Emit): Handle the case when we are a PInvoke method.
21817
21818 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21819
21820         * expression.cs: Use ResolveWithSimpleName on compound names.
21821
21822 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21823
21824         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21825         before trying to reduce it.
21826
21827         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21828
21829         * constant.cs (LookupConstantValue): Implement.
21830
21831         (EmitConstant): Use the above in emitting the constant.
21832
21833         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21834         that are user-defined by doing a LookupConstantValue on them.
21835
21836         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21837         too, like above.
21838
21839 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21840
21841         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21842
21843         (BaseAccess.DoResolve): Implement.
21844
21845         (MemberAccess.DoResolve): Split this routine into a
21846         ResolveMemberAccess routine that can be used independently
21847
21848 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21849
21850         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21851         As that share bits of the implementation.  Is returns a boolean,
21852         while As returns the Type that is being probed.
21853
21854 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21855
21856         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21857         instead of a Literal - much easier.
21858
21859         (EnumInTransit): Remove - utterly useless :-)
21860
21861         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21862
21863         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21864
21865         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21866         chain when we have no associated expression.
21867
21868 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21869
21870         * constant.cs (Define): Use Location while reporting the errror.
21871
21872         Also emit a warning when 'new' is used and there is no inherited
21873         member to hide.
21874
21875         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21876         populated.
21877
21878         (LookupEnumValue): Implement to lookup an enum member's value and define it
21879         if necessary.
21880
21881         (Populate): Re-write accordingly to use the above routine.
21882
21883 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21884
21885         * expression.cs (This): Fix prototype for DoResolveLValue to
21886         override the base class DoResolveLValue.
21887
21888         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21889         declarations) 
21890
21891         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21892         (we need to load the address of the field here).  This fixes
21893         test-22. 
21894
21895         (FieldExpr.DoResolveLValue): Call the DoResolve
21896         function to initialize the Instance expression.
21897
21898         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21899         correctly the GetEnumerator operation on a value type.
21900
21901         * cs-parser.jay: Add more simple parsing error catches.
21902
21903         * statement.cs (Switch): Add support for string switches.
21904         Handle null specially.
21905
21906         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21907
21908 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21909
21910         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21911
21912         (declare_local_constant): New helper function.
21913
21914         * statement.cs (AddConstant): Keep a separate record of constants
21915
21916         (IsConstant): Implement to determine if a variable is a constant.
21917
21918         (GetConstantExpression): Implement.
21919
21920         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21921
21922         * statement.cs (IsVariableDefined): Re-write.
21923
21924 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21925
21926         * class.cs (TypeContainer::FindMembers): Look for constants
21927         in the case when we are looking for MemberTypes.Field
21928
21929         * expression.cs (MemberAccess::DoResolve): Check that in the
21930         case we are a FieldExpr and a Literal, we are not being accessed
21931         by an instance reference.
21932
21933         * cs-parser.jay (local_constant_declaration): Implement.
21934
21935         (declaration_statement): Implement for constant declarations.
21936
21937 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21938
21939         * statement.cs (Switch): Catch double defaults.
21940
21941         (Switch): More work on the switch() statement
21942         implementation.  It works for integral values now, need to finish
21943         string support.
21944
21945
21946 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21947
21948         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21949         integer literals into other integer literals.  To be used by
21950         switch. 
21951
21952 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21953
21954         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21955         some memory.
21956
21957         (EmitDynamicInitializers): Cope with the above since we extract data
21958         directly from ArrayData now.
21959
21960         (ExpectInitializers): Keep track of whether initializers are mandatory
21961         or not.
21962
21963         (Bounds): Make it a hashtable to prevent the same dimension being 
21964         recorded for every element in that dimension.
21965
21966         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21967         from being found.
21968
21969         Also fix bug which was causing the indices to be emitted in the reverse
21970         order.
21971
21972 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21973
21974         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21975         unfinished.  They do not work, because the underlying code is
21976         sloppy.
21977
21978 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21979
21980         * cs-parser.jay: Remove bogus fixme.
21981
21982         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21983         on Switch statement.
21984
21985 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21986
21987         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21988         the same. 
21989
21990         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21991         parameter. Apparently, any expression is allowed. 
21992
21993         (ValidateInitializers): Update accordingly.
21994
21995         (CheckIndices): Fix some tricky bugs thanks to recursion.
21996
21997         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21998         I was being completely brain-dead.
21999
22000         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22001         and re-write acordingly.
22002
22003         (DelegateInvocation): Re-write accordingly.
22004
22005         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22006
22007         (MakeByteBlob): Handle types more correctly.
22008
22009         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22010         initialization from expressions but it is incomplete because I am a complete
22011         Dodo :-|
22012
22013 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22014
22015         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22016         on If.  Basically, we have to return `true' (ie, we do return to
22017         our caller) only if both branches of the if return.
22018
22019         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22020         short-circuit operators, handle them as short circuit operators. 
22021
22022         (Cast.DoResolve): Resolve type.
22023         (Cast.Cast): Take an expression as the target type.
22024
22025         * cs-parser.jay (cast_expression): Remove old hack that only
22026         allowed a limited set of types to be handled.  Now we take a
22027         unary_expression and we resolve to a type during semantic
22028         analysis.
22029
22030         Use the grammar productions from Rhys to handle casts (this is
22031         not complete like Rhys syntax yet, we fail to handle that corner
22032         case that C# has regarding (-x), but we will get there.
22033
22034 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22035
22036         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22037         field which is an array type.
22038
22039         * cs-parser.jay (declare_local_variables): Support array initialization too.
22040
22041         * typemanager.cs (MakeKey): Implement.
22042
22043         (everywhere): Use the above appropriately.
22044
22045         * cs-parser.jay (for_statement): Update for array initialization while
22046         declaring variables.
22047
22048         * ecore.cs : The error message was correct, it's the variable's names that
22049         were misleading ;-) Make the code more readable.
22050
22051         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22052         the correct type etc.
22053
22054         (ConvertExplicit): Handle Enum types by examining the underlying type.
22055
22056 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22057
22058         * parameter.cs (GetCallingConvention): Always return
22059         CallingConventions.Standard for now.
22060
22061 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22062
22063         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22064         and `r' after calling DoNumericPromotions.
22065
22066         * ecore.cs: Fix error message (the types were in the wrong order).
22067
22068         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22069         BindingFlags.Instance as well 
22070
22071         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22072         implicit int literal conversion in an empty cast so that we
22073         propagate the right type upstream.
22074
22075         (UnboxCast): new class used to unbox value types.
22076         (Expression.ConvertExplicit): Add explicit type conversions done
22077         by unboxing.
22078
22079         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22080         the target type before applying the implicit LongLiterals to ULong
22081         literal cast.
22082
22083 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22084
22085         * cs-parser.jay (for_statement): Reworked the way For works: now
22086         we declare manually any variables that are introduced in
22087         for_initializer to solve the problem of having out-of-band code
22088         emition (that is what got for broken).
22089
22090         (declaration_statement): Perform the actual variable declaration
22091         that used to be done in local_variable_declaration here.
22092
22093         (local_variable_declaration): Do not declare anything, just pass
22094         the information on a DictionaryEntry
22095
22096 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22097
22098         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22099         re-write of the logic to now make it recursive.
22100
22101         (UpdateIndices): Re-write accordingly.
22102
22103         Store element data in a separate ArrayData list in the above methods.
22104
22105         (MakeByteBlob): Implement to dump the array data into a byte array.
22106
22107 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22108
22109         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22110         into CheckIndices.
22111
22112         * constant.cs (Define): Implement.
22113
22114         (EmitConstant): Re-write fully.
22115
22116         Pass in location info.
22117
22118         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22119         respectively.
22120
22121         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22122         DictionaryEntry since we need location info too.
22123
22124         (constant_declaration): Update accordingly.
22125
22126         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22127         code into another method : UpdateIndices.
22128
22129 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22130
22131         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22132         some type checking etc.
22133
22134 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22135
22136         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22137         bits to provide dimension info if the user skips doing that.
22138
22139         Update second constructor to store the rank correctly.
22140
22141 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22142
22143         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22144         and try to implement.
22145
22146         * ../errors/cs0150.cs : Add.
22147
22148         * ../errors/cs0178.cs : Add.
22149
22150 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22151
22152         * statement.cs: Implement foreach on multi-dimensional arrays. 
22153
22154         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22155         name of the params argument.
22156
22157         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22158         initializing the array.
22159
22160         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22161         we can use this elsewhere.
22162
22163         * statement.cs: Finish implementation of foreach for single
22164         dimension arrays.
22165
22166         * cs-parser.jay: Use an out-of-band stack to pass information
22167         around, I wonder why I need this.
22168
22169         foreach_block: Make the new foreach_block the current_block.
22170
22171         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22172         function used to return a static Parameters structure.  Used for
22173         empty parameters, as those are created very frequently.
22174
22175         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22176
22177 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22178
22179         * interface.cs : Default modifier is private, not public. The
22180         make verify test passes again.
22181
22182 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22183
22184         * support.cs (ReflectionParameters): Fix logic to determine
22185         whether the last parameter is a params one. Test 9 passes again.
22186
22187         * delegate.cs (Populate): Register the builders we define with
22188         RegisterParameterForBuilder. Test 19 passes again.
22189
22190         * cs-parser.jay (property_declaration): Reference $6 instead
22191         of $$ to get at the location.
22192
22193         (indexer_declaration): Similar stuff.
22194
22195         (attribute): Ditto.
22196
22197         * class.cs (Property): Register parameters for the Get and Set methods
22198         if they exist. Test 23 passes again.
22199
22200         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22201         call to EmitArguments as we are sure there aren't any params arguments. 
22202         Test 32 passes again.
22203
22204         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22205         IndexOutOfRangeException. 
22206
22207         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22208         Test 33 now passes again.
22209
22210 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22211
22212         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22213         broke a bunch of things.  Will have to come up with a better way
22214         of tracking locations.
22215
22216         * statement.cs: Implemented foreach for single dimension arrays.
22217
22218 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22219
22220         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22221         an error.  This removes the lookup from the critical path.
22222
22223         * cs-parser.jay: Removed use of temporary_loc, which is completely
22224         broken. 
22225
22226 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22227
22228         * support.cs (ReflectionParameters.ParameterModifier): Report
22229         whether the argument is a PARAMS argument or not.
22230
22231         * class.cs: Set the attribute `ParamArrayAttribute' on the
22232         parameter argument.
22233
22234         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22235         and cons_param_array_attribute (ConstructorInfo for
22236         ParamArrayAttribute)., 
22237
22238         * codegen.cs: Emit the return using the `Return' statement, that
22239         way we can report the error correctly for missing return values. 
22240
22241         * class.cs (Method.Emit): Clean up.
22242
22243         * expression.cs (Argument.Resolve): Take another argument: the
22244         location where this argument is used.  Notice that this is not
22245         part of the "Argument" class as to reduce the size of the
22246         structure (we know the approximate location anyways).
22247
22248         Test if the argument is a variable-reference, if not, then
22249         complain with a 206.
22250
22251         (Argument.Emit): Emit addresses of variables.
22252
22253         (Argument.FullDesc): Simplify.
22254
22255         (Invocation.DoResolve): Update for Argument.Resolve.
22256
22257         (ElementAccess.DoResolve): ditto.
22258
22259         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22260         method should be virtual, as this method is always virtual.
22261
22262         (NewDelegate.DoResolve): Update for Argument.Resolve.
22263
22264         * class.cs (ConstructorInitializer.DoResolve): ditto.
22265
22266         * attribute.cs (Attribute.Resolve): ditto.
22267
22268 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22269
22270         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22271
22272         * expression.cs (ParameterReference): Drop IStackStorage and implement
22273         IAssignMethod instead. 
22274
22275         (LocalVariableReference): ditto.
22276
22277         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22278         IAssignMethod instead. 
22279
22280 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22281
22282         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22283         enumerations that are used in heavily used structures derive from
22284         byte in a laughable and pathetic attempt to reduce memory usage.
22285         This is the kind of pre-optimzations that you should not do at
22286         home without adult supervision.
22287
22288         * expression.cs (UnaryMutator): New class, used to handle ++ and
22289         -- separatedly from the other unary operators.  Cleans up the
22290         code, and kills the ExpressionStatement dependency in Unary.
22291
22292         (Unary): Removed `method' and `Arguments' from this class, making
22293         it smaller, and moving it all to SimpleCall, so I can reuse this
22294         code in other locations and avoid creating a lot of transient data
22295         strucutres when not required.
22296
22297         * cs-parser.jay: Adjust for new changes.
22298
22299 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22300
22301         * enum.cs (Enum.Populate): If there is a failure during
22302         definition, return
22303
22304         * cs-parser.jay (opt_enum_base): we used to catch type errors
22305         here, but this is really incorrect.  The type error should be
22306         catched during semantic analysis.
22307
22308 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22309
22310         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22311         current_local_parameters as expected since I, in my stupidity, had forgotten
22312         to do this :-)
22313
22314         * attribute.cs (GetValidPlaces): Fix stupid bug.
22315
22316         * class.cs (Method::Emit): Perform check on applicability of attributes.
22317
22318         (Constructor::Emit): Ditto.
22319
22320         (Field::Emit): Ditto.
22321
22322         (Field.Location): Store location information.
22323
22324         (Property, Event, Indexer, Operator): Ditto.
22325
22326         * cs-parser.jay (field_declaration): Pass in location for each field.
22327
22328         * ../errors/cs0592.cs : Add.
22329
22330 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22331
22332         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22333
22334         (InitCoreTypes): Update accordingly.
22335
22336         (RegisterAttrType, LookupAttr): Implement.
22337
22338         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22339         info about the same.
22340
22341         (Resolve): Update to populate the above as necessary.
22342
22343         (Error592): Helper.
22344
22345         (GetValidPlaces): Helper to the above.
22346
22347         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22348
22349         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22350
22351 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22352
22353         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22354
22355         * ../errors/cs0617.cs : Add.
22356
22357 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22358
22359         * enum.cs (Emit): Rename to Populate to be more consistent with what
22360         we expect it to do and when exactly it is called.
22361
22362         * class.cs, rootcontext.cs : Update accordingly.
22363
22364         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22365         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22366
22367         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22368
22369         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22370         of a fieldinfo using the above, when dealing with a FieldBuilder.
22371
22372 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22373
22374         * ../errors/cs0031.cs : Add.
22375
22376         * ../errors/cs1008.cs : Add.
22377
22378         * ../errrors/cs0543.cs : Add.
22379
22380         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22381         enum type.
22382
22383         (FindMembers): Implement.
22384
22385         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22386         enums and delegates too.
22387
22388         (enum_types): Rename to builder_to_enum.
22389
22390         (delegate_types): Rename to builder_to_delegate.
22391
22392         * delegate.cs (FindMembers): Implement.
22393
22394 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22395
22396         * typemanager.cs (IsEnumType): Implement.
22397
22398         * enum.cs (Emit): Re-write parts to account for the underlying type
22399         better and perform checking etc.
22400
22401         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22402         of the underlying type.
22403
22404         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22405         value
22406
22407         * enum.cs (error31): Helper to report error #31.
22408
22409         * cs-parser.jay (enum_declaration): Store location of each member too.
22410
22411         * enum.cs (member_to_location): New hashtable. 
22412
22413         (AddEnumMember): Update location hashtable.
22414
22415         (Emit): Use the location of each member while reporting errors.
22416
22417 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22418
22419         * cs-parser.jay: A for_initializer if is a
22420         local_variable_declaration really ammount to have an implicit
22421         block with the variable declaration and no initializer for for.
22422
22423         * statement.cs (For.Emit): Cope with null initializers.
22424
22425         This fixes the infinite loop on for initializers.
22426
22427 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22428
22429         * enum.cs: More cleanup.
22430
22431         * ecore.cs: Remove dead code.
22432
22433         * class.cs (Property.Emit): More simplification.
22434         (Event.Emit): ditto.
22435
22436         Reworked to have less levels of indentation.
22437
22438 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22439
22440         * class.cs (Property): Emit attributes.
22441
22442         (Field): Ditto.
22443
22444         (Event): Ditto.
22445
22446         (Indexer): Ditto.
22447
22448         (Operator): Ditto.
22449
22450         * enum.cs (Emit): Ditto.
22451
22452         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22453         Enums too.
22454
22455         * class.cs (Field, Event, etc.): Move attribute generation into the
22456         Emit method everywhere.
22457
22458         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22459         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22460         as we had no way of defining nested enums !
22461
22462         * rootcontext.cs : Adjust code accordingly.
22463
22464         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22465
22466 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22467
22468         * expression.cs (EvalConstantExpression): Move into ecore.cs
22469
22470         * enum.cs (Enum): Rename some members and make them public and readonly
22471         according to our convention.
22472
22473         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22474         nothing else.
22475
22476         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22477
22478         (Enum::Emit): Write a simple version for now which doesn't try to compute
22479         expressions. I shall modify this to be more robust in just a while.
22480
22481         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22482
22483         (TypeContainer::CloseType): Create the Enum types too.
22484
22485         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22486
22487         * expression.cs (EvalConstantExpression): Get rid of completely.
22488
22489         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22490         user-defined values and other cases.
22491
22492         (IsValidEnumLiteral): Helper function.
22493
22494         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22495         out there in the case we had a literal FieldExpr.
22496
22497         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22498
22499         (Literalize): Revamp a bit to take two arguments.
22500
22501         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22502
22503 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22504
22505         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22506
22507         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22508
22509         (Resolve): Use the above to ensure we have proper initializers.
22510
22511 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22512
22513         * expression.cs (Expression::EvalConstantExpression): New method to 
22514         evaluate constant expressions.
22515
22516         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22517
22518 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22519
22520         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22521         in an array.
22522
22523         (Binary.ResolveOperator): Handle operator != (object a, object b)
22524         and operator == (object a, object b);
22525
22526         (Binary.DoNumericPromotions): Indicate whether the numeric
22527         promotion was possible.
22528
22529         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22530         Implement.  
22531
22532         Made the ArrayAccess implement interface IAssignMethod instead of
22533         IStackStore as the order in which arguments are passed reflects
22534         this.
22535
22536         * assign.cs: Instead of using expr.ExprClass to select the way of
22537         assinging, probe for the IStackStore/IAssignMethod interfaces.
22538
22539         * typemanager.cs: Load InitializeArray definition.
22540
22541         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22542         static data that can be used to initialize arrays. 
22543
22544 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22545
22546         * expression.cs: Handle operator== and operator!= for booleans.
22547
22548         (Conditioal.Reduce): Implement reducer for the ?: operator.
22549
22550         (Conditional.Resolve): Implement dead code elimination.
22551
22552         (Binary.Resolve): Catch string literals and return a new
22553         concatenated string.
22554
22555         (Unary.Reduce): Implement reduction of unary expressions.
22556
22557         * ecore.cs: Split out the expression core handling here.
22558
22559         (Expression.Reduce): New method used to perform constant folding
22560         and CSE.  This is needed to support constant-expressions. 
22561
22562         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22563         targets, and optimize for !x.
22564
22565 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22566
22567         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22568         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22569         set custom atttributes.
22570
22571         * literal.cs (Literal::GetValue): New abstract method to return the actual
22572         value of the literal, cast as an object.
22573
22574         (*Literal): Implement GetValue method.
22575
22576         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22577         expressions to the arraylist but objects of type Argument.
22578
22579         * class.cs (TypeContainer::Emit): Emit our attributes too.
22580
22581         (Method::Emit, Constructor::Emit): Ditto.
22582
22583         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22584         to be ignoring earlier.
22585
22586 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22587
22588         * attribute.cs (AttributeSection::Define): Implement to do the business
22589         of constructing a CustomAttributeBuilder.
22590
22591         (Attribute): New trivial class. Increases readability of code.  
22592
22593         * cs-parser.jay : Update accordingly.
22594
22595         (positional_argument_list, named_argument_list, named_argument): New rules
22596
22597         (attribute_arguments): Use the above so that we are more correct.
22598
22599 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22600
22601         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22602         to perform all checks for a method with a params parameter.
22603
22604         (Invocation::OverloadResolve): Update to use the above method and therefore
22605         cope correctly with params method invocations.
22606
22607         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22608         params too.
22609
22610         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22611         constructors in our parent too because we can't afford to miss out on 
22612         protected ones ;-)
22613
22614         * attribute.cs (AttributeSection): New name for the class Attribute
22615
22616         Other trivial changes to improve readability.
22617
22618         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22619         use the new class names.
22620
22621 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22622
22623         * class.cs (Method::Define): Complete definition for params types too
22624
22625         (Indexer::Define): Ditto.
22626
22627         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22628         Cope everywhere with a request for info about the array parameter.
22629
22630 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22631
22632         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22633
22634         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22635         local_variable_type to extract the string corresponding to the type.
22636
22637         (local_variable_type): Fixup the action to use the new helper method.
22638
22639         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22640         go.
22641
22642         * expression.cs : Clean out code which uses the above.
22643
22644 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22645
22646         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22647         and bale out if necessary by returning a false.
22648
22649         (RegisterProperty): Ditto.
22650
22651         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22652         and print out appropriate error messages.
22653
22654         * interface.cs (everywhere): Ditto.
22655
22656         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22657         location to constructor.
22658
22659         * class.cs (Property, Event, Indexer): Update accordingly.
22660
22661         * ../errors/cs111.cs : Added.
22662
22663         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22664         of a method, as laid down by the spec.
22665
22666         (Invocation::OverloadResolve): Use the above method.
22667
22668 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22669
22670         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22671         now take a TypeContainer and a Parameters object.
22672
22673         (ParameterData): Modify return type of ParameterModifier method to be 
22674         Parameter.Modifier and not a string.
22675
22676         (ReflectionParameters, InternalParameters): Update accordingly.
22677
22678         * expression.cs (Argument::GetParameterModifier): Same here.
22679
22680         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22681         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22682         symbol in it at all so maybe this is only for now.
22683
22684 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22685
22686         * support.cs (InternalParameters): Constructor now takes an extra argument 
22687         which is the actual Parameters class.
22688
22689         (ParameterDesc): Update to provide info on ref/out modifiers.
22690
22691         * class.cs (everywhere): Update call to InternalParameters to pass in
22692         the second argument too.
22693
22694         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22695         to return the modifier info [ref/out etc]
22696
22697         (InternalParameters, ReflectionParameters): Implement the above.
22698
22699         * expression.cs (Argument::ParameterModifier): Similar function to return
22700         info about the argument's modifiers.
22701
22702         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22703         too.
22704
22705         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22706         a new SetFormalParameters object which we pass to InternalParameters.
22707
22708 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22709
22710         * expression.cs (NewArray): Merge into the ArrayCreation class.
22711
22712 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22713
22714         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22715         NewUserdefinedArray into one as there wasn't much of a use in having
22716         two separate ones.
22717
22718         * expression.cs (Argument): Change field's name to ArgType from Type.
22719
22720         (Type): New readonly property which returns the proper type, taking into 
22721         account ref/out modifiers.
22722
22723         (everywhere): Adjust code accordingly for the above.
22724
22725         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22726         whether we are emitting for a ref or out parameter.
22727
22728         * expression.cs (Argument::Emit): Use the above field to set the state.
22729
22730         (LocalVariableReference::Emit): Update to honour the flag and emit the
22731         right stuff.
22732
22733         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22734
22735         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22736
22737         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22738
22739         (ReflectionParameters, InternalParameters): Implement the above method.
22740
22741         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22742         reporting errors.
22743
22744         (Invocation::FullMethodDesc): Ditto. 
22745
22746 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22747
22748         * cs-parser.jay: Add extra production for the second form of array
22749         creation. 
22750
22751         * expression.cs (ArrayCreation): Update to reflect the above
22752         change. 
22753
22754         * Small changes to prepare for Array initialization.
22755
22756 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22757
22758         * typemanager.cs (ImplementsInterface): interface might be null;
22759         Deal with this problem;
22760
22761         Also, we do store negative hits on the cache (null values), so use
22762         this instead of calling t.GetInterfaces on the type everytime.
22763
22764 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22765
22766         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22767
22768         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22769         split functionality out into different classes.
22770
22771         (New::FormArrayType): Move into NewBuiltinArray.
22772
22773         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22774         quite useless.
22775
22776         (NewBuiltinArray): New class to handle creation of built-in arrays.
22777
22778         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22779         account creation of one-dimensional arrays.
22780
22781         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22782
22783         (NewUserdefinedArray::DoResolve): Implement.
22784
22785         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22786
22787         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22788         we maintain inside the TypeManager. This is necessary to perform lookups on the
22789         module builder.
22790
22791         (LookupType): Update to perform GetType on the module builders too.     
22792
22793         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22794
22795         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22796
22797 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22798
22799         * expression.cs (New::DoResolve): Implement guts of array creation.
22800
22801         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22802
22803 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22804
22805         * expression.cs: Fix bug I introduced lsat night that broke
22806         Delegates. 
22807
22808         (Expression.Resolve): Report a 246 error (can not resolve name)
22809         if we find a SimpleName in the stream.
22810
22811         (Expression.ResolveLValue): Ditto.
22812
22813         (Expression.ResolveWithSimpleName): This function is a variant of
22814         ResolveName, this one allows SimpleNames to be returned without a
22815         warning.  The only consumer of SimpleNames is MemberAccess
22816
22817 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22818
22819         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22820         might arrive here.  I have my doubts that this is correct.
22821
22822         * statement.cs (Lock): Implement lock statement.
22823
22824         * cs-parser.jay: Small fixes to support `lock' and `using'
22825
22826         * cs-tokenizer.cs: Remove extra space
22827
22828         * driver.cs: New flag --checked, allows to turn on integer math
22829         checking. 
22830
22831         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22832         Threading.Monitor.Exit 
22833
22834 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22835
22836         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22837         Expression Class to be IndexerAccess.
22838
22839         Notice that Indexer::DoResolve sets the eclass to Value.
22840
22841 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22842
22843         * class.cs (TypeContainer::Emit): Emit code for indexers.
22844
22845         * assign.cs (IAssignMethod): New interface implemented by Indexers
22846         and Properties for handling assignment.
22847
22848         (Assign::Emit): Simplify and reuse code. 
22849
22850         * expression.cs (IndexerAccess, PropertyExpr): Implement
22851         IAssignMethod, clean up old code. 
22852
22853 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22854
22855         * typemanager.cs (ImplementsInterface): New method to determine if a type
22856         implements a given interface. Provides a nice cache too.
22857
22858         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22859         method.
22860
22861         (ConvertReferenceExplicit): Ditto.
22862
22863         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22864         various methods, with correct names etc.
22865
22866         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22867         Operator.UnaryNegation.
22868
22869         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22870         we have a unary plus or minus operator.
22871
22872         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22873         UnaryMinus.
22874
22875         * everywhere : update accordingly.
22876
22877         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22878         respectively.
22879
22880         * class.cs (Method::Define): For the case where we are implementing a method
22881         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22882         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22883
22884 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22885
22886         * interface.cs (FindMembers): Implement to work around S.R.E
22887         lameness.
22888
22889         * typemanager.cs (IsInterfaceType): Implement.
22890
22891         (FindMembers): Update to handle interface types too.
22892
22893         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22894         use IsAssignableFrom as that is not correct - it doesn't work.
22895
22896         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22897         and accordingly override EmitStatement.
22898
22899         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22900         using the correct logic :-)
22901
22902 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22903
22904         * ../errors/cs-11.cs : Add to demonstrate error -11 
22905
22906 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22907
22908         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22909         then pass this as a hint to ResolveLValue.
22910
22911         * expression.cs (FieldExpr): Add Location information
22912
22913         (FieldExpr::LValueResolve): Report assignment to readonly
22914         variable. 
22915
22916         (Expression::ExprClassFromMemberInfo): Pass location information.
22917
22918         (Expression::ResolveLValue): Add new method that resolves an
22919         LValue. 
22920
22921         (Expression::DoResolveLValue): Default invocation calls
22922         DoResolve. 
22923
22924         (Indexers): New class used to keep track of indexers in a given
22925         Type. 
22926
22927         (IStackStore): Renamed from LValue, as it did not really describe
22928         what this did.  Also ResolveLValue is gone from this interface and
22929         now is part of Expression.
22930
22931         (ElementAccess): Depending on the element access type
22932
22933         * typemanager.cs: Add `indexer_name_type' as a Core type
22934         (System.Runtime.CompilerServices.IndexerNameAttribute)
22935
22936         * statement.cs (Goto): Take a location.
22937
22938 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22939
22940         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22941         if two delegates are compatible.
22942
22943         (NewDelegate::DoResolve): Update to take care of the case when
22944         we instantiate a delegate from another delegate.
22945
22946         * typemanager.cs (FindMembers): Don't even try to look up members
22947         of Delegate types for now.
22948
22949 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22950
22951         * delegate.cs (NewDelegate): New class to take care of delegate
22952         instantiation.
22953
22954         * expression.cs (New): Split the delegate related code out into 
22955         the NewDelegate class.
22956
22957         * delegate.cs (DelegateInvocation): New class to handle delegate 
22958         invocation.
22959
22960         * expression.cs (Invocation): Split out delegate related code into
22961         the DelegateInvocation class.
22962
22963 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22964
22965         * expression.cs (New::DoResolve): Implement delegate creation fully
22966         and according to the spec.
22967
22968         (New::DoEmit): Update to handle delegates differently.
22969
22970         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22971         because of which we were printing out arguments in reverse order !
22972
22973         * delegate.cs (VerifyMethod): Implement to check if the given method
22974         matches the delegate.
22975
22976         (FullDelegateDesc): Implement.
22977
22978         (VerifyApplicability): Implement.
22979
22980         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22981         delegate invocations too.
22982
22983         (Invocation::Emit): Ditto.
22984
22985         * ../errors/cs1593.cs : Added.
22986
22987         * ../errors/cs1594.cs : Added.
22988
22989         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22990
22991 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22992
22993         * typemanager.cs (intptr_type): Core type for System.IntPtr
22994
22995         (InitCoreTypes): Update for the same.
22996
22997         (iasyncresult_type, asynccallback_type): Ditto.
22998
22999         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23000         correct.
23001
23002         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23003         too.
23004
23005         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23006         the builders for the 4 members of a delegate type :-)
23007
23008         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23009         type.
23010
23011         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23012
23013         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23014
23015 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23016
23017         * statement.cs (Break::Emit): Implement.   
23018         (Continue::Emit): Implement.
23019
23020         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23021         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23022         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23023         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23024         end loop
23025
23026         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23027         properties that track the label for the current loop (begin of the
23028         loop and end of the loop).
23029
23030 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23031
23032         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23033         use of emitting anything at all.
23034
23035         * class.cs, rootcontext.cs : Get rid of calls to the same.
23036
23037         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23038
23039         (Populate): Define the constructor correctly and set the implementation
23040         attributes.
23041
23042         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23043         have been defined.
23044
23045         (AddDelegateType): Implement.
23046
23047         (IsDelegateType): Implement helper method.
23048
23049         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23050
23051         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23052         and accordingly handle it.
23053
23054         * delegate.cs (Populate): Take TypeContainer argument.
23055         Implement bits to define the Invoke method. However, I still haven't figured out
23056         how to take care of the native int bit :-(
23057
23058         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23059         Qualify the name of the delegate, not its return type !
23060
23061         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23062         conversion.
23063
23064         (StandardConversionExists): Checking for array types turns out to be recursive.
23065
23066         (ConvertReferenceExplicit): Implement array conversion.
23067
23068         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23069
23070 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23071
23072         * cs-parser.jay (delegate_declaration): Store the fully qualified
23073         name as it is a type declaration.
23074
23075         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23076         readonly.
23077
23078         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23079         as TypeContainer::DefineType.
23080
23081         (Populate): Method in which all the definition of the various methods (Invoke)
23082         etc is done.
23083
23084         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23085         see.
23086
23087         (CloseDelegate): Finally creates the delegate.
23088
23089         * class.cs (TypeContainer::DefineType): Update to define delegates.
23090         (Populate, Emit and CloseType): Do the same thing here too.
23091
23092         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23093         delegates in all these operations.
23094
23095 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23096
23097         * expression.cs: LocalTemporary: a new expression used to
23098         reference a temporary that has been created.
23099
23100         * assign.cs: Handle PropertyAccess back here, so that we can
23101         provide the proper semantic access to properties.
23102
23103         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23104         a few more explicit conversions. 
23105
23106         * modifiers.cs: `NEW' modifier maps to HideBySig.
23107
23108         * expression.cs (PropertyExpr): Make this into an
23109         ExpressionStatement, and support the EmitStatement code path. 
23110
23111         Perform get/set error checking, clean up the interface.
23112
23113         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23114         them into toplevel access objects.
23115
23116 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23117
23118         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23119         SRE.
23120
23121         * typemanager.cs: Keep track here of our PropertyBuilders again to
23122         work around lameness in SRE.
23123
23124 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23125
23126         * expression.cs (LValue::LValueResolve): New method in the
23127         interface, used to perform a second resolution pass for LValues. 
23128
23129         (This::DoResolve): Catch the use of this in static methods.
23130
23131         (This::LValueResolve): Implement.
23132
23133         (This::Store): Remove warning, assigning to `this' in structures
23134         is 
23135
23136         (Invocation::Emit): Deal with invocation of
23137         methods on value types.  We need to pass the address to structure
23138         methods rather than the object itself.  (The equivalent code to
23139         emit "this" for structures leaves the entire structure on the
23140         stack instead of a pointer to it). 
23141
23142         (ParameterReference::DoResolve): Compute the real index for the
23143         argument based on whether the method takes or not a `this' pointer
23144         (ie, the method is static).
23145
23146         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23147         value types returned from functions when we need to invoke a
23148         method on the sturcture.
23149
23150
23151 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23152
23153         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23154         defining the type in the Modulebuilder or Typebuilder. This is to take
23155         care of nested types which need to be defined on the TypeBuilder using
23156         DefineNestedMethod.
23157
23158         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23159         methods in RootContext, only ported to be part of TypeContainer.
23160
23161         (TypeContainer::GetInterfaceOrClass): Ditto.
23162
23163         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23164
23165         * interface.cs (Interface::DefineInterface): New method. Does exactly
23166         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23167         too.
23168
23169         (Interface::GetInterfaces): Move from RootContext here and port.
23170
23171         (Interface::GetInterfaceByName): Same here.
23172
23173         * rootcontext.cs (ResolveTree): Re-write.
23174
23175         (PopulateTypes): Re-write.
23176
23177         * class.cs (TypeContainer::Populate): Populate nested types too.
23178         (TypeContainer::Emit): Emit nested members too.
23179
23180         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23181         instead just use the name argument passed in as it is already fully
23182         qualified.
23183
23184         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23185         to TypeContainer mapping to see if a type is user-defined.
23186
23187         * class.cs (TypeContainer::CloseType): Implement. 
23188
23189         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23190         the default constructor.
23191
23192         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23193         twice.
23194
23195         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23196
23197         * interface.cs (CloseType): Create the type here.
23198
23199         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23200         the hierarchy.
23201
23202         Remove all the methods which are now in TypeContainer.
23203
23204 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23205
23206         * delegate.cs (Define): Re-write bits to define the delegate
23207         correctly.
23208
23209 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23210
23211         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23212
23213         * expression.cs (ImplicitReferenceConversion): handle null as well
23214         as a source to convert to any reference type.
23215
23216         * statement.cs (Return): Perform any implicit conversions to
23217         expected return type.  
23218
23219         Validate use of return statement.  
23220
23221         * codegen.cs (EmitContext): Pass the expected return type here.
23222
23223         * class.cs (Method, Constructor, Property): Pass expected return
23224         type to EmitContext.
23225
23226 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23227
23228         * expression.cs: Make DoResolve take an EmitContext instead of a
23229         TypeContainer.
23230
23231         Replaced `l' and `location' for `loc', for consistency.
23232
23233         (Error, Warning): Remove unneeded Tc argument.
23234
23235         * assign.cs, literal.cs, constant.cs: Update to new calling
23236         convention. 
23237
23238         * codegen.cs: EmitContext now contains a flag indicating whether
23239         code is being generated in a static method or not.
23240
23241         * cs-parser.jay: DecomposeQI, new function that replaces the old
23242         QualifiedIdentifier.  Now we always decompose the assembled
23243         strings from qualified_identifier productions into a group of
23244         memberaccesses.
23245
23246 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23247
23248         * rootcontext.cs: Deal with field-less struct types correctly now
23249         by passing the size option to Define Type.
23250
23251         * class.cs: Removed hack that created one static field. 
23252
23253 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23254
23255         * statement.cs: Moved most of the code generation here. 
23256
23257 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23258
23259         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23260         seem very right.
23261
23262         (ElementAccess): Remove useless bits for now - keep checks as the spec
23263         says.
23264
23265 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23266
23267         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23268         and start performing checks according to the spec.
23269
23270 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23271
23272         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23273         rank_specifiers instead.
23274
23275         (rank_specifiers): Change the order in which the rank specifiers are stored
23276
23277         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23278
23279         * expression.cs (ElementAccess): Implement the LValue interface too.
23280
23281 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23282
23283         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23284         except that user defined conversions are not included.
23285
23286         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23287         perform the conversion of the return type, if necessary.
23288
23289         (New::DoResolve): Check whether we are creating an array or an object
23290         and accordingly do the needful.
23291
23292         (New::Emit): Same here.
23293
23294         (New::DoResolve): Implement guts of array creation.
23295
23296         (New::FormLookupType): Helper function.
23297
23298 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23299
23300         * codegen.cs: Removed most of the code generation here, and move the
23301         corresponding code generation bits to the statement classes. 
23302
23303         Added support for try/catch/finalize and throw.
23304
23305         * cs-parser.jay: Added support for try/catch/finalize.
23306
23307         * class.cs: Catch static methods having the flags override,
23308         virtual or abstract.
23309
23310         * expression.cs (UserCast): This user cast was not really doing
23311         what it was supposed to do.  Which is to be born in fully resolved
23312         state.  Parts of the resolution were being performed at Emit time! 
23313
23314         Fixed this code.
23315
23316 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23317
23318         * expression.cs: Implicity convert the result from UserCast.
23319
23320 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23321
23322         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23323         prevented it from working correctly. 
23324
23325         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23326         merely ConvertImplicit.
23327
23328 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23329
23330         * typemanager.cs: Make the LookupTypeContainer function static,
23331         and not per-instance.  
23332
23333         * class.cs: Make static FindMembers (the one that takes a Type
23334         argument). 
23335
23336         * codegen.cs: Add EmitForeach here.
23337
23338         * cs-parser.jay: Make foreach a toplevel object instead of the
23339         inline expansion, as we need to perform semantic analysis on it. 
23340
23341 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23342
23343         * expression.cs (Expression::ImplicitUserConversion): Rename to
23344         UserDefinedConversion.
23345
23346         (Expression::UserDefinedConversion): Take an extra argument specifying 
23347         whether we look for explicit user conversions too.
23348
23349         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23350
23351         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23352
23353         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23354         with the appropriate arguments.
23355
23356         * cs-parser.jay (cast_expression): Record location too.
23357
23358         * expression.cs (Cast): Record location info.
23359
23360         (Expression::ConvertExplicit): Take location argument.
23361
23362         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23363         to determine if we are doing explicit conversions.
23364
23365         (UserCast::Emit): Update accordingly.
23366
23367         (Expression::ConvertExplicit): Report an error if everything fails.
23368
23369         * ../errors/cs0030.cs : Add.
23370
23371 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23372
23373         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23374         virtual and newslot bits. 
23375
23376         * class.cs (TypeContainer::RegisterRequiredImplementations):
23377         Record methods we need.
23378
23379         (TypeContainer::MakeKey): Helper function to make keys for
23380         MethodBases, since the Methodbase key is useless.
23381
23382         (TypeContainer::Populate): Call RegisterRequiredImplementations
23383         before defining the methods.   
23384
23385         Create a mapping for method_builders_to_methods ahead of time
23386         instead of inside a tight loop.
23387
23388         (::RequireMethods):  Accept an object as the data to set into the
23389         hashtable so we can report interface vs abstract method mismatch.
23390
23391 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23392
23393         * report.cs: Make all of it static.
23394
23395         * rootcontext.cs: Drop object_type and value_type computations, as
23396         we have those in the TypeManager anyways.
23397
23398         Drop report instance variable too, now it is a global.
23399
23400         * driver.cs: Use try/catch on command line handling.
23401
23402         Add --probe option to debug the error reporting system with a test
23403         suite. 
23404
23405         * report.cs: Add support for exiting program when a probe
23406         condition is reached.
23407
23408 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23409
23410         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23411         we do a forcible conversion regardless of type, to check if 
23412         ForceConversion returns a null.
23413
23414         (Binary::error19): Use location to report error.
23415
23416         (Unary::error23): Use location here too.
23417
23418         * ../errors/cs0019.cs : Check in.
23419
23420         * ../errors/cs0023.cs : Check in.
23421
23422         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23423         case of a non-null MethodInfo object with a length of 0 !
23424
23425         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23426         an applicable member - according to the spec :-)
23427         Also fix logic to find members in base types.
23428
23429         (Unary::ResolveOperator): Same here.
23430
23431         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23432         as I was getting thoroughly confused between this and error19 :-)
23433
23434         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23435         (::FindMostEncompassedType): Implement.
23436         (::FindMostEncompassingType): Implement.
23437         (::StandardConversionExists): Implement.
23438
23439         (UserImplicitCast): Re-vamp. We now need info about most specific
23440         source and target types so that we can do the necessary conversions.
23441
23442         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23443         mathematical union with no duplicates.
23444
23445 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23446
23447         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23448         in order from base classes to child classes, so that we can in
23449         child classes look up in our parent for method names and
23450         attributes (required for handling abstract, virtual, new, override
23451         constructs: we need to instrospect our base class, and if we dont
23452         populate the classes in order, the introspection might be
23453         incorrect.  For example, a method could query its parent before
23454         the parent has any methods and would determine that the parent has
23455         no abstract methods (while it could have had them)).
23456
23457         (RootContext::CreateType): Record the order in which we define the
23458         classes.
23459
23460 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23461
23462         * class.cs (TypeContainer::Populate): Also method definitions can
23463         fail now, keep track of this.
23464
23465         (TypeContainer::FindMembers): Implement support for
23466         DeclaredOnly/noDeclaredOnly flag.
23467
23468         (Constructor::Emit) Return the ConstructorBuilder.
23469
23470         (Method::Emit) Return the MethodBuilder. 
23471         Check for abstract or virtual methods to be public.
23472
23473         * rootcontext.cs (RootContext::CreateType): Register all the
23474         abstract methods required for the class to be complete and the
23475         interface methods that must be implemented. 
23476
23477         * cs-parser.jay: Report error 501 (method requires body if it is
23478         not marked abstract or extern).
23479
23480         * expression.cs (TypeOf::Emit): Implement.
23481
23482         * typemanager.cs: runtime_handle_type, new global type.
23483
23484         * class.cs (Property::Emit): Generate code for properties.
23485
23486 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23487
23488         * expression.cs (Unary::ResolveOperator): Find operators on base type
23489         too - we now conform exactly to the spec.
23490
23491         (Binary::ResolveOperator): Same here.
23492
23493         * class.cs (Operator::Define): Fix minor quirk in the tests.
23494
23495         * ../errors/cs0215.cs : Added.
23496
23497         * ../errors/cs0556.cs : Added.
23498
23499         * ../errors/cs0555.cs : Added.
23500
23501 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23502
23503         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23504         single integer which is really efficient
23505
23506 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23507
23508         *  expression.cs (Expression::ImplicitUserConversion): Use location
23509         even in the case when we are examining True operators.
23510  
23511         * class.cs (Operator::Define): Perform extensive checks to conform
23512         with the rules for operator overloading in the spec.
23513
23514         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23515         some of the other conversions mentioned in the spec.
23516
23517         * typemanager.cs (array_type): New static member for the System.Array built-in
23518         type.
23519
23520         (cloneable_interface): For System.ICloneable interface.
23521
23522         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23523         we start resolving the tree and populating types.
23524
23525         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23526  
23527 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23528
23529         * expression.cs (Expression::ExprClassFromMemberInfo,
23530         Expression::Literalize): Create literal expressions from
23531         FieldInfos which are literals.
23532
23533         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23534         type casts, because they were wrong.  The test suite in tests
23535         caught these ones.
23536
23537         (ImplicitNumericConversion): ushort to ulong requires a widening
23538         cast. 
23539
23540         Int32 constant to long requires widening cast as well.
23541
23542         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23543         for integers because the type on the stack is not i4.
23544
23545 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23546
23547         * expression.cs (report118): require location argument. 
23548
23549         * parameter.cs: Do not dereference potential null value.
23550
23551         * class.cs: Catch methods that lack the `new' keyword when
23552         overriding a name.  Report warnings when `new' is used without
23553         anything being there to override.
23554
23555         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23556
23557         * class.cs: Only add constructor to hashtable if it is non-null
23558         (as now constructors can fail on define).
23559
23560         (TypeManager, Class, Struct): Take location arguments.
23561
23562         Catch field instance initialization in structs as errors.
23563
23564         accepting_filter: a new filter for FindMembers that is static so
23565         that we dont create an instance per invocation.
23566
23567         (Constructor::Define): Catch errors where a struct constructor is
23568         parameterless 
23569
23570         * cs-parser.jay: Pass location information for various new
23571         constructs. 
23572
23573         * delegate.cs (Delegate): take a location argument.
23574
23575         * driver.cs: Do not call EmitCode if there were problesm in the
23576         Definition of the types, as many Builders wont be there. 
23577
23578         * decl.cs (Decl::Decl): Require a location argument.
23579
23580         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23581         into integers, and find the most appropiate integer for it.
23582
23583         * literal.cs: Implement ULongLiteral.
23584
23585         * rootcontext.cs: Provide better information about the location of
23586         failure when CreateType fails.
23587
23588 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23589
23590         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23591         as well.
23592
23593         * expression.cs (Binary::CheckShiftArguments): Add missing type
23594         computation.
23595         (Binary::ResolveOperator): Add type to the logical and and logical
23596         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23597         before.
23598
23599         (Binary::DoNumericPromotions): In the case where either argument
23600         is ulong (and most signed types combined with ulong cause an
23601         error) perform implicit integer constant conversions as well.
23602
23603 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23604
23605         * expression.cs (UserImplicitCast): Method should always be
23606         non-null. 
23607         (Invocation::BetterConversion): Simplified test for IntLiteral.
23608
23609         (Expression::ImplicitNumericConversion): Split this routine out.
23610         Put the code that performs implicit constant integer conversions
23611         here. 
23612
23613         (Expression::Resolve): Become a wrapper around DoResolve so we can
23614         check eclass and type being set after resolve.
23615
23616         (Invocation::Badness): Remove this dead function
23617
23618         (Binary::ResolveOperator): Do not compute the expensive argumnets
23619         unless we have a union for it.
23620
23621         (Probe::Emit): Is needs to do an isinst and then
23622         compare against null.
23623
23624         (::CanConvert): Added Location argument.  If the Location argument
23625         is null (Location.Null), then we do not report errors.  This is
23626         used by the `probe' mechanism of the Explicit conversion.  We do
23627         not want to generate an error for something that the user
23628         explicitly requested to be casted.  But the pipeline for an
23629         explicit cast first tests for potential implicit casts.
23630
23631         So for now, if the Location is null, it means `Probe only' to
23632         avoid adding another argument.   Might have to revise this
23633         strategy later.
23634
23635         (ClassCast): New class used to type cast objects into arbitrary
23636         classes (used in Explicit Reference Conversions).
23637
23638         Implement `as' as well.
23639
23640         Reverted all the patches from Ravi below: they were broken:
23641
23642                 * The use of `level' as a mechanism to stop recursive
23643                   invocations is wrong.  That was there just to catch the
23644                   bug with a strack trace but not as a way of addressing
23645                   the problem.
23646
23647                   To fix the problem we have to *understand* what is going
23648                   on and the interactions and come up with a plan, not
23649                   just get things going.
23650
23651                 * The use of the type conversion cache that I proposed
23652                   last night had an open topic: How does this work across
23653                   protection domains.  A user defined conversion might not
23654                   be public in the location where we are applying the
23655                   conversion, a different conversion might be selected
23656                   (ie, private A->B (better) but public B->A (worse),
23657                   inside A, A->B applies, but outside it, B->A will
23658                   apply).
23659
23660                 * On top of that (ie, even if the above is solved),
23661                   conversions in a cache need to be abstract.  Ie, `To
23662                   convert from an Int to a Short use an OpcodeCast', not
23663                   `To convert from an Int to a Short use the OpcodeCast on
23664                   the variable 5' (which is what this patch was doing).
23665
23666 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23667
23668         * expression.cs (Invocation::ConversionExists): Re-write to use
23669         the conversion cache
23670
23671         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23672         cache all conversions done, not just user-defined ones.
23673
23674         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23675         to determine if a conversion exists instead of acutually trying to 
23676         perform the conversion. It's faster too.
23677
23678         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23679         and only then attempt the implicit conversion.
23680
23681 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23682
23683         * expression.cs (ConvertImplicit): Use a cache for conversions
23684         already found. Check level of recursion and bail out if necessary.
23685
23686 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23687
23688         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23689         Export standard methods that we expect for string operations.
23690
23691         * statement.cs (Block::UsageWarning): Track usage of variables and
23692         report the errors for not used variables.
23693
23694         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23695         operator. 
23696
23697 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23698
23699         * codegen.cs: remove unnneded code 
23700
23701         * expression.cs: Removed BuiltinTypeAccess class
23702
23703         Fix the order in which implicit conversions are
23704         done.  
23705
23706         The previous fixed dropped support for boxed conversions (adding a
23707         test to the test suite now)
23708
23709         (UserImplicitCast::CanConvert): Remove test for source being null,
23710         that code is broken.  We should not feed a null to begin with, if
23711         we do, then we should track the bug where the problem originates
23712         and not try to cover it up here.
23713
23714         Return a resolved expression of type UserImplicitCast on success
23715         rather than true/false.  Ravi: this is what I was talking about,
23716         the pattern is to use a static method as a "constructor" for
23717         objects. 
23718
23719         Also, do not create arguments until the very last minute,
23720         otherwise we always create the arguments even for lookups that
23721         will never be performed. 
23722
23723         (UserImplicitCast::Resolve): Eliminate, objects of type
23724         UserImplicitCast are born in a fully resolved state. 
23725
23726         * typemanager.cs (InitCoreTypes): Init also value_type
23727         (System.ValueType). 
23728
23729         * expression.cs (Cast::Resolve): First resolve the child expression.
23730
23731         (LValue): Add new method AddressOf to be used by
23732         the `&' operator.  
23733
23734         Change the argument of Store to take an EmitContext instead of an
23735         ILGenerator, because things like FieldExpr need to be able to call
23736         their children expression to generate the instance code. 
23737
23738         (Expression::Error, Expression::Warning): Sugar functions for
23739         reporting errors.
23740
23741         (Expression::MemberLookup): Accept a TypeContainer instead of a
23742         Report as the first argument.
23743
23744         (Expression::ResolvePrimary): Killed.  I still want to improve
23745         this as currently the code is just not right.
23746
23747         (Expression::ResolveMemberAccess): Simplify, but it is still
23748         wrong. 
23749
23750         (Unary::Resolve): Catch errors in AddressOf operators.
23751
23752         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23753         index to a byte for the short-version, or the compiler will choose
23754         the wrong Emit call, which generates the wrong data.
23755
23756         (ParameterReference::Emit, ::Store): same.
23757
23758         (FieldExpr::AddressOf): Implement.
23759
23760         * typemanager.cs: TypeManager: made public variable instead of
23761         property.
23762
23763         * driver.cs: document --fatal.
23764
23765         * report.cs (ErrorMessage, WarningMessage): new names for the old
23766         Error and Warning classes.
23767
23768         * cs-parser.jay (member_access): Turn built-in access to types
23769         into a normal simplename
23770
23771 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23772
23773         * expression.cs (Invocation::BetterConversion): Fix to cope
23774         with q being null, since this was introducing a bug.
23775
23776         * expression.cs (ConvertImplicit): Do built-in conversions first.
23777
23778 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23779
23780         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23781
23782 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23783
23784         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23785         I had introduced long ago (what's new ?).
23786
23787         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23788         the work of all the checking. 
23789         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23790         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23791
23792         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23793         that is the right way. 
23794
23795         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23796         overloading resolution. Use everywhere instead of cutting and pasting code.
23797
23798         (Binary::ResolveOperator): Use MakeUnionSet.
23799
23800         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23801         we have to convert to bool types. Not complete yet.
23802
23803 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23804
23805         * typemanager.cs (TypeManager::CSharpName): support ushort.
23806
23807         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23808         to provide an expression that performsn an implicit constant int
23809         conversion (section 6.1.6).
23810         (Expression::ConvertImplicitRequired): Reworked to include
23811         implicit constant expression conversions.
23812
23813         (Expression::ConvertNumericExplicit): Finished.
23814
23815         (Invocation::Emit): If InstanceExpression is null, then it means
23816         that we perform a call on this.
23817
23818 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23819
23820         * expression.cs (Unary::Emit): Remove some dead code.
23821         (Probe): Implement Resolve and Emit for `is'.
23822         (Expression::ConvertImplicitRequired): Attempt to do constant
23823         expression conversions here.  Maybe should be moved to
23824         ConvertImplicit, but I am not sure.
23825         (Expression::ImplicitLongConstantConversionPossible,
23826         Expression::ImplicitIntConstantConversionPossible): New functions
23827         that tell whether is it possible to apply an implicit constant
23828         expression conversion.
23829
23830         (ConvertNumericExplicit): Started work on explicit numeric
23831         conversions.
23832
23833         * cs-parser.jay: Update operator constants.
23834
23835         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23836         (Parameters::GetSignature): Hook up VerifyArgs here.
23837         (Parameters::VerifyArgs): Verifies that no two arguments have the
23838         same name. 
23839
23840         * class.cs (Operator): Update the operator names to reflect the
23841         ones that the spec expects (as we are just stringizing the
23842         operator names).
23843
23844         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23845         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23846         previous usage did only work for our methods.
23847         (Expression::ConvertImplicit): Handle decimal implicit numeric
23848         conversions as well.
23849         (Expression::InternalTypeConstructor): Used to invoke constructors
23850         on internal types for default promotions.
23851
23852         (Unary::Emit): Implement special handling for the pre/post
23853         increment/decrement for overloaded operators, as they need to have
23854         the same semantics as the other operators.
23855
23856         (Binary::ResolveOperator): ditto.
23857         (Invocation::ConversionExists): ditto.
23858         (UserImplicitCast::Resolve): ditto.
23859
23860 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23861
23862         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23863         operator, return after emitting body. Regression tests pass again !
23864
23865         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23866         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23867         (Invocation::OverloadResolve): Ditto.
23868         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23869
23870         * everywhere : update calls to the above methods accordingly.
23871
23872 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23873
23874         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23875
23876         * expression.cs (ExpressionStatement): New base class used for
23877         expressions that can appear in statements, so that we can provide
23878         an alternate path to generate expression that do not leave a value
23879         on the stack.
23880
23881         (Expression::Emit, and all the derivatives): We no longer return
23882         whether a value is left on the stack or not.  Every expression
23883         after being emitted leaves a single value on the stack.
23884
23885         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23886         facilties of ExpressionStatement if possible.
23887
23888         * cs-parser.jay: Update statement_expression.
23889
23890 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23891
23892         * driver.cs: Change the wording of message
23893
23894 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23895
23896         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23897         the type of the expression to the return type of the method if
23898         we have an overloaded operator match ! The regression tests pass again !
23899         (Unary::ResolveOperator): Ditto.
23900
23901         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23902         to find "op_Implicit", not "implicit" ;-)
23903         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23904         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23905
23906         * everywhere : Correct calls to the above accordingly.
23907
23908         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23909         (ConvertImplicit): Do user-defined conversion if it exists.
23910
23911 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23912
23913         * assign.cs: track location.
23914         (Resolve): Use implicit conversions on assignment.
23915
23916         * literal.cs: Oops.  Not good, Emit of short access values should
23917         pass (Bytes) or the wrong argument will be selected.
23918
23919         * expression.cs (Unary::Emit): Emit code for -expr.
23920
23921         (Unary::ResolveOperator): Handle `Substract' for non-constants
23922         (substract from zero from the non-constants).
23923         Deal with Doubles as well. 
23924
23925         (Expression::ConvertImplicitRequired): New routine that reports an
23926         error if no implicit conversion exists. 
23927
23928         (Invocation::OverloadResolve): Store the converted implicit
23929         expressions if we make them
23930
23931 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23932
23933         * class.cs (ConstructorInitializer): Take a Location argument.
23934         (ConstructorBaseInitializer): Same here.
23935         (ConstructorThisInitializer): Same here.
23936
23937         * cs-parser.jay : Update all calls accordingly.
23938
23939         * expression.cs (Unary, Binary, New): Take location argument.
23940         Update accordingly everywhere.
23941
23942         * cs-parser.jay : Update all calls to the above to take a location
23943         argument.
23944
23945         * class.cs : Ditto.
23946
23947 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23948
23949         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23950         (Invocation::BetterConversion): Same here
23951         (Invocation::ConversionExists): Ditto.
23952
23953         (Invocation::ConversionExists): Implement.
23954
23955 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23956
23957         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23958         Also take an additional TypeContainer argument.
23959
23960         * All over : Pass in TypeContainer as argument to OverloadResolve.
23961
23962         * typemanager.cs (CSharpName): Update to check for the string type and return
23963         that too.
23964
23965         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23966         a given method.
23967
23968 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23969
23970         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23971         (Invocation::BetterFunction): Implement.
23972         (Invocation::BetterConversion): Implement.
23973         (Invocation::ConversionExists): Skeleton, no implementation yet.
23974
23975         Okay, things work fine !
23976
23977 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23978
23979         * typemanager.cs: declare and load enum_type, delegate_type and
23980         void_type. 
23981
23982         * expression.cs (Expression::Emit): Now emit returns a value that
23983         tells whether a value is left on the stack or not.  This strategy
23984         might be reveted tomorrow with a mechanism that would address
23985         multiple assignments.
23986         (Expression::report118): Utility routine to report mismatches on
23987         the ExprClass.
23988
23989         (Unary::Report23): Report impossible type/operator combination
23990         utility function.
23991
23992         (Unary::IsIncrementableNumber): Whether the type can be
23993         incremented or decremented with add.
23994         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23995         complemented. 
23996         (Unary::ResolveOperator): Implement ++, !, ~,
23997
23998         (Invocation::Emit): Deal with new Emit convetion.
23999
24000         * All Expression derivatives: Updated their Emit method to return
24001         whether they leave values on the stack or not.
24002
24003         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24004         stack for expressions that are statements. 
24005
24006 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * expression.cs (LValue): New interface.  Must be implemented by
24009         LValue objects.
24010         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24011         LValue interface.
24012
24013         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24014         interface for generating code, simplifies the code.
24015
24016 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24017
24018         * expression.cs (everywhere): Comment out return statements in ::Resolve
24019         methods to avoid the warnings.
24020
24021 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24022
24023         * driver.cs (parse): Report error 2001 if we can not open the
24024         source file.
24025
24026         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24027         not resolve it.
24028
24029         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24030         object. 
24031
24032         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24033         otherwise nested blocks end up with the same index.
24034
24035         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24036
24037         * expression.cs:  Instead of having FIXMEs in the Resolve
24038         functions, throw exceptions so it is obvious that we are facing a
24039         bug. 
24040
24041         * cs-parser.jay (invocation_expression): Pass Location information.
24042
24043         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24044         Use a basename for those routines because .NET does not like paths
24045         on them. 
24046
24047         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24048         already defined.
24049
24050 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24051
24052         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24053         are loading the correct data types (throws an exception if not).
24054         (TypeManager::InitCoreTypes): Use CoreLookupType
24055
24056         * expression.cs (Unary::ResolveOperator): return the child
24057         expression for expressions which are just +expr.
24058         (Unary::ResolveOperator): Return negative literals for -LITERAL
24059         expressions (otherwise they are Unary {Literal}).
24060         (Invocation::Badness): Take into account `Implicit constant
24061         expression conversions'.
24062
24063         * literal.cs (LongLiteral): Implement long literal class.
24064         (IntLiteral): export the `Value' of the intliteral. 
24065
24066 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24067
24068         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24069
24070         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24071         instead of 'Operator'
24072
24073         * expression.cs (Binary::ResolveOperator): Update accordingly.
24074         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24075         and 'Minus'
24076
24077         * cs-parser.jay (unary_expression): Update to use the new names.
24078
24079         * gen-treedump.cs (GetUnary): Same here.
24080
24081         * expression.cs (Unary::Resolve): Implement.
24082         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24083         operators are found instead of making noise ;-)
24084         (Unary::ResolveOperator): New method to do precisely the same thing which
24085         Binary::ResolveOperator does for Binary expressions.
24086         (Unary.method, .Arguments): Add.
24087         (Unary::OperName): Implement.   
24088         (Unary::ForceConversion): Copy and Paste !
24089
24090         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24091         a unary operator.
24092
24093         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24094         for the inbuilt operators. Only overloading works for now ;-)
24095
24096 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24097
24098         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24099         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24100
24101         * expression.cs (This::Emit): Implement. 
24102         (This::Resolve): Implement.
24103         (TypeOf:Resolve): Implement.
24104         (Expression::ResolveSimpleName): Add an implicit this to instance
24105         field references. 
24106         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24107         Bind instance variable to Field expressions.
24108         (FieldExpr::Instance): New field used to track the expression that
24109         represents the object instance.
24110         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24111         binding 
24112         (FieldExpr::Emit): Implement.
24113
24114         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24115         the last instruction contains a return opcode to avoid generating
24116         the last `ret' instruction (this generates correct code, and it is
24117         nice to pass the peverify output).
24118
24119         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24120         initializer for static and instance variables.
24121         (Constructor::Emit): Allow initializer to be null in the case of
24122         static constructors.  Only emit initializer for instance
24123         constructors. 
24124
24125         (TypeContainer::FindMembers): Return a null array if there are no
24126         matches.
24127
24128         Also fix the code for the MemberTypes.Method branch, as it was not
24129         scanning that for operators (or tried to access null variables before).
24130
24131         * assign.cs (Assign::Emit): Handle instance and static fields. 
24132
24133         * TODO: Updated.
24134
24135         * driver.cs: Stop compilation if there are parse errors.
24136
24137         * cs-parser.jay (constructor_declaration): Provide default base
24138         initializer for non-static constructors.
24139         (constructor_declarator): Do not provide a default base
24140         initializers if none was specified.
24141         Catch the fact that constructors should not have parameters.
24142
24143         * class.cs: Do not emit parent class initializers for static
24144         constructors, that should be flagged as an error.
24145
24146 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24147
24148         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24149         Move back code into TypeContainer::Populate.
24150
24151 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24152
24153         * class.cs (TypeContainer::AddConstructor): Fix the check to
24154         compare against Name, not Basename. 
24155         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24156
24157         * cs-parser.jay : Update accordingly.
24158
24159         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24160         for methods, don't forget to look into the operators too.
24161         (RegisterMethodBuilder): Helper method to take care of this for
24162         methods, constructors and operators.
24163         (Operator::Define): Completely revamp.
24164         (Operator.OperatorMethod, MethodName): New fields.
24165         (TypeContainer::Populate): Move the registering of builders into
24166         RegisterMethodBuilder.
24167         (Operator::Emit): Re-write.
24168
24169         * expression.cs (Binary::Emit): Comment out code path to emit method
24170         invocation stuff for the case when we have a user defined operator. I am
24171         just not able to get it right !
24172
24173 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24174
24175         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24176         argument. 
24177
24178         (Expression::MemberLookup): Provide a version that allows to
24179         specify the MemberTypes and BindingFlags. 
24180
24181         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24182         so it was not fetching variable information from outer blocks.
24183
24184         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24185         Beforefieldinit as it was buggy.
24186
24187         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24188         that Ravi put here.  
24189
24190         * class.cs (Constructor::Emit): Only emit if block is not null.
24191         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24192         deal with this by semantically definining it as if the user had
24193         done it.
24194
24195         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24196         constructors as we now "emit" them at a higher level.
24197
24198         (TypeContainer::DefineDefaultConstructor): Used to define the
24199         default constructors if none was provided.
24200
24201         (ConstructorInitializer): Add methods Resolve and Emit. 
24202
24203         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24204
24205 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24206
24207         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24208         the default constructor builder with our hashtable for methodbuilders
24209         to methodcores.
24210
24211         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24212         and argument_count is 0 in which case we have a match.
24213         (Binary::ResolveOperator): More null checking and miscellaneous coding
24214         style cleanup.
24215
24216 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24217
24218         * rootcontext.cs (IsNameSpace): Compare against null.
24219
24220         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24221
24222         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24223         and Unary::Operator.
24224
24225         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24226         accordingly.
24227
24228         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24229         we have overloaded operators.
24230         (Binary::ResolveOperator): Implement the part which does the operator overload
24231         resolution.
24232
24233         * class.cs (Operator::Emit): Implement.
24234         (TypeContainer::Emit): Emit the operators we have too.
24235
24236         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24237         the case when we have a user-defined operator.
24238
24239 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24240
24241         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24242
24243 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24244
24245         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24246         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24247         (Constructor::Emit): Implement.
24248         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24249         if we have no work to do. 
24250         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24251         Emit method.
24252
24253         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24254         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24255
24256         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24257         of parent.parent.
24258
24259 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24260
24261         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24262         in the source.
24263         (Tree::RecordNamespace): Method to do what the name says ;-)
24264         (Tree::Namespaces): Property to get at the namespaces hashtable.
24265
24266         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24267         keep track.
24268
24269         * rootcontext.cs (IsNamespace): Fixed it :-)
24270
24271 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24272
24273         * class.cs (TypeContainer::FindMembers): Add support for
24274         constructors. 
24275         (MethodCore): New class that encapsulates both the shared aspects
24276         of a Constructor and a Method.  
24277         (Method, Constructor): Factored pieces into MethodCore.
24278
24279         * driver.cs: Added --fatal which makes errors throw exceptions.
24280         Load System assembly as well as part of the standard library.
24281
24282         * report.cs: Allow throwing exceptions on errors for debugging.
24283
24284         * modifiers.cs: Do not use `parent', instead use the real type
24285         container to evaluate permission settings.
24286
24287         * class.cs: Put Ravi's patch back in.  He is right, and we will
24288         have to cope with the
24289
24290 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24291
24292         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24293         FamORAssem, not FamANDAssem.
24294
24295 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24296
24297         * driver.cs: Added --parse option that only parses its input files
24298         and terminates.
24299
24300         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24301         incorrect.  IsTopLevel is not used to tell whether an object is
24302         root_types or not (that can be achieved by testing this ==
24303         root_types).  But to see if this is a top-level *class* (not
24304         necessarly our "toplevel" container). 
24305
24306 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24307
24308         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24309         parent instead of a direct call to GetType.
24310
24311 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24312
24313         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24314         Modifiers.TypeAttr. This should just be a call to that method.
24315
24316         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24317         object so that we can determine if we are top-level or not.
24318
24319         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24320         TypeContainer too.
24321
24322         * enum.cs (Enum::Define): Ditto.
24323
24324         * modifiers.cs (FieldAttr): Re-write.
24325
24326         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24327         (TypeContainer::HaveStaticConstructor): New property to provide access
24328         to precisely that info.
24329
24330         * modifiers.cs (MethodAttr): Re-write.
24331         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24332
24333         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24334         of top-level types as claimed.
24335
24336 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24337
24338         * expression.cs (MemberLookup): Fruitless attempt to lookup
24339         constructors.  Maybe I need to emit default constructors?  That
24340         might be it (currently .NET emits this for me automatically).
24341         (Invocation::OverloadResolve): Cope with Arguments == null.
24342         (Invocation::EmitArguments): new function, shared by the new
24343         constructor and us.
24344         (Invocation::Emit): Handle static and instance methods.  Emit
24345         proper call instruction for virtual or non-virtual invocations.
24346         (New::Emit): Implement.
24347         (New::Resolve): Implement.
24348         (MemberAccess:Resolve): Implement.
24349         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24350         to track instances.
24351         (FieldExpr::Resolve): Set type.
24352
24353         * support.cs: Handle empty arguments.
24354                 
24355         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24356         SimpleLookup): Auxiliary routines to help parse a qualifier
24357         identifier.  
24358
24359         Update qualifier_identifier rule.
24360
24361         * codegen.cs: Removed debugging messages.
24362
24363         * class.cs: Make this a global thing, this acts just as a "key" to
24364         objects that we might have around.
24365
24366         (Populate): Only initialize method_builders_to_methods once.
24367
24368         * expression.cs (PropertyExpr): Initialize type from the
24369         PropertyType. 
24370
24371         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24372         Resolve pattern.  Attempt to implicitly convert value to boolean.
24373         Emit code.
24374
24375         * expression.cs: Set the type for the int32/int32 argument case.
24376         (Binary::ResolveOperator): Set the return type to boolean for
24377         comparission operators
24378
24379         * typemanager.cs: Remove debugging print code.
24380
24381         (Invocation::Resolve): resolve type.
24382
24383         * class.cs: Allocate a MemberInfo of the correct size, as the code
24384         elsewhere depends on the test to reflect the correct contents.
24385
24386         (Method::) Keep track of parameters, due to System.Reflection holes
24387
24388         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24389         mapping here.
24390
24391         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24392         of the exact size and return that.
24393
24394         (Class::LookupMethodByBuilder): New function that maps
24395         MethodBuilders to its methods.  Required to locate the information
24396         on methods because System.Reflection bit us again.
24397
24398         * support.cs: New file, contains an interface ParameterData and
24399         two implementations: ReflectionParameters and InternalParameters
24400         used to access Parameter information.  We will need to grow this
24401         as required.
24402
24403         * expression.cs (Invocation::GetParameterData): implement a cache
24404         and a wrapper around the ParameterData creation for methods. 
24405         (Invocation::OverloadResolve): Use new code.
24406
24407 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24408
24409         * class.cs (TypeContainer::EmitField): Remove and move into 
24410         (Field::Define): here and modify accordingly.
24411         (Field.FieldBuilder): New member.
24412         (TypeContainer::Populate): Update accordingly.
24413         (TypeContainer::FindMembers): Implement.
24414
24415 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24416
24417         * statement.cs: (VariableInfo::VariableType): New field to be
24418         initialized with the full type once it is resolved. 
24419
24420 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24421
24422         * parameter.cs (GetParameterInfo): Use a type cache to compute
24423         things only once, and to reuse this information
24424
24425         * expression.cs (LocalVariableReference::Emit): Implement.
24426         (OpcodeCast::Emit): fix.
24427
24428         (ParameterReference::Resolve): Implement.
24429         (ParameterReference::Emit): Implement.
24430
24431         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24432         that are expressions need to stay as Expressions.
24433
24434         * typemanager.cs (CSharpName): Returns the C# name of a type if
24435         possible. 
24436
24437         * expression.cs (Expression::ConvertImplicit): New function that
24438         implements implicit type conversions.
24439
24440         (Expression::ImplicitReferenceConversion): Implements implicit
24441         reference conversions.
24442
24443         (EmptyCast): New type for transparent casts.
24444
24445         (OpcodeCast): New type for casts of types that are performed with
24446         a sequence of bytecodes.
24447
24448         (BoxedCast): New type used for casting value types into reference
24449         types.  Emits a box opcode.
24450
24451         (Binary::DoNumericPromotions): Implements numeric promotions of
24452         and computation of the Binary::Type.
24453
24454         (Binary::EmitBranchable): Optimization.
24455
24456         (Binary::Emit): Implement code emission for expressions.
24457
24458         * typemanager.cs (TypeManager): Added two new core types: sbyte
24459         and byte.
24460
24461 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24462
24463         * class.cs (TypeContainer::FindMembers): Method which does exactly
24464         what Type.FindMembers does, only we don't have to use reflection. No
24465         implementation yet.
24466
24467         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24468         typecontainer objects as we need to get at them.
24469         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24470
24471         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24472         typecontainer object.
24473
24474         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24475         of just a Report object.
24476
24477 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24478
24479         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24480         "remove_"
24481         (TypeContainer::Populate): Now define the delegates of the type too.
24482         (TypeContainer.Delegates): Property to access the list of delegates defined
24483         in the type.
24484
24485         * delegates.cs (Delegate::Define): Implement partially.
24486
24487         * modifiers.cs (TypeAttr): Handle more flags.
24488
24489 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24490
24491         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24492         and not <=
24493         (Operator::Define): Re-write logic to get types by using the LookupType method
24494         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24495         (Indexer::Define): Ditto.
24496         (Event::Define): Ditto.
24497         (Property::Define): Ditto.
24498
24499 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24500
24501         * class.cs (TypeContainer::Populate): Now define operators too. 
24502         (TypeContainer.Operators): New property to access the list of operators
24503         in a type.
24504         (Operator.OperatorMethodBuilder): New member to hold the method builder
24505         for the operator we are defining.
24506         (Operator::Define): Implement.
24507
24508 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24509
24510         * class.cs (Event::Define): Make the prefixes of the accessor methods
24511         addOn_ and removeOn_ 
24512
24513         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24514         of the location being passed in too. Ideally, this should go later since all
24515         error reporting should be done through the Report object.
24516
24517         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24518         (Populate): Iterate thru the indexers we have and define them too.
24519         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24520         for the get and set accessors.
24521         (Indexer::Define): Implement.
24522
24523 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24524
24525         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24526         my previous implementation, did not work.
24527
24528         * typemanager.cs: Add a couple of missing types (the longs).
24529
24530         * literal.cs: Use TypeManager.bool_type instead of getting it.
24531
24532         * expression.cs (EventExpr): New kind of expressions.
24533         (Expressio::ExprClassFromMemberInfo): finish
24534
24535 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24536
24537         * assign.cs: Emit stores to static fields differently.
24538
24539 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24540
24541         * Merge in changes and adjust code to tackle conflicts. Backed out my
24542         code in Assign::Resolve ;-) 
24543
24544 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24545
24546         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24547         instead Report.Error and also pass in the location.
24548         (CSharpParser::Lexer): New readonly property to return the reference
24549         to the Tokenizer object.
24550         (declare_local_variables): Use Report.Error with location instead of plain 
24551         old error.
24552         (CheckDef): Ditto.
24553
24554         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24555         (Operator.CheckBinaryOperator): Ditto.
24556
24557         * cs-parser.jay (operator_declarator): Update accordingly.
24558
24559         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24560         (CheckBinaryOperator): Same here.
24561
24562         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24563         on the name without any prefixes of namespace names etc. This is because we
24564         already might have something already fully qualified like 
24565         'System.Console.WriteLine'
24566
24567         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24568
24569 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24570
24571         * cs-tokenizer.cs (location): Return a string which also contains
24572         the file name.
24573
24574         * expression.cs (ElementAccess): New class for expressions of the
24575         type 'element access.'
24576         (BaseAccess): New class for expressions of the type 'base access.'
24577         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24578         respectively.
24579
24580         * cs-parser.jay (element_access): Implement action.
24581         (base_access): Implement actions.
24582         (checked_expression, unchecked_expression): Implement.
24583
24584         * cs-parser.jay (local_variable_type): Correct and implement.
24585         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24586
24587         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24588
24589         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24590         name and the specifiers.
24591
24592         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24593
24594         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24595         making them all public ;-)
24596
24597         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24598         class anyways.
24599
24600 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24601
24602         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24603         PropertyExprs.
24604         (FieldExpr, PropertyExprs): New resolved expressions.
24605         (SimpleName::MemberStaticCheck): Perform static checks for access
24606         to non-static fields on static methods. Maybe this should be
24607         generalized for MemberAccesses. 
24608         (SimpleName::ResolveSimpleName): More work on simple name
24609         resolution. 
24610
24611         * cs-parser.jay (primary_expression/qualified_identifier): track
24612         the parameter index.
24613
24614         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24615         (EmitContext::EmitBoolExpression): Chain to expression generation
24616         instead of temporary hack.
24617         (::EmitStatementExpression): Put generic expression code generation.
24618
24619         * assign.cs (Assign::Emit): Implement variable assignments to
24620         local variables, parameters and fields.
24621
24622 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24623
24624         * statement.cs (Block::GetVariableInfo): New method, returns the
24625         VariableInfo for a variable name in a block.
24626         (Block::GetVariableType): Implement in terms of GetVariableInfo
24627
24628         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24629         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24630
24631 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24632
24633         * cs-parser.jay (operator_declaration): Continue on my quest : update
24634         to take attributes argument.
24635         (event_declaration): Ditto.
24636         (enum_declaration): Ditto.
24637         (indexer_declaration): Ditto.
24638
24639         * class.cs (Operator::Operator): Update constructor accordingly.
24640         (Event::Event): Ditto.
24641
24642         * delegate.cs (Delegate::Delegate): Same here.
24643
24644         * enum.cs (Enum::Enum): Same here.
24645
24646 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24647
24648         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24649
24650         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24651
24652         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24653         being passed around as an arraylist.
24654         (Attributes::AddAttribute): Method to add attribute sections.
24655
24656         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24657         (struct_declaration): Update accordingly.
24658         (constant_declaration): Update.
24659         (field_declaration): Update.
24660         (method_header): Update.
24661         (fixed_parameter): Update.
24662         (parameter_array): Ditto.
24663         (property_declaration): Ditto.
24664         (destructor_declaration): Ditto.
24665
24666         * class.cs (Struct::Struct): Update constructors accordingly.
24667         (Class::Class): Ditto.
24668         (Field::Field): Ditto.
24669         (Method::Method): Ditto.
24670         (Property::Property): Ditto.
24671         (TypeContainer::OptAttribute): update property's return type.
24672
24673         * interface.cs (Interface.opt_attributes): New member.
24674         (Interface::Interface): Update to take the extra Attributes argument.
24675
24676         * parameter.cs (Parameter::Parameter): Ditto.
24677
24678         * constant.cs (Constant::Constant): Ditto.
24679
24680         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24681         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24682         the attributes as a parameter.
24683         (InterfaceProperty): Update constructor call.
24684         (InterfaceEvent): Ditto.
24685         (InterfaceMethod): Ditto.
24686         (InterfaceIndexer): Ditto.
24687
24688         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24689         pass the attributes too.
24690         (interface_event_declaration): Ditto.
24691         (interface_property_declaration): Ditto.
24692         (interface_method_declaration): Ditto.
24693         (interface_declaration): Ditto.
24694
24695 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24696
24697         * class.cs (Method::Define): Track the "static Main" definition to
24698         create an entry point. 
24699
24700         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24701         EntryPoint if we find it. 
24702
24703         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24704         (EmitContext::ig): Make this variable public.
24705
24706         * driver.cs: Make the default output file be the first file name
24707         with the .exe extension.  
24708
24709         Detect empty compilations
24710
24711         Handle various kinds of output targets.  Handle --target and
24712         rename -t to --dumper.
24713
24714         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24715         methods inherited from Expression return now an Expression.  This
24716         will is used during the tree rewriting as we resolve them during
24717         semantic analysis.
24718
24719         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24720         the spec.  Missing entirely is the information about
24721         accessability of elements of it.
24722
24723         (Expression::ExprClassFromMemberInfo): New constructor for
24724         Expressions that creates a fully initialized Expression based on
24725         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24726         a Type.
24727
24728         (Invocation::Resolve): Begin implementing resolution of invocations.
24729
24730         * literal.cs (StringLiteral):  Implement Emit.
24731
24732 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24733
24734         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24735         member.
24736
24737 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24738
24739         * cs-parser.jay (attribute_arguments): Implement actions.
24740         (attribute): Fix bug in production. Implement action.
24741         (attribute_list): Implement.
24742         (attribute_target): Implement.
24743         (attribute_target_specifier, opt_target_specifier): Implement
24744         (CheckAttributeTarget): New method to check if the attribute target
24745         is valid.
24746         (attribute_section): Implement.
24747         (opt_attributes): Implement.
24748
24749         * attribute.cs : New file to handle attributes.
24750         (Attribute): Class to hold attribute info.
24751
24752         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24753         (attribute_section): Modify production to use 2 different rules to 
24754         achieve the same thing. 1 s/r conflict down !
24755         Clean out commented, useless, non-reducing dimension_separator rules.
24756
24757         * class.cs (TypeContainer.attributes): New member to hold list
24758         of attributes for a type.
24759         (Struct::Struct): Modify to take one more argument, the attribute list.
24760         (Class::Class): Ditto.
24761         (Field::Field): Ditto.
24762         (Method::Method): Ditto.
24763         (Property::Property): Ditto.
24764
24765         * cs-parser.jay (struct_declaration): Update constructor call to
24766         pass in the attributes too.
24767         (class_declaration): Ditto.
24768         (constant_declaration): Ditto.
24769         (field_declaration): Ditto.
24770         (method_header): Ditto.
24771         (fixed_parameter): Ditto.
24772         (parameter_array): Ditto.
24773         (property_declaration): Ditto.
24774
24775         * constant.cs (Constant::Constant): Update constructor similarly.
24776         Use System.Collections.
24777
24778         * parameter.cs (Parameter::Parameter): Update as above.
24779
24780 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24781
24782         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24783         (TypeContainer.delegates): New member to hold list of delegates.
24784
24785         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24786         this time as I seem to be on crack ;-)
24787
24788 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24789
24790         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24791         tell whether an identifier represents a namespace.
24792
24793         * expression.cs (NamespaceExpr): A namespace expression, used only
24794         temporarly during expression resolution.
24795         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24796         utility functions to resolve names on expressions.
24797
24798 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24799
24800         * codegen.cs: Add hook for StatementExpressions. 
24801
24802         * class.cs: Fix inverted test for static flag in methods.
24803
24804 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24805
24806         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24807         to make it coincide with MS' number.
24808         (Operator::CheckBinaryOperator): Ditto.
24809
24810         * ../errors/errors.txt : Remove error numbers added earlier.
24811
24812         * ../errors/cs1019.cs : Test case for error # 1019
24813
24814         * ../errros/cs1020.cs : Test case for error # 1020
24815
24816         * cs-parser.jay : Clean out commented cruft.
24817         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24818         used anywhere - non-reducing rule.
24819         (namespace_declarations): Non-reducing rule - comment out.
24820
24821         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24822         with TypeContainer::AddEnum.
24823
24824         * delegate.cs : New file for delegate handling classes.
24825         (Delegate): Class for declaring delegates.
24826
24827         * makefile : Update.
24828
24829         * cs-parser.jay (delegate_declaration): Implement.
24830
24831 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24832
24833         * class.cs (Event::Define): Implement.
24834         (Event.EventBuilder): New member.
24835
24836         * class.cs (TypeContainer::Populate): Update to define all enums and events
24837         we have.
24838         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24839         readonly fields for all these cases ?
24840
24841 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24842
24843         * class.cs (Property): Revamp to use the convention of making fields readonly.
24844         Accordingly modify code elsewhere.
24845
24846         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24847         the Define method of the Property class.
24848
24849         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24850         trivial bug.
24851         (TypeContainer::Populate): Update to define all the properties we have. Also
24852         define all enumerations.
24853
24854         * enum.cs (Define): Implement.
24855
24856 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24857
24858         * cs-parser.jay (overloadable_operator): The semantic value is an
24859         enum of the Operator class.
24860         (operator_declarator): Implement actions.
24861         (operator_declaration): Implement.
24862
24863         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24864         validity of definitions.
24865         (Operator::CheckBinaryOperator): Static method to check for binary operators
24866         (TypeContainer::AddOperator): New method to add an operator to a type.
24867
24868         * cs-parser.jay (indexer_declaration): Added line to actually call the
24869         AddIndexer method so it gets added ;-)
24870
24871         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24872         already taken care of by the MS compiler ?  
24873
24874 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24875
24876         * class.cs (Operator): New class for operator declarations.
24877         (Operator::OpType): Enum for the various operators.
24878
24879 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24880
24881         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24882         ostensibly handle this in semantic analysis.
24883
24884         * cs-parser.jay (general_catch_clause): Comment out
24885         (specific_catch_clauses, specific_catch_clause): Ditto.
24886         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24887         (catch_args, opt_catch_args): New productions.
24888         (catch_clause): Rewrite to use the new productions above
24889         (catch_clauses): Modify accordingly.
24890         (opt_catch_clauses): New production to use in try_statement
24891         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24892         and re-write the code in the actions to extract the specific and
24893         general catch clauses by being a little smart ;-)
24894
24895         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24896         Hooray, try and catch statements parse fine !
24897
24898 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24899
24900         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24901         string from the hashtable of variables.
24902
24903         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24904         I end up making that mistake ;-)
24905         (catch_clauses): Fixed gross error which made Key and Value of the 
24906         DictionaryEntry the same : $1 !!
24907
24908 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24909
24910         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24911
24912         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24913         when the add and remove accessors are specified. 
24914
24915 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24916
24917         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24918         information about indexer_declarator.
24919         (indexer_declarator): Implement actions.
24920         (parsing_indexer): New local boolean used to keep track of whether
24921         we are parsing indexers or properties. This is necessary because 
24922         implicit_parameters come into picture even for the get accessor in the 
24923         case of an indexer.
24924         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24925
24926         * class.cs (Indexer): New class for indexer declarations.
24927         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24928         (TypeContainer::indexers): New member to hold list of indexers for the
24929         type.
24930
24931 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24932
24933         * cs-parser.jay (add_accessor_declaration): Implement action.
24934         (remove_accessor_declaration): Implement action.
24935         (event_accessors_declaration): Implement
24936         (variable_declarators): swap statements for first rule - trivial.
24937
24938         * class.cs (Event): New class to hold information about event
24939         declarations.
24940         (TypeContainer::AddEvent): New method to add an event to a type
24941         (TypeContainer::events): New member to hold list of events.
24942
24943         * cs-parser.jay (event_declaration): Implement actions.
24944
24945 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24946
24947         * cs-parser.jay (dim_separators): Implement. Make it a string
24948         concatenating all the commas together, just as they appear.
24949         (opt_dim_separators): Modify accordingly
24950         (rank_specifiers): Update accordingly. Basically do the same
24951         thing - instead, collect the brackets here.
24952         (opt_rank_sepcifiers): Modify accordingly.
24953         (array_type): Modify to actually return the complete type string
24954         instead of ignoring the rank_specifiers.
24955         (expression_list): Implement to collect the expressions
24956         (variable_initializer): Implement. We make it a list of expressions
24957         essentially so that we can handle the array_initializer case neatly too.
24958         (variable_initializer_list): Implement.
24959         (array_initializer): Make it a list of variable_initializers
24960         (opt_array_initializer): Modify accordingly.
24961
24962         * expression.cs (New::NType): Add enumeration to help us
24963         keep track of whether we have an object/delegate creation
24964         or an array creation.
24965         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24966         members to hold data about array creation.
24967         (New:New): Modify to update NewType
24968         (New:New): New Overloaded contructor for the array creation
24969         case.
24970
24971         * cs-parser.jay (array_creation_expression): Implement to call
24972         the overloaded New constructor.
24973
24974 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24975
24976         * class.cs (TypeContainer::Constructors): Return member
24977         constructors instead of returning null.
24978
24979 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24980
24981         * typemanager.cs (InitCoreTypes): Initialize the various core
24982         types after we have populated the type manager with the user
24983         defined types (this distinction will be important later while
24984         compiling corlib.dll)
24985
24986         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24987         on Expression Classification.  Now all expressions have a method
24988         `Resolve' and a method `Emit'.
24989
24990         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24991         generation from working.     Also add some temporary debugging
24992         code. 
24993
24994 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24995
24996         * codegen.cs: Lots of code generation pieces.  This is only the
24997         beginning, will continue tomorrow with more touches of polish.  We
24998         handle the fundamentals of if, while, do, for, return.  Others are
24999         trickier and I need to start working on invocations soon.
25000
25001         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25002         s.InitStatement. 
25003
25004         * codegen.cs (EmitContext): New struct, used during code
25005         emission to keep a context.   Most of the code generation will be
25006         here. 
25007
25008         * cs-parser.jay: Add embedded blocks to the list of statements of
25009         this block.  So code generation proceeds in a top down fashion.
25010
25011 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25012
25013         * statement.cs: Add support for multiple child blocks.
25014
25015 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25016
25017         * codegen.cs (EmitCode): New function, will emit the code for a
25018         Block of code given a TypeContainer and its ILGenerator. 
25019
25020         * statement.cs (Block): Standard public readonly optimization.
25021         (Block::Block constructors): Link children. 
25022         (Block::Child): Child Linker.
25023         (Block::EmitVariables): Emits IL variable declarations.
25024
25025         * class.cs: Drop support for MethodGroups here, delay until
25026         Semantic Analysis.
25027         (Method::): Applied the same simplification that I did before, and
25028         move from Properties to public readonly fields.
25029         (Method::ParameterTypes): Returns the parameter types for the
25030         function, and implements a cache that will be useful later when I
25031         do error checking and the semantic analysis on the methods is
25032         performed.
25033         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25034         and made a method, optional argument tells whether this is a class
25035         or a structure to apply the `has-this' bit.
25036         (Method::GetCallingConvention): Implement, returns the calling
25037         convention. 
25038         (Method::Define): Defines the type, a second pass is performed
25039         later to populate the methods.
25040
25041         (Constructor::ParameterTypes): implement a cache similar to the
25042         one on Method::ParameterTypes, useful later when we do semantic
25043         analysis. 
25044
25045         (TypeContainer::EmitMethod):  New method.  Emits methods.
25046
25047         * expression.cs: Removed MethodGroup class from here.
25048
25049         * parameter.cs (Parameters::GetCallingConvention): new method.
25050
25051 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25052
25053         * class.cs (TypeContainer::Populate): Drop RootContext from the
25054         argument. 
25055
25056         (Constructor::CallingConvention): Returns the calling convention.
25057         (Constructor::ParameterTypes): Returns the constructor parameter
25058         types. 
25059
25060         (TypeContainer::AddConstructor): Keep track of default constructor
25061         and the default static constructor.
25062
25063         (Constructor::) Another class that starts using `public readonly'
25064         instead of properties. 
25065
25066         (Constructor::IsDefault): Whether this is a default constructor. 
25067
25068         (Field::) use readonly public fields instead of properties also.
25069
25070         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25071         track of static constructors;  If none is used, turn on
25072         BeforeFieldInit in the TypeAttributes. 
25073
25074         * cs-parser.jay (opt_argument_list): now the return can be null
25075         for the cases where there are no arguments. 
25076
25077         (constructor_declarator): If there is no implicit `base' or
25078         `this', then invoke the default parent constructor. 
25079
25080         * modifiers.cs (MethodAttr): New static function maps a set of
25081         modifiers flags into a MethodAttributes enum
25082         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25083         MethodAttr, TypeAttr to represent the various mappings where the
25084         modifiers are used.
25085         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25086
25087 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25088
25089         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25090         method arguments.
25091
25092         * interface.cs (PopulateIndexer): Implemented the code generator
25093         for interface indexers.
25094
25095 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25096
25097         * interface.cs (InterfaceMemberBase): Now we track the new status
25098         here.  
25099
25100         (PopulateProperty): Implement property population.  Woohoo!  Got
25101         Methods and Properties going today. 
25102
25103         Removed all the properties for interfaces, and replaced them with
25104         `public readonly' fields. 
25105
25106 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25107
25108         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25109         initialize their hashtables/arraylists only when they are needed
25110         instead of doing this always.
25111
25112         * parameter.cs: Handle refs and out parameters.
25113
25114         * cs-parser.jay: Use an ArrayList to construct the arguments
25115         instead of the ParameterCollection, and then cast that to a
25116         Parameter[] array.
25117
25118         * parameter.cs: Drop the use of ParameterCollection and use
25119         instead arrays of Parameters.
25120
25121         (GetParameterInfo): Use the Type, not the Name when resolving
25122         types. 
25123
25124 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25125
25126         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25127         and instead use public readonly fields.
25128
25129         * class.cs: Put back walking code for type containers.
25130
25131 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25132
25133         * class.cs (MakeConstant): Code to define constants.
25134
25135         * rootcontext.cs (LookupType): New function.  Used to locate types 
25136
25137
25138 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25139
25140         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25141         this System.Reflection code is.  Kudos to Microsoft
25142
25143         * typemanager.cs: Implement a type cache and avoid loading all
25144         types at boot time.  Wrap in LookupType the internals.  This made
25145         the compiler so much faster.  Wow.  I rule!
25146
25147         * driver.cs: Make sure we always load mscorlib first (for
25148         debugging purposes, nothing really important).
25149
25150         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25151         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25152
25153         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25154         on namespaces that have been imported using the `using' keyword.
25155
25156         * class.cs (TypeContainer::TypeAttr): Virtualize.
25157         (Class::TypeAttr): Return attributes suitable for this bad boy.
25158         (Struct::TypeAttr): ditto.
25159         Handle nested classes.
25160         (TypeContainer::) Remove all the type visiting code, it is now
25161         replaced with the rootcontext.cs code
25162
25163         * rootcontext.cs (GetClassBases): Added support for structs. 
25164
25165 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25166
25167         * interface.cs, statement.cs, class.cs, parameter.cs,
25168         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25169         Drop use of TypeRefs, and use strings instead.
25170
25171 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25172
25173         * rootcontext.cs: 
25174
25175         * class.cs (Struct::Struct): set the SEALED flags after
25176         checking the modifiers.
25177         (TypeContainer::TypeAttr): new property, returns the
25178         TypeAttributes for a class.  
25179
25180         * cs-parser.jay (type_list): Oops, list production was creating a
25181         new list of base types.
25182
25183         * rootcontext.cs (StdLib): New property.
25184         (GetInterfaceTypeByName): returns an interface by type name, and
25185         encapsulates error handling here.
25186         (GetInterfaces): simplified.
25187         (ResolveTree): Encapsulated all the tree resolution here.
25188         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25189         types. 
25190
25191         * driver.cs: Add support for --nostdlib, to avoid loading the
25192         default assemblies.
25193         (Main): Do not put tree resolution here. 
25194
25195         * rootcontext.cs: Beginning of the class resolution.
25196
25197 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25198
25199         * rootcontext.cs: Provide better error reporting. 
25200
25201         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25202
25203         * rootcontext.cs (CreateInterface): Handle the case where there
25204         are no parent interfaces.
25205
25206         (CloseTypes): Routine to flush types at the end.
25207         (CreateInterface): Track types.
25208         (GetInterfaces): Returns an array of Types from the list of
25209         defined interfaces.
25210
25211         * typemanager.c (AddUserType): Mechanism to track user types (puts
25212         the type on the global type hash, and allows us to close it at the
25213         end). 
25214
25215 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25216
25217         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25218         RecordInterface instead.
25219
25220         * cs-parser.jay: Updated to reflect changes above.
25221
25222         * decl.cs (Definition): Keep track of the TypeBuilder type that
25223         represents this type here.  Not sure we will use it in the long
25224         run, but wont hurt for now.
25225
25226         * driver.cs: Smaller changes to accomodate the new code.
25227
25228         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25229         when done. 
25230
25231         * rootcontext.cs (CreateInterface):  New method, used to create
25232         the System.TypeBuilder type for interfaces.
25233         (ResolveInterfaces): new entry point to resolve the interface
25234         hierarchy. 
25235         (CodeGen): Property, used to keep track of the code generator.
25236
25237 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25238
25239         * cs-parser.jay: Add a second production for delegate_declaration
25240         with `VOID'.
25241
25242         (enum_body): Put an opt_comma here instead of putting it on
25243         enum_body or enum_member_declarations so we can handle trailing
25244         commas on enumeration members.  Gets rid of a shift/reduce.
25245
25246         (type_list): Need a COMMA in the middle.
25247
25248         (indexer_declaration): Tell tokenizer to recognize get/set
25249
25250         * Remove old targets.
25251
25252         * Re-add the parser target.
25253
25254 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25255
25256         * cs-parser.jay: Add precendence rules for a number of operators
25257         ot reduce the number of shift/reduce conflicts in the grammar.
25258
25259 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25260
25261         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25262         and put it here.
25263
25264         Get rid of old crufty code.
25265
25266         * rootcontext.cs: Use this to keep track of the parsed
25267         representation and the defined types available to the program. 
25268
25269         * gen-treedump.cs: adjust for new convention.
25270
25271         * type.cs: Split out the type manager, and the assembly builder
25272         from here. 
25273
25274         * typemanager.cs: the type manager will live here now.
25275
25276         * cil-codegen.cs: And the code generator here. 
25277
25278 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25279
25280         * makefile: Fixed up for easy making.
25281
25282 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25283
25284         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25285         the 
25286
25287         (unary_expression): Expand pre_increment_expression and
25288         post_decrement_expression to reduce a shift/reduce.
25289
25290 2001-07-11  Simon Cozens
25291
25292         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25293
25294         Improve allow_keyword_as_indent name.
25295
25296 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25297
25298         * Adjustments for Beta2. 
25299
25300 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25301
25302         * decl.cs: Added `Define' abstract method.
25303         (InTransit): new property, used to catch recursive definitions. 
25304
25305         * interface.cs: Implement `Define'. 
25306
25307         * modifiers.cs: Map Modifiers.constants to
25308         System.Reflection.TypeAttribute flags.
25309
25310         * class.cs: Keep track of types and user-defined types.
25311         (BuilderInit): New method for creating an assembly
25312         (ResolveType): New function to launch the resolution process, only
25313         used by interfaces for now.
25314
25315         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25316         that are inserted into the name space. 
25317
25318 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25319
25320         * ARGH.  I have screwed up my tree so many times due to the use of
25321         rsync rather than using CVS.  Going to fix this at once. 
25322
25323         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25324         load types.
25325
25326 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25327
25328         * Experiment successful: Use System.Type rather that our own
25329         version of Type.  
25330
25331 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25332
25333         * cs-parser.jay: Removed nsAliases from here.
25334
25335         Use new namespaces, handle `using XXX;' 
25336
25337         * namespace.cs: Reimplemented namespace handling, use a recursive
25338         definition of the class.  Now we can keep track of using clauses
25339         and catch invalid using clauses.
25340
25341 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25342
25343         * gen-treedump.cs: Adapted for all the renaming.
25344
25345         * expression.cs (Expression): this class now has a Type property
25346         which returns an expression Type.
25347
25348         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25349         `Type', as this has a different meaning now in the base
25350
25351 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25352
25353         * interface.cs, class.cs: Removed from all the sources the
25354         references to signature computation, as we can not do method
25355         signature computation during the parsing time, as we are not
25356         trying to solve at that point distinguishing:
25357
25358         class X {
25359                 void a (Blah x) {}
25360                 void a (NS.Blah x) {}
25361         }
25362
25363         Which depending on the context might be valid or not, as we do not
25364         know if Blah is the same thing as NS.Blah at that point.
25365
25366         * Redid everything so the code uses TypeRefs now instead of
25367         Types.  TypeRefs are just temporary type placeholders, that need
25368         to be resolved.  They initially have a pointer to a string and the
25369         current scope in which they are used.  This is used later by the
25370         compiler to resolve the reference to an actual Type. 
25371
25372         * DeclSpace is no longer a CIR.Type, and neither are
25373         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25374         are all DeclSpaces, but no Types. 
25375
25376         * type.cs (TypeRefManager): This implements the TypeRef manager,
25377         which keeps track of all the types that need to be resolved after
25378         the parsing has finished. 
25379
25380 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25381
25382         * ARGH.  We are going to have to store `foreach' as a class rather
25383         than resolving it, as we need to verify error 1579 after name
25384         resolution.   *OR* we could keep a flag that says `This request to
25385         IEnumerator comes from a foreach statement' which we can then use
25386         to generate the error.
25387
25388 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25389
25390         * class.cs (TypeContainer.AddMethod): we now add methods to the
25391         MethodGroup instead of the method hashtable.  
25392
25393         * expression.cs: Add MethodGroup abstraction, which gets us one
25394         step closer to the specification in the way we handle method
25395         declarations.  
25396
25397         * cs-parser.jay (primary_expression): qualified_identifier now
25398         tried to match up an identifier to a local variable reference or
25399         to a parameter reference.
25400
25401         current_local_parameters is now a parser global variable that
25402         points to the current parameters for the block, used during name
25403         lookup.
25404
25405         (property_declaration): Now creates an implicit `value' argument to
25406         the set accessor.
25407
25408 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25409
25410         * parameter.cs: Do not use `param' arguments as part of the
25411         signature, per the spec.
25412
25413 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25414
25415         * decl.cs: Base class for classes, structs and interfaces.  This
25416         is the "Declaration Space" 
25417
25418         * cs-parser.jay: Use CheckDef for checking declaration errors
25419         instead of having one on each function.
25420
25421         * class.cs: Factor out some code for handling error handling in
25422         accordance to the "Declarations" section in the "Basic Concepts"
25423         chapter in the ECMA C# spec.
25424
25425         * interface.cs: Make all interface member classes derive from
25426         InterfaceMemberBase.
25427
25428 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25429
25430         * Many things: all interfaces are parsed and generated in
25431         gen-treedump.  Support for member variables, constructors,
25432         destructors, properties, constants is there.
25433
25434         Beginning of the IL backend, but very little done, just there for
25435         testing purposes. 
25436
25437 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25438
25439         * cs-parser.jay: Fix labeled statement.
25440
25441         * cs-tokenizer.cs (escape): Escape " and ' always.
25442         ref_line, ref_name: keep track of the line/filename as instructed
25443         by #line by the compiler.
25444         Parse #line.
25445
25446 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25447
25448         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25449         to match the values in System.CodeDOM.
25450
25451         Divid renamed to Divide.
25452
25453         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25454         statements. 
25455         (Statements.set): remove.
25456
25457         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25458         statements. 
25459
25460         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25461         falseStatements always have valid values. 
25462
25463         * cs-parser.jay: Use System.CodeDOM now.
25464