Fix #77962
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #77962
4         * report.cs (SymbolRelatedToPreviousError): Drop generic type
5         arguments before checking whether a type is reflected or not.
6
7 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8
9         Fix #77954.
10         * expression.cs (Invocation.IsApplicable): Ensure a generic method
11         definition doesn't take part in overload resolution.
12         (Invocation.IsParamsMethodApplicable): Likewise.
13         (Invocation.OverloadResolve): When replacing a reflected override
14         method with its base definition, ensure that type arguments are
15         applied.
16
17 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
18
19         A fix for #77966.
20
21         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
22         was not specified.
23
24         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
25
26 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
27
28         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
29         phase.
30
31         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
32         LocalTemporary change.
33
34         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
35         TypeContainer.
36         (ClassOrStruct.DefineFieldInitializers): Implemented static field
37         initializers optimization.
38         (ClassOrStruct.TypeAttr): Moved from modifiers.
39         (Constructor.CheckBase): Don't crash when static ctor has parameters.
40         (FieldBase.ResolveInitializer): Resolves initializer.
41         (FieldBase.HasDefaultInitializer): New property.
42
43         * cs-parser.jay: Removed message.
44
45         * expression.cs (CompilerGeneratedThis): New specialization.
46
47         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
48
49 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
50
51         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
52
53 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
54
55         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
56         be now EnumConstants only.
57
58 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
59
60         * attribute.cs, driver.cs: Reset more caches.
61
62 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
63
64         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
65
66 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
67
68         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
69         for easier reuse. Updated all overrides.
70         (IntegralConstant): New base class for all integral constants.
71         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
72         of the constant range, report custom error.
73         (UIntConstant.Reduce): Fixed uint conversion.
74
75         * ecore.cs, literal.cs: Reduce updates.
76
77 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
78
79         A fix for #75813.
80
81         * class.cs (Constructor.Define): Removed extra if for default ctors.
82         A patch from Atsushi Enomoto.
83
84 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
85
86         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
87         GetAttributableValue.
88
89         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
90         when required.
91
92         * convert.cs (ImplicitConversionRequired): Error message moved to
93         DoubleLiteral.
94
95         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
96         automatic implicit conversion of an output value.
97         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
98
99         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
100         conversion.
101         (TypeOf.GetAttributableValue): Add extra handling for object type.
102
103         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
104         special error message.
105
106 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
107
108         * class.cs (Constructor.Emit): Don't crash when struct ctor is
109         InternalCall.
110         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
111         compatible with MS runtime.
112
113 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
114
115         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
116         attribute arguments here.
117
118         * class.cs (Indexer.Define): The check was moved to attribute class.
119
120 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
121
122         * expression.cs (StringConcat.Append): Reverted back to no warning state.
123
124 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
125
126         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
127
128         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
129         the blocks too.
130
131 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
132
133         * doc-bootstrap.cs : fix build.
134
135 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
136
137         * expression.cs (StringConcat.Append): Issue a warning when empty string
138         is going to append.
139
140 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
141
142         * assign.cs (CompoundAssign.ResolveSource): Removed.
143
144         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
145         clean up.
146
147         * class.cs (TypeContainer.FindMethods): Removed.
148         (TypeContainer.CheckMemberUsage): Made static.
149
150         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
151
152         * constant.cs (CheckRange): Removed unused type argument.
153         (CheckUnsigned): Removed unused type argument.
154
155         * cs-parser.jay: Updated after MemberAccess clean up.
156         Uses Length for empty string test.
157
158         * cs-tokenizer.cs: Uses Length for empty string test.
159         (IsCastToken): Made static.
160         (is_hex): Made static.
161         (real_type_suffix): Made static.
162
163         * decl.cs (SetupCache): Made static.
164         (OnGenerateDocComment): Removed unused ds argument.
165
166         * delegate.cs (VerifyDelegate): Removed unused argument.
167
168         * doc.cs: Uses Length for empty string test.
169
170         * driver.cs: Uses Length for empty string test.
171
172         * enum.cs (IsValidEnumType): Made static
173
174         * expression.cs (EnumLiftUp): Removed unused argument.
175         (ResolveMethodGroup): Ditto.
176         (BetterConversion): Ditto.
177         (GetVarargsTypes): Ditto.
178         (UpdateIndices): Ditto.
179         (ValidateInitializers): Ditto.
180         (MemberAccess.ctor): Ditto.
181         (GetIndexersForType): Ditto.
182
183         * flowanalysis.cs: (MergeFinally): Removed unused argument.
184
185         * iterators.cs: Updated after MemberAccess clean up.
186
187         * location.cs: Uses Length for empty string test.
188
189         * namespace.cs: Uses Length for empty string test.
190
191          * report.cs (CheckWarningCode): Made static.
192
193         * statement.cs (LabeledStatement): Removed unused argument.
194
195         * typemanager.cs (FilterNone): Removed.
196
197 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
198
199         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
200         obsolete.
201
202         * class.cs: Updated.
203
204 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
205
206         * cs-parser.jay.cs: __arglist is not allowed for delegates.
207
208 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
209
210         A fix for #77816.
211
212         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
213         host container.
214         (AnonymousMethod.ImplicitStandardConversionExists): New method.
215         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
216         Add more error reporting; Fixed issue with params.
217
218         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
219
220         * cs-parser.jay: AnonymousMethod requires host container.
221
222         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
223
224 2006-03-18  Raja R Harinath  <harinath@gmail.com>
225
226         * class.cs: Change 'TypeContainer ds' constructor argument to
227         'DeclSpace parent'.  Some classes were missed below due to
228         different naming convention.
229
230         * class.cs (MemberCore.Parent): Delete.  This makes the
231         ParentContainer changes below enforceable by the compiler.
232
233         Treat pointers to enclosing declaration space as 'DeclSpace', not
234         'TypeContainer'.
235         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
236         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
237
238         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
239         of TypeContainer.
240         (Block.AddThisVariable): Likewise.
241         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
242         (AbstractPropertyEventMethod.Emit): Likewise.
243         (AbstractPropertyEventMethod.EmitMethod): Likewise.
244         (GetMethod.Define, SetMethod.Define): Likewise.
245         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
246         (DelegateMethod.EmitMethod): Likewise.
247
248         Fix regression test-partial-13.cs.
249         Rationalize use of PartialContainer.  Ensure that the partial
250         class semantics can be tied to type-correctness, i.e., any
251         violation will cause a compile error.
252         * class.cs, const.cs: Access all fields that belong to class
253         TypeContainer via ParentContainer.  Arguments of EmitContexts and
254         Resolve()-like functions still use 'Parent'.
255
256         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
257         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
258         (PropertyMethod.CheckModifiers): Remove unused argument.
259         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
260         DeclSpace.
261
262 2006-03-28  Raja R Harinath  <rharinath@novell.com>
263
264         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
265
266 2006-03-17  Raja R Harinath  <harinath@gmail.com>
267
268         Make semantics of PartialContainer simpler.
269         * decl.cs (DeclSpace.IsPartial): Remove.
270         * class.cs (TypeContainer.IsPartial): Likewise.
271         (TypeContainer..ctor): Set PartialContainer to point to self.
272         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
273         (TypeContainer.FindNestedType): Likewise.
274         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
275
276 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
277
278         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
279
280 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
281
282         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
283         classes.
284
285 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
286
287         * class.cs (Operator.Define): An error for base conversion was not
288         reported correctly.
289
290 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
291
292         A fix for #77593, #77574.
293
294         * class.cs (MethodCore.CheckBase): Another if for operator.
295
296 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
297
298         A fix for #77822.
299
300         * expression.cs (VerifyArgumentsCompat): Reverted to double error
301         reporting, it's more tricky than I thought.
302
303 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
304
305         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
306         were not resolved
307
308         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
309         (DelegateCreation.ImplicitStandardConversionExists): New method for just
310         conversion test.
311         
312         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
313         not needed.
314
315 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
316
317         A fix for #77353.
318
319         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
320         (Event.Define): ditto
321         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
322
323         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
324         Removed redundant code and set NewSlot for Invoke method too.
325
326         * parameter.cs (Parameters.ctor): Add custom, type ctor.
327         (Parameters.MergeGenerated): New method. Use this method when you merge
328         compiler generated argument with user arguments.
329
330 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
331
332         * attribute.cs (ResolveAsTypeTerminal): Removed.
333
334         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
335         specialization for predefined types; 30% speed up.
336         Finally placed obsolete check to right place.
337         (Expression.ResolveType): Removed.
338
339         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
340         Updated after ResolveType was removed.
341
342         * expression.cs (Cast.ctor): Check void cast.
343         (Binary.ResolveAsTypeTerminal): Is never type.
344         (Conditional.ResolveAsTypeTerminal): Is never type.
345
346         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
347
348 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
349
350         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
351
352 2006-03-23  Martin Baulig  <martin@ximian.com>
353
354         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
355         type check if either of the types is an open generic type.
356
357 2006-03-23  Martin Baulig  <martin@ximian.com>
358
359         * convert.cs
360         (Convert.ExplicitTypeParameterConversion): New method; implement
361         explicit type parameter conversions.
362
363 2006-03-23  Martin Baulig  <martin@ximian.com>
364
365         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
366         blindly allow all conversions if we do not have any constraints.
367
368 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
369
370         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
371         these two separated members to simplify the code.
372         (Attribute.Resolve): Refactored to use new fields and methods.
373         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
374         implemented obsolete attribute checking.
375         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
376         implemented obsolete checking again. It look line never ending quest ;-)
377         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
378
379         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
380
381         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
382
383         *class.cs (Property.Define): Add RegisterProperty call.
384
385         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
386         argument groups (only 2).
387
388         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
389         encoding expression to arguments.
390         (Expression.ExprClassToResolveFlags): Just turned to property.
391
392         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
393         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
394         optimized as well as implemented support for zero-length attributes.
395
396         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
397         Add caching of PropertyInfo's.
398
399 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
400
401         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
402         error multiple times.
403
404 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
405
406         New partial class implementation.
407         A fix for #77027, #77029, #77403
408
409         * attribute.cs (Attributable): Made attributes protected.
410
411         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
412         the replacements of ClassPart and PartialContainer.
413         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
414         (TypeContainer.AddInterface): Ditto.
415         (TypeContainer.AddPartial): The main method for partial classes. It checks
416         for errors and merges ModFlags and attributes. At the end class is added to
417         partial_parts list.
418         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
419         required here.
420         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
421         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
422         from the rest of partial classes.
423         (TypeContainer.GetClassBases): Simplified.
424         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
425         DefineType.
426         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
427         (TypeContainer.HasExplicitLayout): Uses Flags now.
428         (PartialContainer): Removed.
429         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
430         (StaticClass): Was merged with Class.
431         (Class.GetClassBases): class and static class bases are verified here.
432         (Class.TypeAttr): Added static attributes when class is static.
433         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
434         (MemberBase): In some cases we need to call parent container for partial
435         class. It should be eliminated but it's not easy now.
436
437         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
438
439         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
440         partial classed to accumulate class comments.
441         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
442
443         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
444
445         * driver.cs (MainDriver): Tree.GetDecl was removed.
446
447         * modifiers.cs (Modifiers): Add partial modifier.
448
449         * tree.cs (Tree.decl): Removed.
450         (RootTypes): Started to use this class more often for root types
451         specializations.
452
453 2006-03-23  Raja R Harinath  <rharinath@novell.com>
454
455         * generic.cs (TypeParameter.UpdateConstraints): Update
456         'constraints' if null.
457
458 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
459
460         A fix for #77615
461
462         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
463         external interface does not have an attribute.
464
465 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
466
467         Another prerequisites for new partial classs implementation.
468         
469         * attribute.cs (Attribute.Equal): Implemented.
470         (Attribute.Emit): Changed as attributes can be applied more than twice.
471         (Attributes.Emit): Check for duplicate attributes here.
472
473         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
474         as a parameter, clean-up.
475
476 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
477
478         A fix for #77485
479
480         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
481         contains obsolete attribute check which can in some cases look for base
482         type of current class which is not initialized yet.
483         (TypeContainer.BaseType): Replacement of ptype.
484
485         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
486
487 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
488
489         First of prerequisites for new partial classs implemention.
490         
491         * attribute.cs (Attributable): Extended by ResolveContext;
492         Attributes finally have correct context for resolving in all cases.
493         (AttachTo): Attribute owner is assigned here.
494
495         * codegen.cs (IResolveContext): Introduce new interface to hold
496         all information needed in resolving phase.
497         (EmitContext): Implements IResolveContext; more clean-up needed here.
498         
499         * decl.cs (MemberCore): Implemented IResolveContext.
500
501         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
502         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
503         parameter.cs, statement.cs, tree.cs, typemanager.cs:
504         Refactored to use new IResolveContext instead of EmitContext; cleanup
505
506 2006-03-22  Raja R Harinath  <rharinath@novell.com>
507
508         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
509         mcs to keep code differences small.
510         * attribute.cs (Attribute.GetParameterDefaultValue): New.
511         * typemanager.cs (parameter_default_value_attribute_type): New.
512         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
513         CS1908 check.
514
515 2006-03-22  Martin Baulig  <martin@ximian.com>
516
517         * generic.cs
518         (Nullable.NullableLiteral): Derive from `NullLiteral'.
519
520         * convert.cs
521         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
522         instead of the normal `NullLiteral'.
523
524 2006-03-21  Martin Baulig  <martin@ximian.com>
525
526         Fix #77583.
527         * generic.cs (TypeManager.InferType): If `pt' is a generic
528         parameter, don't check whether `pt == at'.
529
530 2006-03-20  Raja R Harinath  <rharinath@novell.com>
531
532         Fix #77852
533         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
534         (TypeParameter.Resolve): Update to change.
535         (ConstraintChecker.CheckConstraints): Resolve type-argument
536         constraints before use.
537
538 2006-03-16  Martin Baulig  <martin@ximian.com>
539
540         * generic.cs
541         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
542         and don't have any instance constructors, also lookup in the base class.
543         (TypeManager.IsNullableValueType): New public method.
544
545         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
546         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
547         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
548
549         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
550         instead of just TypeManager.IsNullableType() to determine whether
551         a lifted operator exists.
552         (UnaryMutator.DoResolve): Likewise.
553         (Conditional.DoResolve): Likewise.
554         (Binary.DoResolve): A lifted operator only exists if both operands
555         are valuetypes and at least one of them is a nullable type.
556
557 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
558
559         * iterator.cs : yield break is allowed in try statement which has
560           catch clauses. Fixed bug #77767.
561
562 2006-03-12  Martin Baulig  <martin@ximian.com>
563
564         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
565         private IsSignatureEqual() to compare types; see the comment in
566         that method; fixes #77674.
567
568 2006-03-10  Raja R Harinath  <rharinath@novell.com>
569
570         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
571         (Expression.ResolveAsTypeTerminal): Likewise.
572         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
573         * expression.cs, generic.cs, iterators.cs: Likewise.
574         * parameter.cs, statement.cs, typemanager.cs: Likewise.
575
576 2006-03-09  Martin Baulig  <martin@ximian.com>
577
578         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
579         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
580
581 2006-03-09  Martin Baulig  <martin@ximian.com>
582
583         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
584         `prepared' flag is set.
585
586         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
587         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
588         issues; see gtest-254.cs.
589
590 2006-03-07  Martin Baulig  <martin@ximian.com>
591
592         * generic.cs (TypeManager.InferType): Allow infering
593         `IEnumerable<T>' with an array of T; see gtest-251.cs.
594
595 2006-03-06  Martin Baulig  <martin@ximian.com>
596
597         * generic.cs
598         (TypeManager.InferType): Fix gtest-250.cs.
599
600         * typemanager.cs
601         (TypeManager.IsSubclassOf): Also check the base class.
602
603         * expression.cs
604         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
605         fixes gtest-249.cs.
606
607 2006-03-01  Raja R Harinath  <rharinath@novell.com>
608
609         Fix #77679.
610         * expression.cs (ParameterReference.DoResolveBase): Change return
611         type to bool.
612         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
613         Update.
614
615         Fix #77628.
616         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
617
618         Fix #77642.
619         * typemanager.cs (GetFullNameSignature): Don't nullref on
620         protected accessors.
621
622 2006-02-16  Martin Baulig  <martin@ximian.com>
623
624         * generic.cs
625         (TypeManager.GetGenericFieldDefinition): New public method; use it
626         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
627
628 2006-02-14  Martin Baulig  <martin@ximian.com>
629
630         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
631
632 2006-02-14  Martin Baulig  <martin@ximian.com>
633
634         * generic.cs
635         (TypeManager.DropGenericMethodArguments): New public method; don't
636         use GetGenericMethodDefinition() on something which is not a
637         generic method.
638
639 2006-02-14  Martin Baulig  <martin@ximian.com>
640
641         * generic.cs
642         (ConstraintChecker.CheckConstraints): If a type parameter has the
643         `struct' constraint, the type must be a non-nullable valuetype.
644
645 2006-02-10  Martin Baulig  <martin@ximian.com>
646
647         * typemanager.cs
648         (TypeManager.IsOverride): Make this work for instantiated methods
649         in a generic class; fixes #77509.
650         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
651         rather than calling it directly; fixes #77488.  
652
653 2006-02-08  Martin Baulig  <martin@ximian.com>
654
655         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
656         reporting into CheckConstraint() so we can use the correctly
657         instantiated type.
658
659 2006-02-08  Martin Baulig  <martin@ximian.com>
660
661         * expression.cs (BaseAccess): Add support for generic methods.
662
663         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
664         the new MethodGroupExpr.
665
666 2006-02-07  Martin Baulig  <martin@ximian.com>
667
668         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
669         also reference types; fixes #77483.
670
671 2006-02-07  Martin Baulig  <martin@ximian.com>
672
673         * generic.cs
674         (TypeManager.IsGenericMethod): We now return whether something is
675         an instantiated generic method (and not a generic method def).
676         (TypeManager.IsGenericMethodDefinition): New public method.
677
678         * typemanager.cs
679         (TypeManager.CSharpSignature): Only include type arguments for
680         "real" generic methods, not for any instantiated method.
681         (TypeManager.GetMethodName): Likewise, but also allow generic
682         method definitions here.
683
684 2006-02-06  Miguel de Icaza  <miguel@novell.com>
685
686         * codegen.cs (EmitScopeInitFromBlock): check here the
687         capture_context, there is no need to make two calls to the
688         EmitContext. 
689
690         * anonymous.cs: Add some debugging messages that might help me
691         track other instances of this problem in the future (the
692         regression of test 467).
693
694         * cs-parser.jay: track the variable block, as we need to initalize
695         any captured variables declared in this block for the "catch"
696         portion of the "Try" statement.
697
698         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
699         scope initialization for captured variables. 
700
701         Also, move the emit for the variables after the block location has
702         been marked.
703
704 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
705
706        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
707         
708 2006-02-06  Martin Baulig  <martin@ximian.com>
709
710         * class.cs (TypeContainer.DefineType): If we're a struct, pass
711         `TypeManager.value_type' as parent type to
712         ModuleBuilder.DefineType().  Fixes #77358.      
713
714 2006-02-02  Miguel de Icaza  <miguel@novell.com>
715
716         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
717         commit yesterday, the initialization for the roots is necessary.
718         What is not necessary is the scope activation.
719
720 2006-02-02  Raja R Harinath  <rharinath@novell.com>
721
722         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
723         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
724         CS0206 checks.
725         (Argument.Resolve): Remove CS0206 checks.
726
727 2006-02-01  Miguel de Icaza  <miguel@novell.com>
728
729         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
730         scopes for all the roots, the scopes will now be emitted when the
731         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
732
733         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
734         code.  This reduces a lot of existing cruft.
735         
736         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
737         that the ScopeInfo is generated as we enter the scope, not at the
738         time of use, which is what we used to do before.
739
740         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
741         every time a Block is about to be emitted if we have a
742         CaptureContext. 
743
744 2006-02-01  Raja R Harinath  <rharinath@novell.com>
745
746         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
747         attribute for mscorlib too.
748
749         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
750         (Reset): Update.
751         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
752
753         * typemanager.cs (cons_param_array_attribute): Make private.
754         (Reset): Set it to null.
755         (InitCoreHelpers): Don't initialize it.
756         (ConsParamArrayAttribute): New.  Initialize it as needed.
757         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
758
759 2006-01-31  Miguel de Icaza  <miguel@novell.com>
760
761         * expression.cs: There might be errors reported during the
762         selection of applicable methods.  If there are errors, do not
763         continue execution as it will lead the compiler to crash.
764
765 2006-01-30  Miguel de Icaza  <miguel@novell.com>
766
767         * expression.cs: Member access is not allowed on anonymous
768         methods.  Fixes #77402.
769
770 2006-01-30  Raja R Harinath  <rharinath@novell.com>
771
772         Fix #77401
773         * cs-parser.jay (VariableDeclaration): Don't set
774         current_array_type to null.
775         (field_declaration, event_declaration, declaration_statement):
776         Set it to null here.
777
778 2006-01-29  Raja R Harinath  <harinath@gmail.com>
779
780         Fix part of #77397
781         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
782
783 2006-01-28  Raja R Harinath  <harinath@gmail.com>
784
785         * typemanager.cs (GenericParameterPosition): New.
786         * doc.cs: Use it.
787
788 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
789
790         * doc.cs : To process "include" elements, first we should create
791           another list than XmlNodeList, because it could result in node
792           removal, which could result in that the XmlNodeList gives up
793           yielding next node.
794
795 2006-01-25  Miguel de Icaza  <miguel@novell.com>
796
797         * expression.cs: Introduce an error report that we were not
798         catching before.   Gonzalo ran into it.
799
800 2006-01-23  Miguel de Icaza  <miguel@novell.com>
801
802         A fix for bug: #76957
803         
804         * iterators.cs (MoveNextMethod.CreateMethodHost): call
805         ComputeMethodHost before creating the method, this is a new
806         requirement. 
807
808         * anonymous.cs (AnonymousContainer): Now we track all the scopes
809         that this method references (RegisterScope).  The actual scope
810         where the method is hosted is computed with the ComputeMethodHost
811         before we create the method.
812
813         Moved the Deepest routine here.
814
815         (AnonymousContainer.ComputeMethodHost): New routine used to
816         compute the proper ScopeInfo that will host the anonymous method.
817
818         (ScopeInfo): Deal with multiple roots.  The problem was that we
819         did not have a unique root where all ScopeInfos could be hanged
820         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
821         of roots.  
822
823         Remove AdjustMethodScope which is now computed at the end.  Remove
824         LinkScope which did a partial link, instead link all ScopeInfos
825         before code generation from the new "LinkScopes" routine. 
826
827         Simplify all the Add* routines as they no longer need to maintain
828         the tree, they just need to record that they are using variables
829         from a ScopeInfo.
830
831         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
832         routines to produce the forest of ScopeInfo trees.
833
834         * class.cs (TypeContainer.AppendMethod): This is just like
835         AddMethod, but ensures that an interface implementation method
836         (IEnumerable.XXX) is not inserted at the beginning of the queue of
837         methods, but at the end.
838
839         We use this functionality to ensure that the generated MoveNext
840         method in the iterator class is resolved/emitted before the
841         enumerator methods created.   
842
843         This is required because the MoveNext method computes the right
844         ScopeInfo for the method.  And the other methods will eventually
845         need to resolve and fetch information computed from the anonymous
846         method. 
847
848         
849 2006-01-23  Raja R Harinath  <rharinath@novell.com>
850
851         Improve implementation of section 14.4.2.2 (Better function member).
852         * expression.cs (Invocation.MoreSpecific): Compare all type
853         arguments before deciding if one type is more specific than
854         another.  Handle array types too.  Return the more specific type.
855         (Invocation.BetterFunction): Add more tie-breaking rules from
856         section 14.4.2.2.  Perform "more specific" check after
857         other tie-breaking rules.  Compare all parameter types before
858         choosing the "more specific" method.
859
860 2006-01-21  Raja R Harinath  <harinath@gmail.com>
861             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
862
863         Fix rest of #76995.
864         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
865         the 'aliases' hash.
866         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
867         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
868
869 2006-01-18  Martin Baulig  <martin@ximian.com>
870
871         * class.cs (TypeContainer.AddToMemberContainer): Use
872         `symbol.MemberName.MethodName' instead of just `symbol.Name';
873         fixes #77124.
874
875 2006-01-18  Martin Baulig  <martin@ximian.com>
876
877         Fix #76417: a generic class may now have methods which may unify
878         for some type parameter substitutions.
879
880         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
881         for methods which may unify anymore.
882
883         * expression.cs (Invocation.MoreSpecific): New private static
884         method; checks whether one method is more specific than another
885         according to 14.4.2.2 of the spec.
886         (Invocation.BetterFunction): Implement the tie-breaking rules from
887         14.4.2.2 of the spec: if two methods unify for some type parameter
888         substitution, we need to pick the more specific one.
889
890 2006-01-18  Raja R Harinath  <rharinath@novell.com>
891
892         Fix #76656, cs0231-2.cs.
893         * cs-parser.jay (formal_parameter_list): Make error case catch
894         more issues.
895         (parenthesized_expression_0): Add CS1026 check.
896         (invocation_expression): Remove unused { $$ = lexer.Location }.
897
898 2006-01-17  Raja R Harinath  <rharinath@novell.com>
899
900         Fix #76824.
901         * cs-parser.jay (statement_expression): Don't list out the
902         individual statement-expressions.  Convert syntax error into
903         CS0201 check.
904
905 2006-01-16  Raja R Harinath  <rharinath@novell.com>
906
907         Fix #76874.
908         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
909         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
910         CheckIntermediateModification.
911         (FieldExpr.DoResolve): Add new two-argument version that
912         allows us to resolve the InstanceExpression as an lvalue.
913         The one-argument variant is now just a wrapper.
914         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
915         Resolve the lhs as an lvalue if the it has a value type.
916         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
917         from Assign.DoResolve.
918         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
919         resolved as an lvalue.
920         (PropertyExpr.DoResolve): Update.
921         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
922         has a value type.  Move CS1612 check here from
923         CheckIntermediateModification.
924         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
925         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
926         'right_side' of a ResolveLValue on an 'out' argument.
927         (EmptyExpression.LValueMemberAccess): New.  Used as the
928         'right_side' of a propagated ResolveLValue on a value type.
929         (LocalVariableReference.DoResolveBase): Recognize
930         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
931         Add CS1654 check.
932         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
933         EmptyExpression.Null.
934
935 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
936
937         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
938           Type.IsGenericParameter(). Fixed bug #77183.
939         * doc.cs : it is now identical to doc.cs in mcs.
940
941 2006-01-16  Martin Baulig  <martin@ximian.com>
942
943         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
944
945 2006-01-16  Martin Baulig  <martin@ximian.com>
946
947         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
948         ctors; fixes #77250.
949
950 2006-01-12  Miguel de Icaza  <miguel@novell.com>
951
952         This fixes the problem where we used ldfld instead of ldflda to
953         load the "THIS" pointer on captured parameters, when THIS is a
954         value type.  See bug #77205.
955         
956         * iterators.cs (CapturedThisReference.Emit): Pass false to
957         EmitThis (we do not need the address).
958
959         * codegen.cs (EmitThis): it needs to know whether we need the
960         address of `this' or not.  This is used by value types.  
961
962         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
963         every other call passes false.
964
965 2006-01-12  Raja R Harinath  <rharinath@novell.com>
966
967         Fix #77221.
968         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
969         GetOverride.
970         * expression.cs (Invocation.OverloadResolve): Update.
971         (Invocation.DoResolve): Avoid double resolution of invocation.
972
973 2006-01-11  Raja R Harinath  <rharinath@novell.com>
974
975         Fix #77180.
976         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
977         unary negation of floating point types as 0-expr; negation cannot
978         overflow in floating point types.
979
980         Fix #77204.
981         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
982         on operands of 'void' type.
983
984         Fix #77200.
985         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
986         and ExclusiveOr for boolean constants too.
987
988 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
989
990         * expression.cs: Fix Console.WriteLine ((this = x).foo);
991
992 2006-01-12  Miguel de Icaza  <miguel@novell.com>
993
994         * cs-tokenizer.cs (Position): New class used to save and restore
995         the position state in the tokenizer.  Before this patch the save
996         and restore was not complete enough so the line and columns would
997         start to drift and the debugger and stack traces will get the
998         wrong data.
999
1000 2006-01-10  Martin Baulig  <martin@ximian.com>
1001
1002         * generic.cs
1003         (TypeParameter.InflateConstraints): New public method.
1004
1005         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1006         constraints; fixes #77042.
1007
1008 2006-01-10  Martin Baulig  <martin@ximian.com>
1009
1010         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1011         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1012         #77061. 
1013
1014 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1015
1016         Fix #75636.
1017         * expression.cs (Invocation.OverloadResolve): Replace reflected
1018         override methods with their base virtual methods, rather than
1019         skipping over them.
1020         * typemanager.cs (TypeManager.GetOverride): New.
1021
1022 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1023
1024         * driver.cs: Report the case of no source files and no -out:
1025         argument provided.
1026
1027 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1028
1029         Fix #77035.
1030         * expression.cs (ComposedCast.GetSignatureForError): Define.
1031
1032 2006-01-05  Jb Evain  <jbevain@gmail.com>
1033
1034         * class.cs (Property.Define, Indexer.Define): do not tag the
1035         properties as SpecialName | RTSpecialName.
1036
1037 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1038
1039         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1040         doing a low-level comparission of parameter types.  It was lacking
1041         a check for __argslist. 
1042
1043 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1044
1045         * expression.cs (ParameterReference.DoResolveBase): Allow
1046         reference parameters if they are local to this block. 
1047
1048         This allows the ref and out parameters of a delegate to be used in
1049         an anonymous method, for example:
1050
1051         delegate void set (out int x);
1052
1053         set s = delegate (out int x){
1054                 x = 0;
1055         };
1056
1057         This is used by functionality introduced late in the C# language.
1058         
1059         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1060         method that take ref and out parameters. 
1061
1062         Fixes #77119 which was a late change in the spec.
1063
1064 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1065
1066         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1067         parent if its the same scope.  Fixes #77060.
1068
1069 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1070
1071         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1072
1073 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1074
1075         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1076         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1077         that doesn't contain the full public key. This is a update of the
1078         friend assemblies in .Net 2.0 release.
1079         
1080 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1081
1082         Fix #76995
1083
1084         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1085         ListDictionary, to contain the ExternAliasEntry entries (in
1086         addition to the NamespaceEntry.aliases hashtable). This field is
1087         shared between the original entry and its doppelganger (bodyless 
1088         copy of it).
1089         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1090         extern_aliases field.
1091         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1092         lookup in extern_aliases.
1093
1094 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1095
1096         Fix #77006.
1097         * class.cs (TypeContainer.Mark_HasEquals): New.
1098         (TypeContainer.Mark_HasGetHashCode): New.
1099         (ClassPart): Override them.
1100         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1101
1102         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1103         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1104         DeclSpace.
1105
1106         Fix #77008.
1107         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1108         'parent' argument to the base constructor.
1109
1110         Remove all mention of TypeContainer from decl.cs.
1111         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1112         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1113         (DeclSpace.DeclSpace): Likewise.
1114         (DeclSpace.DefineMembers): Remove unused argument.
1115         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1116         debugging check -- we don't care if the debug code throws an
1117         InvalidCastException instead of an InternalErrorException.
1118         * class.cs (TypeContainer.DefineMembers): Update to changes.
1119         (TypeContainer.DoDefineMembers): Likewise.
1120         (TypeContainer.GetMethods): Likewise.
1121         (PropertyMember.Define): Likewise.
1122         (MemberBase.Parent): New property that forwards to
1123         MemberCore.Parent, but ensures that we get a TypeContainer.
1124         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1125         (RootContext.PopulateTypes): Likewise.  Remove special case code
1126         for !RootContext.StdLib: DefineMembers is idempotent.
1127
1128 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1129
1130         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1131
1132 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1133
1134         * doc.cs : The search for referenced namespace was insufficient to
1135           get global one as it used to do. Fixed bug #76965.
1136
1137 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1138
1139         * doc.cs : check name in cref in the last phase that whether it is
1140           namespace or not.
1141
1142 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1143
1144         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1145           Mono.C5.
1146
1147 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1148
1149         * doc.cs : so it turned out that we cannot skip override check for 
1150           interface members. Fixed bug #76954.
1151
1152 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1153
1154         * cs-tokenizer.cs : fixed bug #75984:
1155           - #warning and #error should not be handled when the source line
1156             is disabled.
1157           - #line is not checked strictly when the source line is disabled.
1158           - #define and #undef is on the other hand checked strictly at any
1159             state.
1160
1161 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1162
1163         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1164           CS1027 report.
1165
1166 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1167
1168         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1169
1170         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1171         nested types.
1172
1173 2005-12-14  Martin Baulig  <martin@ximian.com>
1174
1175         * typemanager.cs (TypeManager.GetFullName): Make this public;
1176         `Type.Fullname' now never returns null.
1177
1178         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1179         explicit interface implementations; we're now using the same
1180         naming convention than csc does.
1181
1182 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1183
1184         * convert.cs (ExplicitConversionCore): Check the return value from
1185         ExplicitConversionCore which can return null on failure.  Fixes #76914
1186
1187 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1188
1189         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1190         instead of IsGenericInstance.
1191         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1192         code that's now covered by the more general test.
1193         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1194
1195         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1196         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1197         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1198         * generic.cs, report.cs, typemanager.cs: Likewise.
1199
1200 2005-12-08  Martin Baulig  <martin@ximian.com>
1201
1202         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1203
1204         * typemanager.cs (TypeManager.CSharpSignature): Include type
1205         arguments in the signature of a generic method.
1206
1207 2005-12-07  Martin Baulig  <martin@ximian.com>
1208
1209         Add support for custom attributes on type parameters.
1210
1211         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1212
1213         * generic.cs (TypeParameterName): New public class; we use this
1214         instead of a `string' to store the name of a type parameter, so we
1215         can also have `Attributes'.
1216         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1217         array instead of a `string[]' array.
1218         (TypeParameter.ctor): We now also take an `Attributes' argument.
1219         (TypeParameter.EmitAttributes): New public method; emit our
1220         `OptAttributes' here.
1221         (GenericMethod.EmitAttributes): New public method; emit the custom
1222         attributes on all our type parameters.
1223
1224         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1225         our type parameters.
1226         (MethodData.Define): If we're a generic method, call
1227         EmitAttributes() on it.
1228
1229 2005-12-07  Martin Baulig  <martin@ximian.com>
1230
1231         * generic.cs
1232         (ConstraintChecker): New public abstract class; move the
1233         constraint checking here from `ConstructedType' and also do
1234         constraint checking for generic methods here.
1235
1236         * expression.cs (Invocation.OverloadResolve): Use
1237         ConstraintChecker.CheckConstraints() if we resolved to a generic
1238         method.  Fix #76806.
1239
1240 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1241
1242         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1243
1244         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1245         event initializers.
1246         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1247         (FieldBase.Initializer): Initializer is now optional.
1248         (EventField.Define): Only event field can have initializer.
1249
1250         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1251
1252         * const.cs (Const): Reuse initializer.
1253
1254         * cs-parser.jay: Updated after FieldBase changes.
1255         Added current_array_type to simplify array initializers.
1256
1257         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1258
1259         * expression.cs, iterators.cs: Updated.
1260
1261         * namespace.cs (NamespaceEntry): Made UsingFound private.
1262
1263 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1264
1265         * parameterCollection.cs: Obsolete, removed.
1266         * parser.cs: Obsolete, removed.
1267
1268 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1269
1270         Fix #76849.
1271         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1272
1273         * enum.cs (Enum.Define): Set obsolete context here.
1274
1275 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1276
1277         * doc.cs :
1278           - FindDocumentedMember() now expects 1) paramList as null
1279             when "we don't have to check the number of parameters" and
1280             2) Type.EmptyTypes when "there is no arguments".
1281           - Introduced FoundMember struct to hold the exact type which was
1282             used to find the documented member (the above change broke
1283             test-xml-044; it might be better just to use DeclaringType than
1284             what MS does, like this change does, but it depends on usage.)
1285
1286 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1287
1288         * doc.cs : documented member might be from DeclaringType for nested
1289           types. Fixed bug #76782.
1290
1291 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1292
1293         * anonymous.cs: Have the param code handle leaving copies on the
1294         stack etc. Allows anonymous params to take part in the assignment
1295         code (++, +=, etc). Fixes bug #76550
1296
1297         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1298         it down to the anon code.
1299
1300         * iterators.cs: Use dummy var here
1301
1302         * codegen.cs: Handle new vars
1303
1304 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1305
1306         Fix #76849.
1307         * class.cs (MethodData.Define): Set proper Obsolete context.
1308
1309         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1310         obsolete context.
1311         (FieldExpr.DoResolve): Ditto.
1312
1313 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1314
1315         Fix #76849.
1316         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1317         parent is not obsolete.
1318
1319 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1320
1321         * doc.cs : (FindDocumentedMember) find parameterless members first
1322           and get CS0419 in the early stage. Fixed first case of bug #76727.
1323
1324 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1325
1326         Fix #76859.
1327         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1328         no error was reported.
1329
1330         *expression.cs (Binary.DoResolve): left can be null.
1331
1332 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1333
1334         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1335         abstract method and all overrides.
1336         * support.cs (ParameterData.GenericConstraints): Delete.
1337         (ReflectionParameters.type_params): Delete.
1338         (ReflectionParameters.ReflectionParameters): Make private.
1339         (ReflectionParameters.GetConstaints): New factory method.
1340         * generic.cs (TypeParameterDefineType): Use it.
1341         (TypeManager.GetTypeParameterConstraints): Likewise.
1342
1343 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1344
1345         Fix #76783.
1346         * class.cs (MethodData.Emit): Parameters should be labeled first.
1347
1348 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1349
1350         Fix #76761.
1351         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1352
1353 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1354
1355         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1356
1357         * class.cs (MethodCore): Parameter clean up.
1358         (IMethodData): Added ParameterInfo.
1359         (MethodData): Parameter clean up.
1360         (Indexer.Define): Parameter clean up.
1361
1362         * anonymous.cs,
1363         * codegen.cs,
1364         * cs-parser.jay,
1365         * decl.cs,
1366         * doc.cs,
1367         * ecore.cs,
1368         * flowanalysis.cs,
1369         * iterators.cs,
1370         * pending.cs,
1371         * statement.cs,
1372         * typemanager.cs: Parameter clean up.
1373
1374         * delegate.cs (Define): Get rid of duplicated code.
1375
1376         * expression.cs (ParameterReference): Removed useless parameters
1377         and simplified.
1378         (Invocation): Ditto.
1379
1380         * parameter.cs (ParamsParameter): New class, params specialization.
1381         (ArglistParameter): Attemp to separate arglist.
1382         (Parameter): Refactored to be reusable and faster.
1383         (Parameter.Modifier): Made understandable.
1384         (Parameters): Changed to be used as a class for `this' assembly
1385         parameters. Refactored to use new specialized classes.
1386
1387         * support.cs (ParameterData): Added Types property.
1388         (InternalParameters): Deleted.
1389
1390 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1391
1392         * doc.cs : the previous patch does not actually fix the bug.
1393           PropertyInfo override check is now implemented and really fixed it.
1394         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1395
1396 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1397
1398         * doc.cs : apply "override filter" also to properties.
1399           Fixed bug #76730.
1400
1401 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1402
1403         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1404           no need to check overrides. For classes, omit those results from 
1405           interfaces since they must exist in the class. Fixed bug #76726.
1406
1407 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1408
1409         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1410           with different parameters. Fixed the second problem in #76685.
1411
1412 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1413
1414         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1415           get expected 'protected' access in CheckValidFamilyAccess()).
1416           Fixed bug #76692.
1417
1418 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1419
1420         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1421           Fixed bug #76705.  CS1569 was incorrectly commented out.
1422
1423 2005-11-23  Martin Baulig  <martin@ximian.com>
1424
1425         * generic.cs (Constraints.Define): Removed.
1426         (TypeParameter.DefineConstraints): Removed.
1427         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1428         on the GenericTypeParameterBuilder here.
1429
1430 2005-11-23  Martin Baulig  <martin@ximian.com>
1431
1432         * typemanager.cs (TypeManager.GetProperty): Make this public.
1433
1434         * generic.cs (Nullable.NullableInfo.ctor): Use
1435         TypeManager.GetProperty() rather than using reflection directly.
1436
1437 2005-11-17  Martin Baulig  <martin@ximian.com>
1438
1439         * expression.cs (Indexers.GetIndexersForType): Added support for
1440         generic parameters; fixes #76587.
1441
1442 2005-11-17  Martin Baulig  <martin@ximian.com>
1443
1444         * anonymous.cs
1445         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1446         inherit the scope from our parent.  Fixes #76653.
1447
1448 2005-11-15  Martin Baulig  <martin@ximian.com>
1449
1450         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1451         instead of `ScopeTypeBuilder' to refer to the "current" type.
1452         (AnonymousMethod.CreateScopeType): Correctly create the helper
1453         class if we're inside a generic type definition.
1454
1455 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1456
1457         * doc.cs : use Invocation.IsOverride() to do real override check.
1458         * expression.cs : made Invocation.IsOverride() internal.
1459
1460 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1461
1462         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1463           TypeBuilder.FindMembers() and filter overriden base members out.
1464           Fixed bug #76990.
1465
1466 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1467
1468         * doc.cs : ref/out parameters are represented as '@' (instead of
1469           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1470
1471 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1472
1473         * doc.cs : when there was no '.' in cref to methods in doc comment,
1474           then parameters were missing in the output. Fixed bug #76691.
1475
1476 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1477
1478         * driver.cs : don't output docs when there is an error.
1479           Fixed bug #76693.
1480
1481 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1482
1483         * doc.cs :
1484           Now it should detect indexers. Fixed primary concern in bug #76685.
1485           Fixed CS0419 message to not show the identical member signature in
1486           the message.
1487
1488 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1489
1490         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1491           instead of Type.FindMembers() since it does not handle events.
1492           Fixed bug #71604.
1493
1494 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1495
1496         * codegen.cs: Fixed typo (speficied -> specified).
1497
1498 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1499
1500         Fix #76369.
1501         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1502
1503 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1504
1505         * attribute.cs: Changed error message.
1506
1507         * cs-tokenizer.cs: One more check.
1508
1509 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1510
1511         * statement.cs (Block.Resolve): Ignore empty statement.
1512
1513 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1514
1515         * report.cs: Made error/warning methods more strict to avoid
1516         their misuse.
1517
1518         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1519         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1520         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1521         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1522
1523 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1524
1525         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1526         Use the more explicit AssemblyName.FullName instead of 
1527         AssemblyName.Name to report errors.
1528         
1529 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1530
1531         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1532         with mcs.
1533
1534 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1535
1536         * class.cs,
1537         * convert.cs,
1538         * cs-parser.jay,
1539         * decl.cs,
1540         * enum.cs,
1541         * expression.cs,
1542         * generic.cs,
1543         * pending.cs,
1544         * report.cs: Fixed error reporting and typos.
1545
1546         * generic.cs (TypeParameter.GetSignatureForError): New method.
1547         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1548
1549         * typemanager.cs (GetFullName): Refactored.
1550
1551 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1552
1553         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1554         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1555
1556         * class.cs (TypeContainer.IsComImport): New property.
1557         (Constructor.Define): Create proper ctor for ComImport types.
1558
1559         * expression.cs (New.CheckComImport): Fixed.
1560
1561 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1562
1563         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1564         that a parameter has been captured does not mean that we do not
1565         have to do the rest of the processing.  This fixes the second part
1566         of #76592.  If there was another anonymous method capturing
1567         values in the past, the Scope would never be set for the second
1568         method that captured the same parameter.
1569
1570         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1571         properly manipulate the stack.   Second part of fix for #76592.
1572
1573         * expression.cs (New): Add support for invoking "new" on
1574         interfaces that have been flagged with the ComImport attribute and
1575         the CoClass.  Fixes #76637 
1576
1577         * statement.cs (Try.DoEmit): When a variable is captured, do not
1578         try to emit the vi.LocalBuilder variable as it has been captured.
1579         Create a temporary variable and store the results on the
1580         FieldBuilder.  Fixes #76642
1581
1582 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1583
1584         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1585
1586         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1587
1588         * expression.cs (Binary.DoResolve): Added && optimalization.
1589     
1590         * typemanager.cs (AddUserType): Removed useless argument.
1591
1592 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1593
1594         * statement.cs (Block.variables): Uses ListDictionary.
1595
1596 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1597
1598         Fix #75969.
1599         * class.cs (PartialContainer.EmitType): Customized to emit
1600         security attributes.
1601         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1602         for partial classes.
1603
1604 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1605
1606         Fix #76599.
1607         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1608         access has to be fixed.
1609         
1610         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1611
1612 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1613
1614         Fix #76590.
1615         * ecore.cs (NullCast.Reduce): Implemented.
1616
1617         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1618         constant type.
1619         
1620         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1621         properly.
1622         (Foreach.Resolve): Catch null properly.
1623
1624 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1625  
1626         * cs-tokenizer.cs: Warning text fix.
1627
1628         * driver.cs: AllWarningNumbers exposed on public interface.
1629
1630         * report.cs (): Reviewed warning numbers.
1631         (IsValidWarning): Use binary search.
1632
1633 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1634  
1635         * driver.cs: Implemeted resource visibility.
1636         (Resources): New class for code sharing between /res: and
1637         /linkres:
1638  
1639 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1640
1641         decl.cs (CurrentTypeParameters): Fixed to be public.
1642
1643 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1644
1645         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1646
1647 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1648
1649         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1650
1651 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1652
1653         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1654
1655 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1656
1657         Add friend assembly access support.
1658         * typemanager.cs: assembly_internals_vis_attrs
1659         cache for friend assembly access. 
1660         (TypeManager.IsFriendAssembly): New method for
1661         checking friend assembly access.
1662         (TypeManager.Error_FriendAccessNameNotMatching): New
1663         helper method.
1664         (TypeManager.CompareKeyTokens): Likewise.
1665         (TypeManager.Filter): Handle friend accessible
1666         members.
1667
1668         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1669         friend accessible types.
1670
1671         * ecore.cs (Expression.IsAccessorAccessible): Handle
1672         friend accessible properties.
1673
1674         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1675         accessible types.
1676         
1677 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1678
1679         Fix #76568.
1680         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1681         folding.
1682         
1683         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1684         contants only.
1685         
1686         * ecore.cs (NullCast): Child is contant only.
1687         
1688         * literal.cs (NullLiteral.Reduce): null can be converted to any
1689         reference type.
1690
1691 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1692
1693         * driver.cs: Use Encoding.Default as default code page instead
1694           of ISO-28591.
1695
1696 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1697
1698         Fix #76085.
1699         * expression.cs (Invocation.Error_InvalidArguments): Handle
1700         __arglist parameters.
1701         (Invocation.VerifyArgumentsCompat): Likewise.
1702         * support.cs (ReflectionParameters.GetSignatureForError): Print
1703         __arglist parameters.
1704         (InternalParamters.GetSignatureForError): Likewise.
1705         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1706
1707 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1708
1709         * attribute.cs (GetPropertyValue): Made public.
1710
1711         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1712         Resolve.
1713         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1714         attribute.
1715         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1716         is not defined.
1717         
1718         * driver.cs: Reflect method name change.
1719         
1720         * statement.cs (Try.Resolve): Warn when try has both general
1721         exception handlers.
1722         
1723         * typemanager.cs: runtime_compatibility_attr_type new predefined
1724         type.
1725
1726 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1727
1728         Fix #76419.
1729         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1730         treat it as an empty parameter list.
1731
1732 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1733
1734         Fix #76271.     
1735         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1736         ResolveAsTypeStep silent.
1737         * statement.cs (Block.AddConstant): Mark block as used.
1738         (Block.ResolveMeta): Avoid piling on error messages
1739         if a constant initializer resolution fails.
1740
1741 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1742
1743         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1744         Remove.
1745         (NamespaceEntry.VerifyAllUsing): New.
1746         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1747         behaviour.  Delegates actual resolution of alias to ...
1748         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1749         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1750         Update.
1751         * driver.cs (Driver.MainDriver): Update.
1752         
1753         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1754         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1755         property.
1756         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1757         Remove.
1758         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1759         RootNamespace.DefineNamespacesForAll.
1760
1761 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1762
1763         * typemanager.cs (assemblies, external_aliases, modules)
1764         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1765         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1766         overhead.  Move resposibility ...
1767         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1768         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1769
1770 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1771
1772         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1773         cached_namespaces.  Improve usage.
1774         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1775         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1776         Move from GlobalRootNamespace and simplify.
1777         (RootNamespace.Global): Make instance variable.
1778         (RootNamespace.RootNamespace): Add "alias name" parameter.
1779         (GlobalRootNamespace): Simplify drastically.
1780         (Namespace.Lookup): Don't use GetNamespace.
1781         * typemanager.cs (GetRootNamespace): Rename from
1782         ComputeNamespaceForAlias.
1783         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1784
1785 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1786
1787         * anonymous.cs (AnonymousContainer): Don't crash when container
1788         doesn't exist.
1789
1790 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1791
1792         * expression.cs (Binary.DoResolve): Warn when comparing same
1793         values.
1794
1795 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1796
1797         Fix #76486.
1798         * expression.cs (Binary.DoResolve): It looks like there are no
1799         convetsion rules in enum context.
1800
1801 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1802
1803         Add support for extern alias qualifiers.
1804         * typemanager.cs: Move some LookupTypeReflection code
1805         to namespace.cs, to have cleaner code. Added some methods
1806         to help us keep track of the extern aliased references.
1807         * driver.cs: Add suport for extern alias assemblies on command
1808         line and check for their warnings/errors. Also keep track of the
1809         extern aliased assemblies.
1810         * namespace.cs: Move the global functionality of Namespace
1811         to GlobalRootNamespace/RootNamespace. Now the global namespace
1812         is GlobalRootNamespace.Globa. Also the code moved from 
1813         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1814         Finally added LocalAliasEntry (AliasEntry before) and
1815         ExternAliasEntry, to handle alias statements.
1816         * cs-parser.jay: Add support in the grammar for extern alias
1817         statement.
1818         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1819         Update callings to Namespace (now in GlobalRootNamespace).
1820
1821 2005-10-25  Martin Baulig  <martin@ximian.com>
1822
1823         * convert.cs (ImplicitTypeParameterConversion): Make base
1824         interfaces actually work; fixes #76557.
1825
1826 2005-10-25  Martin Baulig  <martin@ximian.com>
1827
1828         * generic.cs
1829         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1830         all the type parameters; fixes #76551.
1831
1832 2005-10-25  Martin Baulig  <martin@ximian.com>
1833
1834         Fix #76472.
1835
1836         * generic.cs
1837         (GenericMethod.ctor): Added `Expression return_type' and
1838         `Parameters parameters' arguments.
1839         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1840         parameter and return types to check their constraints if they're
1841         generic types.
1842
1843         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1844         boolean field.
1845
1846         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1847         constraints of a generic type if `ec.ResolvingGenericMethod'.
1848
1849         * class.cs (MethodCore.DoDefineParameters): Set
1850         `ec.ResolvingGenericMethod' if we're a generic method.
1851         (MemberBase.MemberType): Likewise.
1852
1853 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1854
1855         * typemanager.cs (TypeManager): Added 
1856         TypeManager.internals_visible_attr_type to cache
1857         S.R.CompilerServices.InternalsVisibleToAttribute.
1858
1859         * codegen.cs (AssemblyClass): Added checks for 
1860         InternalsVisibleToAttribute in new method 
1861         CheckInternalsVisibleAttribute () and also cache the
1862         AssemblyName in AssemblyClass.Name.
1863         
1864 2005-10-24  Martin Baulig  <martin@ximian.com>
1865
1866         * typemanager.cs
1867         (TypeManager.ExpandInterfaces): Added overloaded version which
1868         just takes a `Type[]' array.
1869
1870         * generic.cs
1871         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1872         just use the interfaces which were explicitly specified and not
1873         the interfaces they inherit.  Fixes #76482.
1874         (TypeParameter.FindMembers): Expand the interfaces here.
1875
1876 2005-10-21  Martin Baulig  <martin@ximian.com>
1877
1878         * generic.cs
1879         (Constraints.Resolve): Also resolve the actual types here.
1880         (Constraints.ResolveTypes): Just check the constraints here.
1881         Fixes #76363; see gtest-218.cs.
1882
1883 2005-10-21  Martin Baulig  <martin@ximian.com>
1884
1885         * convert.cs
1886         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1887         instead of a `BoxedCast'; fixes gtest-217.cs.
1888
1889 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1890
1891         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1892           1) "new()" is specified as generic parameter constraint and 2) the
1893           type is TypeBuilder and 3) the type is abstract even if it has a
1894           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1895
1896 2005-10-20  Martin Baulig  <martin@ximian.com>
1897
1898         * generic.cs
1899         (GenericConstraints.TypeParameter): New public property.
1900         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1901         (TypeParameter.DeclSpace): New public property.
1902         (TypeParameter.DefineType): Inflate the constraints if our
1903         `DeclSpace' is an `Iterator'.   
1904
1905 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1906
1907         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1908           GenericMethod argument to compare methods' generic type arguments.
1909           Fixed bug #76382.
1910
1911 2005-10-19  Martin Baulig  <martin@ximian.com>
1912
1913         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1914         not ResolveType() when resolving the base type, so we're not
1915         checking the constraints here.
1916         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1917         if we have any.
1918
1919 2005-10-19  Martin Baulig  <martin@ximian.com>
1920
1921         * generic.cs (ConstructedType.CheckConstraints): Committing
1922         untested fix for #76441.
1923
1924 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1925
1926         Fix #76371.
1927         * class.cs (TypeContainer.DefineType): Move updating of
1928         topological sort earlier in the code.
1929         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1930
1931 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1932
1933         Fix #76273.
1934         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1935         
1936         * constant.cs (Constant.TryReduce): Moved from Cast class.
1937         (Reduce): Made little bit more OO and fixed missing conversions.
1938         
1939         * ecore.cs (Reduce): Implemented.
1940         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1941         
1942         * literal.cs (Reduce): Implemented.
1943         
1944         * class.cs: Reverted Miguel's wrong commit.
1945
1946 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1947
1948         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1949
1950 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1951
1952         * cs-parser.jay, expression.cs : CS0214 was missing error location
1953           for constants. Fixed bug #76404.
1954
1955 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1956
1957         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1958         InstanceExpression.
1959         (PropertyExpr.EmitCall): Likewise.
1960         * expression.cs (Invocation.EmitArguments): Handle case where
1961         arguments == null.
1962         (Invocation.EmitCall): Avoid allocating temporary variable if
1963         there are no arguments.
1964
1965 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1966
1967         Fix #76370.
1968         * convert.cs (ExplicitConversionCore): Fixed object->enum
1969         conversion.
1970
1971 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1972
1973         Fix #76323.
1974         * convert.cs (ImplicitConversionStandard): Move conversion of
1975         void* to arbitrary pointer types ...
1976         (ExplicitConversionStandard): .. here.
1977         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1978         error to always print typenames.
1979
1980 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1981
1982         * convert.cs (GetConversionOperator): Rename from
1983         GetConversionOperators.  Move operator selection code from ...
1984         (UserDefinedConversion): ... here.
1985
1986 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1987
1988         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1989         conversion.
1990
1991 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1992
1993         * assign.cs (Assign.DoResolve): Error method changed.
1994
1995         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1996         
1997         * const.cs (ResolveValue): Reset in_transit immediately.
1998         
1999         * constant.cs: Error method changed.
2000         
2001         * convert.cs: Removed useless location parameter.
2002         (ExplicitNumericConversion): Don't do double enum check.
2003         (ExplicitConversionCore): Renamed from ExplicitConversion.
2004         (ExplicitUnsafe): Extracted from ExplicitConversion.
2005         (ExplicitConversion): Uses for error reporting.
2006         
2007         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2008         error messages.
2009         (ResolveBoolean): Uses common error method.
2010         (CastToDecimal): Get rid of ec.
2011         (CastFromDecimal): Optimized.
2012         (ConvCast): Get rid of ec.
2013         
2014         * enum.cs (ResolveValue): Reset in_transit immediately.
2015         (Emit): Return after first error.
2016         
2017         * expression.cs: Convert changes.
2018         
2019         * literal.cs: Error method changed.
2020         
2021         * statement.cs: Error method changed.
2022
2023 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2024
2025         Fix gtest-131.cs and gtest-211.cs.
2026         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2027         Only emit code for a label if it is used.  Unreachable code can
2028         violate ECMA evaluation stack invariants.
2029
2030 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2031
2032         * anonymous.cs: Implemented ExprClassName.
2033         
2034         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2035         delegate.
2036         
2037         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2038         check.
2039         
2040         * class.cs (StaticClass.DefineContainerMembers): Report protected
2041         members as error.
2042         
2043         * codegen.cs: if(ed) PRODUCTION.
2044         
2045         * convert.cs (Error_CannotImplicitConversion): Better error
2046         distinction.
2047         
2048         * cs-parser.jay: More error checks.
2049         
2050         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2051         
2052         * driver.cs (CSCParseOption): Enabled wrong option check.
2053         
2054         * ecore.cs (Expression.ExprClassName): Turned to property.
2055         (MemberExpr.CheckIntermediateModification): For checking boxed
2056         value types     modification.
2057         
2058         * statement.cs (Fixed.Resolve): Expression type must be
2059         convertible to fixed type.
2060         (CollectionForeach.GetEnumeratorFilter,TryType):
2061         Small refactoring for easier error checking.
2062
2063 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2064
2065         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2066         attributes.
2067         
2068         * class.cs (GeneratedBaseInitializer): New class for customization
2069         compiler generated initializers.
2070         (MemberBase.DoDefine): Check Obsolete attribute here.
2071         (FieldMember.DoDefine): Ditto.
2072         
2073         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2074         constants.
2075         
2076         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2077         (MemberCore.GetObsoleteAttribute): Removed argument.
2078         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2079         (MemberCore.CheckObsoleteType): New helper.
2080         
2081         * delegate.cs,
2082         * enum.cs,
2083         * statement.cs: Updates after MemberCore changes.
2084         
2085         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2086         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2087         
2088         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2089         obsolete attribute for compiler construct.
2090         (As.DoResolve): Cache result.
2091         
2092         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2093
2094 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2095
2096         * expression.cs (Probe): instead of having a "Type probe_type"
2097         keep the extra information as a TypeExpr probe_type_expr since the
2098         "As" operator needs to perform some type checks.
2099
2100         * (As.DoResolve): If the type is a type parameter, ensure that it
2101         is constrained by a class.
2102
2103 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2104
2105         * statement.cs (Lock): Use the TemporaryVariable class instead of
2106         manually using local variables as those do not work when variables
2107         are captured.
2108
2109         * ecore.cs: Moved the TemporaryVariable class from being a nested
2110         class inside Foreach to be a public class that can be employed in
2111         other places. 
2112
2113 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2114
2115         * cs-parser.jay: interface_accessors replaced by
2116         accessor_declarations.
2117
2118         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2119         location.
2120         
2121         * statement.cs (GotoCase.Resolve): Convert null constant to
2122         null case.
2123         (SwitchLabel.ResolveAndReduce): Ditto.
2124         (SwitchLabel.NullStringCase): Custom null stamp.
2125         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2126         
2127         typemanager.cs (CSharpSignature): Don't skip first argument
2128         for full names.
2129
2130 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2131
2132         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2133         expression.cs, iterators.cs, literal.cs: Store constants and
2134         literals location.
2135         
2136         * class.cs (MemberBase.ShortName): Pass location.
2137         
2138         * cs-parser.jay: Some location fixes.
2139         
2140         * ecore.cs (Expression.Location): Made virtual.
2141
2142 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2143
2144         Fix #72930.
2145         * const.cs (Const.ResolveValue): Check for assigning non-null
2146         value to reference type.
2147
2148 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2149
2150         Fix #76133.
2151         * expression.cs (This.VerifyFixed): In a value type T, the type of
2152         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2153         value type R, 'this' is treated as a value parameter.
2154
2155 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2156
2157         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2158         if the underlying types are the same, otherwise we need to produce
2159         code that will do the proper cast.
2160
2161         This was exposed by Marek's constant rewrite which produced
2162         invalid code for the call site:
2163
2164         enum X : long { a }
2165         void Method (X v) {}
2166
2167         Method ((X) 5)
2168
2169         This fixes test-49.cs
2170
2171 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2172
2173         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2174           Type/Object should be allowed as well. Fixed bug #75968.
2175
2176 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2177
2178         * expression.cs : (Binary.DoResolve): when one is enum constant and
2179           another is constant 0, then return enum one *as enum type*.
2180           Fixed bug 74846.
2181
2182 2005-10-04  Martin Baulig  <martin@ximian.com>
2183
2184         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2185         `SetMemberIsUsed()' work for generics, too.
2186
2187 2005-10-04  Martin Baulig  <martin@ximian.com>
2188
2189         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2190         for corlib.  Fixes #75691.
2191
2192 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2193
2194         Fix #76255.
2195         * driver.cs: Fix compilation files with full root path.
2196
2197 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2198
2199         * report.cs (SymbolRelatedToPreviousError): Format the output so
2200         it does not use an open parenthesis that is never closed. 
2201
2202         * driver.cs: Follow coding guidelines
2203
2204 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2205
2206         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2207
2208         * location.cs (InEmacs): in this mode, do not report column
2209         location as it confuses Emacs.
2210
2211 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2212
2213         * support.cs (SeekableStreamReader.Position): Don't error out when
2214         the requested position is just beyond the end of the current
2215         buffered data.
2216
2217 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2218
2219         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2220         try to keep in sync with the byte count of the underlying Stream.
2221         However, this limits us to a window size of 2048 characters: i.e.,
2222         the maximum lookahead of our lexer/parser can be 2048 characters.
2223
2224 2005-09-22  Martin Baulig  <martin@ximian.com>
2225
2226         * driver.cs: Removed a debugging FIXME.
2227
2228 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2229
2230         * cs-parser.jay (type_arguments): Add CS1644 check.
2231         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2232
2233 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2234
2235         * Makefile (PROGRAM): Make profile specific.
2236         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2237         the current directory.
2238
2239         Fix test-455.cs.
2240         * expression.cs (Invocation.EmitCall): Remove optimization on
2241         this_call since it doesn't handle 'this' being a value type.
2242
2243 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2244
2245         * driver.cs: Ensure file handles are closed after parsing
2246
2247 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2248
2249         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2250         if the underlying types are the same, otherwise we need to produce
2251         code that will do the proper cast.
2252
2253         This was exposed by Marek's constant rewrite which produced
2254         invalid code for the call site:
2255
2256         enum X : long { a }
2257         void Method (X v) {}
2258
2259         Method ((X) 5)
2260
2261         This fixes test-49.cs
2262
2263 2005-09-05  Martin Baulig  <martin@ximian.com>
2264
2265         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2266         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2267
2268         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2269
2270 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2271
2272         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2273           to be a pointer type due to the spec 25.2, so check if declaring
2274           type is generic type definition. Fixed bug #75772.
2275
2276 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2277
2278         Fixed bug #75957.
2279         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2280           both types are not defined by methods.
2281         * expression.cs : (Invocation.IsApplicable): it should work when
2282           the argument type is equal to the parameter type, not only when
2283           ImplicitConversionExists() returns true.
2284
2285 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2286
2287         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2288         internal.
2289
2290         Fix #75941.
2291         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2292         flow-branching for LocalVariableReferences in case we were invoked
2293         from a MemberAccess.
2294         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2295         Carved out of ...
2296         (LocalVariableReference.DoResolveBase): ... this.
2297         (MemberAccess.Resolve): Do the check that was disabled during
2298         SimpleNameResolve.
2299
2300 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2301
2302         * class.cs :
2303           (PartialContainer.Create): check abstract/sealed/static strictly
2304           but abstract/sealed can exist only at one side. Fixed bug #75883.
2305
2306 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2307
2308         Fix #75945.
2309         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2310         specified, don't default to UnmanagedType.I4.
2311
2312 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2313
2314         * expression.cs : conditional operator should check possibly
2315           incorrect assign expression. Fixed bug #75946.
2316
2317 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2318
2319         Fix #75934.
2320         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2321         (ScopeInfo.EmitScopeType): Use it to construct field names from
2322         names of captured locals.
2323
2324         Fix #75929.
2325         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2326         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2327         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2328         (ExplicitConversion): Remove enum cases already handled by
2329         implicit conversion.  Move implicit conversion check to the beginning.
2330         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2331         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2332         Don't treat System.Enum as a struct.
2333
2334 2005-08-30  Jb Evain  <jbevain@gmail.com>
2335
2336         * attribute.cs: handles as expression in parameters.
2337
2338 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2339
2340         Fix #75802.
2341         * class.cs (TypeContainer.VerifyClsName): Don't use a
2342         PartialContainer when verifying CLS compliance.
2343         (AbstractPropertyEventMethod): Set Parent here, ...
2344         (PropertyMethod): ... not here.
2345
2346 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2347
2348         * attribute.cs : escaped attribute name should not be allowed to be
2349           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2350
2351 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2352
2353         Fix #75927.
2354         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2355         when converting a long constant to unsigned long.
2356         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2357         detect where IsApplicable and VerifyArgumentsCompat disagree.
2358
2359 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2360         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2361
2362         Fix #75848.
2363         * class.cs (TypeContainer.CanElideInitializer): New helper.
2364         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2365         can safely emitting the initializer of a field.
2366
2367 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2368
2369         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2370           allowed inside a switch (without loop). Fixed bug #75433.
2371
2372 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2373
2374         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2375         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2376
2377 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2378
2379         * driver.cs : kinda reverting the default encoding changes (not exact 
2380           revert since I noticed that "codepage:reset" might not work fine).
2381
2382 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2383
2384         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2385           Location. Now getter and setter store location correctly.
2386           (errors/cs0111-12.cs now reports the expected location.)
2387
2388 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2389
2390         * driver.cs : Use default encoding on the environment.
2391           Removed (now that) extra parameter for SeekableStreamReader.
2392         * support.cs : (SeekableStreamReader) third .ctor() argument for
2393           StreamReader is not required (always true). preamble size could
2394           be acquired in simpler and safe way.
2395
2396 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2397
2398         * cs-parser.jay: report CS0642 at warning level 3
2399           and report CS0642 for an if else statement also
2400           fixes bug #74745. Patch by John Luke (and a bit
2401           modified by me).
2402           Removed extra CS0642 warning check for "while",
2403           "for" and "fixed".
2404         * statement.cs: In Block.Resolve(), CS0642 check
2405           is reimplemented to check a sequence of an empty
2406           statement and a block.
2407
2408           Both fix bug #66777.
2409
2410 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2411
2412         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2413         detection until I fix it.
2414         
2415         * cs-tokenizer.cs: Changed error message.
2416         
2417         * cs-parser.jay: Fixed 2 error locations.
2418         
2419         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2420         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2421         properties.
2422         
2423         * enum.cs (GetSignatureForError): Fixed.
2424         
2425         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2426         method detection.
2427         
2428         * class.cs,
2429         * typemanager.cs (RegisterProperty): Removed.
2430         
2431         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2432
2433 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2434
2435         Fix #75874.
2436         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2437         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2438
2439 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2440
2441         * expression.cs : tiny fix is required for not warning positive ulong.
2442           See test-441.cs.
2443
2444 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2445
2446         * expression.cs : add CS0652 check for constant and integral
2447           expression. Fixed bug #53974.
2448
2449 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2450
2451         * expression.cs : in DoNumericPromotions(), check if there is implicit
2452           conversion overload for string (to check CS0034). Fixed bug #52492.
2453
2454 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2455
2456         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2457
2458 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2459
2460         * ecore.cs : report location when it is *not* Null.
2461
2462 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2463
2464         * codegen.cs,
2465           ecore.cs,
2466           flowanalysis.cs,
2467           expression.cs:
2468           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2469           correctly. Fixed bug #75721.
2470
2471 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2472
2473         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2474         loop that performs 'min (pos, char_count)'.
2475
2476         Fix #75862.
2477         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2478         converted value in Operator.OnesComplement.
2479
2480 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2481
2482         * anonymous.cs: If the anon method is pulled into a helper class,
2483         it needs to be `internal' not `private'. Fixes runtime behavior on
2484         msft. bug #75704
2485
2486 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2487
2488         Fix #75803
2489         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2490         is a partial class.
2491
2492 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2493
2494         The big constants rewrite
2495         Fix #75746, #75685 and more
2496         As a side effect saved 1MB for MWF ;-)
2497         
2498         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2499         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2500         enum based for corlib compilation.
2501         
2502         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2503         subtractions.
2504         
2505         * class.cs (FixedField.Define): Use ResolveAsConstant.
2506         
2507         * const.cs (IConstant): Interface constants and enums.
2508         (Const.ResolveValue): New method for constant resolvning.
2509         (ExternalConstant): Constants from imported assemblies.
2510         
2511         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2512         conversion; like enums.
2513         (Constant.ToType): Converts this constant to different type.
2514         (Constant.Increment): Adds 1.
2515         
2516         * convert.cs (ImplicitConversionRequired): Simplified.
2517         
2518         * cs-parser.jay: Create EnumMember directly.
2519         
2520         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2521         
2522         * doc.cs (GenerateEnumDocComment): Removed.
2523         
2524         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2525         (ConvertIntLiteral): Removed.
2526         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2527         
2528         * enum.cs (EnumMember): Implement IConstant.
2529         (Enum.IsValidEnumConstant): Removed.
2530         (Enum.GetNextDefaultValue): Removed.
2531         (Enum.FindMembers): Updated.
2532         (Enum.GenerateDocComment): Iterate enum members.
2533         
2534         * expression.cs (Cast.TryReduce): Handle enums correctly.
2535         (New.Constantify): Made public.
2536         (MemberAccess.DoResolve): Removed contant specific if(s).
2537         
2538         * literal.cs (NullLiteral): Implement new abstract methods.
2539         
2540         * statement.cs (GotoCase.Resolve): Use new constant methods.
2541         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2542         
2543         * typemanager.cs (LookupEnum): Removed.
2544         (IsEnumType): Fixed to work with corlib.
2545         (RegisterConstant): Removed.
2546         (LookupConstant): Removed.
2547         (GetConstant): Changed to work with IConstant.
2548
2549 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2550
2551         * location.cs : Fixed overflown (>255) column number.
2552
2553 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2554
2555         First cut of the qualified-alias-member feature.
2556         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2557         token.
2558         * cs-parser.jay (DOUBLE_COLON): New token.
2559         (namespace_or_type_name): Add rule for recognizing
2560         qualified-alias-members.
2561         (primary_expression): Likewise.
2562         (element_access): Allow QualifiedAliasMember as a possible
2563         type-bearing expression.
2564         (local_variable_type, local_variable_pointer_type): Likewise.
2565         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2566         aliases in the current and enclosing namespace declarations.
2567         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2568         * decl.cs (MemberName.is_double_colon): New.
2569         (MemberName.MemberName): Add new constructor for alias-member.
2570         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2571         * expression.cs (QualifiedAliasMember): New expression type.
2572
2573 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2574
2575         * location.cs : it borked when no argument was specified.
2576
2577 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2578
2579         * location.cs : tiny ToString() format fix.
2580
2581 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2582
2583         * statement.cs : oops, it was missing.
2584
2585 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2586
2587         A set of fixes for precise line/column location.
2588
2589         * location.cs :
2590           "token" field now holds a file/line "delta", a line number offset 
2591           from the segment, and a column number. See also:
2592           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2593           December/009508.html
2594           Removed static IsNull. Use instance IsNull property instead.
2595         * cs-tokenizer.cs :
2596           For some tokens it stores Location. For Identifier it stores
2597           LocatedToken which is a pair of string name and location.
2598           Column numbers are adjusted only at getChar().
2599         * report.cs :
2600           Use Location.ToString() for reporting (it now contains column).
2601         * cs-parser.jay :
2602           Largely modified to use LocatedToken instead of
2603           string (IDENTIFIER), and to acquire Location from some tokens.
2604         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2605           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2606           codegen.cs :
2607           Now MemberName holds Location. DeclSpace.ctor() receives Location
2608           as a parameter. Removed extra parameters to all derived classes.
2609           Replaced Location.IsNull() with instance property.
2610         * assign.cs, expression.cs :
2611           Added .ctor() overload that omits Location.
2612         * attribute.cs :
2613           Added "nameEscaped" flag that indicates the identifier was escaped
2614           in the source file. This fixes bug #57047.
2615
2616 2005-09-02  Martin Baulig  <martin@ximian.com>
2617
2618         * class.cs: Make CS3005 a warning, not an error.
2619
2620 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2621
2622         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2623         New method, looking for lo-case imported cls type.
2624
2625         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2626         here.
2627
2628         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2629
2630         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2631
2632         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2633         all_imported_types.
2634         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2635
2636         Optimized to save 3.5 MB for SWF compilation.
2637
2638 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2639
2640         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2641         (PartialContainer.Create): Moved logic AddToContainer.
2642         (PartialContainer.MarkForDuplicationCheck): Shares name.
2643         
2644         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2645         place.
2646         
2647         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2648         initialization.
2649         (Namespace.GetSignatureForError): New method.
2650         
2651         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2652         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2653
2654 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2655
2656         Fix #75669.
2657         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2658         member lookup rather than qualifier_type, since qualifier_type can
2659         be null.
2660
2661 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2662
2663         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2664         enum member.
2665
2666 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2667
2668         * statement.cs: Copy the local exception into the exception
2669         captured local.  Fixes 75674
2670
2671 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2672
2673         Fix #75658.
2674         * expression.cs (Invocation.OverloadResolve): Don't report error
2675         CS1501 if error CS1502 has been reported.
2676         (New.DoResolve): Delegate CS1501 reporting to
2677         Invocation.OverloadResolve.
2678
2679         Fix #75656.
2680         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2681         invariant-meaning-in-block property in an enclosing block if
2682         necessary.
2683
2684 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2685
2686         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2687         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2688         (Switch.CheckSwitch): Just save 50kb for SWF.
2689
2690 2005-07-27  Martin Baulig  <martin@ximian.com>
2691
2692         * anonymous.cs (CaptureContext.AddField): Added
2693         `AnonymousContainer am' argument; compute its toplevel scope if
2694         it's not already computed.  Fixes #75649.
2695
2696 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2697
2698         Fix #75628.
2699         * class.cs (Constructor.Emit): Reset block to null if the block
2700         resolve fails.
2701
2702 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2703
2704         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2705
2706 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2707
2708         * class.cs (MethodData.Define): Check whether accessor implementing
2709         interface is public.
2710
2711         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2712
2713 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2714
2715         Fix #57245
2716         * namespace.cs (LookupType): Moved same type check to...
2717         
2718         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2719         with the same name.
2720
2721 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2722
2723         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2724         already found a typebuilder.
2725         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2726         MemberNames, not strings.
2727
2728         * const.cs (Error_ExpressionMustBeConst): 
2729         Rename from Error_EpressionMustBeConst.
2730         * const.cs, class.cs, statement.cd: Update.
2731
2732 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2733
2734         Fix #65573
2735
2736         * const.cs (Const.LookupConstantValue): Report missing contant expression
2737         everytime.
2738         (Error_EpressionMustBeConstant): Only one error method.
2739
2740         * class.cs, statement.c: Updated.
2741
2742 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2743
2744         * statement.cs (Block.Flags): Add back HasVarargs.
2745         (Block.flags): Make protected.
2746         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2747
2748         * typemanager.cs (types, typecontainers, user_types): Remove.
2749         (UserTypes, TypeContainers): Likewise.
2750         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2751         (CleanUp, Reset): Update.
2752         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2753         (GetNestedType): Use Type.GetNestedType.
2754         (CoreLookupType): Take two arguments, the namespace and the
2755         basename of the type.  Update to use the Namespace.Lookup
2756         mechanism.
2757         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2758         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2759         string concatenation and substring matches.
2760         * class.cs, enum.cs, delegate.cs: Update to changes.
2761
2762 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2763
2764         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2765         Expression and made virtual.
2766
2767         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2768         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2769
2770         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2771
2772         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2773         error message.
2774
2775         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2776         change.
2777
2778 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2779
2780         Fix #57707
2781         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2782         AssemblyCultureAttribute is not used on executable.
2783
2784         * rootcontext.cs,
2785         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2786
2787 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2788
2789         Fix #60638.
2790         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2791         New.  Reports CS0252/CS0253.
2792         Mostly taken from preliminary patch by Duncak Mak.
2793         (Binary.DoResolveOperator): Store results of operator lookup.
2794         Use them to detect if we need to warn about unintended reference
2795         comparisons.
2796
2797 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2798
2799         Fix #72969.
2800         * namespace.cs (Namespace.Lookup): Add back location parameter.
2801         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2802         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2803
2804         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2805         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2806         (Namespace.LookupType): ... this.
2807         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2808         of namespaces.
2809         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2810         purported to handle pointers.
2811         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2812         CoreLookupType.
2813
2814 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2815
2816         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2817         type as namespace.
2818
2819 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2820
2821         * namespace.cs (Namespace.Lookup): Drop location parameter.
2822         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2823         (NamespaceEntry.Lookup): ... this.
2824         (NamespaceEntry.Error_AmbiguousTypeReference):
2825         Move here from DeclSpace.
2826         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2827         names ...
2828         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2829         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2830         Move to NamespaceEntry.
2831         * delegate.cs, expression.cs: Update to changes.
2832
2833 2005-08-31  Martin Baulig  <martin@ximian.com>
2834
2835         Committing a patch from Atsushi Enomoto for #75850.
2836
2837         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2838         Prefer a generic enumerator over a non-generic one.
2839
2840 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2841
2842         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2843         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2844
2845 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2846
2847         * driver.cs : reverting default encoding change as well as mcs.
2848
2849 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2850
2851         * driver.cs, support.cs : merged r48826.
2852           Marek Safer wrote:
2853           > could you integrate your mcs changes to gmcs otherwise
2854           > gmcs cannot compile some files.
2855
2856 2005-08-20  Martin Baulig  <martin@ximian.com>
2857
2858         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2859         scope if we don't already have it.
2860
2861         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2862         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2863         fixes #75867.
2864
2865 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2866
2867         * statement.cs: Copy the local exception into the exception
2868         captured local.  Fixes 75674
2869
2870 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2871
2872         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2873         type as namespace.
2874
2875 2005-08-12  Martin Baulig  <martin@ximian.com>
2876
2877         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2878         for nested types here to avoid hitting the cache too early.
2879
2880 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2881
2882         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2883         an error. 
2884
2885 2005-08-03  Martin Baulig  <martin@ximian.com>
2886
2887         Make iterators in generic methods work; see gtest-191.cs.
2888
2889         * generic.cs
2890         (Constraints.Resolve): Protect against being called twice.
2891
2892         * class.cs
2893         (TypeContainer.GetClassBases): Make this `protected virtual'.
2894
2895         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2896         (Iterator.GetClassBases): Override this and compute the base
2897         classes here.
2898         (Iterator.DefineNestedTypes): If we're a generic method, all our
2899         method type parameters become class type parameters on the proxy
2900         class.
2901
2902         * statement.cs
2903         (ToplevelBlock.Parameters): Make this a property, not a field.
2904         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2905
2906 2005-08-03  Martin Baulig  <martin@ximian.com>
2907
2908         * typemanager.cs (TypeManager.IsSubclassOf): Use
2909         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2910         (TypeManager.GetFullName_recursed): Improved.
2911
2912 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2913
2914         Fix #75417
2915         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2916         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2917         invocation_type == mi.DeclaringType, since the first one also checks
2918         other condition used by generic instances.
2919         
2920 2005-07-27  Martin Baulig  <martin@ximian.com>
2921
2922         * anonymous.cs (CaptureContext.AddField): Added
2923         `AnonymousContainer am' argument; compute its toplevel scope if
2924         it's not already computed.  Fixes #75649.
2925
2926 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2927
2928         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2929         CheckAttributeType and refactored.
2930         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2931         ResolveAsTypeTerminal error handling.
2932         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2933         handling.
2934         (GetSignatureForError): Print errors in same way.
2935
2936         * class.cs,
2937         * codegen.cs: Reflect attribute GetSignatureForError change.
2938
2939         * ecore.cs,
2940         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2941
2942         * namespace.cs (UsingEntry): Refactored to make fields private.
2943
2944         * assign.cs,
2945         statement.cs: Error_UnexpectedKind has extra parameter.
2946
2947 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2948
2949         * ecore.cs (IAlias): Remove.
2950         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2951         that implement the interface.
2952         * namespace.cs (Namespace): Likewise.
2953         (Namespace.declspaces): Renamed from 'defined_names'.
2954         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2955         DeclSpace instead of an IAlias.
2956         * tree.cs (Tree.AddDecl): Update.
2957
2958 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2959
2960         * statement.cs (Block.Flags); Remove HasVarargs.
2961         (Block.HasVarargs): Move to ToplevelBlock.
2962         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2963         (Block.Variables): Make protected.  Initialize variable hashtable
2964         if necessary.
2965         (Block.AddVariable): Update.
2966         (Block.Resolve): Update to changes.
2967         (ToplevelBlock.HasVarargs): New boolean.
2968         (ToplevelBlock.ThisVariable): Move here from Block.
2969         (ToplevelBlock.AddThisVariable): Likewise.
2970         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2971         * expression.cs (This.ResolveBase): Update to changes.
2972         (ArglistAccess.DoResolve): Likewise.
2973
2974 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2975
2976         Fix #75321
2977         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2978
2979         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2980         not used and not used & assigned.
2981         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2982
2983 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2984
2985         Fix #75053
2986         * expression.cs (Is.DoResolve): null is never provided type.
2987
2988 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2989
2990         Fix #52496
2991         * cs-parser.jay: Less strict event error rule to catch more errors.
2992
2993 2005-07-11  Martin Baulig  <martin@ximian.com>
2994
2995         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2996         for the constructor constraint: we do not only have to check
2997         whether the class has a public constructor, but also ensure that
2998         it's parameterless.  Fixes #75492.
2999
3000 2005-07-11  Martin Baulig  <martin@ximian.com>
3001
3002         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3003         between type parameters if they either have the reference type
3004         constraint or the class constraint.
3005
3006 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3007
3008         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3009
3010 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3011
3012         Fix #74975
3013         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3014         (ExtractSecurityPermissionSet): Cope with self referencing security
3015         attributes properly.
3016
3017         * driver.cs (SetOutputFile): Made public property OutputFile.
3018
3019 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3020
3021         Fix #75486.
3022         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3023         has_nonstatic_fields.  Make into a FieldBase pointer.
3024         (TypeContainer.AddField): Add CS0282 check.
3025         (TypeContainer.EmitType): Update.
3026
3027 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3028
3029         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3030         compare if they start with __.
3031
3032 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3033
3034         * statement.cs (Switch.SwitchGoverningType): Only look at
3035         UserCasts that don't need implicit standard conversions to one of
3036         the allowed switch types (Fixes test-322.cs).
3037         (LocalInfo.Resolve): Re-enable sanity-test.
3038
3039 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3040
3041         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3042         
3043         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3044         
3045         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3046
3047 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3048
3049         Fix #75472.
3050         * ecore.cs (SimpleName.GetSignatureForError): Add.
3051         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3052         (MemberAccess.GetSignatureForError): Add.
3053
3054 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3055  
3056         The big error and warning messages review.
3057         
3058         * anonymous.cs,
3059         * assign.cs,
3060         * attribute.cs,
3061         * class.cs,
3062         * codegen.cs,
3063         * convert.cs,
3064         * cs-parser.jay,
3065         * cs-tokenizer.cs,
3066         * decl.cs,
3067         * delegate.cs,
3068         * doc.cs,
3069         * driver.cs,
3070         * ecore.cs,
3071         * enum.cs,
3072         * expression.cs,
3073         * flowanalysis.cs,
3074         * iterators.cs,
3075         * literal.cs,
3076         * location.cs,
3077         * modifiers.cs,
3078         * namespace.cs,
3079         * parameter.cs,
3080         * pending.cs,
3081         * report.cs,
3082         * rootcontext.cs,
3083         * statement.cs,
3084         * support.cs,
3085         * tree.cs,
3086         * typemanager.cs: Updated.
3087         
3088         * class.cs: (MethodCore.SetYields): Moved here to share.
3089         (PropertyMethod.Define): Moved iterator setup here.
3090         
3091         * iterators.cs: Add orig_method to have full access to parent
3092         container.
3093
3094 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3095
3096         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3097         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3098         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3099         variable of struct type.
3100         * expression.cs (Unary.ResolveOperator): Update to change.
3101         (Indirection.VerifyFixed): Likewise.
3102         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3103         (ParameterReference.VerifyFixed): Value parameters are fixed.
3104         (This.VerifyFixed): Treat 'this' as a value parameter.
3105         * statement.cs (LocalInfo.IsFixed): Remove.
3106
3107 2005-07-01  Martin Baulig  <martin@ximian.com>
3108
3109         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3110         `ec.EmitThis ()' to get the correct scope.
3111
3112 2005-07-01  Martin Baulig  <martin@ximian.com>
3113
3114         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3115         instance is a ParameterReference; fixes #75299.
3116
3117 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3118
3119         Fix #75412.
3120         * expression.cs (Indexers.map): Remove.
3121         (Indexers.Append): Filter out inaccessible setters and getters.
3122         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3123
3124         Fix #75283.
3125         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3126         Refactored from ...
3127         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3128         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3129         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3130         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3131
3132 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3133
3134         Fix #75322
3135         * class.cs (FieldBase.GetInitializerExpression): One more field
3136         for backup.
3137
3138 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3139
3140         * pending.cs: Do not define a proxy if the base method is virtual,
3141         it will be picked up by the runtime (bug 75270).
3142
3143 2005-07-08  Martin Baulig  <martin@ximian.com>
3144
3145         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3146         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3147
3148 2005-07-07  Martin Baulig  <martin@ximian.com>
3149
3150         * generic.cs (ConstructedType.CheckConstraint): Use
3151         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3152         called recursively; fixes #75329.
3153
3154 2005-07-06  Martin Baulig  <martin@ximian.com>
3155
3156         * generic.cs (TypeManager.InferTypeArguments): Added support for
3157         anonymous methods; fixes #75461.
3158
3159 2005-07-01  Martin Baulig  <martin@ximian.com>
3160
3161         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3162         `ec.EmitThis ()' to get the correct scope.
3163
3164 2005-07-01  Martin Baulig  <martin@ximian.com>
3165
3166         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3167         instance is `This'; fixes #75299.
3168
3169 2005-06-30  Martin Baulig  <martin@ximian.com>
3170
3171         * class.cs (Indexer): Implement IIteratorContainer; added support
3172         for iterators in indexers.
3173
3174         * codegen.cs
3175         (EmitContext.CurrentIterator): Make this a property, not a field.
3176
3177         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3178
3179 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3180
3181         * pending.cs: Do not define a proxy if the base method is virtual,
3182         it will be picked up by the runtime (bug 75270).
3183
3184 2005-06-28  Martin Baulig  <martin@ximian.com>
3185
3186         * cs-parser.jay (interface_method_declaration): Avoid a
3187         reduce/reduce conflict by moving some of the code into a separate
3188         `interface_method_declaration_body' rule; fixes #75368.
3189
3190 2005-06-28  Martin Baulig  <martin@ximian.com>
3191
3192         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3193         array check after the check for TypeBuilder's.
3194
3195 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3196
3197         * convert.cs (FindMostEncompassedType): Add two trivial special
3198         cases (number_of_types == 0 || number_of_types == 1).
3199         (FindMostEncompasingType): Likewise.
3200
3201 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3202
3203         Some cleanups preparing for the fix of #75283.
3204         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3205         error testing.
3206         (EventExpr.InstanceResolve): Likewise.
3207         (EventExpr.DoResolve): Remove redundant checks.
3208
3209 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3210
3211         * class.cs: Small fix.
3212
3213 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3214
3215         Fix #75160.
3216         * class.cs (GetPartialBases): Fix return value check of
3217         part.GetClassBases.
3218
3219 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3220
3221         Ensure that partial classes are registered in their enclosing
3222         namespace.  Initial part of fix of #75160.
3223         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3224         Register declspace with namespace here, not in
3225         DeclSpace.RecordDecl.
3226         * cs-parser.jay: Pass namespace to RecordDecl.
3227         * class.cs (PartialContainer.Create): Likewise.
3228         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3229         called.
3230         * decl.cs (Declspace.RecordDecl): Remove.
3231         * namespace.cs (NamespaceEntry.DefineName): Remove.
3232
3233 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3234
3235         * rootcontext.cs: Reset TargetExt as well.
3236
3237 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3238
3239         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3240         -langversion:ISO-1.
3241
3242 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3243
3244         Fix #75080, cs0119.cs.
3245         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3246         of ...
3247         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3248         allowing ExprClass.Type and ExprClass.Namespace for
3249         ResolveFlags.VariableOrValue.
3250         (Expression.Resolve) [1-argument variant]: Change default resolve
3251         flags based on language version.
3252         (Expression.Error_UnexpectedKind): Use a simple string array
3253         rather than an ArrayList.
3254         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3255         not ExprClass.Type.
3256         (TypeOfVoid.DoResolve): Likewise.
3257         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3258         flags argument -- it always has the same value.
3259
3260 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3261
3262         Fix #75081.
3263         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3264         Use it in the error message.
3265         * assign.cs, expression.cs, statement.cs: Update.
3266
3267 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3268
3269         Fix #75088.
3270         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3271         the "almostMatchedMember" case too.
3272         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3273         that failed the accessibility checks to 'almost_match'.
3274
3275 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3276
3277         * attribute.cs: Use internal MethodBuilder methods to set
3278         ExactSpelling and SetLastError on PInvoke methods, instead
3279         of passing them via charset.  Fixes #75060.
3280
3281 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3282
3283         * parameter.cs (Parameter): Remove TODO comment.
3284         (Parameter.DefineParameter): Remove Location parameter.
3285         (Parameters.LabelParameters): Likewise.
3286         * class.cs (Constructor.Emit): Update to change.
3287         (MethodData.Emit): Likewise.
3288         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3289         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3290
3291 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3292
3293         * parameter.cs,
3294           Removed Parameters.Location and added Parameter.Location instead.
3295           Removed Location parameter from Emit() and GetSignature().
3296         * anonymous.cs,
3297           class.cs,
3298           cs-parser.jay,
3299           delegate.cs,
3300           iterators.cs,
3301           statement.cs :
3302           Modified all related calls.
3303
3304 2005-06-21  Martin Baulig  <martin@ximian.com>
3305
3306         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3307         left-hand side is not a nullable type; fixes #75328.
3308
3309 2005-06-21  Martin Baulig  <martin@ximian.com>
3310
3311         * typemanager.cs
3312         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3313         (TypeManager.GetFullNameSignature): Likewise.
3314
3315         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3316         `source.FullName' and `target.FullName' to check whether there are
3317         two conflicting definitions.
3318
3319 2005-06-21  Martin Baulig  <martin@ximian.com>
3320
3321         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3322         a BoxedCast - also for reference types - to be compatible with csc.
3323
3324 2005-06-21  Martin Baulig  <martin@ximian.com>
3325
3326         * expression.cs (MemberAccess.DoResolve): Add support for nested
3327         types in a generic instance; fixes #75320.
3328
3329 2005-06-20  Martin Baulig  <martin@ximian.com>
3330
3331         * generic.cs (TypeManager.InferType): Also walk the class
3332         hierarchy for generic instances; fixes #75261.
3333
3334 2005-06-17  Martin Baulig  <martin@ximian.com>
3335
3336         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3337         to make things work for corlib.
3338
3339 2005-06-15  Martin Baulig  <martin@ximian.com>
3340
3341         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3342         obsolete `SecurityAction' values.
3343
3344 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3345
3346         * rootcontext.cs: Reset TargetExt as well.
3347         
3348 2005-06-09  Martin Baulig  <martin@ximian.com>
3349
3350         * delegate.cs (Delegate.VerifyMethod): Added
3351         `MethodGroupExpr old_mg' argument; inherit its
3352         `HasTypeParameters'; fix #75085.
3353
3354 2005-06-09  Martin Baulig  <martin@ximian.com>
3355
3356         * expression.cs (Invocation.OverloadResolve): Correctly handle
3357         generic methods for the SetMemberIsUsed(); fix #75064.
3358
3359 2005-06-09  Martin Baulig  <martin@ximian.com>
3360
3361         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3362         fixes #75062.
3363
3364 2005-06-08  Martin Baulig  <martin@ximian.com>
3365
3366         * cs-parser.jay (nullable_type_or_conditional): If we put the
3367         nullable back and our `type' is a `ComposedCast', remove the
3368         nullable from it.  Fixes #75156.
3369
3370         * expression.cs (ComposedCast.RemoveNullable): New public method.
3371
3372 2005-06-08  Martin Baulig  <martin@ximian.com>
3373
3374         The big Iterators rewrite :-)
3375
3376         * iterators.cs: Rewrite this to use the anonymous methods framework.
3377
3378         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3379         before the TypeContainers; see 2test-21.cs.
3380
3381         * class.cs
3382         (TypeContainer.DefineType): Don't create a new EmitContext if we
3383         already have one (this only happens if we're an Iterator).
3384         (TypeContainer.Define): Also call Define() on all our iterators.
3385         (Method.CreateEmitContext): Added support for iterators.
3386
3387         * anonymous.cs
3388         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3389         (AnonymousContainer.CreateMethodHost): Moved here from
3390         AnonymousMethod and made abstract.
3391         (AnonymousContainer.CreateScopeType): New abstract method.
3392         (AnonymousContainer.IsIterator): New public property.
3393         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3394         get the ScopeTypeBuilder rather than manually defining it here. 
3395         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3396         iterators here.
3397
3398         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3399         before RootContext.DefineTypes().
3400
3401         * codegen.cs (EmitContext.RemapToProxy): Removed.
3402         (EmitContext.CurrentAnonymousMethod): Changed type from
3403         AnonymousMethod -> AnonymousContainer.
3404         (EmitContext.ResolveTopBlock): Protect from being called twice.
3405         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3406         (EmitContext.EmitThis): Removed the iterators hacks; use the
3407         anonymous methods framework for that.
3408
3409         * statement.cs
3410         (ToplevelBlock.Container): Make this a property, not a field.
3411         (ToplevelBlock.ReParent): New public method; move the
3412         ToplevelBlock into a new container.
3413         (Foreach.TemporaryVariable): Simplify.
3414
3415 2005-06-05  Martin Baulig  <martin@ximian.com>
3416
3417         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3418         (Block.AddTemporaryVariable): New public method; creates a new
3419         `LocalInfo' for a temporary variable.
3420         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3421         variables here.
3422         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3423         non-iterator variables.
3424
3425 2005-06-05  Martin Baulig  <martin@ximian.com>
3426
3427         * statement.cs (Foreach.TemporaryVariable): Create the
3428         LocalBuilder in the Emit phase and not in Resolve since in some
3429         situations, we don't have an ILGenerator during Resolve; see
3430         2test-19.cs for an example.
3431
3432 2005-06-04  Martin Baulig  <martin@ximian.com>
3433
3434         The big Foreach rewrite - Part II.
3435
3436         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3437         with `PropertyInfo ienumerator_getcurrent'.
3438
3439         * codegen.cs (VariableStorage): Removed.
3440
3441         * statement.cs
3442         (Foreach): Derive from Statement, not ExceptionStatement.
3443         (Foreach.CollectionForeach): New nested class.  Moved all the code
3444         dealing with collection foreach here.
3445         (Foreach.ForeachHelperMethods): Removed.
3446         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3447
3448 2005-05-23  Martin Baulig  <martin@ximian.com>
3449
3450         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3451         don't need to.  Fix #75014.
3452
3453 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3454
3455         Improve user-defined conversion handling.
3456         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3457         applicable operators.
3458         (AddConversionOperators): New.  Helper for GetConversionOperators.
3459         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3460         there is only one most encompassed/encompassing type.
3461         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3462         "applicable operator" handling.
3463         (UserConversion): Move cache here from GetConversionOperators.
3464         Directly cache the chosen operator, rather than the whole
3465         MethodGroup.
3466         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3467         case.  Allow conversion of decimal to sbyte and byte too.
3468         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3469         New static methods.  Used to avoid allocating EmptyExpressions in
3470         convert.cs.
3471
3472 2005-05-24  Duncan Mak  <duncan@novell.com>
3473
3474         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3475         another class, used in Convert.ExplicitNumericConversion.
3476         (CastToDecimal): New class, similar to above, but casts to
3477         System.Decimal, used in Convert.ImplicitNumericConversion and also
3478         in explicit convesion from double/float to decimal.
3479
3480         * convert.cs (ImplicitNumericConversion): Handle implicit
3481         conversions to System.Decimal.
3482         (ExplicitNumericConversion): handle explicit conversions to
3483         System.Decimal.
3484
3485         This fixes #68711.
3486         
3487 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3488
3489         * typemanager.cs: Do not throw an exception in the TypeBuilder
3490         case, we take care of it on the TypeCode.
3491
3492 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3493         
3494         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3495         is back.
3496         
3497         * cs-parser.jay: Catch more lexical errors.
3498         
3499         * report.cs: Add one more Error method.
3500         
3501         * rootcontext.cs,
3502         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3503
3504 2005-05-20  Martin Baulig  <martin@ximian.com>
3505
3506         * class.cs (TypeContainer.CircularDepException): Removed.
3507         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3508         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3509         (CS0146) and interface (CS0529) dependencies here.
3510
3511 2005-05-20  Martin Baulig  <martin@ximian.com>
3512
3513         * expression.cs (New.DoResolve): Move the CS0712 check above the
3514         CS0144 check; otherwise it can never be reached.
3515
3516 2005-05-20  Martin Baulig  <martin@ximian.com>
3517
3518         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3519
3520 2005-05-20  Martin Baulig  <martin@ximian.com>
3521
3522         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3523
3524         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3525
3526 2005-05-19  Martin Baulig  <martin@ximian.com>
3527
3528         * delegate.cs
3529         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3530         to disable error reporting.
3531
3532         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3533         here since we don't want to report an error; see the new test-336.cs.
3534
3535 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3536
3537         * statement.cs (ToplevelBlock.GetParameterReference)
3538         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3539         Move here from class Block.
3540         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3541         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3542
3543 2005-05-18  Martin Baulig  <martin@ximian.com>
3544
3545         Fix #74978.
3546
3547         * flowanalysis.cs
3548         (FlowBranching.Reachability): Add non-static public And() and Or()
3549         methods.
3550         (FlowBranchingSwitch): New class; do the `break_origins' thing
3551         like in FlowBranchingLoop.
3552         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3553         reachability, not just locals and parameters.
3554         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3555         switch; MergeBreakOrigins() now takes care of that.
3556
3557 2005-05-18  Martin Baulig  <martin@ximian.com>
3558
3559         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3560         a loop and may leave it, reset the barrier; fixes #74974.
3561
3562 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3563
3564         Fix test-382.cs.  Emit values of decimal constants.
3565         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3566         Carved out of ...
3567         (TypeContainer.AddField): ... this.
3568         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3569         with initializers to include 'Const's.
3570         (ClassPart.RegisterFieldForInitialization): Forward to
3571         PartialContainer.
3572         * const.cs (Const.Const): Pass initializer to base class.
3573         (Const.Define): In case of decimal constants, register them for
3574         initialization in a static constructor.
3575
3576 2005-05-14  Martin Baulig  <martin@ximian.com>
3577
3578         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3579         do not call ResolveUnreachable() on unreachable statements in
3580         here, see the comment in the source code.
3581
3582 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3583
3584         Fix #74934.
3585         * expression.cs (BinaryResolveOperator): If one of the operands of
3586         an equality comparison is 'null' and the other is a pointer type,
3587         convert the null to a NullPointer.
3588         * convert.cs (ImplicitReferenceConversion): If the expression is a
3589         NullLiteral and the target type is a pointer type, return a
3590         NullPointer instead.
3591         (ImplicitConversionStandard): Likewise.
3592
3593 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3594         
3595         * cs-parser.jay: Set readonly context based on special constructs.
3596         
3597         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3598         readonly variable error handling.
3599         
3600         * rootcontext.cs (EmitCode): Don't verify members when error
3601         occurred.
3602         
3603         * statement.cs (LocalInfo): Add reaodnly context information.
3604         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3605
3606 2005-05-17  Martin Baulig  <martin@ximian.com>
3607
3608         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3609         #70970. 
3610
3611 2005-05-13  Martin Baulig  <martin@ximian.com>
3612
3613         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3614         handle unreachable blocks.
3615
3616 2005-05-13  Martin Baulig  <martin@ximian.com>
3617
3618         * class.cs
3619         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3620         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3621         #74905. 
3622
3623 2005-05-13  Martin Baulig  <martin@ximian.com>
3624
3625         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3626         instance variable, not a local.  Fix #74873.
3627         (Block.ResolveUnreachable): Set it to true here.
3628
3629 2005-05-12  Martin Baulig  <martin@ximian.com>
3630
3631         * cs-parser.jay (property_declaration): Pass the `current_class',
3632         not the `current_container' to Property's .ctor.  Fixes #74912.
3633
3634 2005-05-11  Martin Baulig  <martin@ximian.com>
3635
3636         * typemanager.cs (Closure): Copy this from MCS and merge all the
3637         GMCS-specific changes into it.
3638
3639 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3640
3641         Fix #74920.
3642         * typemanager.cs (unmanaged_enclosing_types): New.
3643         (IsUnmanagedType): Avoid infloops by using
3644         'unmanaged_enclosing_types' to talk with recursive invocations.
3645
3646 2005-05-11  Duncan Mak  <duncan@novell.com>
3647
3648         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3649         continuing to process for 'arg'.
3650         (handle_preprocessing_directive): Check the argument of the #endif
3651         directive and report error CS1025 if there are any trailing
3652         characters.
3653
3654         According to the C# spec, having even whitespace after the #endif
3655         directive is illegal; however, because we call arg.TrimEnd ()
3656         beforehand, we have the same behavior as csc, allowing whitespace
3657         after the directive.
3658
3659         Fixes #74892.
3660
3661 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3662
3663         Fix #74863.
3664         
3665         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3666         (Constructor.GetObsoleteAttribute): Implemented correctly.
3667
3668 2005-05-10  Martin Baulig  <martin@ximian.com>
3669
3670         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3671         resolve the type; fixes #74864.
3672         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3673         in DoResolve(); fixes #74862.
3674
3675 2005-05-10  Martin Baulig  <martin@ximian.com>
3676
3677         * support.cs (ReflectionParameters.ParameterModifier): Use
3678         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3679         and `ParameterAttributes.In'.  Fixes #74884.
3680
3681 2005-05-10  Martin Baulig  <martin@ximian.com>
3682
3683         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3684         the cache if we're just looking for `MemberTypes.NestedType' in a
3685         generic instance.
3686
3687         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3688         constraints if we're still resolving the type tree.
3689         (Expression.MemberLookup): If we're resolving the type tree, only
3690         look for `MemberTypes.NestedType' since we're only interested in
3691         getting types.
3692
3693         * class.cs (TypeContainer.DefineType): Don't resolve the type
3694         parameters here; do this later in ResolveType() after the type
3695         tree has been resolved.
3696         (TypeContainer.ResolveType): New public method; this is called
3697         after the type tree is resolved and before the types are being
3698         populated.  We resolve the generic constraints here.
3699         (TypeContainer.DoDefineMember): Check the constraints on our base
3700         class and interfaces.
3701
3702         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3703         set the `ResolvingTypeTree' flag on the EmitContext.
3704
3705         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3706
3707 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3708
3709         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3710         
3711         * expression.cs (Argument.GetParameterModifier): Turned to property.
3712         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3713         
3714         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3715         its C# equivalent.
3716         
3717 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3718
3719         Fix #74852.
3720         * decl.cs (MemberCache.AddMethods): Register override methods,
3721         rather than non-override methods.
3722         * typemanager.cs (RegisterOverride): New.
3723         (IsOverride): Update.
3724
3725 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3726
3727         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3728
3729 2005-05-06  Martin Baulig  <martin@ximian.com>
3730
3731         * attribute.cs
3732         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3733         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3734
3735 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3736
3737         Fix #73105.
3738         
3739         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3740         recursive declaration.
3741         
3742         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3743         
3744 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3745
3746         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3747         
3748         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3749
3750 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3751
3752         Fix #74797.
3753         * decl.cs (DeclSpace.FamilyAccessible): 
3754         Use TypeManager.IsNestedFamilyAccessible.
3755
3756         Fix reopened #64812.
3757         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3758         internal'.
3759
3760 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3761             Abin Thomas  <projectmonokochi@rediffmail.com>
3762             Anoob V E  <projectmonokochi@rediffmail.com>
3763             Harilal P R  <projectmonokochi@rediffmail.com>
3764
3765         Fix #64812.
3766         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3767         allow access to all static members.
3768
3769 2005-05-04  Martin Baulig  <martin@ximian.com>
3770
3771         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3772
3773 2005-05-04  Martin Baulig  <martin@ximian.com>
3774
3775         Fix #74655.
3776
3777         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3778         section at the end; make things work if `default' is not the last
3779         section.        
3780
3781 2005-05-04  Martin Baulig  <martin@ximian.com>
3782
3783         Fix #70400.
3784
3785         * statement.cs (Switch): Replaced the `got_default' field with a
3786         `default_section' one.
3787         (Switch.CheckSwitch): Set `default_section' here.
3788         (Switch.Resolve): If we're a constant switch and the constant is
3789         not found, use the default section.
3790
3791 2005-05-03  Martin Baulig  <martin@ximian.com>
3792
3793         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3794
3795         * statement.cs (Foreach.ArrayForeach): New nested class.
3796         (Foreach.TemporaryVariable): New nested class.
3797         (Foreach.EmitArrayForeach): Removed; this is now in the new
3798         ArrayForeach class.
3799
3800 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3801
3802         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3803         more conservative.
3804         (VerifyPendingMethods): Revert change below.
3805
3806         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3807         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3808         that used to trigger warning -28.  Remove warning -28.
3809         * expression.cs (Invocation.OverloadResolve): Use
3810         TypeManager.IsOverride to distinguish override methods.
3811
3812         Fix #74773.
3813         * pending.cs (VerifyPendingMethods): If a base type implements the
3814         requested interface, don't bother checking individual methods of
3815         the base type.  As a side-effect, this prevents the creation of
3816         unnecessary proxies.
3817
3818 2005-05-02  Martin Baulig  <martin@ximian.com>
3819
3820         Fix #70182.
3821
3822         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3823         Also `And' the locals if the old vector is null.
3824         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3825         null; in this case we basically reset all the variables.        
3826
3827 2005-05-02  Martin Baulig  <martin@ximian.com>
3828
3829         Fix #74529.
3830
3831         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3832         Added `FlowBranching branching' argument; always `and' the
3833         variables instead of `or'ing them unless we're an infinite loop.
3834
3835         * statement.cs (While.Resolve): Create a new sibling unless we're
3836         infinite.       
3837
3838 2005-05-02  Martin Baulig  <martin@ximian.com>
3839
3840         Fix #70140.
3841
3842         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3843         arguments; use it instead of creating a new TopLevelBlock.
3844         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3845         our ConstructorInitializer.
3846
3847         * statement.cs
3848         (TopLevelBlock.TopLevelBranching): New public property.
3849         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3850         and create our `TopLevelBranching'.
3851
3852         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3853         anonymous method host, use `block.TopLevelBranching' rather than
3854         creating a new branching.
3855
3856 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3857
3858         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3859         a ScopeInfo, if any of the current children is a child of the new
3860         entry, move those children there.
3861
3862 2005-04-30  Martin Baulig  <martin@ximian.com>
3863
3864         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3865         at the beginning of a SwitchSection.  Fix #73335.
3866
3867 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3868
3869         Fix #74378
3870         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3871         
3872         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3873         (FieldExpr.DoResolve): Obsolete members are ignored for field
3874         initializers.
3875         
3876 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3877
3878         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3879         of arrays detection.
3880
3881         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3882         verification.
3883         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3884
3885         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3886         arrays report.
3887
3888 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3889
3890         * cs-parser.jay: Use the prefered version of -unsafe in error
3891         message.
3892
3893 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3894
3895         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3896         circumstances.
3897
3898 2005-04-20  John Luke  <john.luke@gmail.com>
3899
3900         * driver.cs: fix typo in error message, --outout to --output
3901
3902 2005-04-30  Martin Baulig  <martin@ximian.com>
3903
3904         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3905         handle the .NET 2.x security attributes.
3906
3907 2005-04-30  Martin Baulig  <martin@ximian.com>
3908
3909         * typemanager.cs
3910         (TypeManager.ExpandInterfaces): Don't add things twice.
3911
3912         * class.cs
3913         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3914
3915 2005-04-29  Martin Baulig  <martin@ximian.com>
3916
3917         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3918
3919         * anonymous.cs: Added support for anonymous generic methods.
3920
3921 2005-04-29  Martin Baulig  <martin@ximian.com>
3922
3923         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3924         generic instances.
3925
3926 2005-04-29  Martin Baulig  <martin@ximian.com>
3927
3928         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3929
3930         * expression.cs (New.DoResolve): Fix the CS0304 check.
3931
3932 2005-04-29  Martin Baulig  <martin@ximian.com>
3933
3934         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3935         naming schema.
3936
3937         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3938         explicit interface implementation, compare the interface types.
3939         (MethodData.Define): Use the new naming scheme from the latest
3940         .NET 2.x beta2.
3941         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3942
3943         * decl.cs (MemberName.GetMemberName): Removed.
3944         (MemberName.MethodName, FullName): New properties.
3945
3946 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3947
3948         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3949
3950 2005-04-22  Martin Baulig  <martin@ximian.com>
3951
3952         * generic.cs (GenericMethod): Create the EmitContext in the
3953         `Define()'; in `Define(MethodBuilder)', create the type parameters
3954         before calling `Define()'.  Fixes #73933.
3955
3956 2005-04-22  Martin Baulig  <martin@ximian.com>
3957
3958         * generic.cs
3959         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3960         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3961
3962         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3963         ConstructedType, check its constraints.
3964
3965 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3966
3967         * codegen.cs (InRefOutArgumentResolving): New field.
3968         
3969         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3970         fields outside contructor.
3971         
3972         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3973         
3974 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3975
3976         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3977         parameter code was not completed ever, so it was not as up-to-date
3978         as local variables.  Must finish it.
3979
3980         The bug fix was to compare the Toplevel of the block, not the
3981         current block.  Thanks for Ben for pointing this out. 
3982
3983 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3984
3985         * decl.cs (AddMethods): Use the declaring type of the problem
3986         method to determine if we want to squash a warning.
3987
3988 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3989
3990         * attribute.cs: Removed debug output.
3991
3992         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3993         
3994         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3995         Report.Stderr.
3996         
3997 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3998
3999         Fix #74481.
4000         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4001         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4002         all null comparisons against reference types.
4003
4004 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4005
4006         Fix# 74565
4007         * class.cs (TypeContainer.CircularDepException) New nested
4008         exception class.
4009         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4010         (TypeContainer.DefineType): Removed error, reset InTransit before
4011         exit.
4012         (Class.DefineType): Throw exception when is in Transit.
4013         Catch exception and report error.
4014         (Struct.DefineType): Throw exception when is in Transit.
4015         Catch exception and report error.
4016         (Interface.DefineType): Throw exception when is in Transit.
4017         Catch exception and report error.
4018
4019         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4020         handle nested exception handlers.
4021
4022         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4023         a catch.
4024
4025         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4026         InFinally and InCatch storage.
4027
4028         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4029         (Catch.Resolve): Set and Restore ec.InCatch.
4030         (Try.Resolve): Set and Restore ec.InFinally.
4031         (Try.HasCatch): True when try has catch.
4032
4033 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4034
4035         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4036           for the same event member, so exclude such cases from warning 419.
4037           Fixed bug #74633.
4038
4039 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4040
4041         * expression.cs (Binary.ResolveOperator): Apply patch from John
4042         Luke to fix bug 59864: operators &, | and ^ on enumerations
4043         require that the same enum type on both sides.
4044
4045         * driver.cs: Add warnings to old flag usage, this is to assist
4046         people who produce Makefiles and hope that the Makefiles will be
4047         used on Windows.
4048
4049         * class.cs (TypeContainer.EmitType): Moved the definition of the
4050         special $PRIVATE$ field from the resolve phase to the Emit phase.
4051         During resolve we do not know if we are a struct with
4052         HasExplicitLayout, we know this only after the attributes for the
4053         type are emitted.
4054
4055         Set the FieldOffset to zero on the dummy field that we create for
4056         the class.   Fixes 74590.
4057
4058 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4059
4060         Fix #73834.
4061         * ecore.cs (PropertyExpr.resolved): New.
4062         (DoResolve): Use it to handle a case of double resolution here.
4063         Handle a case of identical-name-and-type-name.
4064         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4065         resolution by storing the results of expression resolution back
4066         into the "probes" array.
4067
4068 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4069
4070         Fix cs0208-7.cs and cs0208-8.cs.
4071         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4072         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4073         error reporting to point out the reason a struct is not unmanaged.
4074
4075 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4076
4077         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4078           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4079
4080 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4081
4082         Fix #74528.
4083         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4084         IdenticalNameAndTypeName here.
4085         (EventExpr.InstanceResolve): Likewise.
4086
4087 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4088
4089         C# 2.0 DefaultCharSetAttribute implementation
4090         
4091         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4092         which allows us to set GlobalNamespace for every resolve.
4093         (Attribute.ResolveArguments): Cut from Resolve.
4094         (Attribute.GetCharSetValue): Returns CharSet named argument.
4095         (Attribute.DefinePInvokeMethod): Gets default charset from
4096         module settings.
4097         (GlobalAttribute.ResolveAsTypeStep): Override.
4098         (GlobalAttribute.ResolveArguments): Override.
4099         
4100         * class.cs (TypeAttr): Is protected.
4101         
4102         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4103         (ModuleClass.DefaultCharSetType): New memeber.
4104         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4105         
4106         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4107         charset from module.
4108         
4109         * delegate.cs (TypeAttr): Override.
4110         (Delegate.DefineType): Use this TypeAttr.
4111         
4112         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4113         at very early stage (before types are defined) to resolve model
4114         module attributes. It will probably not work with corlib but it
4115         should be ok.
4116         
4117         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4118         charset from module.
4119         
4120         * typemanager.cs (default_charset_type): New type.
4121
4122 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4123
4124         * decl.cs (MemberCache.AddMethods): Don't warn if
4125         System.Object.Finalize has buggy MethodAttributes.
4126
4127         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4128         removed below.
4129
4130 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4131
4132         * doc.cs : detect ambiguous reference to overloaded members.
4133           Fixed bug #71603. MS 1.1 csc does not detect it.
4134
4135 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4136
4137         * doc.cs : delegates must not be referenced with parameters.
4138           Fixed bug #71605.
4139
4140 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4141
4142         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4143
4144 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4145
4146         * driver.cs (MainDriver): Stop processing if the CLS stage found
4147         errors. 
4148
4149         (CompilerCallableEntryPoint.InvokeCompiler): Always
4150         reset after execution;   Take a TextWriter argument for the
4151         output.
4152
4153         * report.cs: Use the error stream instead of hardcoding stderr. 
4154
4155 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4156
4157         * class.cs: Reduce code paths to test, too small of an
4158         optimization to make it worth the extra testing.  Always perform
4159         it. 
4160
4161 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4162
4163         Fix #74510.
4164         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4165         operators that had errors reported on them.
4166
4167 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4168
4169         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4170         argument types.
4171         (Attribute.Resolve): Add named argument type checking.
4172         
4173         * class.cs (FixedField.Define): Use IsPrimitiveType
4174         
4175         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4176         
4177         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4178         unsafe parameter types.
4179         
4180         * statement.cs (Using.ResolveExpression): Add better error description.
4181         
4182         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4183         
4184 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4185
4186         Fix #74484.
4187         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4188         AttributeUsageAttribute in the emitcontext of the attribute class,
4189         not in the emitcontext of the attributable entity it was attached to.
4190         * cs-parser.jay: Use 'current_class', not 'current_container',
4191         when creating a GlobalAttribute.
4192
4193 2005-04-08  Alp Toker  <alp@atoker.com>
4194
4195         * pending.cs: The fix to #58413 failed to compile methods implementing
4196         interfaces with/without params modifiers and vice versa, even though
4197         params modifiers aren't part of the signature. Make the modifier check
4198         less strict as in csc.
4199
4200 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4201             Anoob V E  <projectmonokochi@rediffmail.com>
4202             Harilal P R  <projectmonokochi@rediffmail.com>
4203
4204         Fix #58413.
4205         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4206         modifiers of pending methods.
4207         (PendingImplementation.PendingImplementation): Initialize it.
4208         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4209         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4210         with ParameterData.  Add check for modifiers.
4211         * class.cs (MethodData.Define): Update to changes.
4212
4213 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4214
4215         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4216
4217 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4218
4219         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4220         property.
4221         
4222         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4223         
4224         * rootcontext.cs,
4225         * typemanager.cs: Registered RequiredAttributeAttribute.
4226         
4227 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4228
4229         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4230         Warning CS0169 is back at level 3.
4231         (IMethodData.SetMemberIsUsed): New method.
4232         
4233         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4234         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4235         
4236         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4237
4238         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4239         contants.
4240         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4241         is used.
4242         
4243         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4244         is used.
4245         
4246         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4247         to avoid the problems with nested types.
4248
4249 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4250             Anoob V.E  <projectmonokochi@rediffmail.com>
4251             Harilal P.R  <projectmonokochi@rediffmail.com>
4252             Raja R Harinath  <rharinath@novell.com>
4253
4254         Fix #73820.
4255         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4256         attribute.
4257         * typemanager (GetConstructor): Make public.
4258
4259 2005-04-05  John Luke  <john.luke@gmail.com>
4260             Raja R Harinath  <rharinath@novell.com>
4261
4262         Fix #62232.
4263         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4264         struct too.  Return false quicker in a few cases.
4265         (VerifyUnManaged): Use it.
4266
4267 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4268
4269         Fix #74041.
4270         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4271         not 'unreachable_seen'.
4272
4273 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4274
4275         * attribute.cs (Attribute.GetValue): Removed unused.
4276         
4277         * codegen.cs (CodeGen.TrimExt): Removed unused.
4278         
4279         * cs-parser.jay (output): Removed unused.
4280         
4281         * cs-tokenizer.cs (hex_digits): Removed unused.
4282         
4283         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4284         
4285         * expression.cs (Indirection.LoadExprValue): Removed unused.
4286         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4287         
4288         * iterators.cs (Iterator.param_types): Removed unused.
4289         
4290         * statement.cs (Goto.block): Removed unused.
4291         (ToplevelBlock.did): Removed unused.
4292         (Switch.ResolveConstantSwitch): Removed unused.
4293
4294 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4295
4296         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4297         resetting thingy.
4298
4299 2005-04-19  Martin Baulig  <martin@ximian.com>
4300
4301         Merged r42462 from MCS and made it work for GMCS.
4302
4303         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4304
4305         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4306
4307 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4308
4309         Fix #74232 and cs0208-3.cs.
4310         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4311         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4312         unmanaged type.  Don't use FieldBuilders when 't' is a
4313         TypeBuilder.  Use ModFlags and MemberType fields.
4314         * class.cs (MemberBase.member_type): Rename from MemberType.
4315         (MemberBase.MemberType): New property.  Determines member_type on
4316         demand.
4317         (MemberBase.DoDefine): Don't initialize MemberType here.
4318         (FieldMember.Define): Likewise.
4319
4320 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4321
4322         Fix #74241
4323         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4324         Attributes are emitted there.
4325         
4326 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4327
4328         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4329         keyword in 'partial enum' too.
4330         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4331         is not allowed).
4332         Report from Kamil Skalski <nazgul@omega.pl>.
4333
4334         Fix #74309.
4335         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4336         have partial containers too.
4337
4338         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4339         in block' checks to Block.CheckInvariantMeaningInBlock.
4340         * statement.cs (Block.GetKnownVariableInfo): Make private.
4341         (Block.IsVariableUsedInChildBlock): Remove.
4342         (Block.IsVariableUsedInBlock): Likewise.
4343         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4344         conflicting declaration.
4345         (Block.AddVariable): Make error messages less long-winded and more
4346         specific.  Show location of conflicting declaration.
4347         * parameter.cs (Parameters.Location): New readonly property.
4348
4349 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4350
4351         Clean up semantics of invoking ResolveMemberAccess.
4352         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4353         can have an instance, ensure that we pass in a non-TypeExpression
4354         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4355         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4356         argument.  Update to changes and simplify.
4357         (FieldExpr.Emitinstance): Remove CS0120 check.
4358         (PropertyExpr.EmitInstance): Likewise.
4359         * expression.cs (Argument.Resolve): Likewise.
4360         (Invocation.DoResolve): Update to changes in semantics of
4361         InstanceExpression.
4362
4363 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4364
4365         Fix #74241
4366         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4367         customization.
4368         
4369         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4370
4371 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4372
4373         Fix difference in behaviour with commandline invocation.
4374         * driver.cs (Driver.Reset): New.
4375         (CompilerCallableEntryPoint): Call it.
4376
4377         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4378         variable" warnings if the boolean expression failed to resolve.
4379
4380 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4381
4382         * attribute.cs: Fix the union of several permissions when some of them
4383         are unrestricted (so the result isn't an unrestricted permission set).
4384         Fix #74036.
4385
4386 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4387
4388         * ecore.cs (MemberExpr): New class.  Convert from interface
4389         IMemberExpr.
4390         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4391         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4392         error checks.
4393         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4394         (MethodGroupExpr.IsExplicitImpl): Remove.
4395         (Expression.GetFieldFromEvent): Remove.
4396         (SimpleName.MemberStaticCheck): Remove.
4397         (SimpleName.DoSimpleNameResolve): Update to changes.
4398         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4399         (MemberAccess.IdenticalNameAndTypeName): Remove.
4400         (MemberAccess.error176): Move to MemberExpr.
4401         (MemberAccess.DoResolve): Update to changes.
4402         (BaseAccess.DoResolve): Likewise.
4403
4404 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4405
4406         C# 2.0 Conditional attribute class implementation
4407         
4408         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4409         Analyzes class whether it has attribute which has ConditionalAttribute
4410         and its condition is not defined.
4411         
4412         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4413         (Class.IsExcluded): New method. Search for at least one defined
4414         condition in ConditionalAttribute of attribute class.
4415
4416 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4417
4418         * ecore.cs (PropertyExpr): Derive from Expression, not
4419         ExpressionStatement.
4420         (PropertyExpr.EmitStatement): Remove.
4421
4422 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4423
4424         Fix #74060.
4425         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4426         internal field "value__" of an enum be private.  The examples for
4427         "value__" that I found on MSDN all used FieldAttributes.Private.
4428
4429         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4430         Don't mention IL method attribute names.
4431
4432         Fix #47991.  Remove a TODO.
4433         * statement.cs (Block.Toplevel): Make into a field.
4434         (Block.Parameters): Move into ToplevelBlock.
4435         (Block.known_variables): Rename from child_variable_names.
4436         (Block.Block): Remove variants that take Parameters.  Initialize
4437         'Toplevel' with the immediately surrounding toplevel block.
4438         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4439         LocalInfo parameter.
4440         (Block.GetKnownVariableInfo): New.
4441         (Block.IsVariableNameUsedInChildBlock): Update.
4442         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4443         the block, even though it may not be in scope.
4444         (Block.AddVariable): Remove Parameters parameter.  Use
4445         Toplevel.Parameters instead.
4446         (Block.AddConstant): Remove Parameters parameter.
4447         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4448         (Block.IsParamaterReference): Likewise.
4449         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4450         (ToplevelBlock.Parameters): New.  Moved from Block.
4451         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4452         initialize Parameters to a non-null value.
4453         * cs-parser.jay: Update to changes.
4454         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4455         simple names that mean different things in the same block.  Use
4456         Block.IsVariableNameUsedInBlock.
4457
4458 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4459
4460         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4461
4462 2005-03-26  Raja R Harinath  <harinath@acm.org>
4463
4464         Fix #73038.
4465         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4466         fails to resolve, ensure that the LHS is still resolved as an
4467         lvalue.
4468
4469 2005-03-25  Raja R Harinath  <harinath@acm.org>
4470
4471         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4472         ec.ContainerType.
4473         (Enum.current_ec): Remove.
4474         (Enum.LookupEnumValue): Remove EmitContext argument.
4475         Just uses the one created during DefineType.
4476         (Enum.FindMembers): Update.
4477         * expression.cs (MemberAccess.DoResolve): Update.
4478
4479 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4480
4481         * assign.cs (Assign.DoResolve): Check for CS1717 when
4482         source and target are same (uses Equals).
4483
4484         * expression.cs (LocalVariableReference, ParameterReference,
4485         This): Implemented Equals, GetHashCode.
4486
4487         * statement.cs (Block.GetParameterReference): Removed useless
4488         local variable.
4489
4490 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4491
4492         Fix cs0128.cs
4493         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4494         blocks before deciding whether the error is cs0136 or cs0128.
4495
4496         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4497         (using_alias_directive, using_namespace_directive): Pass
4498         MemberName, not an expression to Namespace.UsingAlias and
4499         Namespace.Using.
4500         (MakeName): Use the MemberName of the namespace.
4501         * namespace.cs (Namespace.MemberName): New.
4502         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4503         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4504         Likewise.
4505         * decl.cs (MemberName.Name): Make readonly.
4506         (MemberName.FromDotted): New "constructor".
4507         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4508         (MemberCore.Name): Compute from MemberName on demand.
4509         (MemberCore.SetMemberName): Provide a way to change the
4510         MemberName.
4511         (MemberCore.AddToContainer): Don't take a fullname parameter.
4512         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4513         fully qualified name of the container to the member name.
4514         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4515         only if the type is a member of the root container.
4516         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4517         MemberName.Left rather than searching for an embedded ".".
4518         (PartialContainer.CreatePart): Update to changes in RootContext.
4519         (MemberBase.ShortName): Turn into a property.  Use
4520         MemberCore.SetMemberName.
4521         (MemberBase.ExplicitInterfaceName): Remove.
4522         (MemberBase.UpdateMemberName): Remove.
4523         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4524         (PropertyBase.SetMemberName): New override.
4525         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4526         (Tree.GetDecl): New.
4527         (Tree.AllDecls): Rename from Decls.
4528         * attribute.cs, enum.cs, report.cs: Update to changes.
4529         * driver.cs (MainDriver): Use MemberName.FromDotted on
4530         RootContext.MainClass.
4531
4532 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4533
4534         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4535         checks.
4536
4537         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4538
4539 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4540
4541         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4542         property accessor modifiers.
4543
4544         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4545         fixed buffer attribute (CS1716).
4546         (PropertyMethod.HasCustomAccessModifier): When property accessor
4547         has custom modifier.
4548
4549         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4550         modifiers.
4551         (PropertyExpr.DoResolveLValue): Add CS0272.
4552
4553 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4554
4555         * convert.cs: When converting to a pointer, use the proper Conv.U
4556         or Conv.I depending on the source data type.
4557
4558         * cs-tokenizer.cs: Make the size for large decimal constants,
4559         fixes #72957.
4560
4561 2005-03-17  Martin Baulig  <martin@ximian.com>
4562
4563         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4564         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4565
4566 2005-03-17  Martin Baulig  <martin@ximian.com>
4567
4568         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4569         to bool so we can return an error condition.
4570         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4571         returned an error.
4572
4573 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4574
4575         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4576         attributes.
4577
4578 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4579
4580         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4581         Refactor to avoid traversing the list of assemblies, and to avoid
4582         string concatenation.
4583         * typemanager.cs (guid_attr_type): Remove.
4584         (negative_hits, pointers, references): Remove hashes.
4585         (type_hash): New.
4586         (GetConstructedType): New.  Uses type_hash to handle constructed
4587         types (arrays, references, pointers).
4588         (GetReferenceType, GetPointerType): Use it.
4589         (GetNestedType): New.  Uses type_hash to handle nested types of
4590         reflected types.
4591         (LookupType, LookupTypeDirect): Remove.
4592         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4593         'types' hash and LookupTypeReflection directly.
4594         (params_string, params_object): Use GetConstructedType.
4595         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4596         top-level types.
4597         (Namespace.Lookup): Use cached_types.
4598         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4599         provided by old TypeManager.LookupType.
4600         * rootcontext.cs (MakeFQN): Remove.
4601         * decl.cs (DeclSpace.MakeFQN): Likewise.
4602         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4603         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4604         TypeManager.GetConstructedType.
4605         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4606
4607 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4608
4609         * cs-parser.jay: Fix build.
4610
4611 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4612
4613         * class.cs (TypeContainer.CircularDepException) New nested
4614         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4615
4616         * cs-parser.jay: Reports CS1527 for any namespace element.
4617
4618         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4619         Added CS0407.
4620
4621         * expression.cs (ParameterReference.IsAssigned): Changed error to
4622         CS0269.
4623         (Error_WrongNumArguments): Moved CS0245 detection here.
4624
4625         * statement.cs (Return.Resolve): Add CS1622 report.
4626
4627 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4628
4629         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4630
4631 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4632
4633         * attribute.cs expression.cs: Get rid of some allocations.
4634
4635 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4636
4637         * doc.cs : just eliminate the latest change.
4638
4639 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4640
4641         * doc.cs : commented out the latest change. It breaks xml-030.cs
4642
4643 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4644
4645         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4646           fail. So invoke CreateType() in FindDocumentedType().
4647
4648 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4649
4650         * cs-tokenizer.cs : added IsKeyword().
4651         * doc.cs : Detect keyword incorrectly used as identifier.
4652           Allow identifiers prefixed by @.
4653
4654 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4655
4656         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4657         It caused exception in namespace resolving (again!).
4658         
4659         * class.cs (Class.ctor): Removed exit.
4660         (PropertyMethod.ctor): ditto.
4661         
4662         * codegen.cs (Codegen.Reset): Reset static data.
4663         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4664         
4665         * cs-tokenizer.cs (Cleanup): Removed.
4666         
4667         * driver.cs (GetSystemDir): Rewrote to one line command.
4668         It caused problem with unloaded dynamic modules.
4669         (UnixParseOption): Removed Exit.
4670         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4671         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4672         Now can be mcs used as library.
4673         
4674         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4675         empty location.
4676         
4677         * location.cs (Reset): Reset static data.
4678         
4679         * namespace.cs (Reset): Reset static data.
4680         
4681         * report.cs (Report.Reset): Reset static data.
4682         
4683         * rootcontext.cs (RootContext.Reset): Reset static data.
4684         
4685         * tree.cs (RootTypes.ctor): Use Location.Null
4686         
4687         * typemanager.cs (TypeManager.Reset): Reset static data.
4688         (CoreLookupType): Removed Exit.
4689         (TypeHandle.Reset): Reset static data.
4690         
4691 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4692
4693         Fix #73516.
4694         * typemanager.cs (ComputeNamespaces): Import namespaces from
4695         referenced modules too.
4696
4697 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4698
4699         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4700         than '.'.
4701
4702 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4703
4704         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4705         enclosing DeclSpace.  This ensures that a name-lookup populates
4706         more caches and there are fewer 'TypeExpression's.  Carve out
4707         nested type lookup into ...
4708         (LookupNestedTypeInHierarchy): ... this.
4709
4710 2005-04-15  Martin Baulig  <martin@ximian.com>
4711
4712         Merged r41590 from MCS and make it work in the generics land.
4713
4714         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4715         `check' argument.
4716
4717         * class.cs (PartialContainer.UpdateConstraints): Removed.
4718         (PartialContainer.CheckConstraints): Removed.
4719         (PartialContainer.SetParameterInfo): Store the constraints here.
4720         (PartialContainer.DefineTypeParameters): New public method;
4721         resolve the type parameter's constraints here.  Note that the
4722         PartialContainer doesn't have an EmitContext anymore, so we must
4723         do this in the ClassPart.
4724
4725 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4726
4727         Clean up a few partial-class semantics.  
4728         Fixes test-357.cs and cs1618-2.cs.
4729         * cs-parser.jay (struct_declaration): Use 'current_class' as
4730         parent of newly-created struct.  Remove call to Register ().
4731         Use 'pop_current_class' to complete handing the current struct.
4732         (interface_declaration): Likewise.
4733         (class_declaration): Likewise.
4734         (enum_declaration): Use 'current_class' as parent of newly created
4735         enum.
4736         (delegate_declaration): Likewise.
4737         (pop_current_class): New function.  This is used to handle closing
4738         up the 'current_class' and 'current_container', and pointing them
4739         to the enclosing class/container.
4740         (CSharpParser): Initialize 'current_class' too.
4741         * decl.cs (MemberCore): Add check for invariant: a partial
4742         container is not a parsed entity, and thus does not enclose any
4743         parsed members.
4744         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4745         (DeclSpace.BaseTypeExpr): Use it.
4746         (DeclSpace.LookupType): Add check for invariant.
4747         * class.cs (TypeContainer): Add check for invariant: a nested
4748         class should have the same NamespaceEntry as its enclosing class.
4749         (TypeContainer.EmitFieldInitializers): Make virtual.
4750         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4751         MemberCore.
4752         (TypeContainer.Register): Remove.
4753         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4754         null.  Use TypeResolveEmitContext for resolving base types and
4755         interfaces.  Move initialization of Parts.TypeBuilder here from
4756         ...
4757         (TypeContainer.DefineNestedTypes): ... here.
4758         (PartialContainer): Take a Namespace not a NamespaceEntry.
4759         (PartialContainer.Create): Don't use Register.  Call the
4760         appropriate Add... function directly.
4761         (ClassPart): Take both the PartialContainer and the enclosing
4762         class as constructor arguments.
4763         (ClassPart.EmitFieldInitializers): Override.
4764         (ClassPart.PartFindNestedTypes): Remove.
4765         (FieldBase.GetInitializerExpression): Resolve the initializer
4766         expression in the emit context of the enclosing class.
4767         * tree.cs (RootTypes): Remove Register ().
4768         
4769 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4770
4771         * cs-parser.jay: Removed CS0134.
4772         
4773         * driver.cs: Removed CS1901.
4774         
4775         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4776         for predefined types.
4777
4778 2005-03-07  Duncan Mak  <duncan@novell.com>
4779
4780         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4781         well. Fixes bug #73454.
4782
4783 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4784
4785         * cs-tokenizer.cs (xtoken): Add CS1035.
4786         
4787         * class.cs (MethodData.Define): Add CS0683.
4788         (FieldMember.ctor): Add CS0681.
4789
4790 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4791
4792         * ecore.cs (SimpleName.DoResolve): Rename from
4793         SimpleName.DoResolveAllowStatic.
4794         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4795         Pass 'intermediate' flag to MemberStaticCheck.
4796         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4797         of "intermediate" lookups via MemberAccess.
4798         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4799         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4800
4801 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4802
4803         Fix #73394.
4804         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4805         slipped in because of variable names that are identical to a
4806         builtin type's BCL equivalent ('string String;', 'int Int32;').
4807         (PropertyExpr.EmitInstance): Likewise.
4808
4809 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4810
4811         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4812         
4813         * report.cs (warning_ignore_table): Made public.
4814
4815 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4816
4817         Fix #73282.
4818         * class.cs (MethodData.Emit): Pass 'container' to
4819         container.GetObsoleteAttribute instead of 'container.Parent'.
4820
4821 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4822
4823         * cs-parser.jay: Add 1534 error test.
4824
4825         * iterators.cs (Yield.CheckContext): Add error 1629.
4826         (Iterator.ctor): Save unsafe modifier.
4827         (MoveNextMethod.DoEmit): Restore unsafe context.
4828
4829         * namespace.cs (UsingAlias): Better error message.
4830
4831 2005-03-03  Dan Winship  <danw@novell.com>
4832
4833         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4834         the warning message [#73219]
4835
4836 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4837
4838         Fix compile with MCS 1.0.0.0.
4839         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4840         w_restore to not depend on string constant folding.
4841
4842 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4843
4844         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4845         CS0246 check to users who passed 'silent = false'.
4846         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4847         check.
4848         (SimpleName.SimpleNameResolve): Update.
4849         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4850         (MemberAccess.IdenticalNameAndTypeName): Update.
4851         * doc.cs (FindDocumentedTypeNonArray): Update.
4852
4853 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4854
4855         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4856         * parameters.cs (ComputeAndDefineParameters): Remove.
4857         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4858         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4859         Use GetParameterInfo.
4860
4861 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4862
4863         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4864
4865 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4866
4867         Unify DeclSpace.LookupType and DeclSpace.FindType.
4868         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4869         is in charge of defining nested types on demand.
4870         (DeclSpace.LookupType): Use it when the current_type is a
4871         TypeBuilder.  Use LookupTypeDirect for reflected types.
4872         (DeclSpace.FindType): Remove.
4873         (DeclSpace.LookupInterfaceOrClass): Likewise.
4874         (DeclSpace.DefineTypeAndParents): Likewise.
4875         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4876         DeclSpace.LookupType.
4877         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4878         * typemanager.cs (LookupType): Simplify.
4879         (AddUserType): Remove type from negative_hits.
4880         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4881         * class.cs (TypeContainer.FindMembers): Move handling of nested
4882         types ...
4883         (TypeContainer.FindMembers_NestedTypes): ... here.
4884         (TypeContainer.FindNestedType): Implement override.
4885         (ClassPart.FindNestedType): Delegate to PartialContainer.
4886         (ClassPart.PartFindNestedType): Looks up the nested types of the
4887         part alone.
4888
4889 2005-04-14  Martin Baulig  <martin@ximian.com>
4890
4891         * generic.cs (ConstructedType): Moved all the type lookup and
4892         nested class logic into SimpleName.
4893         (ConstructedType.ResolveConstructedType): Our underlying type is
4894         already fully resolved; all the type lookup stuff is in
4895         SimpleName.
4896
4897         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4898         constructed types here instead of in ConstructedType.
4899
4900         * decl.cs (MemberName.GetTypeExpression): Always create a
4901         SimpleName, not a ConstructedType.
4902         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4903
4904 2005-03-02  Martin Baulig  <martin@ximian.com>
4905
4906         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4907         static constructor in static classes.
4908
4909 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4910
4911         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4912         sizeParamIndex is not specified.
4913
4914 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4915
4916         Fix #73117
4917         * report.cs (WarningMessage.IsEnabled): Missing null check.
4918
4919 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4920
4921         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4922         in the fields and not in the properties.
4923
4924 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4925
4926         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4927         fields as well.
4928
4929 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4930
4931         * attribute.cs: Small refactoring (improved robustness).
4932         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4933         (ValidateGuid): Removed.
4934         (Resolve): Removed referenced to above mentioned.
4935         (GetAttributeUsage): Made private and changed to work without
4936         class assistance.
4937         (GetIndexerAttributeValue): Don't crash.
4938         (GetConditionalAttributeValue): Ditto.
4939         (GetClsCompliantAttributeValue): Ditto.
4940         (ExtractSecurityPermissionSet): All attributes exceptions are
4941         error 648.
4942         (GetPropertyValue): New helper.
4943         (GetMethodImplOptions): New method.
4944         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4945         some missing properties.
4946         
4947         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4948         (Method.ApplyAttributeBuilder): Updated.
4949         
4950         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4951         exception.
4952
4953 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4954
4955         Fix #73052.
4956         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4957         non-simple types (array, pointer, reference).
4958
4959 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4960
4961         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4962
4963         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4964         for operators.
4965         (Method.CheckBase): Catch wrong destructor here.
4966         (MethodData.Define): Add errors 550, 668.
4967
4968         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4969
4970         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4971
4972         * pending.cs (VerifyPendingMethods): Add error 551.
4973
4974         * typemanager.cs (CSharpName): Next error report helper.
4975
4976 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4977
4978         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4979         attributes. Removed useless attribute double check.
4980         It saves almost 2MBs for corlib.
4981
4982 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4983
4984         Fix #72924.
4985         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4986         called twice in case of error.
4987
4988 2005-02-23  Chris Toshok  <toshok@ximian.com>
4989
4990         Fix compiler portions of #72827.
4991         * statement.cs (Block.Emit): call Begin/EndScope on the
4992         EmitContext instead of the ILGenerator.
4993
4994         * codegen.cs (EmitContext.BeginScope): new method, call
4995         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4996         we have one.)
4997         (EmitContext.BeginScope): same, but EndScope and CloseScope
4998
4999         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5000         offset and call the superclass's OpenScope(int) with it.
5001         (SymbolWriter.CloseScope): get the current il
5002         offset and call superclass's CloseScope(int) with it.
5003
5004 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5005
5006         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5007         CS1677 for out and ref as well.
5008
5009         * class.cs (Method.Define): Add error CS1599 detection.
5010         
5011         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5012         
5013         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5014         
5015         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5016         
5017         * support.cs.cs (ModifierDesc): New helper method.
5018
5019 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5020             Abin Thomas  <projectmonokochi@rediffmail.com>
5021             Anoob V E  <projectmonokochi@rediffmail.com>
5022             Harilal P R  <projectmonokochi@rediffmail.com>
5023
5024         Fix #57851, #72718.
5025         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5026         MemberLookup (used for error reporting) actually returns a result.
5027         Fix error report number (122, not 112).
5028
5029 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5030             Anoob V E  <projectmonokochi@rediffmail.com>
5031             Harilal P R  <projectmonokochi@rediffmail.com>
5032
5033         Fix #71134.
5034         * pending.cs (PendingImplementation.GetAbstractMethods):
5035         Find NonPublic members too.
5036
5037 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5040         Fixed error 217.
5041         
5042         * class.cs (MethodCore.CheckMethodAgainstBase):
5043         Add error 239 report.
5044
5045 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5046
5047         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5048         
5049         * class.cs (Operator.Define): Add error 217 report.
5050         
5051 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5052
5053         Fix #68955.
5054         * expression.cs (Invocation.IsApplicable): Make public.
5055         (Invocation.IsParamsMethodApplicable): Likewise.
5056         * delegate.cs (Delegate.VerifyApplicability): Don't use
5057         Invocation.VerifyArgumentCompat for parameter applicability
5058         testing.  Use Invocation.IsApplicable and
5059         Invocation.IsParamsMethodApplicable.
5060
5061 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5062
5063         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5064         
5065         * class.cs (Operator.Define): Add error 217 report.
5066         
5067 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5068
5069         * namespace.cs (UsingEntry.Resolve): Undo change below.
5070
5071 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5072
5073         Fix #72756.
5074         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5075         disable the error message when the extended MemberLookup also
5076         fails.
5077         (Expression.MemberLookupFinal): Update.
5078         (SimpleName.DoSimpleNameResolve): Update.
5079         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5080         Don't use MemberLookupFinal.
5081         (New.DoResolve): Update.
5082         (BaseAccess.CommonResolve): Update.
5083
5084 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5085
5086         Fix #72732.
5087         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5088         occured previously, don't resolve again.
5089
5090 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5091
5092         Fix #69949
5093         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5094         argument. Call ResolveAttributeUsage for unresolved.
5095         when types doesn't match ctor arguments.
5096         
5097         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5098         for nested attribute classes.
5099         (Class.attribute_usage): Removed.
5100         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5101         for attribute class.
5102         
5103         * ecore.cs (IsAttribute): Removed.
5104         
5105         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5106         
5107         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5108         now normal types.
5109         (attribute_types): Removed.
5110         (EmitCode): Global attributes are emited as the latest.
5111
5112 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5113
5114         * class.cs (EmitFieldInitializers): Don't emit field initializer
5115         for default values when optimilization is on.
5116         
5117         * constant.cs (Constant.IsDefaultValue): New property.
5118         
5119         * driver.cs: Add /optimize handling.
5120         
5121         * constant.cs,
5122         * ecore.cs,
5123         * literal.cs: Implement new IsDefaultValue property.
5124         
5125         * rootcontext.cs (Optimize): New field, holds /optimize option.
5126
5127 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5128
5129         Fix crasher in re-opened #72347.
5130         * namespace.cs (Namespace.Lookup): Return null if
5131         DeclSpace.DefineType returns null.
5132
5133         Fix #72678.
5134         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5135
5136 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5137
5138         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5139         now returns null if it cannot resolve to an lvalue.
5140         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5141         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5142         returned null.  Remove check for SimpleName.
5143         (EventExpr.DoResolveLValue): New.
5144         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5145         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5146         error from ...
5147         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5148         avoid CS0131 error.
5149         (Unary.ResolveOperator): Move CS0211 check ...
5150         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5151         CS0131 error.
5152         (Unary.DoResolveLValue): Simplify.
5153         (AddressOf.DoResolveLValue): New.
5154         (ArrayAccess.DoResolveLValue): New.
5155
5156 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5157
5158         * attribute.cs (Attribute.Resolve): Add arguments casting for
5159         when types doesn't match ctor arguments.
5160
5161 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5162
5163         Fix parts of #63202.
5164         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5165         lookup of operator in base type.  Ensure that all checks happen
5166         when the operator resolves to an "op_..." method.
5167
5168 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5169
5170         Fix #71992.
5171         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5172         'ignore_cs0104' parameter.  Pass it to ...
5173         (NamespaceEntry.Lookup): ... this.
5174         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5175         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5176         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5177         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5178         Update.  Request that cs0104 errors be ignored.
5179         (ComposedCast.ResolveAsTypeStep): Update.
5180
5181 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5182
5183         Fix #59209.
5184         * expression.cs (Invocation.BetterFunction): Remove support for
5185         comparing virtual functions and their overrides.
5186         (Invocation.IsOverride): New.
5187         (Invocation.OverloadResolve): Don't consider 'override' functions
5188         during candidate selection.  Store them in a lookaside list.
5189         If the selected method is a 'virtual' function, use the list to
5190         find any overrides that are closer to the LHS type.
5191
5192 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5193
5194         * expression.cs (New.DoResolve): Add complex core type reduction.
5195         (New.Constantify): Converts complex core type syntax like 'new int ()'
5196         to simple constant.
5197         
5198 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5199
5200         * decl.cs (EntryType.EntryType): New constructor to create an
5201         updated copy of a cache entry.
5202         (MemberCache.AddMethods): Use it.
5203         (MemberCache.ClearDeclaredOnly): Remove.
5204         (MemberCache.MemberCache): Update.
5205
5206 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5207
5208         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5209         variable.  This one is represents the actual low-level declaration
5210         of the method, as opposed to the semantic level `IsStatic'.   
5211
5212         An anonymous method which is hosted into a static method might be
5213         actually an instance method.  IsStatic would reflect the
5214         container, while MethodIsStatic represents the actual code
5215         generated.
5216
5217         * expression.cs (ParameterReference): Use the new MethodIsStatic
5218         instead of IsStatic.
5219
5220         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5221         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5222         set on the current EmitContext. 
5223
5224         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5225         resolve our casted expression as an LValue.  This triggers the
5226         proper LValue processing that is later required by Assign.
5227
5228         This fixes 72347.
5229
5230         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5231
5232 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5233
5234         C# 2.0 Fixed buffer implementation
5235
5236         * anonymous.cs: Update after RegisterHelperClass renaming.
5237
5238         * attribute.cs (AttributeTester.fixed_buffer_cache):
5239         Cache of external fixed buffers.
5240         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5241         implementation if field is fixed buffer else null.
5242
5243         * class.cs
5244         (TypeContainer.AddField): Accept FieldMember instead of Field.
5245         (FieldBase.IsFieldClsCompliant): Extracted code from
5246         VerifyClsCompliance descendant customization.
5247         (FixedField): New class handles fixed buffer fields.
5248         (FixedFieldExternal): Keeps information about imported fixed
5249         buffer.
5250         (IFixedField): Make access to internal or external fixed buffer
5251         same.
5252
5253         * cs-parser.jay: Add fixed buffer parsing.
5254
5255         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5256         buffer.
5257
5258         * expression.cs (Indirection): Extended implementation to accept
5259         fixed buffer field.
5260         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5261         (ElementAccess.MakePointerAccess): Get type as parameter.
5262         (DoResolve): Add fixed buffer field expression conversion.
5263         (DoResolveLValue): Ditto.
5264         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5265         (ArrayPtr): Derives from FixedBufferPtr.
5266         (ArrayPtr.Emit): Add extra emit for array elements.
5267
5268         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5269
5270         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5271         for compiler generated types.
5272         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5273
5274         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5275         and consume less memory.
5276         (Fixed.Resolve): Add fixed buffer case.
5277
5278         * typemanager.cs (compiler_generated_attr_ctor,
5279         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5280         (HasElementType): Add our own implementation to work on every
5281         runtime.
5282
5283 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5284
5285         * anonymous.cs (CaptureContext): Track whether `this' has been
5286         referenced.   
5287
5288         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5289         only captured `this' if it was implicitly done (instance
5290         methods/variables were used). 
5291
5292         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5293         `this' must be captured.
5294
5295 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5296  
5297         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5298         is null it means that there has been no need to capture anything,
5299         so we just create a sibling.
5300
5301         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5302
5303         Just a partial fix.  The other half is fairly elusive.
5304         
5305 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5306
5307         Fix #52586, cs0121-4.cs.
5308         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5309         and return a hashtable.
5310         (MemberCache.ClearDeclaredOnly): New.
5311         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5312         the method_hash of a base type too.
5313         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5314         type methods.  Overwrite entries with the same MethodHandle so
5315         that the ReflectedType is correct.  The process leaves in base
5316         virtual functions and their overrides as distinct entries.
5317         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5318         matters since it was boxed in a ArrayList before.
5319         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5320         modifier.
5321         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5322         case of a virtual function and its override (choose the overload
5323         as better).
5324         (Invocation.OverloadResolve): Avoid 'override' members during
5325         'applicable_type' calculation.
5326
5327 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5328
5329         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5330         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5331         GetTypeHandle.  It is possible for a reflected type to derive from
5332         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5333         System.Array during mscorlib compilation).
5334         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5335         contain a method_hash, don't create one either.  Don't create a
5336         deep copy of the base cache's method_hash.
5337         (MemberCache.SetupCache): Rename back from DeepCopy.
5338         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5339         already initialized.  If we see an override function, add its
5340         underlying base virtual function to the member_hash too.
5341
5342 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5343
5344         Combine two near-redundant caches.
5345         * typemanager.cs (method_params): Rename from method_internal_params.
5346         (TypeManager.GetParameterData): New.  Replace
5347         Invocation.GetParameterData.
5348         (TypeManager.LookupParametersByBuilder): Remove.
5349         * expression.cs (Invocation.method_parameter_cache): Remove.
5350         (Invocation.GetParameterData): Remove.
5351         Update to changes.
5352         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5353         Update to changes.
5354
5355 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5356
5357         Fix #72015.
5358         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5359         TypeManager.multicast_delegate_type is null, resolve it by looking
5360         up "System.MulticastDelegate".
5361         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5362
5363 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5364             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5365             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5366
5367         Fix cs0164.cs.
5368         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5369         (LabeledStatement.AddReference): New.  Set 'referenced'.
5370         (Goto.Resolve): Use it.
5371
5372 2005-02-05  John Luke  <john.luke@gmail.com>
5373
5374         * driver.cs: remove duplicate -doc line in Usage ()
5375
5376 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5377
5378         * location.cs (Location.AddFile): Fix CS2002 error report.
5379
5380 2005-02-02  Martin Baulig  <martin@ximian.com>
5381
5382         * delegate.cs (Delegate.DefineType): Report an internal error if
5383         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5384         details.        
5385
5386 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5387
5388         Fix a crasher in a variant of #31984.
5389         * const.cs (Constant.CheckBase): New override that defers the
5390         new-or-override check in case the base type hasn't been populated
5391         yet.
5392         (Constant.Define): Ensure the new-or-override check is performed.
5393
5394 2005-02-01  Duncan Mak  <duncan@ximian.com>
5395
5396         * const.cs (LookupConstantValue): Check that `ce' is not null
5397         before calling GetValue ().
5398
5399 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5400
5401         Fix test-334.cs (#69519).
5402         * cs-parser.jay (using_alias_directive): Pass in an expression to
5403         NamespaceEntry.UsingAlias.
5404         (using_namespace_directive): Pass in an expression to
5405         NamespaceEntry.Using.
5406         (namespace_name): Don't flatten to a string.
5407         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5408         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5409         ResolveAsTypeStep.
5410         (NamespaceEntry.UsingEntry): Likewise.
5411         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5412         changes.
5413         (NamespaceEntry.LookupForUsing): Remove.
5414         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5415         names.
5416         (NamespaceEntry.Lookup): Remove support for dotted names.
5417
5418 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5419
5420         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5421         split into two.
5422         (NamespaceEntry.ImplicitParent): Compute on demand.
5423         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5424         parallels the current.
5425         (NamespaceEntry.LookupForUsing): Use it.
5426         (NamespaceEntry.Lookup): If the current namespace-entry is
5427         implicit, don't search aliases and using tables.
5428
5429 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5430
5431         Fix #31984.
5432         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5433         BaseCache here.
5434         (TypeContainer.BaseCache): Compute on demand.
5435         (TypeContainer.FindMembers): Define constants and types if they're
5436         not already created.
5437         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5438         check.
5439         * const.cs (Constant.Define): Make idempotent.
5440
5441 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5442
5443         * pending.cs: Produce better code (no nops produced by using Ldarg
5444         + value).
5445         
5446         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5447         i - 1' it should be arg + 1.
5448
5449         Fixes bug #71819.
5450
5451 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5452
5453         * attribute.cs (Attribute.CheckAttributeType): Make private
5454         non-virtual.
5455         (Attribute.ResolveType): Make virtual.
5456         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5457         handling of RootContext.Tree.Types.
5458
5459 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5460
5461         Update attribute-handling to use the SimpleName/MemberAccess
5462         mechanisms.
5463         * cs-parser.jay (attribute): Pass in an expression to the
5464         constructors of Attribute and GlobalAttribute.
5465         * attribute.cs (Attribute): Take an expression for the name.
5466         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5467         passed in attribute name expression.
5468         (Attribute.CheckAttributeType): Use it.
5469         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5470         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5471         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5472         argument to prevent error messages if the lookup fails.
5473
5474 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5475
5476         * expression.cs (Indirection): Implemented IVariable interface
5477         to support indirection in AddressOf operator.
5478         (PointerArithmetic.Emit): Add optimalization for case where
5479         result can be precomputed.
5480
5481 2005-01-26  Martin Baulig  <martin@ximian.com>
5482
5483         * class.cs (TypeContainer.AttributeTargets): Return the correct
5484         AttributeTargets depending on our `Kind' instead of throwing an
5485         exception; fixes #71632.
5486
5487 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5488
5489         Fix #71257
5490         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5491         constant members.
5492
5493 2005-03-17  Martin Baulig  <martin@ximian.com>
5494
5495         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5496         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5497
5498 2005-03-17  Martin Baulig  <martin@ximian.com>
5499
5500         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5501         to bool so we can return an error condition.
5502         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5503         returned an error.
5504
5505 2005-03-17  Martin Baulig  <martin@ximian.com>
5506
5507         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5508
5509         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5510         converting from an array-type of T to `IEnumerable<T>'.
5511
5512 2005-03-16  Martin Baulig  <martin@ximian.com>
5513
5514         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5515         (Nullable.LiftedUnaryMutator): New public class.
5516
5517         * expression.cs (UnaryMutator.DoResolve): Added support for
5518         Nullable Types.
5519
5520 2005-03-14  Martin Baulig  <martin@ximian.com>
5521
5522         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5523
5524 2005-03-14  Martin Baulig  <martin@ximian.com>
5525
5526         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5527         the comparision operators `<', `>', `<=' and `>='.
5528
5529 2005-03-13  Martin Baulig  <martin@ximian.com>
5530
5531         * generic.cs
5532         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5533         avoid confusion with the `NullLiteral'.
5534         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5535
5536 2005-03-13  Martin Baulig  <martin@ximian.com>
5537
5538         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5539         comparing arbitrary types with the null literal.
5540
5541 2005-03-13  Martin Baulig  <martin@ximian.com>
5542
5543         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5544         boolean operators '&&', '||', '&' and '|'.
5545         (Nullable.OperatorTrueOrFalse): New public class.
5546
5547         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5548         instead of a `StaticCallExpr'; added support for nullables.
5549
5550 2005-03-10  Martin Baulig  <martin@ximian.com>
5551
5552         * expression.cs
5553         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5554         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5555
5556 2005-03-07  Martin Baulig  <martin@ximian.com>
5557
5558         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5559         it work if `expr' is not an IMemoryLocation.
5560         (Nullable.Lifted): Implement IMemoryLocation.
5561         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5562         target type.
5563
5564 2005-03-05  Martin Baulig  <martin@ximian.com>
5565
5566         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5567         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5568         (Nullable): Added support for lifted unary and binary operators.
5569
5570         * expression.cs (Unary.DoResolve): Added support for nullable types.
5571         (Binary.DoResolve): Likewise.
5572         (Conditional.DoResolve): Likewise.
5573
5574 2005-03-02  Martin Baulig  <martin@ximian.com>
5575
5576         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5577
5578         * class.cs (ClassPart.SetParameterInfo): Override this.
5579         (PartialContainer.SetParameterInfo): Override this.
5580         (TypeContainer.CheckConstraints): New protected method.
5581         (PartialContainer.CheckConstraints): Override this and check
5582         whether the same contraints were specified in all parts of a
5583         partial generic type definition.
5584         (PartialContainer.UpdateConstraints): New public method.
5585
5586         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5587
5588 2005-03-02  Martin Baulig  <martin@ximian.com>
5589
5590         Committing a patch from Carlos Alberto Cortez to fix #72887.
5591
5592         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5593         casts from `T []' to `int []'.
5594
5595 2005-03-02  Martin Baulig  <martin@ximian.com>
5596
5597         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5598
5599         * expression.cs (Binary.ResolveOperator): When resolving a
5600         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5601         `=='.  Fixes #71866.  See gen-127.cs.
5602
5603 2005-03-02  Martin Baulig  <martin@ximian.com>
5604
5605         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5606         static constructor in static classes.
5607
5608 2005-03-02  Martin Baulig  <martin@ximian.com>
5609
5610         * generic.cs
5611         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5612         (Nullable.LiftedConversion): Added support for user-defined
5613         conversions.
5614
5615         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5616
5617         * cs-parser.jay: Use ComposedCast everywhere instead of
5618         NullableType, so we don't need to check for NullableType
5619         everywhere.
5620         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5621         case where we'll be resolved into a `parenthesized_expression_0'
5622         afterwards.
5623
5624         * convert.cs
5625         (Convert.UserDefinedConversion): Added nullable conversions.
5626
5627 2005-02-28  Martin Baulig  <martin@ximian.com>
5628
5629         * generic.cs (TypeManager.IsNullableType): New static method.
5630         (Nullable): New abstract class.
5631         (Nullable.NullLiteral): New public class.
5632         (Nullable.LiftedConversion): New public class.
5633
5634         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5635         `builtin_types opt_nullable'.
5636
5637         * convert.cs
5638         (Convert.ImplicitConversionStandard): Added nullable conversions.
5639         (Convert.ExplicitConversionStandard): Likewise.
5640         (Convert.ExplicitConversion): Likewise.
5641
5642 2005-02-26  Martin Baulig  <martin@ximian.com>
5643
5644         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5645         begin with a "?", for instance "?[]".  Don't do a type lookup if
5646         `dim' is empty.
5647
5648 2005-02-25  Martin Baulig  <martin@ximian.com>
5649
5650         The first part of Nullable Types :-)
5651
5652         * generic.cs (NullableType): New public class.
5653         (NullCoalescingOperator): New public class.
5654         (TypeArguments.Resolve): Add a CS0306 check.
5655
5656         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5657         (opt_nullable): New rule.
5658         (type): Added `opt_nullable' to `namespace_or_type_name',
5659         `builtin_types' and `pointer_type'.
5660         (array_type): Added `opt_nullable'.
5661         (opt_rank_specifier_or_nullable): New rule; this is the
5662         combination of `opt_rank_specifier' and `opt_nullable'.
5663         (opt_error): New rule; catch errors here.
5664         (nullable_type_or_conditional): New rule; we use this to check for
5665         nullable and still detect the conditional operator.
5666         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5667         instead `opt_rank_specifier'.
5668
5669         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5670         for nullables.
5671
5672 2005-02-24  Martin Baulig  <martin@ximian.com>
5673
5674         * README, README.Changes: Removed; they're old and obsolete.
5675
5676 2005-02-22  Martin Baulig  <martin@ximian.com>
5677
5678         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5679         returned an error, set `constraints' to null to avoid a crash
5680         later on.
5681         (TypeParameter.ResolveType): Likewise.
5682
5683 2005-02-22  Martin Baulig  <martin@ximian.com>
5684
5685         * generic.cs
5686         (Constraints.ResolveTypes): Protect against being called twice.
5687         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5688         (TypeParameter.ResolveType): New public method; calls
5689         constraints.ResolveTypes().
5690         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5691         into the new ResolveType().
5692         (GenericMethod.Define): Call ResolveType() on all our
5693         TypeParameter's.        
5694
5695 2005-02-21  Martin Baulig  <martin@ximian.com>
5696
5697         * generic.cs
5698         (TypeManager.generic_nullable_type): New static public field.
5699         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5700
5701         * rootcontext.cs
5702         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5703
5704 2005-02-15  Martin Baulig  <martin@ximian.com>
5705
5706         * generic.cs (ConstructedType.Constraints): Correctly check
5707         constraints if the argument type is a type parameter; fixes
5708         #72326. 
5709
5710 2005-02-02  Martin Baulig  <martin@ximian.com>
5711
5712         * delegate.cs (Delegate.DefineType): Report an internal error if
5713         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5714         details.        
5715
5716 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5717
5718         * pending.cs: Produce better code (no nops produced by using Ldarg
5719         + value).
5720         
5721         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5722         i - 1' it should be arg + 1.
5723
5724         Fixes bug #71819.
5725         
5726 2005-01-26  Martin Baulig  <martin@ximian.com>
5727
5728         * cs-parser.jay (indexer_declarator): Don't report an error if we
5729         have type parameters since we can be an explicit interface
5730         implementation; fixes #71449.
5731
5732 2005-01-26  Martin Baulig  <martin@ximian.com>
5733
5734         * class.cs (TypeContainer.AttributeTargets): Return the correct
5735         AttributeTargets depending on our `Kind' instead of throwing an
5736         exception; fixes #71632.
5737
5738 2005-01-26  Martin Baulig  <martin@ximian.com>
5739
5740         * delegate.cs (Delegate.DefineType): Correctly define our type
5741         parameters.  Fixes #71483.
5742
5743 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5744
5745         Fix #71602.
5746         * expression.cs (MemberAccess.DoResolve): Don't complain with
5747         cs0572 when the LHS of a member access has identical name and type
5748         name.
5749
5750 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5751
5752         Fix #71651, #71675
5753         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5754         CreatePermission.
5755         Create custom PermissionSet only for PermissionSetAttribute.
5756
5757 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5758
5759         Fix #71649
5760         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5761         delegates in static class.
5762
5763 2005-01-24  Martin Baulig  <martin@ximian.com>
5764
5765         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5766         merging an implicit block, just use its reachability.
5767
5768         * statement.cs (Block.Resolve): Make the unreachable code check
5769         work wrt. implicit blocks; see test-337 from #63842.
5770
5771 2005-01-21  Alp Toker  <alp@atoker.com>
5772  
5773         * cs-parser.jay: destructor_declaration's container is PartialContainer
5774         not Class when partial types are used, so use Kind prop instead of
5775         'is'.
5776         
5777 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5778
5779         * cs-parser.jay: Improve error reporting when an interface
5780         declares new types.
5781
5782 2005-01-20  Dick Porter  <dick@ximian.com>
5783
5784         * support.cs: SeekableStreamReader fix from Sandor Dobos
5785         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5786         chars are read.  Fixes bug 70369.
5787
5788 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5789
5790         * cs-parser.jay (catch_clause): Simplify current_block handling
5791         somewhat.
5792
5793 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5794
5795         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5796         code with ImplicitStandardConversion to handle the implicit
5797         conversion of method groups into valid delegate invocations. 
5798
5799         The problem is that in parameter handling we were using this code
5800         path.  Fixes bug #64698
5801
5802 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5803
5804         * cs-parser.jay: Fix several infelicities.
5805         - Avoid assigning to the parser value stack.  Code like 
5806           '$3 = null' is unclean.  Synthesize a value for the code block
5807           instead. 
5808         - Avoid using oob_stack for storing location information.  Use ...
5809         (_mark_): ... this.  New (empty) rule.  Saves the current location
5810         in $$.
5811         (foreach_statement): Avoid using oob_stack for current_block
5812         handling.  Use technique used in for_statement and
5813         using_statement.  Synthesize a value for the code block to store
5814         additional intermediate information.
5815
5816 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5817
5818         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5819         of a different type is only allowed to private fields of a
5820         containing type, not on fields of a base class.
5821
5822         See test-174.cs and error cs0122-9.cs
5823
5824 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5825
5826         Fix test-335.cs (bug #58126).
5827         * cs-parser.jay (argument): Split out non-expression parts of the
5828         rule into 'non_simple_argument'.
5829         (invocation_expression): Support parenthesized invocations with
5830         multiple arguments, and with single non-simple arguments.
5831
5832 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5833
5834         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5835         places.
5836
5837 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5838
5839         Fix cs0038-1.cs, cs1640-6.cs.
5840         * ecore.cs (Expression.Resolve): Remove special-case for
5841         SimpleName in error-handling.
5842         (Expression.almostMatchedMembers): Relax access permission to
5843         protected.
5844         (Expression.MemberLookupFailed): Handle duplicates in
5845         almostMatchedMembers list.
5846         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5847         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5848         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5849         overload if the passed in MemberInfo is a MethodBase.
5850
5851 2005-01-25  Martin Baulig  <martin@ximian.com>
5852
5853         * doc.cs
5854         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5855
5856 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5857
5858         Fix #70749
5859         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5860         for non-CAS & merge permission sets properly.
5861
5862 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5863
5864         Improve standard-compliance of simple name and member access 
5865         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5866         * ecore.cs (FullNamedExpression): New abstract base class 
5867         for Namespaces and TypeExpressions.
5868         (ResolveFlags.SimpleName): Remove.
5869         (SimpleName): Remove support for dotted names.
5870         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5871         DeclSpace.FindType and DeclSpace.LookupType.
5872         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5873         (Expression.ExprClassName): Make member function.
5874         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5875         a namespace.  Remove creation of dotted "SimpleName"s.
5876         (MemberAccess.DoResolve): Likewise.
5877         * decl.cs (DeclSpace.Cache): Make private.
5878         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5879         (DeclSpace.FindType): Update.
5880         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5881         FullNamedExpression.
5882         * namespace.cs (Namespace): Derive from FullNamedExpression
5883         so that it can be part of expression resolution.
5884         (Namespace.Lookup): Return an FullNamedExpression.
5885         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5886         namespace.
5887         * rootcontext.cs (NamespaceLookup): Remove.
5888         (LookupType): Move to DeclSpace.
5889         * attribute.cs (CheckAttributeType): Update.
5890         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5891         (FindDocumentedTypeNonArray): Likewise.
5892
5893 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5894
5895         Fix cs0509.cs, cs1632.cs.
5896         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5897         is the same as IsInterface.
5898         (TypeContainer.GetClassBases): Likewise.
5899         * statement.cs (LabeledStatement.ig): New field.
5900         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5901         label.
5902         (LabeledStatement.DoEmit): Check that the label was created with
5903         the same ILGenerator.
5904
5905 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5906
5907         Fix #71058
5908         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5909         accessors to its properties.
5910
5911         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5912         from accessors to property.
5913         
5914 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5915
5916         Fix #70722
5917         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5918         only for overrides.
5919         
5920 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5921
5922         * attribute.cs: Check for null and empty strings.  
5923
5924         I have lost another battle to Paolo.
5925
5926 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5927
5928         Fix #70942
5929         * class.cs (PropertyMethod): Set Parent field in ctors.
5930         (SetMethod.InternalParameters): Add unsafe switch hack.
5931         Override MarkForDuplicationCheck where it is appropriate.
5932
5933         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5934         It says whether container allows members with the same name.
5935         Base default is no.
5936         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5937         Removed is_method parameter.
5938
5939 2005-01-06  Duncan Mak  <duncan@ximian.com>
5940
5941         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5942         because the previous change led to incorrect reporting of CS1032
5943         ("Cannot define/undefine preprocessor symbols after first token in
5944         file"). Instead of using `tokens_seen' as the only flag that
5945         triggers CS1040, introduce `comments_seen'. This new flag is used
5946         to signify having seen comments on the current line, so it is
5947         unset after a newline.
5948
5949 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5950
5951         * doc.cs : When searching for a type, find nested type too.
5952           This fixes bug #71040.
5953
5954 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5955
5956         * doc.cs :
5957           - Warn missing member comment on those classes which also does not
5958             have doc comments. Fixed bug #71041.
5959           - Don't warn missing doc comment on default constructor.
5960             Fixed bug #71042.
5961
5962 2005-01-06  Duncan Mak  <duncan@ximian.com>
5963
5964         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5965         comments, set `tokens_seen' to true. This allows us to detect
5966         misplaced preprocessor directives (i.e. not at the beginning of
5967         the a line, nor after whitespaces). In that case, report error
5968         CS1040. This fixes bug #56460.
5969
5970         * cs-parser.jay (interface_member_declaration): Add checks for
5971         IsExplicitImpl, and report CS0541 error if an interface member is
5972         defined as an explicit interface declaration.
5973
5974 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5975
5976         Fix #70817
5977         * class.cs (PropertyMethod): Set Parent field in ctors.
5978         (SetMethod.InternalParameters): Add unsafe switch hack.
5979         
5980         * decl.cs (MemberCore.Parent): Cannot be readonly.
5981
5982 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5983
5984         * decl.cs (DeclSpace.ResolveType): Remove.
5985         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5986         Merge in code from ...
5987         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5988         * class.cs, enum.cs: Update to changes.
5989
5990 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5991
5992         * anonymous.cs: Ensure that we init the scope of our parent if it
5993         has not been initialized yet.
5994
5995 2004-12-30  Duncan Mak  <duncan@ximian.com>
5996
5997         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5998         if field.FieldBuilder is null. Fixes #70758.
5999
6000         * convert.cs: Fixed some typos and updated some of the comments.
6001         (ImplicitStandardConversionExists):
6002         (TryImplicitIntConversion): If `target_type' is an interface and
6003         the type of `ic' implements this interface, return true or a new
6004         BoxedCast instead of null. This fixes #70468.
6005
6006 2004-12-29  Duncan Mak  <duncan@ximian.com>
6007
6008         * expression.cs (Argument.Emit): Check that Expr is
6009         IMemoryLocation before casting to it, and report CS1510 otherwise.
6010
6011         This fixes #70402.
6012
6013 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6014
6015         * statement.cs (Block.ThisVariable): remove the recursion here, to
6016         make the --profile more sane.
6017
6018 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6019
6020         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6021         assembly, by JB Evain.
6022
6023 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6024
6025         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6026           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6027         "parent" refers to enclosing type/class.  "base" refers to superclass.
6028
6029 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6030
6031         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6032         Ensure that we only have GlobalAttributes.
6033         * attribute.cs (Attribute.Emit): Make non-virtual.
6034         (GlobalAttribute.Emit): Remove.
6035         (Attribute.Resolve): Make virtual.
6036         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6037         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6038         the argument. Don't create one.
6039         (Attribute.GetObsoleteAttribute): Likewise.
6040         (Attribute.GetClsCompliantAttributeValue): Likewise.
6041         * class.cs, decl.cs: Update to changes.
6042
6043 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6044
6045         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6046         
6047         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6048         
6049         * statement.cs (Foreach.Resolve): Add error 186 report.
6050
6051 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6052
6053         * expression.cs (Conditional.DoResolve): Add warning 429.
6054         
6055         * statement.cs (If.Resolve): Add warning 665.
6056
6057 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6058
6059         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6060         except when in the parser, and in GlobalAttribute.
6061         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6062         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6063         RootContext.Tree.Types.NamespaceEntry once work is done.
6064         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6065         and resets RootContext.Tree.Types.NamespaceEntry.
6066
6067 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6068
6069         * cs-parser.jay: Don't create a block for every variable.
6070
6071 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6072
6073         * location.cs: Provide extra information.
6074
6075         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6076         variables from the captured environment, it is the ldarg_0.
6077
6078 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6079
6080         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6081         find a conclusion.
6082         
6083         * class.cs: Changed warning level for 169 to avoid developer
6084         displeasure from warning flooding. It will be changed back when they
6085         fix most of current BCL warnings.
6086         
6087         * RootContext.cs: Pushed default WarningLevel to 3.
6088         
6089         * statement.cs: Removed unused variable.
6090
6091 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6092
6093         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6094         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6095         Add error 502 report.
6096         (StaticClass.DefineType): Add error 441 report.
6097         (Class.AllowedModifiersProp): New virtual property as temporary
6098         extension to AllowedModifiers.
6099         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6100         to share implementation with StaticClass and don't call virtual
6101         methods from ctor.
6102         
6103         * driver.cs (MainDriver): Add error 1558 test.
6104
6105         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6106         report. Moved error 36 test here.
6107
6108         * statement.cs (Throw.Resolve): Add error 724 report.
6109
6110         * typemanager.cs: Add out_attribute_type core type.
6111         
6112 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6113
6114         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6115         3018 report.
6116         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6117
6118         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6119         3017 report.
6120         
6121         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6122
6123         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6124         Add error 3023 report.
6125         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6126
6127         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6128         implementation.
6129
6130 2004-12-12  John Luke  <john.luke@gmail.com>
6131
6132         * driver.cs (AddArgs): take -- into account when
6133         adding arguments, fixes bug 65710 
6134
6135 2004-12-12  Martin Baulig  <martin@ximian.com>
6136
6137         * expression.cs (Unary.TryReduceNegative): Added support for
6138         SByteConstant and ByteConstant.
6139         (Unary.Reduce): Check error values from TryReduceNegative().
6140
6141 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6142
6143         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6144         and report exception as error 182.
6145
6146 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6147
6148         * driver.cs (Main): Fix message when there are warnings.
6149
6150 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6151
6152         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6153
6154 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6155
6156         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6157         Reduced number of warnings.
6158         
6159         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6160
6161 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6162
6163         * driver.cs: Removed message.
6164
6165         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6166
6167 2004-12-08    <vargaz@freemail.hu>
6168
6169         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6170
6171 2004-12-08  Martin Baulig  <martin@ximian.com>
6172
6173         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6174         instead of a CS3002 for properties and indexer.
6175
6176 2004-12-08  Martin Baulig  <martin@ximian.com>
6177
6178         * decl.cs (MemberName.ToString): Make this work again.
6179
6180 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6181
6182         * attribute.cs (Resolve): Add error 591 detection.
6183
6184         * class.cs (FieldMember.Define): Add error 1547 detection.
6185         (Indexer.Define): Add error 620 detection.
6186         (Operator.Define): Add error 590 detection.
6187
6188         * ecore.cs: Missing argument for error 79.
6189
6190         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6191         detection.
6192
6193 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6194
6195         Fix #70106
6196         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6197         only.
6198
6199 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6200
6201         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6202           Some operator comments were suppressed.
6203         * doc.cs : Implicit/explicit operator name in doc comments are like
6204           "op_Explicit(type)~returnType", so added suffix handling.
6205
6206 2005-01-21  Alp Toker  <alp@atoker.com>
6207
6208         * cs-parser.jay: destructor_declaration's container is PartialContainer
6209         not Class when partial types are used, so use Kind prop instead of 'is'.
6210
6211 2004-12-12  Martin Baulig  <martin@ximian.com>
6212
6213         * expression.cs (Unary.TryReduceNegative): Added support for
6214         SByteConstant and ByteConstant.
6215         (Unary.Reduce): Check error values from TryReduceNegative().
6216
6217 2004-12-11  Martin Baulig  <martin@ximian.com>
6218
6219         * support.cs (ReflectionParameters.ParameterName): If we have a
6220         `gpd', call `ParameterName' on it.
6221
6222         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6223
6224         * pending.cs (PendingImplementation.DefineProxy): Call
6225         DefineParameter() for all of the MethodBuilder's arguments.
6226
6227 2004-12-09  Martin Baulig  <martin@ximian.com>
6228
6229         * doc.cs (DocUtil): Make this a static class.
6230
6231 2004-12-09  Martin Baulig  <martin@ximian.com>
6232
6233         * expression.cs (Invocation.InferType): Moved the type inference
6234         implementation into TypeManager.
6235
6236         * generics.cs (TypeManager): Moved the type inference
6237         implementation here.
6238
6239 2004-12-09  Martin Baulig  <martin@ximian.com>
6240
6241         * typemanager.cs (TypeManager): Make this a partial class.
6242
6243         * generics.cs
6244         (TypeManager): Move the generics part of `TypeManager' here.
6245
6246 2004-12-08  Martin Baulig  <martin@ximian.com>
6247
6248         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6249         instead of a CS3002 for properties and indexer.  Added CS3024
6250         check for generic interfaces.
6251
6252         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6253         instances are not CLS-compliant.
6254
6255 2004-12-08  Martin Baulig  <martin@ximian.com>
6256
6257         * cs-parser.jay
6258         (void_pointer_expression): New rule for `void*', `void**' etc.
6259         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6260
6261 2004-12-08  Martin Baulig  <martin@ximian.com>
6262
6263         * expression.cs (Invocation.InferType): Removed the hack for
6264         MethodCore.MayUnify().  
6265
6266         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6267         this actually work.
6268
6269         * class.cs (MethodCore.MayUnify): Use
6270         TypeManager.MayBecomeEqualGenericTypes().       
6271
6272 2004-12-08  Martin Baulig  <martin@ximian.com>
6273
6274         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6275         parameter, box it.  Fixes #69233.
6276
6277 2004-12-08  Martin Baulig  <martin@ximian.com>
6278
6279         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6280         have the ctor constraint.  Fixes #68326.
6281
6282 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6283
6284         * cs-parser.jay : interface comment was not consumed because of
6285           extra opt_semicolon before doc handling.
6286
6287 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6288
6289         Fix test-327.cs, test-328.cs, and put in early infrastructure
6290         for eventually fixing #52697.
6291         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6292         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6293         from other methods.
6294         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6295         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6296         (VerifyUsing, error246): Update.
6297         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6298         'NamespaceEntry.LookupNamespaceOrType'.
6299
6300 2004-12-07  Martin Baulig  <martin@ximian.com>
6301
6302         * driver.cs: Call it "BETA SOFTWARE" :-)
6303
6304 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6305
6306         Fix crash on cs0657-17.cs.
6307         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6308         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6309         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6310         the case where the NamespaceEntry gets overwritten.
6311
6312 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6313
6314         Fixed #69195, #56821
6315         * ecore.cs (ResolveBoolean): Tiny refactoring.
6316
6317         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6318         of right expression resolving when left is false constant and
6319         operator is LogicalAnd OR true constant and operator is LogicalOr.
6320
6321         * statement.cs (ResolveUnreachable): Always reports warning.
6322
6323 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6324
6325         * class.cs: Distinguish between 1721 and 1722 (just a little help
6326         for the programmer).
6327
6328 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6329
6330         * delegate.cs: Only allow this on new versions of the language. 
6331
6332 2004-12-02  Duncan Mak  <duncan@ximian.com>
6333
6334         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6335         Expression class.
6336         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6337         here as a static method. Take an additional bool out parameter
6338         `must_do_cs1540_check' for signaling to InstanceResolve.
6339         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6340         member field from PropertyExpr class and made it an argument of
6341         the method instead.
6342         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6343         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6344         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6345         and `remove_accessor' as well as InstanceResolve: report CS0122
6346         where applicable.
6347
6348         Fixes #70129.
6349
6350 2004-12-07  Martin Baulig  <martin@ximian.com>
6351
6352         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6353         and CS0692 where appropriate.
6354
6355 2004-12-06  Martin Baulig  <martin@ximian.com>
6356
6357         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6358         IsDuplicateImplementation() and improved it.
6359
6360         * expression.cs (Invocation.InferTypeArguments): Added
6361         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6362         and removed the "ref" modifier from `infered_types'.
6363
6364         * decl.cs (MemberName.ToString): Removed the exception.
6365
6366 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6367
6368         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6369           comments are allowed.
6370
6371 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6372
6373         * delegate.cs: Add checks for subtypes in paramaters and return values
6374         in VerifyMethod () to add support for Covariance/Contravariance
6375         in delegates.
6376         
6377 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6378
6379         * report.cs: Remove extra closing parenthesis.
6380
6381         * convert.cs (Error_CannotImplicitConversion): If the name of the
6382         types are the same, provide some extra information.
6383
6384 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6385
6386         Fix bug #70102
6387         * attribute.cs (Resolve): Improved implementation of params
6388         attribute arguments.
6389
6390         * support.cs (ParameterData): Add HasParams to be faster.
6391
6392 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6393
6394         all things are for /doc support:
6395
6396         * doc.cs: new file that supports XML documentation generation.
6397         * mcs.exe.sources: added doc.cs.
6398         * driver.cs:
6399           Handle /doc command line option.
6400           Report error 2006 instead of 5 for missing file name for /doc.
6401           Generate XML documentation when required, after type resolution.
6402         * cs-tokenizer.cs:
6403           Added support for picking up documentation (/// and /** ... */),
6404           including a new XmlCommentState enumeration.
6405         * cs-parser.jay:
6406           Added lines to fill Documentation element for field, constant,
6407           property, indexer, method, constructor, destructor, operator, event
6408           and class, struct, interface, delegate, enum.
6409           Added lines to warn incorrect comment.
6410         * rootcontext.cs :
6411           Added Documentation field (passed only when /doc was specified).
6412         * decl.cs:
6413           Added DocComment, DocCommentHeader, GenerateDocComment() and
6414           OnGenerateDocComment() and some supporting private members for
6415           /doc feature to MemberCore.
6416         * class.cs:
6417           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6418         * delegate.cs:
6419           Added overriden DocCommentHeader.
6420         * enum.cs:
6421           Added overriden DocCommentHeader and GenerateDocComment().
6422
6423 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6424
6425         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6426         unwrapping the enumeration values, chain to
6427         DoConstantNumericPromotions again, so we can promote things to the
6428         fundamental types (takes care of enums that are bytes, sbytes).
6429
6430         Fixes bug #62054.
6431
6432 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6433
6434         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6435         Fix long-standing bug in type-lookup.  Use FindType instead of
6436         LookupType when ec.ResolvingTypeTree.
6437         (Attribute.ResolveType, Attribute.Resolve)
6438         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6439         Update to changes.
6440         (Attributes.Search): Remove internal version.  Update.
6441         (Attributes.SearchMulti): Update.
6442         (Attributes.GetClsCompliantAttribute): Remove.
6443         (Attributes.GetIndexerNameAttribute): Remove.
6444         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6445         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6446         * class.cs (Indexer.Define): Likewise.
6447
6448 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6449
6450         Fix bug #68790
6451         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6452         MarshallByReference members access.
6453
6454         * expression.cs: Use CheckMarshallByRefAccess;
6455         Better error CS0197 message.
6456
6457         * report.cs: Print whole related error message.
6458
6459 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6460
6461         * class (GetClassBases): Better error 60 report.
6462         (EventProperty): Disabled warning 67 detection.
6463
6464 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6465
6466         Fix bug #60324
6467         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6468
6469         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6470         precise values.
6471
6472 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6473
6474         Fix bug #49488
6475         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6476
6477         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6478
6479 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6480
6481         * attribute.cs (Attribute.Resolve): Refine error reporting and
6482         report a cs0117 if the identifier does not exist, to distinguish
6483         from 0617 which is a miss-use of the actual identifier.
6484
6485         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6486         between cs0070 and cs0079.
6487
6488         * class.cs (MemberBase.DoDefine): When reporting a wrong
6489         accessibility level, we use MethodCore to compare instead of
6490         Method (this was a regression in some refactoring effort).
6491
6492         So now we correctly report cs0056 again.
6493
6494         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6495         testing the target_type (which was known to be object_type) and
6496         not the source type (which is anonymous_method).
6497
6498         Fixed reporting of error cs1660.
6499
6500         * expression.cs (UserCast.Source): Expose the underlying cast.
6501
6502         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6503         allowed types to find a match to int32 first (most common).
6504
6505         In addition, it ignores any ImplicitUserConversions that did an
6506         internal implicit conversion (as the switch statement allows only
6507         one integral conversion to exist).
6508
6509         * class.cs (PartialContainer.Create): rename `name' to
6510         `member_name' for clarity.  Then replace the string calls with a
6511         call to MemberName.GetPartialName, as now using
6512         MemberName.ToString is an error (this is due to the side effects
6513         it had, that were fixed in the past).
6514
6515         This will restore the error reporting on a number of partial class
6516         errors that were missusing this (and getting an exception as a
6517         results, which is now just a plain textual warning, because
6518         yyparse debug output would crash otherwise).
6519
6520 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6521
6522         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6523
6524 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6525
6526         * rootcontext.cs (LookupType): Make sure to cache lookups that
6527         don't give us a negative result. This saves about 5% of corlib
6528         compilation time.
6529
6530 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6531
6532         * report.cs (AbstractMessage.Print): messages are sent to stderr
6533
6534         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6535         non-interface in the list of interfaces (at this point, either
6536         parent was properly set, or a base class is being listed in the
6537         interfaces section).
6538
6539         This flags error 1722, and resolves the crash from bug 69259.
6540
6541 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6542
6543         * statement.cs (Using.EmitExpressionFinally): make this work right
6544         for valuetypes. Fixes 69926.
6545
6546 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6547
6548         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6549         converted to an enum" here, before we try to change the underlying
6550         type.  This code exists, but it is a different code path than the
6551         one used while encoding constants.
6552
6553         (ImplicitReferenceConversionExists): In addition, resynchronized
6554         the code here, so it matches the same code in
6555         ImplicitReferenceConversionExists for the `from any class-type S
6556         to any interface-type T'.       
6557
6558 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6559
6560         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6561
6562 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6563
6564         * cs-parser.jay: Use verbosity accordingly. 
6565
6566 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6567
6568         * expression.cs (Unary.ResolveOperator): Do not report warning;
6569         AddressOf reads from variable.
6570         
6571         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6572
6573 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6574
6575         Fix bug #69462
6576
6577         * attribute.cs (Attributable): Removed CheckTargets.
6578         (Attributes.Emit): Explicit attribute targets are tested here.
6579
6580         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6581         not enabled for interfaces.
6582
6583         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6584         (GetAssemblyName): Ouch next bug there.
6585
6586 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6587
6588         * expression.cs: Error 275 added.
6589         
6590 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6591
6592         Fix bug #69177 (Implemented decimal constant support)
6593
6594         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6595         (BinaryFold): Add DecimalConstant.
6596
6597         * const.cs (Define): Decimal constant 
6598         (is not constant.
6599         (ChangeType): Add decimal type handling.
6600         (LookupConstantValue): Don't set value for decimal type but
6601         emit DecimalConstantAttribute. Needed for constant optimization.
6602
6603         * constant.cs (ToDecimal): New method.
6604         (ConvertToDecimal): New method.
6605         (IntConstant): Implemented ConvertToDecimal.
6606         (DecimalConstant.Emit): Emit optimized version for decimals in
6607         int range.
6608
6609         * expression.cs (ResolveOperator): Changed order of constant
6610         reduction to work correctly with native types which have
6611         overloaded operators.
6612         (ResolveMemberAccess): Extract constant value from attribute
6613         for decimal type.
6614
6615         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6616
6617         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6618         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6619         (ChangeType): Decimal is special.
6620         (TypeToCoreType): Add decimal type.
6621
6622 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6623
6624         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6625         decimal types.
6626
6627 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6628
6629         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6630         test cs1667-5.cs.
6631
6632 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6633
6634         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6635
6636         * pending.cs (PendingImplementation): Grab only interfaces.
6637
6638 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6639
6640         * statement.cs (ForeachHelperMethods): Add location member and
6641         error 202 detection.
6642
6643 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6644
6645         * expression.cs (DoResolveBase): Fixed wrong warning for out
6646         variables.
6647
6648 2004-12-04  Martin Baulig  <martin@ximian.com>
6649
6650         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6651         to check whether the conversion is ok.
6652
6653         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6654         `Type.EmptyTypes' if we're not a generic TypeContainer.
6655
6656 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6657
6658         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6659         old bug: when converting from the null literal to a pointer,
6660         return an EmptyCast, not the NullLiteral.
6661
6662         This fixes #69921, the recent null_type changes probably made this
6663         bug more prominent.
6664
6665 2004-12-03  Martin Baulig  <martin@ximian.com>
6666
6667         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6668         method as our child, call AnonymousMethod.Compatible() on it.
6669
6670 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6671
6672         * class.cs (FieldBase): Use an unused bit field from the field to
6673         encode the `has_offset' property from the FieldMember.  This saves
6674         a couple of Ks on bootstrap compilation.
6675
6676         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6677         method as our child, return the AnonymousMethod resolved
6678         expression.
6679
6680         * expression.cs (New.DoResolve): Allow return values from
6681         NewDelegate to also include AnonymousMethods.
6682
6683         Fixes #70150.
6684
6685 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6686
6687         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6688         cs1648 report.
6689         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6690         System.Runtime.InteropServices._Exception, since it's a base
6691         interface of the core type System.Exception in the net_2_0 profile.
6692
6693 2004-11-27  Martin Baulig  <martin@ximian.com>
6694
6695         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6696
6697 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6698
6699         * Makefile: Convert to use executable.make.
6700         * gmcs.exe.sources: New.
6701
6702 2004-11-25  Martin Baulig  <martin@ximian.com>
6703
6704         * expression.cs (Invocation.InferType): Added support for byref types.
6705
6706 2004-11-25  Martin Baulig  <martin@ximian.com>
6707
6708         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6709         in TypeManager.TypeToCoreType().
6710
6711 2004-11-25  Martin Baulig  <martin@ximian.com>
6712
6713         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6714         "Dispose" method from the `current_type'.
6715         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6716         DoDefineMembers() instead of using the MethodBuilder; this is
6717         required for generic iterators.
6718
6719         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6720
6721 2004-11-24  Martin Baulig  <martin@ximian.com>
6722
6723         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6724
6725 2004-11-20  Martin Baulig  <martin@ximian.com>
6726
6727         * expression.cs (Invocation.InferType): Correctly infer generic
6728         instances; see gen-103.cs.
6729         (Invocation.InferTypeArguments): If a generic method doesn't have
6730         any unbound type parameters, we don't need to infer anything.
6731
6732 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6733
6734         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6735
6736 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6737
6738         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6739         (TypeHandle.GetMemberCache): New.
6740         (TypeHandle.TypeHandle): Update.
6741         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6742         (TypeManager.LookupParentInterfacesCache):
6743         Rename from LookupInterfaceCache.  Optimize slightly.
6744         (TypeManager.MemberLookup_FindMembers): Update.
6745         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6746         multi-type variant.
6747         (AddCacheContents): Rename from AddHashtable.
6748         * class.cs (TypeContainer.parent_container): Remove.
6749         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6750         (TypeContainer.DoDefineMembers): Don't initialize it.
6751         Update to name changes.
6752         
6753 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6754
6755         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6756         that factors the code to check access modifiers on override.  
6757
6758         (PropertyBase): Use the code here.
6759
6760         Patch from Lluis S'anchez, fixes bug #69361.
6761
6762 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6763
6764         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6765         routine that is used to report the use of a captured variable
6766         whose address has been taken.
6767
6768         There are two checks: one when variables are being captured and
6769         the other check is when the address of a variable is taken. 
6770         
6771         (because an anonymous methods might be resolved before *or* after
6772         the address has been taken) and 
6773
6774         * expression.cs (Conditional.DoResolve): Remove the special
6775         casing that Martin added to trueExpr and falseExpr being both
6776         NullLiteral.  We get the right behavior now just by introducing
6777         the null_type into the compiler. 
6778
6779         * convert.cs (ExplicitConversion): Change the code to use
6780         null_type instead of testing `expr is NullLiteral'.
6781         (ImplicitConversionStandard): use null_type too.
6782         (ImplicitReferenceConversionExists): use null_type too.
6783         (ImplicitReferenceConversion): use null_type too.
6784
6785         * literal.cs: The type of `NullLiteral' is now null_type instead
6786         of object_type. 
6787         (Resolve): Set the type here.
6788
6789         * typemanager.cs: Introduce null_type.
6790
6791 2004-11-18  Martin Baulig  <martin@ximian.com>
6792
6793         * rootcontext.cs
6794         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6795
6796 2004-11-18  Martin Baulig  <martin@ximian.com>
6797
6798         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6799
6800 2004-11-18  Martin Baulig  <martin@ximian.com>
6801
6802         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6803         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6804         call ResolveConstructedType() on it to resolve it without checking
6805         constraints.
6806         (Constraints.ResolveTypes): Check them here.
6807         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6808         but don't check constraints.
6809         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6810         check constraints here.
6811         (ConstructedType.ResolveConstructedType): New public method.  This
6812         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6813         resolve ourselves without checking constraints.
6814
6815         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6816
6817 2004-11-18  Martin Baulig  <martin@ximian.com>
6818
6819         * decl.cs
6820         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6821
6822         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6823
6824 2004-11-18  Martin Baulig  <martin@ximian.com>
6825
6826         * ecore.cs (TypeExpr.ResolveType): Removed.
6827         (Expression.ResolveAsTypeTerminal): We always return a fully
6828         resolved `TypeExpr', so we can just access its `Type'.
6829
6830         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6831
6832 2004-11-17  Martin Baulig  <martin@ximian.com>
6833
6834         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6835         sure we don't return any unresolved TypeExpr's.
6836         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6837         a `TypeExpr'.
6838         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6839
6840         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6841         unresolved `ConstructedType's.
6842
6843 2004-11-17  Martin Baulig  <martin@ximian.com>
6844
6845         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6846
6847 2004-11-17  Martin Baulig  <martin@ximian.com>
6848
6849         * ecore.cs
6850         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6851
6852         * decl.cs (DeclSpace.ResolveType): Removed.
6853         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6854
6855 2004-11-17  Martin Baulig  <martin@ximian.com>
6856
6857         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6858         direction, like FindMembers() does.  Fixes #69546, testcase is in
6859         test-315.cs.    
6860
6861 2004-11-16  Martin Baulig  <martin@ximian.com>
6862
6863         This is based on a patch from Marek Safar, see bug #69082.
6864         Fixes bugs #63705 and #67130.
6865
6866         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6867         method; create a MemberCache for an interface type and cache the
6868         result.
6869
6870         * decl.cs (IMemberContainer.ParentContainer): Removed.
6871         (IMemberContainer.ParentCache): New property.
6872         (MemberCache.SetupCacheForInterface): Removed.
6873         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6874         to create a cache for an interface's "parent".
6875
6876         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6877         interfaces too.
6878
6879 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6880
6881         * statement.cs: Avoid adding bools to a hashtable.
6882
6883 2004-11-15  Martin Baulig  <martin@ximian.com>
6884
6885         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6886
6887 2004-11-11  Martin Baulig  <martin@ximian.com>
6888
6889         * typemanager.cs (TypeManager.GetMethodName): New method.
6890
6891         * class.cs (MethodData.Define): Include the generic arity in the
6892         name of an explicit interface; also add it to the method name.
6893
6894         * pending.cs (PendingImplementation.InterfaceMethod): The method
6895         name now includes the generic arity.
6896
6897 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6898
6899         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6900         calling an unsafe method from a safe location.
6901
6902 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6903
6904         Fix #69167
6905         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6906
6907 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6908
6909         * namespace.cs (VerifyUsing): use GetPartialName instead of
6910         ToString. 
6911
6912 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6913
6914         * statement.cs (Return.Resolve): Fix regression in typo: if
6915         `in_exc', we have to request a NeedReturnLabel, this was a typo
6916         introduced in the anonymous method check-in.  Fixes #69131.
6917
6918         * Indexers were using the ShortName when defining themselves,
6919         causing a regression in the compiler bootstrap when applying the
6920         patch from 2004-11-02 (first part), now they use their full name
6921         and the bug is gone.
6922
6923 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6924
6925         * driver.cs: Strip the path from the names of embedded resources. Fixes
6926         #68519.
6927
6928 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6929
6930         Fix error message regression: cs0104-2.cs.
6931         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6932         (AliasEntry.Resolve): Update.
6933         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6934         'silent' flag.
6935         (RootContext.LookupType): Update.
6936
6937 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6938
6939         * cs-parser.jay: Add support for handling accessor modifiers
6940         * class: Add support port accessor modifiers and error checking,
6941         define PropertyMethod.Define as virtual (not abstract anymore)
6942         * ecore.cs: Add checking for proeprties access with access modifiers
6943         * iterators.cs: Modify Accessor constructor call based in the modified
6944         constructor
6945 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6946
6947         * expression.cs (StringConcat): Handle being called twice,
6948         as when we have a concat in a field init with more than two
6949         ctors in the class
6950
6951 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6952
6953         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6954         special case explicit implementations, we should always produce
6955         the .property or .event declaration.
6956         
6957         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6958         since it will not return correct data if people use this
6959         unresolved in the presence of using statements (see test-313).
6960
6961         * class.cs (MethodData.Define): If we are an explicit interface
6962         implementation, set the method name to the full name of the
6963         interface plus the name of the method.  
6964
6965         Notice that using the method.MethodName.GetFullName() does not
6966         work, as it will only contain the name as declared on the source
6967         file (it can be a shorthand in the presence of using statements)
6968         and not the fully qualifed type name, for example:
6969
6970         using System;
6971
6972         class D : ICloneable {
6973                 object ICloneable.Clone ()  {
6974                 }
6975         }
6976
6977         Would produce a method called `ICloneable.Clone' instead of
6978         `System.ICloneable.Clone'.
6979
6980         * namespace.cs (Alias.Resolve): Use GetPartialName.
6981         
6982 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6983
6984         * cs-parser.jay: Add error 1055 report.
6985
6986 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6987
6988         * assign.cs (Assign.DoResolve): Only do the transform of
6989         assignment into a New if the types are compatible, if not, fall
6990         through and let the implicit code deal with the errors and with
6991         the necessary conversions. 
6992
6993 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6994
6995         * cs-parser.jay: Add error 1031 report.
6996
6997         * cs-tokenizer.cs: Add location for error 1038.
6998
6999 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7000
7001         * cs-parser.jay: Add error 1016 report.
7002
7003 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7004
7005         * cs-parser.jay: Add errors 1575,1611 report.
7006
7007 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7008
7009         * cs-parser.jay: Add error 1001 report.
7010
7011 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7012
7013         Fix #68850
7014         * attribute.cs (GetMarshal): Add method argument for
7015         caller identification.
7016
7017         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7018         agument for GetMarshal and RuntimeMissingSupport.
7019
7020 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7021
7022         * attribute.cs (ExtractSecurityPermissionSet): Removed
7023         TypeManager.code_access_permission_type.
7024
7025         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7026
7027 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7028
7029         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7030         for obsolete use of a variable here.   Fixes regression on errors
7031         cs0619-25 and cs0619-26.
7032
7033 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7034
7035         Fix #62358, implemented security attribute encoding.
7036
7037         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7038         Tests permitted SecurityAction for assembly or other types.
7039         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7040         data from SecurityPermissionAttribute to PermisionSet class.
7041
7042         * class.cs (ApplyAttributeBuilder): Added special handling
7043         for System.Security.Permissions.SecurityAttribute based types.
7044
7045         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7046         special handling for System.Security.Permissions.SecurityAttribute
7047         based types.
7048
7049         * enum.cs (ApplyAttributeBuilder): Added special handling
7050         for System.Security.Permissions.SecurityAttribute based types.
7051
7052         * parameter.cs (ApplyAttributeBuilder): Added special handling
7053         for System.Security.Permissions.SecurityAttribute based types.
7054
7055         * rootcontext.cs: Next 2 core types.
7056
7057         * typemanager.cs (TypeManager.security_permission_attr_type):
7058         Built in type for the SecurityPermission Attribute.
7059         (code_access_permission_type): Build in type.
7060
7061 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7062
7063         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7064         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7065         all of this information into
7066         EmitContext.EmitCapturedVariableInstance.
7067         
7068         * codegen.cs (EmitCapturedVariableInstance): move here the
7069         funcionality of emitting an ldarg.0 in the presence of a
7070         remapping.   This centralizes the instance emit code.
7071
7072         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7073         then emit a load of this: it means that we have reached the
7074         topmost ScopeInfo: the one that contains the pointer to the
7075         instance of the class hosting the anonymous method.
7076
7077         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7078         captures to the topmost CaptureContext.
7079
7080 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7081
7082         * expression.cs (LocalVariableReference): Move the knowledge about
7083         the iterators into codegen's EmitCapturedVariableInstance.
7084
7085 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7086
7087         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7088         all code paths return a value from an anonymous method (it is the
7089         same as the 161 error, but for anonymous methods).
7090
7091 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7092
7093         The introduction of anonymous methods in the compiler changed
7094         various ways of doing things in the compiler.  The most
7095         significant one is the hard split between the resolution phase
7096         and the emission phases of the compiler.
7097
7098         For instance, routines that referenced local variables no
7099         longer can safely create temporary variables during the
7100         resolution phase: they must do so from the emission phase,
7101         since the variable might have been "captured", hence access to
7102         it can not be done with the local-variable operations from the runtime.
7103         
7104         * statement.cs 
7105
7106         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7107         is a toplevel block.
7108
7109         (ToplevelBlock): A new kind of Block, these are the blocks that
7110         are created by the parser for all toplevel method bodies.  These
7111         include methods, accessors and anonymous methods.
7112
7113         These contain some extra information not found in regular blocks:
7114         A pointer to an optional CaptureContext (for tracking captured
7115         local variables and parameters).  A pointer to the parent
7116         ToplevelBlock.
7117         
7118         (Return.Resolve): Catch missmatches when returning a value from an
7119         anonymous method (error 1662).
7120         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7121         phase.
7122
7123         (Break.Resolve): ditto.
7124
7125         (SwitchLabel): instead of defining the labels during the
7126         resolution phase, we now turned the public ILLabel and ILLabelCode
7127         labels into methods called GetILLabelCode() and GetILLabel() that
7128         only define the label during the Emit phase.
7129
7130         (GotoCase): Track the SwitchLabel instead of the computed label
7131         (its contained therein).  Emit the code by using
7132         SwitchLabel.GetILLabelCode ().
7133
7134         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7135         whether the Local has been captured or not.
7136
7137         (LocalInfo.IsCaptured): New property, used to tell whether the
7138         local has been captured.
7139         
7140         * anonymous.cs: Vastly updated to contain the anonymous method
7141         support.
7142
7143         The main classes here are: CaptureContext which tracks any
7144         captured information for a toplevel block and ScopeInfo used to
7145         track the activation frames for various local variables.   
7146
7147         Each toplevel block has an optional capture context associated
7148         with it.  When a method contains an anonymous method both the
7149         toplevel method and the anonymous method will create a capture
7150         context.   When variables or parameters are captured, they are
7151         recorded on the CaptureContext that owns them, for example:
7152
7153         void Demo () {
7154              int a;
7155              MyDelegate d = delegate {
7156                  a = 1;
7157              }
7158         }
7159
7160         Here `a' will be recorded as captured on the toplevel
7161         CapturedContext, the inner captured context will not have anything
7162         (it will only have data if local variables or parameters from it
7163         are captured in a nested anonymous method.
7164
7165         The ScopeInfo is used to track the activation frames for local
7166         variables, for example:
7167
7168         for (int i = 0; i < 10; i++)
7169                 for (int j = 0; j < 10; j++){
7170                    MyDelegate d = delegate {
7171                         call (i, j);
7172                    }
7173                 }
7174
7175         At runtime this captures a single captured variable `i', but it
7176         captures 10 different versions of the variable `j'.  The variable
7177         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7178         recorded on a child.  
7179
7180         The toplevel ScopeInfo will also track information like the `this'
7181         pointer if instance variables were referenced (this is necessary
7182         as the anonymous method lives inside a nested class in the host
7183         type of the method). 
7184
7185         (AnonymousMethod): Expanded to track the Toplevel, implement
7186         `AnonymousMethod.Compatible' to tell whether an anonymous method
7187         can be converted to a target delegate type. 
7188
7189         The routine now also produces the anonymous method content
7190
7191         (AnonymousDelegate): A helper class that derives from
7192         DelegateCreation, this is used to generate the code necessary to
7193         produce the delegate for the anonymous method that was created. 
7194
7195         * assign.cs: API adjustments for new changes in
7196         Convert.ImplicitStandardConversionExists.
7197
7198         * class.cs: Adjustments to cope with the fact that now toplevel
7199         blocks are of type `ToplevelBlock'. 
7200
7201         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7202         insteda of standard blocks.
7203
7204         Flag errors if params arguments are passed to anonymous methods.
7205
7206         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7207         `CurrentAnonymousMethod' which points to the current Anonymous
7208         Method.  The variable points to the AnonymousMethod class that
7209         holds the code being compiled.  It is set in the new EmitContext
7210         created for the anonymous method.
7211
7212         (EmitContext.Phase): Introduce a variable and an enumeration to
7213         assist in enforcing some rules about when and where we are allowed
7214         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7215         only one that enfonces this right now).
7216
7217         (EmitContext.HaveCaptureInfo): new helper method that returns
7218         whether we have a CapturedContext initialized.
7219
7220         (EmitContext.CaptureVariable): New method used to register that a
7221         LocalInfo must be flagged for capturing. 
7222
7223         (EmitContext.CapturedParameter): New method used to register that a
7224         parameters must be flagged for capturing. 
7225         
7226         (EmitContext.CapturedField): New method used to register that a
7227         field must be flagged for capturing. 
7228
7229         (EmitContext.HaveCapturedVariables,
7230         EmitContext.HaveCapturedFields): Return whether there are captured
7231         variables or fields. 
7232
7233         (EmitContext.EmitMethodHostInstance): This is used to emit the
7234         instance for the anonymous method.  The instance might be null
7235         (static methods), this (for anonymous methods that capture nothing
7236         and happen to live side-by-side with the current method body) or a
7237         more complicated expression if the method has a CaptureContext.
7238
7239         (EmitContext.EmitTopBlock): Routine that drives the emission of
7240         code: it will first resolve the top block, then emit any metadata
7241         and then emit the code.  The split is done so that we can extract
7242         any anonymous methods and flag any captured variables/parameters.
7243         
7244         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7245         during this phase, the ILGenerator should not be used as labels
7246         and local variables declared here might not be accessible to any
7247         code that is part of an anonymous method.  
7248
7249         Exceptions to this include the temporary variables that are
7250         created by some statements internally for holding temporary
7251         variables. 
7252         
7253         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7254         metadata for a cb
7255
7256         (EmitContext.TemporaryReturn): This method is typically called
7257         from the Emit phase, and its the only place where we allow the
7258         ReturnLabel to be defined other than the EmitMeta.  The reason is
7259         that otherwise we would have to duplicate a lot of logic in the
7260         Resolve phases of various methods that today is on the Emit
7261         phase. 
7262
7263         (EmitContext.NeedReturnLabel): This no longer creates the label,
7264         as the ILGenerator is not valid during the resolve phase.
7265
7266         (EmitContext.EmitThis): Extended the knowledge in this class to
7267         work in anonymous methods in addition to iterators. 
7268
7269         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7270         code is necessary on the stack to access the instance to a local
7271         variable (the variable will be accessed as a field).
7272
7273         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7274         EmitContext.EmitAddressOfParameter): Routines to support
7275         parameters (not completed at this point). 
7276         
7277         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7278         will also remove the parameters.
7279
7280         * convert.cs (Convert): Define a `ConstantEC' which points to a
7281         null.  This is just to prefity some code that uses
7282         ImplicitStandardConversion code and do not have an EmitContext
7283         handy.
7284
7285         The idea is to flag explicitly that at that point in time, it is
7286         known that the conversion will not trigger the delegate checking
7287         code in implicit conversions (which requires a valid
7288         EmitContext). 
7289
7290         Everywhere: pass new EmitContext parameter since
7291         ImplicitStandardConversionExists now requires it to check for
7292         anonymous method conversions. 
7293
7294         (Convert.ImplicitStandardConversionExists): If the type of an
7295         expression is the anonymous_method_type, and the type is a
7296         delegate, we invoke the AnonymousMethod.Compatible method to check
7297         whether an implicit conversion is possible. 
7298
7299         (Convert.ImplicitConversionStandard): Only do implicit method
7300         group conversions if the language level is not ISO_1.
7301
7302         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7303         MethodInfo for the Invoke method.  used by Delegate and
7304         AnonymousDelegate.
7305
7306         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7307         method conversions if the target type is a delegate.
7308
7309         Removed extra debugging nops.
7310
7311         (LocalVariableReference): Turn the `local_info' into a public
7312         field. 
7313
7314         Add `prepared' field, the same hack used for FieldExprs to cope
7315         with composed assignments, as Local variables do not necessarily
7316         operate purely on the stack as they used to: they can be captured
7317         fields. 
7318
7319         Add `temp' for a temporary result, like fields.
7320
7321         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7322
7323         It now copes with Local variables that are captured and emits the
7324         proper instance variable to load it from a field in the captured
7325         case. 
7326
7327         (ParameterReference.DoResolveBase): During the resolve phase,
7328         capture parameters if we are in an anonymous method.
7329
7330         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7331         anonymous method, use the EmitContext helper routines to emit the
7332         parameter reference.
7333
7334         * iterators.cs: Set RemapToProxy to true/false during the
7335         EmitDispose class.
7336
7337         * parameters.cs (GetParameterByName): New helper method. 
7338
7339         * typemanager.cs (anonymous_method_type) a new type that
7340         represents an anonyous method.  This is always an internal type,
7341         used as a fencepost to test against the anonymous-methodness of an
7342         expression. 
7343         
7344 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7345
7346         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7347         561 report.
7348         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7349
7350 2004-11-10  Martin Baulig  <martin@ximian.com>
7351
7352         * expression.cs (Invocation.BetterFunction): If two methods have
7353         equal parameter types, but only one of them is generic, the
7354         non-generic one wins.
7355         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7356         instance; just use `Type.IsValueType' to determine whether
7357         something is a struct or not.
7358         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7359         so we can be called multiple times.
7360
7361 2004-11-10  Martin Baulig  <martin@ximian.com>
7362
7363         * generic.cs (TypeParameter.DefineConstraints): New public method.
7364         (TypeParameter.CheckAccessLevel): Override this and return true.
7365         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7366         override ResolveType() anymore.
7367         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7368
7369 2004-11-10  Martin Baulig  <martin@ximian.com>
7370
7371         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7372         call DeclSpace.ResolveNestedType() on it.
7373
7374 2004-11-10  Martin Baulig  <martin@ximian.com>
7375
7376         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7377         non-null, call ParameterModifier() on it.
7378
7379 2004-11-10  Martin Baulig  <martin@ximian.com>
7380
7381         * iterators.cs
7382         (Iterators): Added `current_type' and `this_type' fields.
7383         (Iterators.DefineIterator): Create a new EmitContext and store it
7384         in `ec'; compute `this_type'.
7385
7386 2004-11-10  Martin Baulig  <martin@ximian.com>
7387
7388         * typemanager.cs
7389         (TypeManager.IsPrivateAccessible): New public method.
7390         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7391
7392 2004-11-10  Martin Baulig  <martin@ximian.com>
7393
7394         * class.cs (TypeContainer.DefineType): Call
7395         TypeBuilder.DefineGenericParameters() before resolving the type
7396         parameters.
7397         (MethodData.parent_method): New protected field.
7398         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7399         (MethodData.Define): Compute `parent_method'.
7400
7401         * decl.cs
7402         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7403         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7404         (DeclSpace.ec): New protected field; store the EmitContext here.
7405         (DeclSpace.EmitContext): New public property.
7406         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7407         (DeclSpace.ResolveNestedType): New public method.
7408         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7409         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7410         (DeclSpace.FamilyAccessible): Likewise.
7411         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7412         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7413         EmitContext.
7414
7415         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7416         field.
7417
7418         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7419         (Enum.Emit): Don't create a new EmitContext.
7420
7421 2004-10-18  Martin Baulig  <martin@ximian.com>
7422
7423         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7424         `Type' directly, but call ResolveType() on it.
7425         (Catch.Resolve): Likewise.
7426         (Foreach.Resolve): Likewise.
7427
7428 2004-10-18  Martin Baulig  <martin@ximian.com>
7429
7430         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7431         `Type' directly, but call ResolveType() on it.
7432         (Probe.DoResolve): Likewise.
7433         (ArrayCreation.LookupType): Likewise.
7434         (TypeOf.DoResolve): Likewise.
7435         (SizeOf.DoResolve): Likewise.
7436
7437 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7438
7439         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7440         the ResolveType.
7441
7442 2004-10-17  John Luke  <john.luke@gmail.com>
7443
7444         * class.cs (Operator.GetSignatureForError): use CSharpName
7445
7446         * parameter.cs (Parameter.GetSignatureForError): Returns
7447         correct name even if was not defined.
7448
7449 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7450
7451         Fix #65816.
7452         * class.cs (TypeContainer.EmitContext): New property.
7453         (DefineNestedTypes): Create an emitcontext for each part.
7454         (MethodCore.DoDefineParameters): Use container's emitcontext.
7455         Pass type array to InternalParameters.
7456         (MemberBase.DoDefine): Use container's emitcontext.
7457         (FieldMember.Define): Likewise.
7458         (Event.Define): Likewise.
7459         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7460         Pass type array to InternalParameters.
7461         (SetIndexerMethod.GetParameterInfo): Likewise.
7462         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7463         * delegate.cs (Define): Pass emitcontext to
7464         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7465         array to InternalParameters.
7466         * expression.cs (ParameterReference.DoResolveBase): Pass
7467         emitcontext to GetParameterInfo.
7468         (ComposedCast.DoResolveAsTypeStep): Remove check on
7469         ec.ResolvingTypeTree.
7470         * parameter.cs (Parameter.Resolve): Change argument to
7471         EmitContext.  Use ResolveAsTypeTerminal.
7472         (Parameter.GetSignature): Change argument to EmitContext.
7473         (Parameters.ComputeSignature): Likewise.
7474         (Parameters.ComputeParameterTypes): Likewise.
7475         (Parameters.GetParameterInfo): Likewise.
7476         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7477         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7478         * support.cs (InternalParameters..ctor): Remove variant that takes
7479         a DeclSpace.
7480         * typemanager.cs (system_intptr_expr): New.
7481         (InitExpressionTypes): Initialize it.
7482
7483 2004-10-12  Chris Toshok  <toshok@ximian.com>
7484
7485         * cs-parser.jay: fix location for try_statement and catch_clause.
7486
7487 2004-10-18  Martin Baulig  <martin@ximian.com>
7488
7489         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7490         `Type' directly, but call ResolveType() on it.
7491         (MemberBase.DoDefine): Likewise.
7492
7493         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7494         `Type' directly, but call ResolveType() on it.
7495         (ComposedCast.DoResolveAsTypeStep): Likewise.
7496
7497         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7498         `Type' directly, but call ResolveType() on it.
7499
7500 2004-10-17  John Luke  <john.luke@gmail.com>
7501
7502         * class.cs (Operator.GetSignatureForError): use CSharpName
7503
7504         * parameter.cs (Parameter.GetSignatureForError): Returns
7505         correct name even if was not defined.
7506
7507 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7508
7509         Fix #65816.
7510         * class.cs (TypeContainer.EmitContext): New property.
7511         (DefineNestedTypes): Create an emitcontext for each part.
7512         (MethodCore.DoDefineParameters): Use container's emitcontext.
7513         Pass type array to InternalParameters.
7514         (MemberBase.DoDefine): Use container's emitcontext.
7515         (FieldMember.Define): Likewise.
7516         (Event.Define): Likewise.
7517         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7518         Pass type array to InternalParameters.
7519         (SetIndexerMethod.GetParameterInfo): Likewise.
7520         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7521         * delegate.cs (Define): Pass emitcontext to
7522         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7523         array to InternalParameters.
7524         * expression.cs (ParameterReference.DoResolveBase): Pass
7525         emitcontext to GetParameterInfo.
7526         (ComposedCast.DoResolveAsTypeStep): Remove check on
7527         ec.ResolvingTypeTree.
7528         * parameter.cs (Parameter.Resolve): Change argument to
7529         EmitContext.  Use ResolveAsTypeTerminal.
7530         (Parameter.GetSignature): Change argument to EmitContext.
7531         (Parameters.ComputeSignature): Likewise.
7532         (Parameters.ComputeParameterTypes): Likewise.
7533         (Parameters.GetParameterInfo): Likewise.
7534         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7535         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7536         * support.cs (InternalParameters..ctor): Remove variant that takes
7537         a DeclSpace.
7538         * typemanager.cs (system_intptr_expr): New.
7539         (InitExpressionTypes): Initialize it.
7540
7541 2004-10-12  Chris Toshok  <toshok@ximian.com>
7542
7543         * cs-parser.jay: fix location for try_statement and catch_clause.
7544
7545 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7546
7547         More DeclSpace.ResolveType avoidance.
7548         * decl.cs (MemberCore.InUnsafe): New property.
7549         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7550         with newly created EmitContext.
7551         (FieldMember.Define): Likewise.
7552         * delegate.cs (Delegate.Define): Likewise.
7553         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7554         only if normal name-lookup fails.
7555         (TypeExpr.DoResolve): Enable error-checking.
7556         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7557         (SizeOf.DoResolve): Likewise.
7558         (ComposedCast.DoResolveAsTypeStep): Likewise.
7559         (StackAlloc.DoResolve): Likewise.
7560         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7561         (Block.Unsafe): New property.
7562         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7563         (Unsafe): Set 'unsafe' flag of contained block.
7564         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7565         (Fixed.Resolve): Likewise.
7566         (Catch.Resolve): Likewise.
7567         (Using.ResolveLocalVariableDecls): Likewise.
7568         (Foreach.Resolve): Likewise.
7569
7570 2004-10-05  John Luke <john.luke@gmail.com>
7571
7572         * cs-parser.jay: add location to error CS0175
7573
7574 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7575
7576         * ecore.cs (Expression.Constantity): Add support for turning null
7577         into a constant.
7578
7579         * const.cs (Const.Define): Allow constants to be reference types
7580         as long as the value is Null.
7581
7582 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7583
7584         * namespace.cs (NamespaceEntry.Using): No matter which warning
7585         level is set, check if this namespace name has already been added.
7586
7587 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7588
7589         * expression.cs: reftype [!=]= null should always use br[true,false].
7590         # 67410
7591
7592 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7593
7594         Fix #67108
7595         * attribute.cs: Enum conversion moved to 
7596         GetAttributeArgumentExpression to be applied to the all
7597         expressions.
7598
7599 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7600
7601         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7602         * class.c (TypeContainer.DefineType): Flag error if
7603         base types aren't accessible due to access permissions.
7604         * decl.cs (DeclSpace.ResolveType): Move logic to
7605         Expression.ResolveAsTypeTerminal.
7606         (DeclSpace.ResolveTypeExpr): Thin layer over
7607         Expression.ResolveAsTypeTerminal.
7608         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7609         Refactor code into NestedAccess.  Use it.
7610         (DeclSpace.NestedAccess): New.
7611         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7612         argument to silence errors.  Check access permissions.
7613         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7614         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7615         (Cast.DoResolve): Likewise.
7616         (New.DoResolve): Likewise.
7617         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7618         (TypeOf.DoResolve): Likewise.
7619
7620         * expression.cs (Invocation.BetterConversion): Return the Type of
7621         the better conversion.  Implement section 14.4.2.3 more faithfully.
7622         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7623         section 14.4.2.2 explicit.
7624         (Invocation.OverloadResolve): Update.
7625         (Invocation): Remove is_base field.
7626         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7627         (Invocation.Emit): Likewise.
7628
7629 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7630
7631         * cs-parser.jay: Reverted 642 warning fix.
7632
7633 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7634
7635         Fix bug #66615
7636         * decl.cs (FindMemberWithSameName): Indexer can have more than
7637         1 argument.
7638
7639 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7640
7641         * expression.cs (LocalVariableReference.DoResolveLValue):
7642         Do not report warning 219 for out values.
7643         (EmptyExpression.Null): New member to avoid extra allocations.
7644
7645 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7646
7647         * cs-parser.jay: Fix wrong warning 642 report.
7648
7649         * cs-tokenizer.cs (CheckNextToken): New helper;
7650         Inspect next character if is same as expected.
7651
7652 2004-09-23  Martin Baulig  <martin@ximian.com>
7653
7654         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7655         (Convert.ImplicitReferenceConversionExists): Likewise.
7656
7657 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7658
7659         * Makefile (DISTFILES): Comment out a few missing files.
7660
7661 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7662
7663         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7664         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7665         (gmcs.exe): Invoke bootstrap-libs.
7666         (clean-local): Clean the net_2_0_bootstrap profile too.
7667         (PROGRAM_INSTALL_DIR): New.
7668         (install-local): Use it.
7669
7670 2004-10-13  Martin Baulig  <martin@ximian.com>
7671
7672         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7673         (TypeParameter.DefineType): If we're a method type parameter and
7674         that method is overriding something, "inflate" its constraints.
7675
7676 2004-10-12  Martin Baulig  <martin@ximian.com>
7677
7678         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7679         and have type arguments, create and resolve a ConstructedType.
7680
7681 2004-10-12  Martin Baulig  <martin@ximian.com>
7682
7683         * decl.cs (MemberCache.FindMemberToOverride): Use
7684         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7685         to compare the invocationType.
7686
7687         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7688         When comparing two type parameters, only do the signature-only
7689         comparision for method type parameters.
7690
7691 2004-10-11  Martin Baulig  <martin@ximian.com>
7692
7693         * report.cs: Don't make --fatal abort on warnings, we have
7694         -warnaserror for that.
7695
7696 2004-10-11  Martin Baulig  <martin@ximian.com>
7697
7698         * typemanager.cs
7699         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7700         (TypeManager.IsEqual): Call ourself recursively instead of using
7701         Type.IsEqual(). 
7702
7703 2004-10-11  Martin Baulig  <martin@ximian.com>
7704
7705         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7706         on our own type parameters, not on the ones we inherit from a containing
7707         class.
7708
7709         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7710         the comparision.
7711
7712         * generic.cs (TypeParameter.Define): We may only be called once.
7713
7714         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7715         instead of TypeManager.IsEqual().
7716
7717 2004-09-28  Martin Baulig  <martin@ximian.com>
7718
7719         * generic.cs
7720         (GenericConstraints.EffectiveBaseClass): New public property.
7721         (TypeParameter.GenericConstraints): New public property.
7722         (ConstructedType.CheckConstraints): Improved.
7723
7724         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7725         (Convert.TypeParameterConversion): New private method; use this in
7726         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7727         for all conversions related to type parameters.
7728
7729 2004-09-24  Martin Baulig  <martin@ximian.com>
7730
7731         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7732         type parameter conversions for type parameters which are known to
7733         be reference types.
7734
7735 2004-09-24  Martin Baulig  <martin@ximian.com>
7736
7737         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7738         `IsValueType' properties.
7739
7740         * support.cs (ReflectionConstraints): Use
7741         Type.GetGenericParameterConstraints() instead of the old hack.
7742
7743 2004-09-24  Martin Baulig  <martin@ximian.com>
7744
7745         * generic.cs (GenericConstraints): Moved here and made it an
7746         abstract class.
7747
7748         * support.cs (GenericConstraints): Moved to generic.cs.
7749
7750 2004-09-24  Martin Baulig  <martin@ximian.com>
7751
7752         * support.cs
7753         (ReflectionConstraints): Un-nested this class and made it public.
7754
7755         * typemanager.cs
7756         (TypeManager.GetTypeParameterConstraints): New public method.
7757         (TypeManager.HasConstructorConstraint): Use the attributes.
7758
7759 2004-09-24  Martin Baulig  <martin@ximian.com>
7760
7761         * support.cs (GenericConstraints): Replaced `HasConstructor',
7762         `IsReferenceType' and `IsValueType' with `Attributes'.
7763         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7764         method and made the .ctor public.
7765
7766         * generic.cs (Constraints.Attributes): New public property.
7767         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7768         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7769         `IsValueType' -> `HasValueTypeConstraint'.
7770
7771 2004-09-23  Martin Baulig  <martin@ximian.com>
7772
7773         * generic.cs (Constraints): Reflect latest runtime changes.
7774
7775 2004-09-23  Martin Baulig  <martin@ximian.com>
7776
7777         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7778         (Convert.ImplicitReferenceConversionExists): Likewise.
7779
7780 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7781
7782         * class.cs (Operator.Define): Add error 448 and 559 report.
7783         
7784 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7785
7786         * class.cs (MemberBase.IsTypePermitted): New protected
7787         method for checking error CS0610.
7788
7789 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7790
7791         * class.cs (TypeContainer.HasExplicitLayout): New property
7792         Returns whether container has StructLayout attribute set Explicit.
7793         (FieldMember): New abstract class for consts and fields.
7794         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7795         (Field): Reuse FieldMember.
7796
7797         * const.cs (Const): Reuse FieldMember.
7798
7799         * rootcontext.cs: EmitConstants call moved to class.
7800
7801 2004-09-22  Martin Baulig  <martin@ximian.com>
7802
7803         Marek and me just fixed one of our oldest bugs: #28562 :-)
7804
7805         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7806
7807         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7808         we're an EnumConstant, just return that.
7809         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7810         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7811         to get the value which'll actually be written into the attribute.
7812         However, we have to use GetValue() to access the attribute's value
7813         in the compiler.        
7814
7815 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7816
7817         * constant.cs (Constant.IsNegative): New abstract property
7818         IsNegative.
7819
7820         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7821         (StackAlloc.DoResolve): Reused IsNegative.
7822
7823 2004-09-22  Martin Baulig  <martin@ximian.com>
7824
7825         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7826         public method; like LookupTypeContainer, but also works for
7827         generic instances.
7828
7829         * report.cs (Report.SymbolRelatedToPreviousError): Use
7830         TypeManager.LookupGenericTypeContainer().       
7831
7832 2004-09-22  Martin Baulig  <martin@ximian.com>
7833
7834         Thanks to Peter Sestoft for this bug report.
7835
7836         * expression.cs (Conditional): If both the `trueExpr' and the
7837         `falseExpr' is a NullLiteral, return a NullLiteral.
7838
7839 2004-09-22  Martin Baulig  <martin@ximian.com>
7840
7841         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7842         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7843         for the "get_Current" call.
7844
7845 2004-09-21  Martin Baulig  <martin@ximian.com>
7846
7847         * convert.cs (Convert.ImplicitReferenceConversion): When
7848         converting to an interface type, first check whether we're
7849         converting from a reference type.
7850
7851 2004-09-14  Martin Baulig  <martin@ximian.com>
7852
7853         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7854
7855 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7856
7857         Fixed bug #61902
7858         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7859         called and is obsolete then this member suppress message
7860         when call is inside next [Obsolete] method or type.
7861
7862         * expression.cs: Use TestObsoleteMethodUsage member.
7863
7864 2004-09-14  Martin Baulig  <martin@ximian.com>
7865
7866         * genericparser.cs: Removed.
7867
7868 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7869
7870         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7871
7872 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7873
7874         * attribute.cs (Attribute.Resolve): Add error 653 report.
7875
7876         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7877         report.
7878         (Method.ApplyAttributeBuilder): Add error 685 report.
7879         (Operator.Define): Add error 564 report.
7880
7881         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7882
7883         * expression.cs (Invocation.DoResolve): Add error
7884         245 and 250 report.
7885
7886         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7887         error 674 report.
7888
7889 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7890
7891         * class.cs (ConstructorInitializer.Resolve):
7892         Wrong error number (515->516).
7893
7894 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7895
7896         * class.cs (Indexer.Define): Add error 631 report.
7897
7898 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7899
7900         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7901
7902 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7903
7904         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7905
7906 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7907
7908         * cs-parser.jay: Added error CS0241 report.
7909
7910 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7911
7912         * cs-parser.jay (fixed_statement): Introduce a scope for the
7913         declaration in the 'fixed' statement.
7914
7915 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7916
7917         * cs-parser.jay: Added CS0230 error report.
7918
7919 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7920
7921         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7922
7923 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7924
7925         * expression.cs (Argument.Resolve): Added error CS0192 and
7926         CS0199 report.
7927
7928 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7929
7930         C# 2.0 #pragma warning feature
7931
7932         * cs-tokenizer.cs (PreProcessPragma): New method; 
7933         Handles #pragma directive.
7934
7935         * report.cs (WarningRegions): New class; Support
7936         class for #pragma warning directive. It tests whether
7937         warning is enabled for a given line.
7938
7939 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7940
7941         * const.cs: Add more descriptive error report, tahnks to
7942         Sebastien. 
7943
7944 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7947
7948 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7949
7950         * expression.cs: Apply patch from Ben: Remove dead code from
7951         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7952         as that code just threw an exception anwyays.
7953
7954         * const.cs: Remove the call to the turnintoconstant, for details
7955         see bug: #63144
7956         
7957         * literal.cs: The type of the null-literal is the null type;  So
7958         we use a placeholder type (literal.cs:System.Null, defined here)
7959         for it.
7960
7961         * expression.cs (Conditional.DoResolve): Remove some old code that
7962         is no longer needed, conversions have been fixed.
7963
7964         (ArrayCreationExpression.DoResolve): Return false if we fail to
7965         resolve the inner expression.
7966
7967 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7968
7969         Fix test-290.cs.
7970         * cs-parser.jay (delegate_declaration): Record a delegate
7971         declaration as a type declaration.
7972         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7973
7974 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7975
7976         * parameter.cs: Do not crash if the type can not be resolved. 
7977
7978         * expression.cs: Report errors with unsafe pointers, fixes #64896
7979
7980 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7981
7982         * expression.cs: Pointer arith always needs to do a conv.i
7983         if the operand is a long. fix 65320
7984
7985 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7986
7987         Fixed cs0619-37.cs, cs0619-38.cs
7988
7989         * enum.cs (GetObsoleteAttribute): Removed.
7990
7991         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7992         on Enum member is double staged. The first is tested member
7993         and then enum.
7994
7995 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7996
7997         Fixed #56986, #63631, #65231
7998
7999         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8000         adds member to name container.
8001         (TypeContainer.AddToTypeContainer): New method, adds type to
8002         name container.
8003         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8004         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8005         AddOperator): Simplified by reusing AddToMemberContainer.
8006         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8007         instead of field.
8008         (Method.CheckForDuplications): Fixed implementation to test all
8009         possibilities.
8010         (MemberBase): Detection whether member is explicit interface
8011         implementation is now in constructor.
8012         (MemberBase.UpdateMemberName): Handles IndexerName.
8013         (Accessor): Changed to keep also location information.
8014         (AbstractPropertyEventMethod): Is derived from MemberCore.
8015         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8016         will be emited or not.
8017         (PropertyBase.AreAccessorsDuplicateImplementation):
8018         Tests whether accessors are not in collision with some method.
8019         (Operator): Is derived from MethodCore to simplify common
8020         operations.
8021
8022         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8023         must be performed.
8024         (DeclSpace.AddToContainer): Adds the member to defined_names
8025         table. It tests for duplications and enclosing name conflicts.
8026
8027         * enum.cs (EnumMember): Clean up to reuse the base structures
8028
8029 2004-09-03  Martin Baulig  <martin@ximian.com>
8030
8031         Merged latest changes into gmcs.  Please keep this comment in
8032         here, it makes it easier for me to see what changed in MCS since
8033         the last time I merged.
8034
8035 2004-09-03  Martin Baulig  <martin@ximian.com>
8036
8037         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8038         into TypeContainer, to make partial classes work again.
8039
8040 2004-09-03  Martin Baulig  <martin@ximian.com>
8041
8042         * rootcontext.cs (RootContext.V2): Removed.
8043
8044 2004-03-23  Martin Baulig  <martin@ximian.com>
8045
8046         * expression.cs (Invocation.OverloadResolve): Added `bool
8047         may_fail' argument and use it instead of the Location.IsNull() hack.
8048
8049 2004-09-09  Martin Baulig  <martin@ximian.com>
8050
8051         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8052
8053 2004-09-09  Martin Baulig  <martin@ximian.com>
8054
8055         * generic.cs (TypeParameter.DefineType): Added support for
8056         explicit interface methods.
8057
8058 2004-09-09  Martin Baulig  <martin@ximian.com>
8059
8060         * README.Changes: New document.  Started to list important changes
8061         between MCS and GMCS here.
8062
8063 2004-09-08  Martin Baulig  <martin@ximian.com>
8064
8065         * class.cs
8066         (TypeContainer.CheckRecursiveDefinition): New protected method.
8067         (TypeContainer.DefineType): Move the CS0146 check into
8068         CheckRecursiveDefinition().     
8069
8070 2004-09-06  Martin Baulig  <martin@ximian.com>
8071
8072         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8073         types for the constructor constraint.
8074
8075 2004-09-03  Martin Baulig  <martin@ximian.com>
8076
8077         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8078         into TypeContainer, to make partial classes work again.
8079
8080 2004-09-03  Martin Baulig  <martin@ximian.com>
8081
8082         * rootcontext.cs (RootContext.V2): Removed.
8083
8084 2004-03-23  Martin Baulig  <martin@ximian.com>
8085
8086         * expression.cs (Invocation.OverloadResolve): Added `bool
8087         may_fail' argument and use it instead of the Location.IsNull() hack.
8088
8089 2004-09-03  Martin Baulig  <martin@ximian.com>
8090
8091         Merged latest changes into gmcs.  Please keep this comment in
8092         here, it makes it easier for me to see what changed in MCS since
8093         the last time I merged.
8094
8095 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8096
8097         Fix #61128.
8098         * expression.cs (BetterConversion): Don't allow either conversion 
8099         to be null.  Remove redundant implicit conversion test when 'q ==
8100         null' -- when this function is invoked, we already know that the
8101         implicit conversion exists.
8102         (BetterFunction): Assume that 'best' is non-null.  Remove
8103         redundant reimplementation of IsApplicable when 'best' is null.
8104         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8105         number of arguments.
8106         (IsAncestralType): Extract from OverloadResolve.
8107         (OverloadResolve): Make robust to the MethodGroupExpr being
8108         unsorted.  Implement all the logic of Section 14.5.5.1, and
8109         support overloading of methods from multiple applicable types.
8110         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8111
8112         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8113         (RealError, Warning): Append type of report to related symbol.
8114
8115 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8116
8117         * enum.cs: Fixed CLS-Compliance checks for enum members.
8118         Error tests cs3008-8.cs, cs3014-8.cs
8119
8120 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8121
8122         Fixed bug #62342, #63102
8123         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8124         like ImplementMethod.
8125
8126 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8127
8128         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8129         Fixed bug #65170.
8130
8131 2004-09-02  Martin Baulig  <martin@ximian.com>
8132
8133         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8134         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8135         on the MethodBase.
8136
8137 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8138
8139         C# 2.0 Static classes implemented
8140
8141         * class.cs (TypeContainer): instance_constructors,
8142         initialized_fields, initialized_static_fields,
8143         default_constructor, base_inteface_types are protected to be
8144         accessible from StaticClass.
8145         (TypeContainer.DefineDefaultConstructor): New virtual method
8146         for custom default constructor generating
8147         (StaticClass): New class to handle "Static classes" feature.
8148
8149         * cs-parser.jay: Handle static keyword on class like instance
8150         of StaticClass.
8151
8152         * driver.cs: Added "/langversion" command line switch with two
8153         options (iso-1, default).
8154
8155 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8156
8157         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8158
8159 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8160
8161         * delegate.cs: Style.
8162
8163 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8164
8165         * delegate.cs: Add seperate instance expr field for miguel.
8166
8167 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8168
8169         * PointerArithmetic (Resolve): make sure we are not doing
8170         pointer arith on void*. Also, make sure we are resolved
8171         by not setting eclass until resolve.
8172
8173         All callers: Make sure that PointerArithmetic gets resolved.
8174
8175 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8176
8177         * ArrayCreation (LookupType): If the type does not resolve 
8178         to an array, give an error.
8179
8180 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8181
8182         * statement.cs (Try.Resolve): Fixed bug #64222
8183
8184 2004-08-27  Martin Baulig  <martin@ximian.com>
8185
8186         * class.cs
8187         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8188         crash here.     
8189
8190 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8191
8192         * ecore.cs (Constantify): Get underlying type via
8193         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8194         Windows in special cases.
8195
8196 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8197
8198         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8199         for obtaining also private methods.
8200         (GetRemoveMethod): Used GetRemoveMethod (true)
8201         for obtaining also private methods.
8202
8203 2004-09-02  Martin Baulig  <martin@ximian.com>
8204
8205         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8206         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8207         on the MethodBase.
8208
8209 2004-08-27  Martin Baulig  <martin@ximian.com>
8210
8211         * class.cs
8212         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8213         crash here.     
8214
8215 2004-08-25  Martin Baulig  <martin@ximian.com>
8216
8217         * support.cs (ReflectionParameters..ctor): If this is a generic
8218         method, retrieve and store its type parameters.
8219         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8220         (ReflectionParameters.GenericConstraints): The argument specifies
8221         the type parameter, not the method parameter.
8222         (InternalParameters.GenericConstraints): Likewise.
8223
8224         * generic.cs (TypeParameter.DefineType): Correctly handle
8225         constraints wrt. generic methods in interfaces and their
8226         implementations.        
8227
8228 2004-08-24  Martin Baulig  <martin@ximian.com>
8229
8230         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8231         (Constraints.IsSubclassOf): New internal method.
8232
8233         * typemanager.cs (TypeManager.FindMembers): Added special support
8234         for GenericTypeParameterBuilder's.      
8235         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8236         type parameters.
8237
8238 2004-08-24  Martin Baulig  <martin@ximian.com>
8239
8240         * typemanager.cs
8241         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8242         this for accessibility checks.
8243         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8244         IsNestedFamilyAccessible.
8245         (TypeManager.IsSubclassOf): New method, do what the name actually
8246         says.   
8247
8248 2004-08-24  Martin Baulig  <martin@ximian.com>
8249
8250         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8251         as a SimpleName, include the generic arity.
8252
8253 2004-08-24  Martin Baulig  <martin@ximian.com>
8254
8255         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8256         MethodAttributes.HideBySig for operators.
8257
8258 2004-08-23  Martin Baulig  <martin@ximian.com>
8259
8260         Back to the old error reporting system :-)
8261
8262         * report.cs (Message): Removed.
8263         (Report.MessageData, ErrorData, WarningData): Removed.
8264         (Report.Error, Warning): Back to the old system.
8265
8266 2004-08-23  Martin Baulig  <martin@ximian.com>
8267
8268         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8269
8270         * class.cs (TypeContainer.ParentContainer): New public virtual
8271         method; replaces the explicit interface implementation.
8272         (ClassPart.ParentContainer): Override.
8273
8274 2004-08-23  Martin Baulig  <martin@ximian.com>
8275
8276         * statement.cs (Switch): Added support for constant switches; see
8277         #59428 or test-285.cs.
8278
8279 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8280
8281         Fixed bug #62740.
8282         * statement.cs (GetEnumeratorFilter): Removed useless
8283         logic because C# specs is strict. GetEnumerator must be
8284         public.
8285
8286 2004-08-22  Martin Baulig  <martin@ximian.com>
8287
8288         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8289         a switch and may break, reset the barrier.  Fixes #59867.
8290
8291 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8292
8293         CLS-Compliance speed up (~5% for corlib)
8294
8295         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8296         New method. Tests container for CLS-Compliant names
8297
8298         * class.cs (TypeContainer.VerifyClsName): New method.
8299         Checks whether container name is CLS Compliant.
8300         (Constructor): Implements IMethodData.
8301
8302         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8303         low-case table for CLS Compliance test.
8304         (MemberCache.VerifyClsParameterConflict): New method.
8305         Checks method parameters for CS3006 error.
8306
8307         * enum.cs (EnumMember): Is derived from MemberCore.
8308         (Enum.VerifyClsName): Optimized for better performance.
8309
8310 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8311
8312         * report.cs: Renamed Error_T to Error and changed all
8313         references.
8314
8315 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8316
8317         * class.cs (TypeContainer.IndexerArrayList): New inner class
8318         container for indexers.
8319         (TypeContainer.DefaultIndexerName): New constant for default
8320         indexer name. Replaced all "Item" with this constant.
8321         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8322
8323         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8324         DefaultMemberAttribute constructor.
8325
8326 2004-08-05  Martin Baulig  <martin@ximian.com>
8327
8328         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8329         Fix bug #59429.
8330
8331 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8332
8333         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8334         multi platforms problem.
8335
8336         * compiler.csproj: Included shared files.
8337
8338 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8339
8340         Fix bug 60333, 55971 in the more general way
8341         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8342         Added arg_type argument for constant conversion.
8343         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8344
8345 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8346
8347         Fix bug #59760
8348         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8349         OperatorArrayList, MethodCoreArrayList for typecontainer
8350         containers. Changed class member types to these new types.
8351         (MethodArrayList.DefineMembers): Added test for CS0659.
8352
8353 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8354
8355         * cfold.cs: Synchronize the folding with the code in expression.cs
8356         Binary.DoNumericPromotions for uint operands.
8357
8358         * attribute.cs: Revert patch from Raja, it introduced a regression
8359         while building Blam-1.2.1 (hard to isolate a test case).
8360
8361 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8362
8363         Fix for #55382
8364         * class.cs:
8365         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8366         name collision.
8367         (MethodCore.parent_method): New member. The method we're overriding
8368         if this is an override method.
8369         (MethodCore.CheckBase): Moved from Method class and made common.
8370         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8371         private.
8372         (MethodCore.CheckForDuplications): New abstract method. For custom
8373         member duplication search in a container
8374         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8375         method and its return type.
8376         (Event.conflict_symbol): New member. Symbol with same name in the
8377         parent class.
8378
8379         * decl.cs:
8380         (MemberCache.FindMemberWithSameName): New method. The method
8381         is looking for conflict with inherited symbols.
8382
8383 2004-08-04  Martin Baulig  <martin@ximian.com>
8384
8385         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8386
8387         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8388
8389 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8390
8391         * report.cs (Message): New enum for better error, warning reference in
8392         the code.
8393         (MessageData): New inner abstract class. It generally handles printing of
8394         error and warning messages.
8395         Removed unused Error, Warning, Message methods.
8396
8397 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8398
8399         Fix for cs0592-8.cs test
8400         * attribute.cs
8401         (Attributable.ValidAttributeTargets): Made public.
8402         (Attribute.ExplicitTarget): New member for explicit target value.
8403         (Attribute.CheckTargets): Now we translate explicit attribute
8404         target to Target here.
8405
8406 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8407
8408         * ecore.cs (MethodGroupExpr): new IsBase property.
8409
8410         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8411
8412         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8413         rather than an instance expr.
8414
8415         (DelegateCreation.Emit): Use the method group rather than
8416         the instance expression. Also, if you have base.Foo as the
8417         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8418
8419         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8420
8421         (NewDelegate.DoResolve): Only check for the existance of Invoke
8422         if the method is going to be needed. Use MethodGroupExpr.
8423
8424         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8425
8426         * expression.cs: For pointer arith., make sure to use
8427         the size of the type, not the size of the pointer to
8428         the type.
8429
8430 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8431
8432         Fix for #60722
8433         * class.cs (Class): Added error CS0502 test.
8434
8435 2004-08-03  John Luke  <jluke@cfl.rr.com>
8436             Raja R Harinath  <rharinath@novell.com>
8437
8438         Fix for #60997.
8439         * attribute.cs (Attribute.complained_before): New flag.
8440         (Attribute.ResolveType, Attribute.Resolve),
8441         (Attribute.DefinePInvokeMethod): Set it.
8442         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8443         
8444 2004-08-03  Martin Baulig  <martin@ximian.com>
8445
8446         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8447         use a user-defined operator; we still need to do numeric
8448         promotions in case one argument is a builtin type and the other
8449         one has an implicit conversion to that type.  Fixes #62322.
8450
8451 2004-08-18  Martin Baulig  <martin@ximian.com>
8452
8453         * class.cs (Method.Define): Use the correct method name when
8454         creating the MethodBuilder for a generic method.
8455
8456 2004-08-17  Martin Baulig  <martin@ximian.com>
8457
8458         * generic.cs (Constraints): Support type parameter constraints.
8459
8460 2004-08-16  Martin Baulig  <martin@ximian.com>
8461
8462         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8463         (Token.GENERIC_DIMENSION): New token; this is returned if we
8464         encounter an unbound generic type in a typeof() expression.
8465
8466         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8467         this token is only generated while parsing a typeof() expression.
8468         (typeof_expression): Removed the old unbound_type hack.
8469
8470         * generic.cs (TypeArguments.IsUnbound): New public property.
8471
8472         * decl.cs (MemberName): Added support for unbound types.
8473
8474 2004-08-14  Martin Baulig  <martin@ximian.com>
8475
8476         * typemanager.cs
8477         (TypeManager.IsEqualGenericInstance): New static method.
8478         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8479         just used to check accessibility, so follow the rules of 26.1.6.        
8480
8481         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8482         ConstructedType instead of a TypeExpression if we have type arguments.
8483
8484         * cs-parser.jay (typeof_expression): Support unbound generic types.
8485
8486         * ecore.cs (UnboundTypeExpression): New public class.
8487
8488 2004-08-12  Martin Baulig  <martin@ximian.com>
8489
8490         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8491         TypeManager.IsEqual() rather than `=='.
8492
8493         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8494         generic instances as well.
8495
8496 2004-08-12  Martin Baulig  <martin@ximian.com>
8497
8498         * expression.cs (Invocation.InferType): We can only infer method
8499         type parameters.  Fixes #62647.
8500
8501 2004-08-11  Martin Baulig  <martin@ximian.com>
8502
8503         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8504         before resolving the base classes.
8505
8506 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8507
8508         * Makefile: install .mdb file too.
8509
8510 2004-08-05  Martin Baulig  <martin@ximian.com>
8511
8512         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8513         initializer, the current type is just the TypeBuilder, not the
8514         instantiated generic type.
8515         (FieldExpr.IsFieldInitializer): New public property.
8516
8517 2004-08-04  Martin Baulig  <martin@ximian.com>
8518
8519         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8520
8521         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8522
8523 2004-08-03  Martin Baulig  <martin@ximian.com>
8524
8525         * class.cs (MethodData.Define): If we're an explicit
8526         implementation, remove the generic arity from the type name.
8527
8528 2004-08-03  Martin Baulig  <martin@ximian.com>
8529
8530         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8531         use a user-defined operator; we still need to do numeric
8532         promotions in case one argument is a builtin type and the other
8533         one has an implicit conversion to that type.  Fixes #62322.
8534
8535 2004-08-02  Martin Baulig  <martin@ximian.com>
8536
8537         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8538         `TypeExpr[]' array.
8539         (TypeContainer.GetClassBases): Return the unexpanded list of
8540         interfaces; we expand them later.
8541         (TypeContainer.DefineType): After creating the TypeBuilder, call
8542         TypeManager.ExpandInterfaces() to get an expanded and resolved
8543         list of interfaces.
8544
8545         * ecore.cs (TypeExpr.GetInterfaces): Removed
8546
8547         * generics.cs (Constraints.InterfaceConstraints): Remove.
8548         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8549         register the interface constraints.
8550
8551         * typemanager.cs
8552         (TypeManager.AddUserType): Removed the `ifaces' argument.
8553         (TypeManager.AddTypeParameter): Likewise.
8554         (TypeManager.AddUserInterface): Removed, was unused.
8555         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8556         `TypeExpr[]' array for the interfaces.
8557         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8558         has been defined, returns a list of the resolved interfaces types.
8559         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8560         (TypeManager.GetExplicitInterfaces): Likewise.  
8561
8562 2004-08-02  Martin Baulig  <martin@ximian.com>
8563
8564         * expression.cs (Invocation.EmitCall): If we're invoking a method
8565         on a type parameter, use the new `Constrained' prefix opcode.
8566
8567 2004-08-02  Martin Baulig  <martin@ximian.com>
8568
8569         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8570         (LocalInfo.IsThis): New public property.
8571         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8572
8573 2004-08-01  Martin Baulig  <martin@ximian.com>
8574
8575         * class.cs (TypeContainer.GetClassBases): Don't set the default
8576         here since we may get called from GetPartialBases().
8577         (TypeContainer.DefineType): If GetClassBases() didn't return a
8578         parent, use the default one.
8579
8580 2004-07-30  Martin Baulig  <martin@ximian.com>
8581
8582         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8583
8584         * class.cs (SourceMethod): New public class, derive from the
8585         symbol writer's ISourceMethod.
8586         (Method): Use the new symbol writer API.
8587
8588         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8589         as argument and use the new symbol writer.
8590
8591         * location.cs
8592         (SourceFile): Implement the symbol writer's ISourceFile.
8593         (Location.SymbolDocument): Removed.
8594         (Location.SourceFile): New public property.
8595
8596         * symbolwriter.cs: Use the new symbol writer API.
8597
8598 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8599
8600         * Makefile (install-local): Remove.  Functionality moved to
8601         executable.make.
8602
8603 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8604
8605         * Makefile: Install mcs.exe.config file together with mcs.exe.
8606         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8607         correct runtime version.
8608         
8609 2004-07-25  Martin Baulig  <martin@ximian.com>
8610
8611         * class.cs
8612         (TypeContainer.RegisterOrder): Removed, this was unused.
8613         (TypeContainer, interface_order): Removed.
8614         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8615         TypeContainer as argument since we can also be called with a
8616         `PartialContainer' for a partial class/struct/interface.
8617         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8618         of checking whether we're an `Interface' - we could be a
8619         `PartialContainer'.
8620         (PartialContainer.Register): Override; call
8621         AddClass()/AddStruct()/AddInterface() on our parent.
8622
8623         * cs-parser.jay (interface_member_declaration): Add things to the
8624         `current_container', not the `current_class'.
8625
8626         * rootcontext.cs (RegisterOrder): The overloaded version which
8627         takes an `Interface' was unused, removed.
8628
8629         * typemanager.cs (TypeManager.LookupInterface): Return a
8630         `TypeContainer', not an `Interface'.
8631         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8632         contain a `PartialContainer' for an interface, so check it's
8633         `Kind' to figure out what it is.
8634
8635 2004-07-25  Martin Baulig  <martin@ximian.com>
8636
8637         * class.cs (Class.DefaultTypeAttributes): New public constant.
8638         (Struct.DefaultTypeAttributes): Likewise.
8639         (Interface.DefaultTypeAttributes): Likewise.
8640         (PartialContainer.TypeAttr): Override this and add the
8641         DefaultTypeAttributes.
8642
8643 2004-07-25  Martin Baulig  <martin@ximian.com>
8644
8645         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8646         we can just use the `Parent' field instead.
8647
8648 2004-07-25  Martin Baulig  <martin@ximian.com>
8649
8650         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8651
8652 2004-07-25  Martin Baulig  <martin@ximian.com>
8653
8654         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8655         our parts before defining any methods.
8656         (TypeContainer.VerifyImplements): Make this virtual.
8657         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8658         on our PartialContainer.
8659
8660 2004-07-25  Martin Baulig  <martin@ximian.com>
8661
8662         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8663
8664         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8665         argument, we can just use the `Parent' field instead.
8666
8667         * class.cs
8668         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8669         (MemberBase.DoDefine): Likewise.
8670
8671 2004-07-24  Martin Baulig  <martin@ximian.com>
8672
8673         * decl.cs (MemberCore.Parent): New public field.
8674         (DeclSpace.Parent): Moved to MemberCore.
8675
8676         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8677         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8678         parent's .ctor.
8679         (FieldBase, Field, Operator): Likewise.
8680         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8681         (EventField, Event): Likewise.
8682
8683 2004-07-23  Martin Baulig  <martin@ximian.com>
8684
8685         * class.cs (PartialContainer): New public class.
8686         (ClassPart): New public class.
8687         (TypeContainer): Added support for partial classes.
8688         (TypeContainer.GetClassBases): Splitted some of the functionality
8689         out into GetNormalBases() and GetPartialBases().
8690
8691         * cs-tokenizer.cs (Token.PARTIAL): New token.
8692         (Tokenizer.consume_identifier): Added some hacks to recognize
8693         `partial', but only if it's immediately followed by `class',
8694         `struct' or `interface'.
8695
8696         * cs-parser.jay: Added support for partial clases.
8697
8698 2004-07-23  Martin Baulig  <martin@ximian.com>
8699
8700         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8701         a `DeclSpace' and also made it readonly.
8702         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8703         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8704         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8705
8706         * cs-parser.jay: Pass the `current_class', not the
8707         `current_container' (at the moment, this is still the same thing)
8708         to a new Method, Property, Event, Indexer or Constructor.
8709
8710 2004-07-23  Martin Baulig  <martin@ximian.com>
8711
8712         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8713         and removed the `current_interface' one.
8714         (struct_declaration, class_declaration, interface_declaration):
8715         Set `current_class' to the newly created class/struct/interface;
8716         set their `Bases' and call Register() before parsing their body.
8717
8718 2004-07-23  Martin Baulig  <martin@ximian.com>
8719
8720         * class.cs (Kind): New public enum.
8721         (TypeContainer): Made this class abstract.
8722         (TypeContainer.Kind): New public readonly field.
8723         (TypeContainer.CheckDef): New public method; moved here from
8724         cs-parser.jay.
8725         (TypeContainer.Register): New public abstract method.
8726         (TypeContainer.GetPendingImplementations): New public abstract
8727         method.
8728         (TypeContainer.GetClassBases): Removed the `is_class' and
8729         `is_iface' parameters.
8730         (TypeContainer.DefineNestedTypes): Formerly known as
8731         DoDefineType().
8732         (ClassOrStruct): Made this class abstract.
8733
8734         * tree.cs (RootTypes): New public type. 
8735
8736 2004-07-20  Martin Baulig  <martin@ximian.com>
8737
8738         * tree.cs (Tree.RecordNamespace): Removed.
8739         (Tree.Namespaces): Removed.
8740
8741         * rootcontext.cs (RootContext.IsNamespace): Removed.
8742
8743         * cs-parser.jay (namespace_declaration): Just create a new
8744         NamespaceEntry here.
8745
8746 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8747
8748         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8749         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8750         entry to make sure it runs in the correct runtime version.
8751         
8752 2004-07-18  Martin Baulig  <martin@ximian.com>
8753
8754         * generic.cs (ConstructedType.CheckConstraints): Improved
8755         constraints checking.
8756
8757 2004-07-18  Martin Baulig  <martin@ximian.com>
8758
8759         * expression.cs (Invocation.BetterMethod): Call
8760         TypeManager.TypeToCoreType() on all types and removed my previous
8761         hack; we're already doig the right thing here.
8762
8763 2004-07-17  Martin Baulig  <martin@ximian.com>
8764
8765         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8766
8767 2004-07-16  Martin Baulig  <martin@ximian.com>
8768
8769         * iterators.cs: Added generics support.
8770
8771 2004-07-16  Martin Baulig  <martin@ximian.com>
8772
8773         * iterators.cs: Rewrote this.  We're now using one single Proxy
8774         class for both the IEnumerable and the IEnumerator interface and
8775         `Iterator' derives from Class so we can use the high-level API.
8776
8777         * class.cs (TypeContainer.AddIterator): New method.
8778         (TypeContainer.DoDefineType): New protected virtual method, which
8779         is called from DefineType().
8780         (TypeContainer.DoDefineMembers): Call DefineType() and
8781         DefineMembers() on all our iterators.
8782         (TypeContainer.Emit): Call Emit() on all our iterators.
8783         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8784
8785         * codegen.cs (EmitContext.CurrentIterator): New public field.
8786
8787 2004-07-15  Martin Baulig  <martin@ximian.com>
8788
8789         * typemanager.cs
8790         (TypeManager.not_supported_exception_type): New type.   
8791
8792 2004-07-14  Martin Baulig  <martin@ximian.com>
8793
8794         * typemanager.cs
8795         (TypeManager.generic_ienumerable_type): New type.
8796         (TypeManager.generic_ienumerator_type): New type.
8797
8798         * rootcontext.cs
8799         (RootContext.interfaces_first_stage): Added
8800         "System.Collections.Generic.IEnumerator`1" and
8801         "System.Collections.Generic.IEnumerable`1".     
8802
8803 2004-07-14  Martin Baulig  <martin@ximian.com>
8804
8805         * iterators.cs: Use real error numbers.
8806
8807 2004-07-14  Martin Baulig  <martin@ximian.com>
8808
8809         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8810         requires this to be a System.Collection.IEnumerable and not a
8811         class implementing that interface.
8812         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8813
8814 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8815
8816         * class.cs: Fixed previous fix, it broke some error tests.
8817
8818 2004-07-12  Martin Baulig  <martin@ximian.com>
8819
8820         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8821         Fixes #61293.
8822
8823 2004-07-14  Martin Baulig  <martin@ximian.com>
8824
8825         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8826         an exclamation mark (!) for the generic arity to reflect the
8827         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8828
8829 2004-07-13  Martin Baulig  <martin@ximian.com>
8830
8831         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8832         specifiers being part of a type argument.
8833
8834 2004-07-13  Martin Baulig  <martin@ximian.com>
8835
8836         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8837         name for generic types.
8838
8839 2004-07-13  Martin Baulig  <martin@ximian.com>
8840
8841         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8842         bit to fix #60119.
8843
8844 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * assign.cs (LocalTemporary): Add new argument: is_address,If
8847         `is_address' is true, then the value that we store is the address
8848         to the real value, and not the value itself.
8849         
8850         * ecore.cs (PropertyExpr): use the new local temporary
8851         stuff to allow us to handle X.Y += z (where X is a struct)
8852
8853 2004-07-08  Martin Baulig  <martin@ximian.com>
8854
8855         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8856         not always return, just like we're doing in Using.Resolve().
8857
8858 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8859
8860         * cs-parser.jay (fixed_statement): flag this as Pinned.
8861
8862 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8863
8864         * typemanager.cs (TypeManager): Removed MakePinned method, this
8865         mechanism is replaced with the .NET 2.x compatible mechanism of
8866         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8867
8868         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8869         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8870         `IsFixed' property which has a different meaning.
8871
8872 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8873
8874         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8875         visible from inside a nested class, not just the names of the
8876         immediately enclosing class.
8877         Fix for bug #60730.
8878
8879 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8880
8881         * expression.cs (BetterConversion): Remove buggy special-case
8882         handling of "implicit constant expression conversions".  At this
8883         point, we already know that the conversion is possible -- we're
8884         only checking to see which is better.
8885
8886 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8887
8888         * cs-parser.jay: Added error CS0210 test.
8889
8890 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8891
8892         * cs-parser.jay: Added error CS0134 test.
8893
8894 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8895
8896         Fix bug #52507
8897         * cs-parser.jay: Added error CS0145 test.
8898
8899 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8900
8901         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8902
8903 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8904         
8905         * expression.cs (StackAlloc.Resolve): The argument may not
8906         be a constant; deal with this case.
8907         
8908 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8909
8910         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8911         GetIndexerAttributeValue.
8912         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8913
8914         * class.cs (Indexer.Define): Added error tests for CS0415,
8915         CS0609.
8916
8917 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8918
8919         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8920         property code.
8921
8922 2004-06-23  Martin Baulig  <martin@ximian.com>
8923
8924         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8925         neither return nor throw, reset the barrier as well.  Fixes #60457.
8926
8927 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8928
8929         * class.cs : EventAttributes is now set to None by default.
8930           This fixes bug #60459.
8931
8932 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8933
8934         Fix bug #60219
8935         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8936         Don't throw exception but return null (it's sufficient now).
8937
8938 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8939
8940         * typemanager.cs (GetArgumentTypes): Faster implementation.
8941
8942 2004-06-18  Martin Baulig  <martin@ximian.com>
8943
8944         * attribute.cs (Attribute.Resolve): Check whether we're an
8945         EmptyCast which a Constant child.  Fixes #60333.
8946
8947 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8948
8949         * statement.cs (EmitCollectionForeach): Account for the fact that
8950         not all valuetypes are in areas which we can take the address of.
8951         For these variables, we store to a temporary variable. Also, make
8952         sure that we dont emit a `callvirt' on a valuetype method.
8953
8954 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8955
8956         * expression.cs (StackAlloc.DoReSolve): Added test for
8957         negative parameter (CS0247).
8958
8959 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8960
8961         Fix bug #59792
8962         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8963
8964 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8965
8966         Fix bug #59781
8967         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8968         ulong.
8969
8970 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8971
8972         Fix bug #58254 & cs1555.cs, cs1556.cs
8973         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8974
8975 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8976
8977         * cs-parser.jay: Added error CS1669 test for indexers.
8978
8979 2004-06-18  Martin Baulig  <martin@ximian.com>
8980
8981         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8982         argument.  Fixes #60441.
8983
8984 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8985         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8986         The name needs to have the actual name of the method in order
8987         for other tests (such as the one in OverloadResolve for Invoke
8988         on a delegate) to work. As well, it does not really help
8989         error reporting because the method group had multiple methods.
8990         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8991         Make profiling work.
8992         
8993 2004-06-13  Martin Baulig  <martin@ximian.com>
8994
8995         * cs-parser.jay: Don't allow generic attributes.
8996
8997 2004-06-13  Martin Baulig  <martin@ximian.com>
8998
8999         * class.cs (MemberBase.DoDefineBase): New protected method.
9000         (MemberBase.DoDefine): Compute the `flags' in the new
9001         DoDefineBase() which must be called first.
9002         (Method.Define): Call DoDefineBase() first so we have the flags
9003         when defining the generic method.
9004
9005         * cs-parser.jay (interface_method_declaration): Support generic methods.
9006
9007 2004-06-13  Martin Baulig  <martin@ximian.com>
9008
9009         * decl.cs (TypeName): Removed.
9010         (MemberName): Removed TypeName and MemberNow; now we just have
9011         MemberName.
9012
9013         * cs-parser.jay: Don't distinguish between type arguments and type
9014         parameters in the grammar and simplified the rules a bit.  The
9015         reduce/reduce conflicts are now gone (except the one we inherited
9016         from mcs).
9017
9018 2004-06-11  Martin Baulig  <martin@ximian.com>
9019
9020         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9021         call this twice: for params and varargs methods.
9022
9023 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9024
9025         * class.cs:
9026         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9027
9028 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9029
9030         * attribute.cs (Attribute.GetValidTargets): Made public.
9031
9032         * class.cs: 
9033         (AbstractPropertyEventMethod): New class for better code sharing.
9034         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9035         CS1667 report.
9036         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9037
9038 2004-06-09  Martin Baulig  <martin@ximian.com>
9039
9040         * cs-parser.jay: Removed a reduce/reduce conflict.
9041
9042 2004-06-03  Martin Baulig  <martin@ximian.com>
9043
9044         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9045         GetSimpleName() and return a SimpleName.
9046
9047         * ecore.cs (SimpleName.Arguments): New public field.
9048         (SimpleName): Added overloaded ctor which takes an additional
9049         TypeArguments argument.
9050         (SimpleName.SimpleNameResolve): Added support for generic methods.
9051         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9052         formerly in MemberAccess.DoResolve(), but we also need it in
9053         SimpleNameResolve().
9054
9055         * expression.cs (MemberAccess.DoResolve): Use the new
9056         MethodGroupExpr.ResolveGeneric().       
9057
9058 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9059
9060         * decl.cs: If possible, use lookuptypedirect here. We can only do
9061         this if there is no `.' after the namespace. Avoids using
9062         LookupType, which does lots of slow processing.
9063         (FindNestedType) New method, does what it says :-).
9064         * namespace.cs: use LookupTypeDirect.
9065         * rootcontext.cs: use membercache, if possible.
9066         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9067
9068 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9069
9070         * expression.cs:
9071         According to the spec, 
9072
9073         In a member access of the form E.I, if E is a single identifier,
9074         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9075         field, property, localvariable, or parameter with the same type as
9076         the meaning of E as a type-name (§3.8), then both possible
9077         meanings of E are permitted.
9078
9079         We did not check that E as a simple-name had the same type as E as
9080         a type name.
9081
9082         This trivial check gives us 5-7% on bootstrap time.
9083
9084 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9085
9086         * expression.cs (Invocation.OverloadResolve): Avoid the
9087         use of hashtables and boxing here by allocating on demand.
9088
9089 2004-05-30  Martin Baulig  <martin@ximian.com>
9090
9091         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9092         we're doing a silent lookup.  Don't try to lookup nested types in
9093         TypeManager.object_type (thanks to Ben Maurer).
9094
9095 2004-05-30  Martin Baulig  <martin@ximian.com>
9096
9097         Committing a patch from Ben Maurer.
9098
9099         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9100
9101 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9102
9103         * convert.cs: add a trivial cache for overload operator resolution.
9104
9105 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9106
9107         * attribute.cs
9108         (AttributeTester.GetObsoleteAttribute): Returns instance of
9109         ObsoleteAttribute when type is obsolete.
9110
9111         * class.cs
9112         (TypeContainer.VerifyObsoleteAttribute): Override.
9113         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9114         (MethodCode.VerifyObsoleteAttribute): Override.
9115         (MemberBase.VerifyObsoleteAttribute): Override.
9116
9117         * decl.cs
9118         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9119         and report proper error.
9120
9121         *delegate.cs
9122         (Delegate.VerifyObsoleteAttribute): Override.
9123
9124         * ecore.cs
9125         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9126         and report proper error.
9127         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9128
9129         * enum.cs
9130         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9131         and enum member.
9132
9133         * expression.cs
9134         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9135         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9136         Added test for ObsoleteAttribute.
9137
9138         * statement.cs
9139         (Catch): Derived from Statement.
9140
9141 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9142
9143         * decl.cs: If possible, use lookuptypedirect here. We can only do
9144         this if there is no `.' after the namespace. Avoids using
9145         LookupType, which does lots of slow processing.
9146         (FindNestedType) New method, does what it says :-).
9147         * namespace.cs: use LookupTypeDirect.
9148         * rootcontext.cs: use membercache, if possible.
9149         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9150
9151 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9152
9153         * expression.cs:
9154         According to the spec, 
9155
9156         In a member access of the form E.I, if E is a single identifier,
9157         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9158         field, property, localvariable, or parameter with the same type as
9159         the meaning of E as a type-name (§3.8), then both possible
9160         meanings of E are permitted.
9161
9162         We did not check that E as a simple-name had the same type as E as
9163         a type name.
9164
9165         This trivial check gives us 5-7% on bootstrap time.
9166
9167 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9168
9169         Fixed bug #59071 & cs0160.cs
9170         * statement.cs (Try.Resolve): Check here whether order of catch
9171         clauses matches their dependencies.
9172
9173 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9174
9175         Fixed bug #58624
9176         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9177         unsafe type.
9178
9179 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9180
9181         * expression.cs (Invocation.OverloadResolve): Avoid the
9182         use of hashtables and boxing here by allocating on demand.
9183
9184 2004-05-30  Martin Baulig  <martin@ximian.com>
9185
9186         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9187         we're doing a silent lookup.  Don't try to lookup nested types in
9188         TypeManager.object_type (thanks to Ben Maurer).
9189
9190 2004-05-30  Martin Baulig  <martin@ximian.com>
9191
9192         Committing a patch from Ben Maurer.
9193
9194         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9195
9196 2004-05-29  Martin Baulig  <martin@ximian.com>
9197
9198         * class.cs (IMethodData.ShouldIgnore): New method.
9199
9200         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9201         `Location' argument, we don't need it anywhere.  Use
9202         `IMethodData.ShouldIgnore ()' instead of
9203         `MethodData.GetMethodFlags ()'.
9204         (TypeManager.AddMethod): Removed.
9205         (TypeManager.AddMethod2): Renamed to AddMethod.
9206
9207 2004-05-29  Martin Baulig  <martin@ximian.com>
9208
9209         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9210
9211         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9212         converting from a class type S to an interface type and we already
9213         have an object on the stack, don't box it again.  Fixes #52578.
9214
9215 2004-05-29  Martin Baulig  <martin@ximian.com>
9216
9217         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9218         Added support for `params' parameters.  Fixes #59267.
9219
9220 2004-05-29  Martin Baulig  <martin@ximian.com>
9221
9222         * literal.cs (NullPointer): Provide a private .ctor which sets
9223         `type' to TypeManager.object_type.  Fixes #59048.
9224
9225 2004-05-29  Martin Baulig  <martin@ximian.com>
9226
9227         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9228         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9229
9230         * ecore.cs (EventExpr.instance_expr): Make the field private.
9231
9232 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9233
9234         Fixed bug #50080 & cs0214-2.cs
9235         * expression.cs (Cast.DoResolve): Check unsafe context here.
9236         
9237         * statement.cs (Resolve.DoResolve): Likewise.
9238
9239 2004-05-26  Martin Baulig  <martin@ximian.com>
9240
9241         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9242
9243         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9244         (RootContext.LookupType): Pass down the `silent' flag.
9245
9246 2004-05-25  Martin Baulig  <martin@ximian.com>
9247
9248         * expression.cs
9249         (MethodGroupExpr.IdenticalTypeName): New public property.
9250         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9251         expression actually refers to a type.
9252
9253 2004-05-25  Martin Baulig  <martin@ximian.com>
9254
9255         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9256         for #56176 and made it actually work.
9257
9258 2004-05-25  Martin Baulig  <martin@ximian.com>
9259
9260         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9261         (FieldExpr, PropertyExpr): Override and implement
9262         CacheTemporaries.  Fixes #52279.
9263
9264 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9265
9266         * location.cs: In the new compiler listing a file twice is a
9267         warning, not an error.
9268
9269 2004-05-24  Martin Baulig  <martin@ximian.com>
9270
9271         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9272         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9273
9274 2004-05-24  Martin Baulig  <martin@ximian.com>
9275
9276         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9277         walking the `using' list.  Fixes #53921.
9278
9279 2004-05-24  Martin Baulig  <martin@ximian.com>
9280
9281         * const.cs (Const.LookupConstantValue): Added support for
9282         EmptyCast's; fixes #55251.
9283
9284 2004-05-24  Martin Baulig  <martin@ximian.com>
9285
9286         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9287         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9288         which does the CS0135 check.  The reason is that we first need to
9289         check whether the variable actually exists.
9290
9291 2004-05-24  Martin Baulig  <martin@ximian.com>
9292
9293         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9294         than RootContext.LookupType() to find the explicit interface
9295         type.  Fixes #58584.
9296
9297 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9298
9299         * Makefile: Simplify.  Use executable.make.
9300         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9301
9302 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9303
9304         * decl.cs:
9305         * enum.cs:
9306         Use the invariant culture when doing String.Compare for CLS case
9307         sensitivity.
9308         
9309 2004-05-23  Martin Baulig  <martin@ximian.com>
9310
9311         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9312         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9313
9314         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9315
9316 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9317
9318         * class.cs (MemberBase.Define): Reuse MemberType member for 
9319         resolved type. Other methods can use it too.
9320
9321 2004-05-23  Martin Baulig  <martin@ximian.com>
9322
9323         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9324         the variable also exists in the current block (otherwise, we need
9325         to report a CS0103).  Fixes #58670.
9326
9327 2004-05-23  Martin Baulig  <martin@ximian.com>
9328
9329         * flowanalysis.cs (Reachability.Reachable): Compute this
9330         on-the-fly rather than storing it as a field.
9331
9332 2004-05-23  Martin Baulig  <martin@ximian.com>
9333
9334         * flowanalysis.cs (Reachability.And): Manually compute the
9335         resulting `barrier' from the reachability.      
9336        
9337 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9338
9339         Fix bug #57835
9340         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9341         instance of ObsoleteAttribute when symbol is obsolete.
9342
9343         * class.cs
9344         (IMethodData): Extended interface for ObsoleteAttribute support.
9345
9346 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9347
9348         * attribute.cs: Fix bug #55970
9349
9350 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9351
9352         Fix bug #52705
9353         * attribute.cs
9354         (GetObsoleteAttribute): New method. Creates the instance of
9355         ObsoleteAttribute.
9356         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9357         ObsoleteAttribute when member is obsolete.
9358         (AttributeTester.Report_ObsoleteMessage): Common method for
9359         Obsolete error/warning reporting.
9360
9361         * class.cs
9362         (TypeContainer.base_classs_type): New member for storing parent type.
9363
9364         * decl.cs
9365         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9366         for this MemberCore.
9367
9368 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9369
9370         * attribute.cs, const.cs: Fix bug #58590
9371
9372 2004-05-21  Martin Baulig  <martin@ximian.com>
9373
9374         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9375         out parameters if the end of the method is unreachable.  Fixes
9376         #58098. 
9377
9378 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9379
9380         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9381         Hari was right, why extra method.
9382
9383 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9384
9385         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9386
9387 2004-05-20  Martin Baulig  <martin@ximian.com>
9388
9389         * delegate.cs: Convert this file to Unix mode - like the original
9390         version in mcs is.
9391
9392 2004-05-20  Martin Baulig  <martin@ximian.com>
9393
9394         * attribute.cs: Convert this file to Unix mode - like the original
9395         version in mcs is.
9396
9397 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9398
9399        Fix bug #58688 (MCS does not report error when the same attribute
9400        is assigned twice)
9401
9402        * attribute.cs (Attribute.Emit): Distinction between null and default.
9403
9404 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9405
9406        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9407        of a top-level attribute without an attribute target.
9408        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9409        Make non-static.
9410        (Attribute.Conditional_GetConditionName), 
9411        (Attribute.Obsolete_GetObsoleteMessage): Update.
9412        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9413        part of ScanForIndexerName.
9414        (Attribute.CanIgnoreInvalidAttribute): New function.
9415        (Attribute.ScanForIndexerName): Move to ...
9416        (Attributes.ScanForIndexerName): ... here.
9417        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9418        (Attributes.Search): New internal variant that can choose not to
9419        complain if types aren't resolved.  The original signature now
9420        complains.
9421        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9422        complaints suppressed.
9423        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9424        only if it not useful.
9425        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9426        top-level for attributes that are shared between the assembly
9427        and a top-level class.
9428        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9429        * class.cs: Update to reflect changes.
9430        (DefineIndexers): Fuse loops.
9431        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9432        a couple more variants of attribute names.
9433
9434 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9435
9436         Fix bug #52585 (Implemented explicit attribute declaration)
9437
9438         * attribute.cs:
9439         (Attributable.ValidAttributeTargets): New abstract method. It gets
9440         list of valid attribute targets for explicit target declaration.
9441         (Attribute.Target): It holds target itself.
9442         (AttributeSection): Removed.
9443         (Attribute.CheckTargets): New method. It checks whether attribute
9444         target is valid for the current element.
9445
9446         * class.cs:
9447         (EventProperty): New class. For events that are declared like
9448         property (with add and remove accessors).
9449         (EventField): New class. For events that are declared like field.
9450         class.cs
9451
9452         * cs-parser.jay: Implemented explicit attribute target declaration.
9453
9454         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9455         Override ValidAttributeTargets.
9456
9457         * parameter.cs:
9458         (ReturnParameter): Class for applying custom attributes on 
9459         the return type.
9460         (ParameterAtribute): New class. Class for applying custom
9461         attributes on the parameter type.
9462
9463 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9464
9465         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9466         definitions. 
9467
9468         (Method): Allow UNSAFE here.
9469
9470         * modifiers.cs: Support unsafe reporting.
9471
9472 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9473
9474         * decl.cs: Fix bug #58478.
9475
9476 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9477
9478         * statement.cs: When checking for unreachable code on an EmptyStatement,
9479         set the location. Fixes bug #58488.
9480
9481 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9482
9483         * driver.cs: Add -pkg handling.
9484
9485         From Gonzalo: UseShelLExecute=false
9486
9487 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9488
9489         * attribute.cs:
9490         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9491         for attribute.
9492         (Attribute.IsClsCompliaceRequired): Moved to base for better
9493         accesibility.
9494         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9495         when attribute is AttributeUsageAttribute.
9496         (Attribute.GetValidTargets): Simplified.
9497         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9498         attribute for this type.
9499         (Attribute.ApplyAttributes): Method renamed to Emit and make
9500         non-static.
9501         (GlobalAttributeSection): New class for special handling of global
9502         attributes (assembly, module).
9503         (AttributeSection.Emit): New method.
9504
9505         * class.cs: Implemented Attributable abstract methods.
9506         (MethodCore.LabelParameters): Moved to Parameter class.
9507         (Accessor): Is back simple class.
9508         (PropertyMethod): Implemented Attributable abstract class.
9509         (DelegateMethod): Implemented Attributable abstract class.
9510         (Event): New constructor for disctintion between normal Event
9511         and Event with accessors.
9512
9513         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9514
9515         * codegen.cs, const.cs, decl.cs, delegate.cs:
9516         (CommonAssemblyModulClass): Implemented Attributable abstract class
9517         and simplified.
9518
9519         * enum.cs: Implement IAttributeSupport interface.
9520         (EnumMember): New class for emum members. Implemented Attributable
9521         abstract class
9522
9523         * parameter.cs:
9524         (ParameterBase): Is abstract.
9525         (ReturnParameter): New class for easier [return:] attribute handling.
9526
9527         * typemanager.cs: Removed builder_to_attr.
9528
9529 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9530
9531         Fix bug #57151.
9532         * attribute.cs (Attribute.GetPositionalValue): New function.
9533         * class.cs (TypeContainer.VerifyMembers): New function.
9534         (TypeContainer.Emit): Use it.
9535         (ClassOrStruct): New base class for Class and Struct.
9536         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9537         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9538         class.
9539         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9540         then each non-static field should have a FieldOffset attribute.
9541         Otherwise, none of the fields should have a FieldOffset attribute.
9542         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9543         and FieldOffset attributes.
9544         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9545         (TypeManager.field_offset_attribute_type): New core types.
9546         (TypeManager.InitCoreTypes): Initialize them.
9547
9548 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9549
9550         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9551         Return correct type.
9552         From bug #58270.
9553
9554 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9555
9556         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9557         be implicitly converted to ulong.
9558         
9559         * expression.cs: The logic for allowing operator &, | and ^ worked
9560         was wrong, it worked before because we did not report an error in
9561         an else branch.  Fixes 57895.
9562
9563         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9564         allow volatile fields to be reference types.
9565
9566 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9567
9568         * driver.cs: Add support for /debug-
9569
9570 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9571
9572         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9573         Add a 'complain' parameter to silence errors.
9574         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9575         silently overlooked type-resolutions.
9576         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9577         to reflect changes.
9578         (Attributes.Search): New function.
9579         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9580         (Attributes.GetAttributeFullName): Remove hack.
9581         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9582         Update to reflect changes.
9583         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9584         Use Attributes.Search instead of nested loops.
9585
9586 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9587
9588         * decl.cs:
9589         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9590         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9591         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9592
9593         * report.cs: (Report.Warning): Renamed to Warning_T because of
9594         parameter collision.
9595
9596 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9597
9598         * expression.cs (MemberAccess.ResolveMemberAccess):
9599         Exit with non-zero status after Report.Error.
9600         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9601         Likewise.
9602         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9603
9604 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9605
9606         * support.cs: Don't hang when the file is empty.
9607
9608 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9609
9610         * support.cs: In SeekableStreamReader, compute the preamble size of the
9611           underlying stream. Position changes should take into account that initial
9612           count of bytes.
9613
9614 2004-05-03  Todd Berman  <tberman@sevenl.net>
9615
9616         * driver.cs: remove unused GetSysVersion function.
9617
9618 2004-05-03  Todd Berman  <tberman@sevenl.net>
9619
9620         * driver.cs: Remove the hack from saturday, as well as the hack
9621         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9622         link_paths to get that bit proper.
9623
9624 2004-05-01  Todd Berman  <tberman@sevenl.net>
9625
9626         * driver.cs: Try a LoadFrom before a Load, this checks the current
9627         path. This is currently a bug in mono that is be fixed, however, this
9628         provides a workaround for now. This will be removed when the bug
9629         is fixed.
9630
9631 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9632
9633         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9634         incomplete key pairs (#57941).
9635
9636 2004-05-01  Todd Berman  <tberman@sevenl.net>
9637
9638         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9639         from the GAC
9640
9641 2004-04-30  Jackson Harper  <jackson@ximian.com>
9642
9643         * codegen.cs: Open keys readonly.
9644         
9645 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9646
9647         * typemanager.cs: don't report cyclic struct layout when a struct
9648         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9649         which has 2 Pango.Rectangle fields.
9650
9651 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9652
9653         * expression.cs: Handle IntPtr comparisons with IL code
9654         rather than a method call.
9655
9656 2004-04-29  Martin Baulig  <martin@ximian.com>
9657
9658         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9659         the list of PropertyInfo's in class hierarchy and find the
9660         accessor.  Fixes #56013.
9661
9662 2004-04-29  Martin Baulig  <martin@ximian.com>
9663
9664         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9665
9666 2004-04-29  Martin Baulig  <martin@ximian.com>
9667
9668         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9669
9670         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9671
9672 2004-04-29  Martin Baulig  <martin@ximian.com>
9673
9674         * class.cs (ConstructorInitializer.Resolve): Check whether the
9675         parent .ctor is accessible.  Fixes #52146.
9676
9677 2004-04-29  Martin Baulig  <martin@ximian.com>
9678
9679         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9680
9681         * statement.cs (Using.EmitLocalVariableDecls): Use
9682         TypeManager.idisposable_type, not typeof (IDisposable).
9683         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9684
9685 2004-04-29  Martin Baulig  <martin@ximian.com>
9686
9687         * class.cs (Event.Define): Don't emit the field and don't set
9688         RTSpecialName and SpecialName for events on interfaces.  Fixes
9689         #57703. 
9690
9691 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9692
9693         Refactor Attribute.ApplyAttributes.
9694         * attribute.cs (Attributable): New base class for objects that can
9695         have Attributes applied on them.
9696         (Attribute): Make AttributeUsage fields public.
9697         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9698         (Attribute.IsInternalCall): New property.
9699         (Attribute.UsageAttr): Convert to a public read-only property.
9700         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9701         (Attribute.ResolveType, Attribute.Resolve)
9702         (Attribute.ScanForIndexerName): Update to reflect changes.
9703         (Attribute.CheckAttributeTarget): Re-format.
9704         (Attribute.ApplyAttributes): Refactor, to various
9705         Attributable.ApplyAttributeBuilder methods.
9706         * decl.cs (MemberCore): Make Attributable.
9707         * class.cs (Accessor): Make Attributable.
9708         (MethodData.ApplyAttributes): Use proper attribute types, not
9709         attribute names.
9710         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9711         (TypeContainer.ApplyAttributeBuilder)
9712         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9713         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9714         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9715         (Operator.ApplyAttributeBuilder): New factored-out methods.
9716         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9717         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9718         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9719         * parameter.cs (ParameterBase): New Attributable base class
9720         that can also represent Return types.
9721         (Parameter): Update to the changes.
9722
9723 2004-04-29  Jackson Harper  <jackson@ximian.com>
9724
9725         * driver.cs: Prefer the corlib system version when looking for
9726         assemblies in the GAC. This is still a hack, but its a better hack
9727         now.
9728         
9729 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9730
9731         * decl.cs, enum.cs: Improved error 3005 reporting.
9732   
9733         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9734         (related_symbols): New private member for list of symbols
9735         related to reported error/warning.
9736         
9737         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9738
9739 2004-04-29  Martin Baulig  <martin@ximian.com>
9740
9741         * ecore.cs (Expression.Constantify): If we're an enum and
9742         TypeManager.TypeToCoreType() doesn't give us another type, use
9743         t.UnderlyingSystemType.  Fixes #56178.  
9744
9745 2004-04-29  Martin Baulig  <martin@ximian.com>
9746
9747         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9748         interfaces and for each interface, only add members directly
9749         declared in that interface.  Fixes #53255.
9750
9751 2004-04-28  Martin Baulig  <martin@ximian.com>
9752
9753         * expression.cs (ConditionalLogicalOperator): Use a temporary
9754         variable for `left' to avoid that we evaluate it more than once;
9755         bug #52588.
9756
9757 2004-04-28  Martin Baulig  <martin@ximian.com>
9758
9759         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9760         `void[]' (CS1547).
9761
9762 2004-04-28  Martin Baulig  <martin@ximian.com>
9763
9764         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9765         void (CS1547).
9766
9767         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9768         whether the type is not void (CS1547).
9769
9770 2004-04-28  Martin Baulig  <martin@ximian.com>
9771
9772         * expression.cs (Unary.DoResolveLValue): Override this and report
9773         CS0131 for anything but Operator.Indirection.
9774
9775 2004-04-28  Martin Baulig  <martin@ximian.com>
9776
9777         Committing a patch from Ben Maurer; see bug #50820.
9778
9779         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9780         check for classes.
9781
9782         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9783         classes.        
9784
9785 2004-04-28  Martin Baulig  <martin@ximian.com>
9786
9787         Committing a patch from Ben Maurer; see bug #50820.
9788
9789         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9790         check for classes.
9791
9792         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9793         classes.        
9794
9795 2004-04-28  Martin Baulig  <martin@ximian.com>
9796
9797         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9798         (Block.AddLabel): Call DoLookupLabel() to only search in the
9799         current block.
9800
9801 2004-04-28  Martin Baulig  <martin@ximian.com>
9802
9803         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9804         comparing StringConstants and NullLiterals in Equality and Inequality.
9805
9806 2004-04-28  Jackson Harper  <jackson@ximian.com>
9807
9808         * driver.cs: Attempt to load referenced assemblies from the
9809         GAC. This is the quick and dirty version of this method that
9810         doesnt take into account versions and just takes the first
9811         canidate found. Will be good enough for now as we will not have more
9812         then one version installed into the GAC until I update this method.
9813
9814 2004-04-28  Martin Baulig  <martin@ximian.com>
9815
9816         * typemanager.cs (TypeManager.CheckStructCycles): New public
9817         static method to check for cycles in the struct layout.
9818
9819         * rootcontext.cs (RootContext.PopulateTypes): Call
9820         TypeManager.CheckStructCycles() for each TypeContainer.
9821         [Note: We only need to visit each type once.]
9822
9823 2004-04-28  Martin Baulig  <martin@ximian.com>
9824
9825         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9826
9827         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9828         success and added `out object value'.  Use a `bool resolved' field
9829         to check whether we've already been called rather than
9830         `ConstantValue != null' since this breaks for NullLiterals.
9831
9832 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9833
9834         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9835         setting of this flag, since the 'set' method may be non-public.
9836
9837 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9838
9839         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9840         check on current_vector.Block.
9841
9842 2004-04-27  Martin Baulig  <martin@ximian.com>
9843
9844         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9845         a field initializer.  Fixes #56459.
9846
9847 2004-04-27  Martin Baulig  <martin@ximian.com>
9848
9849         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9850         we're not attempting to use an indexer.  Fixes #52154.
9851
9852 2004-04-27  Martin Baulig  <martin@ximian.com>
9853
9854         * statement.cs (Return): Don't create a return label if we don't
9855         need it; reverts my change from January 20th.  Thanks to Ben
9856         Maurer for this.
9857
9858 2004-04-27  Martin Baulig  <martin@ximian.com>
9859
9860         According to the spec, `goto' can only leave a nested scope, but
9861         never enter it.
9862
9863         * statement.cs (Block.LookupLabel): Only lookup in the current
9864         block, don't recurse into parent or child blocks.
9865         (Block.AddLabel): Check in parent and child blocks, report
9866         CS0140/CS0158 if we find a duplicate.
9867         (Block): Removed this indexer for label lookups.
9868         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9869         this already does the error reporting for us.
9870
9871         * flowanalysis.cs
9872         (FlowBranching.UsageVector.Block): New public variable; may be null.
9873         (FlowBranching.CreateSibling): Added `Block' argument.
9874         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9875         label for the target of a `goto' and check whether we're not
9876         leaving a `finally'.
9877
9878 2004-04-27  Martin Baulig  <martin@ximian.com>
9879
9880         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9881         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9882         just for returns).
9883
9884 2004-04-27  Martin Baulig  <martin@ximian.com>
9885
9886         * statement.cs (Block.AddLabel): Also check for implicit blocks
9887         and added a CS0158 check.
9888
9889 2004-04-27  Martin Baulig  <martin@ximian.com>
9890
9891         * flowanalysis.cs (FlowBranchingLoop): New class.
9892         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9893         UsageVector's instead of an ArrayList.
9894         (FlowBranching.Label): Likewise.
9895         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9896         (FlowBranching.AddBreakVector): New method.
9897
9898 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9899
9900         * attribute.cs: Small regression fix: only convert the type if we
9901         the type is different, fixes System.Drawing build.
9902
9903 2004-04-27  Martin Baulig  <martin@ximian.com>
9904
9905         * attribute.cs (Attribute.Resolve): If we have a constant value
9906         for a named field or property, implicity convert it to the correct
9907         type.
9908
9909 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9910
9911         * statement.cs (Block.Block): Implicit blocks share
9912         'child_variable_names' fields with parent blocks.
9913         (Block.AddChildVariableNames): Remove.
9914         (Block.AddVariable): Mark variable as "used by a child block" in
9915         every surrounding block.
9916         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9917         been used in a child block, complain about violation of "Invariant
9918         meaning in blocks" rule.
9919         * cs-parser.jay (declare_local_variables): Don't use
9920         AddChildVariableNames.
9921         (foreach_statement): Don't create an implicit block: 'foreach'
9922         introduces a scope.
9923
9924 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9925
9926         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9927         converting from 0L to ulong.  Fixes 57522.
9928
9929 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9930
9931         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9932         derived class hides via 'new' keyword field from base class (test-242.cs).
9933         TODO: Handle this in the more general way.
9934         
9935         * class.cs (CheckBase): Ditto.
9936
9937 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9938
9939         * decl.cs (caching_flags): New member for storing cached values
9940         as bit flags.
9941         (MemberCore.Flags): New enum where bit flags for caching_flags
9942         are defined.
9943         (MemberCore.cls_compliance): Moved to caching_flags.
9944         (DeclSpace.Created): Moved to caching_flags.
9945
9946         * class.cs: Use caching_flags instead of DeclSpace.Created
9947         
9948 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9949
9950         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9951         if we are only a derived class, not a nested class.
9952
9953         * typemanager.cs: Same as above, but do this at the MemberLookup
9954         level (used by field and methods, properties are handled in
9955         PropertyExpr).   Allow for the qualified access if we are a nested
9956         method. 
9957
9958 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9959
9960         * class.cs: Refactoring.
9961         (IMethodData): New inteface; Holds links to parent members
9962         to avoid member duplication (reduced memory allocation).
9963         (Method): Implemented IMethodData interface.
9964         (PropertyBase): New inner classes for get/set methods.
9965         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9966         (Event): New inner classes for add/remove methods.
9967         (Event.DelegateMethod): Implemented IMethodData interface.
9968
9969         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9970         EmitContext (related to class.cs refactoring).
9971
9972 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9973
9974         * delegate.cs (Delegate.VerifyApplicability): If the number of
9975         arguments are the same as the number of parameters, first try to
9976         verify applicability ignoring  any 'params' modifier on the last
9977         parameter.
9978         Fixes #56442.
9979
9980 2004-04-08  Martin Baulig  <martin@ximian.com>
9981
9982         Merged latest changes into gmcs.  Please keep this comment in
9983         here, it makes it easier for me to see what changed in MCS since
9984         the last time I merged.
9985
9986 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9987
9988         * class.cs (TypeContainer.AddIndexer): Use
9989         'ExplicitInterfaceName' to determine if interface name was
9990         explicitly specified.  'InterfaceType' is not initialized at this time.
9991         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9992         Indexers array is already in the required order.  Initialize
9993         'IndexerName' only if there are normal indexers.
9994         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9995         (TypeContainer.Emit): Emit DefaultMember attribute only if
9996         IndexerName is initialized.
9997         Fixes #56300.
9998
9999 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10000
10001         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10002         Fixes #57007
10003
10004 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10005
10006         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10007         attributes.
10008         Fix for #56456.
10009
10010         * attribute.cs (Attribute.Resolve): Check for duplicate named
10011         attributes.
10012         Fix for #56463.
10013
10014 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10015
10016         * iterators.cs (MarkYield): track whether we are in an exception,
10017         and generate code accordingly.  Use a temporary value to store the
10018         result for our state.
10019
10020         I had ignored a bit the interaction of try/catch with iterators
10021         since their behavior was not entirely obvious, but now it is
10022         possible to verify that our behavior is the same as MS .NET 2.0
10023
10024         Fixes 54814
10025
10026 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10027
10028         * iterators.cs: Avoid creating temporaries if there is no work to
10029         do. 
10030
10031         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10032         Enumerations, use TypeManager.EnumToUnderlying and call
10033         recursively. 
10034
10035         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10036         bug #57013
10037
10038         (This.Emit): Use EmitContext.EmitThis to emit our
10039         instance variable.
10040
10041         (This.EmitAssign): Ditto.
10042
10043         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10044         codepaths, we will move all the functionality into
10045         Mono.CSharp.This 
10046
10047         (FieldExpr.EmitAssign): Ditto.
10048
10049         This fixes several hidden bugs that I uncovered while doing a code
10050         review of this today.
10051
10052         * codegen.cs (EmitThis): reworked so the semantics are more clear
10053         and also support value types "this" instances.
10054
10055         * iterators.cs: Changed so that for iterators in value types, we
10056         do not pass the value type as a parameter.  
10057
10058         Initialization of the enumerator helpers is now done in the caller
10059         instead of passing the parameters to the constructors and having
10060         the constructor set the fields.
10061
10062         The fields have now `assembly' visibility instead of private.
10063
10064 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10065
10066         * expression.cs (Argument.Resolve): Check if fields passed as ref
10067         or out are contained in a MarshalByRefObject.
10068
10069         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10070         another compiler type.
10071
10072 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10073
10074         * class.cs (Indexer.Define): use the new name checking method.
10075         Also, return false on an error.
10076         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10077         (is_identifier_[start/part]_character): make static.
10078
10079 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10080
10081         * expression.cs (Binary.ResolveOperator): Do no append strings
10082         twice: since we can be invoked more than once (array evaluation)
10083         on the same concatenation, take care of this here.  Based on a fix
10084         from Ben (bug #56454)
10085
10086 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10087
10088         * codegen.cs: Fix another case where CS1548 must be reported (when 
10089         delay-sign isn't specified and no private is available #56564). Fix
10090         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10091         error when MCS is used on the MS runtime and we need to delay-sign 
10092         (which seems unsupported by AssemblyBuilder - see #56621).
10093
10094 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10095
10096         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10097         (TypeManager.ComputeNamespaces): Faster implementation for
10098         Microsoft runtime.
10099
10100         * compiler.csproj: Updated AssemblyName to mcs.
10101
10102 2004-05-11  Jackson Harper  <jackson@ximian.com>
10103
10104         * Makefile: Preserve MONO_PATH
10105         
10106 2004-05-11  Jackson Harper  <jackson@ximian.com>
10107
10108         * Makefile: Use mono and mcs to build gmcs
10109         
10110 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10111
10112         * codegen.cs: Add patch from Robert Shade
10113         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10114         sync with mcs.
10115
10116 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10117
10118         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10119         incomplete key pairs (#57941).
10120
10121 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10122
10123         * codegen.cs: Fix another case where CS1548 must be reported (when 
10124         delay-sign isn't specified and no private is available #56564). Fix
10125         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10126         error when MCS is used on the MS runtime and we need to delay-sign 
10127         (which seems unsupported by AssemblyBuilder - see #56621).
10128
10129 2004-04-29  Jackson Harper  <jackson@ximian.com>
10130
10131         * Makefile: Set MONO_PATH to use the bootstrap corlib
10132         * driver.cs: Check the GAC for referenced assemblies.
10133                 
10134 2004-04-29  Martin Baulig  <martin@ximian.com>
10135
10136         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10137
10138 2004-04-07  Martin Baulig  <martin@ximian.com>
10139
10140         * expression.cs (Binary.ResolveOperator): Added special case for
10141         Equality/Inequality between a type parameter and a null literal.
10142
10143 2004-04-07  Martin Baulig  <martin@ximian.com>
10144
10145         * convert.cs: Check null literal -> type parameter conversions.
10146
10147 2004-04-07  Martin Baulig  <martin@ximian.com>
10148
10149         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10150         `class' and `struct' constraints.
10151
10152 2004-04-07  Martin Baulig  <martin@ximian.com>
10153
10154         * generic.cs (SpecialConstraint): New public enum.
10155         (Constraints.Resolve): Added support for the `class' and `struct'
10156         constraints.
10157
10158         * cs-parser.jay (type_parameter_constraint): Added support for the
10159         `class' and `struct' constraints.
10160
10161 2004-04-07  Martin Baulig  <martin@ximian.com>
10162
10163         * support.cs (GenericConstraints): Replaced `Types' by
10164         `ClassConstraint' and `InterfaceConstraints'; added
10165         `HasClassConstraint'.   
10166
10167 2004-04-07  Martin Baulig  <martin@ximian.com>
10168
10169         * generic.cs
10170         (Constraints.InterfaceConstraints): New public property.
10171         (Constraints.Types): Make this property public
10172         (TypeParameter): Implement IMemberContainer.
10173         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10174         instead of a TypeBuilder/MethodBuilder; pass the interface
10175         constraints to TypeManager.AddTypeParameter().
10176         (TypeParameter.DefineType): Just take an EmitContext and no
10177         TypeBuilder/MethodBuilder.  Use the new public API.
10178
10179         * typemanager.cs (TypeManager.AddTypeParameter): Added
10180         `TypeExpr[]' argument; add the interfaces to the
10181         `builder_to_ifaces' hash.
10182         (TypeManager.LookupMemberContainer): For
10183         GenericTypeParameterBuilders, get the TypeParameter from the
10184         `builder_to_type_param'.
10185         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10186         the TypeParameter and call FindMembers on it.
10187
10188 2004-04-07  Martin Baulig  <martin@ximian.com>
10189
10190         * class.cs
10191         (MethodCore.GenericMethod): Moved this field here from Method.
10192         (MethodCore.IsDuplicateImplementation): Take the number of type
10193         parameters into account if we're a generic method.
10194
10195         * expression.cs (Invocation.InferTypeArguments): Don't return true
10196         if `arguments' is null; we still need to check whether we actually
10197         don't need to infer anything in this case.
10198         (MemberAccess): Merged the functionality from GenericMemberAccess
10199         into this class.
10200
10201         * generic.cs (GenericMemberAccess): Removed.
10202
10203 2004-04-05  Martin Baulig  <martin@ximian.com>
10204
10205         * decl.cs (MemberCore): For generic classes, interfaces and
10206         structs, `Name' now includes the number of type parameters
10207         ("Stack!1.Node!1").
10208         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10209         encode the number of type arguments in the type name.
10210
10211         * expression.cs (Expression.MemberLookup): Removed the
10212         `num_type_args' argument; we now encode the number of type
10213         arguments in the type name.
10214
10215         * ecore.cs (SimpleName): Encode the number of type arguments in
10216         the type name itself.
10217
10218         * generic.cs (ConstructedType): Likewise.
10219
10220         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10221         `MemberName'; we now include the number of type parameters in the
10222         type name.
10223
10224         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10225         (TypeManager.MemberLookup): Removed the
10226         `num_type_args' argument; we now encode the number of type
10227         arguments in the type name.     
10228
10229 2004-04-03  Martin Baulig  <martin@ximian.com>
10230
10231         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10232         (MemberCore.MemberName): Moved here from MemberBase.
10233         (DeclSpace.SetParameterInfo): Just take the constraints as an
10234         ArrayList; we already have the type parameters in our
10235         `MemberName'; also do the CS0080 reporting here.
10236
10237         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10238         `IDENTIFIER opt_type_parameter_list'; when constructing our
10239         `MemberName', it'll already include our type parameters.
10240         (class_declaration, interface_declaration): Likewise.
10241         (delegate_declaration): Likewise.
10242         (MakeName): Take a MemberName and return a MemberName.
10243         The following two changes are required to avoid shift/reduce conflicts:
10244         (member_name): Don't include a TypeName anymore; ie. this is now
10245         just 'IDENTIFIER opt_type_parameter_list'.
10246         (property_declaration, event_declaration): Use a
10247         `namespace_or_type_name' instead of a `member_name'.            
10248
10249 2004-04-03  Martin Baulig  <martin@ximian.com>
10250
10251         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10252         `MemberName' class.
10253         (TypeName): Formerly known as MemberName.
10254
10255         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10256         instead of a `MemberName'.
10257
10258         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10259         (member_name): New rule; create a MemberName.
10260
10261 2004-04-02  Martin Baulig  <martin@ximian.com>
10262
10263         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10264         (CS0305 and CS0308).
10265
10266 2004-04-02  Martin Baulig  <martin@ximian.com>
10267
10268         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10269         support for nested types.
10270
10271 2004-04-02  Martin Baulig  <martin@ximian.com>
10272
10273         * ecore.cs (IAlias): New public interface.
10274         (TypeExpr, TypeExpression): Implement IAlias.
10275         (TypeAliasExpression): New public class.
10276
10277         * namespace.cs (Namespace): Implement IAlias.
10278         (Namespace.Lookup): Return an IAlias instead on an object.
10279         (Namespace.DefineName): Take an IAlias instead of an object.
10280         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10281         an object.
10282         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10283         Expression.
10284         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10285         object.
10286         (NamespaceEntry.Lookup): Likewise.
10287
10288         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10289         instead of a Type.      
10290
10291         * decl.cs (DeclSpace): Implement IAlias.
10292         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10293
10294         * generic.cs (ConstructedType): Improved error checking.
10295
10296 2004-04-02  Martin Baulig  <martin@ximian.com>
10297
10298         * convert.cs: Added type parameter conversions.
10299
10300         * ecore.cs
10301         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10302         (ClassCast.Emit): If the source type is a type parameter, box it.
10303         If the target type is a type parameter, emit an `unbox.any'
10304         instead of a `classcast'.1      
10305
10306 2004-04-01  Martin Baulig  <martin@ximian.com>
10307
10308         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10309
10310 2004-04-01  Martin Baulig  <martin@ximian.com>
10311
10312         * generic.cs (ConstructedType.CheckConstraints): Use
10313         Convert.ImplicitStandardConversionExists(); user-defined implicit
10314         conversions are not allowed according to the spec.
10315
10316 2004-03-30  Martin Baulig  <martin@ximian.com>
10317
10318         * expression.cs (New): Added support for type parameters.
10319
10320         * typemanager.cs
10321         (TypeManager.activator_type): New public static field.
10322         (TypeManager.activator_create_instance): Likewise.
10323
10324 2004-03-30  Martin Baulig  <martin@ximian.com>
10325
10326         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10327         public method.
10328
10329 2004-03-30  Martin Baulig  <martin@ximian.com>
10330
10331         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10332         the spec here: the argument type must be convertible to the
10333         constraints.
10334
10335 2004-03-30  Martin Baulig  <martin@ximian.com>
10336
10337         * generic.cs
10338         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10339         TypeManager.AddTypeParameter().
10340         (ConstructedType.CheckConstraints): Re-enable this and actually
10341         check whether we have a constructor constraint.
10342
10343         * typemanager.cs
10344         (TypeManager.builder_to_type_param): New static field.
10345         (TypeManager.AddTypeParameter): New static method.
10346         (TypeManager.LookupTypeParameter): New public method.
10347
10348 2004-03-30  Martin Baulig  <martin@ximian.com>
10349
10350         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10351         the new API to actually define the constructor constraint.
10352
10353         * typemanager.cs
10354         (TypeManager.new_constraint_attr_type): New static field.
10355         (TypeManager.InitCoreTypes): Initialize it.
10356
10357 2004-03-30  Martin Baulig  <martin@ximian.com>
10358
10359         * generic.cs (Constraints): Completed error checking, use correct
10360         error numbers.
10361
10362 2004-03-29  Martin Baulig  <martin@ximian.com>
10363
10364         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10365
10366         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10367         public version which takes a `ParameterData pd' instead of an
10368         `ArrayList args'.
10369
10370 2004-03-29  Martin Baulig  <martin@ximian.com>
10371
10372         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10373         not a MethodInfo.       
10374
10375 2004-03-29  Martin Baulig  <martin@ximian.com>
10376
10377         * expression.cs (Argument.ResolveMethodGroup): If we're a
10378         ConstructedType, call GetMemberAccess() on it.  
10379
10380 2004-03-29  Martin Baulig  <martin@ximian.com>
10381
10382         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10383         (MethodCore.CheckGenericOverride): When overriding a generic
10384         method, check whether the constraints match.
10385
10386         * support.cs (GenericConstraints): New public interface.
10387         (ParameterData.GenericConstraints): New public method.
10388
10389         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10390         method parameter and compute our constraints if appropriate.
10391         (Parameter.GenericConstraints): New public property.
10392
10393         * generic.cs (Constraints): Implement GenericConstraints.
10394
10395 2004-03-29  Martin Baulig  <martin@ximian.com>
10396
10397         * decl.cs (MemberCache.FindMemberToOverride): Use
10398         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10399
10400 2004-03-29  Martin Baulig  <martin@ximian.com>
10401
10402         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10403
10404 2004-03-29  Martin Baulig  <martin@ximian.com>
10405
10406         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10407         not allowed on non-generic declarations").
10408
10409 2004-03-29  Martin Baulig  <martin@ximian.com>
10410
10411         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10412         public version of this method.
10413
10414         * class.cs (MethodCore.IsDuplicateImplementation): Use
10415         Invocation.InferTypeArguments() to check this.
10416
10417 2004-03-29  Martin Baulig  <martin@ximian.com>
10418
10419         * convert.cs: Use TypeManager.IsDelegateType() instead of
10420         comparing types correctly.
10421
10422 2004-03-29  Martin Baulig  <martin@ximian.com>
10423
10424         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10425         types directly to make it work for generic instances.
10426
10427         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10428
10429 2004-03-29  Martin Baulig  <martin@ximian.com>
10430
10431         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10432         support for arrays.     
10433
10434 2004-03-24  Martin Baulig  <martin@ximian.com>
10435
10436         * decl.cs (DeclSpace.FindType): Also use
10437         TypeManager.CheckGeneric() for types from the using clauses.
10438
10439 2004-03-23  Martin Baulig  <martin@ximian.com>
10440
10441         * expression.cs (Invocation.OverloadResolve): Added `bool
10442         may_fail' argument and use it instead of the Location.IsNull() hack.
10443
10444 2004-03-23  Martin Baulig  <martin@ximian.com>
10445
10446         * expression.cs (Invocation.InferType): Use correct type inference
10447         rules here.     
10448
10449 2004-03-23  Martin Baulig  <martin@ximian.com>
10450
10451         * ecore.cs (MethodGroupExpr.Name): Use
10452         TypeManager.CSharpSignature() instead of just the name.
10453
10454         * expression.cs (Invocation.OverloadResolve): Provide better error
10455         reporting.
10456         (Invocation.DoResolve): OverloadResolve() never returns null
10457         without reporting an error, so removed the error -6 reporting here.
10458
10459 2004-03-23  Martin Baulig  <martin@ximian.com>
10460
10461         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10462         generic methods.
10463
10464         * cs-parser.jay (delegate_declaration): Support generic delegates.
10465
10466         * delegate.cs: Support generic delegates.
10467
10468 2004-03-22  Martin Baulig  <martin@ximian.com>
10469
10470         * expression.cs (Invocation.InferParamsTypeArguments): New static
10471         method; does type inference for params arguments.
10472
10473 2004-03-21  Martin Baulig  <martin@ximian.com>
10474
10475         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10476         method; checks whether a method is a generic method.    
10477
10478         * expression.cs (Invocation.InferTypeArguments): New static method;
10479         infer type arguments for generic method invocation.
10480
10481         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10482         property; we set this to true if we're resolving a generic method
10483         invocation and the user specified type arguments, ie. we're not
10484         doing type inference.
10485
10486 2004-03-20  Martin Baulig  <martin@ximian.com>
10487
10488         * class.cs (MethodData.DeclaringType): New public property.
10489         (MethodData.Define): Set DeclaringType here.
10490         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10491         instead of OperatorMethodBuilder.DeclaringType.
10492
10493 2004-03-20  Martin Baulig  <martin@ximian.com>
10494
10495         * cs-tokenizer.cs (xtoken): Return a special
10496         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10497
10498         * cs-parser.jay (default_value_expression): Switch to the new
10499         syntax (14.5.13).
10500
10501 2004-03-19  Martin Baulig  <martin@ximian.com>
10502
10503         * decl.cs (MemberName): New class.  We use this to "construct"
10504         namespace_or_type_name's.
10505
10506         * generics.cs (TypeArguments.GetDeclarations): New public method;
10507         returns the type arguments as a string[] and reports a CS0081 if
10508         one of them is not an identifier.
10509
10510         * class.cs (MemberBase): The .ctor now takes the name as a
10511         MemberName instead of a string.
10512         (MemberBase.ExplicitInterfaceName): Changed type from string to
10513         Expression.
10514         (MemberBase.DoDefine): If we're an explicit implementation, the
10515         InterfaceType may be a generic instance.
10516
10517         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10518         (namespace_name): Call MemberName.GetName () to transform the
10519         MemberName into a string and ensure we don't have any type
10520         arguments.
10521         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10522         MemberName into an expression.
10523         (method_header): Use namespace_or_type_name instead of member_name.     
10524
10525 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10526
10527         * rootcontext.cs: Add new types to the boot resolution.
10528
10529         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10530         MulticastDelegate is not allowed.
10531
10532         * typemanager.cs: Add new types to lookup: System.TypedReference
10533         and ArgIterator.
10534
10535         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10536         check for TypedReference or ArgIterator, they are not allowed. 
10537
10538         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10539         makes us properly catch 1510 in some conditions (see bug 56016 for
10540         details). 
10541
10542 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10543
10544         * CryptoConvert.cs: update from corlib version
10545         with endian fixes.
10546
10547 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10548
10549         * class.cs (Indexer.Define): Check indexername declaration
10550
10551 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10552
10553         * attribute.cs (IsClsCompliant): Fixed problem with handling
10554         all three states (compliant, not-compliant, undetected).
10555
10556 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10557
10558         * attribute.cs (Attribute): Location is now public.
10559         (Resolve): Store resolved arguments (pos_values) in attribute class.
10560         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10561         (GetClsCompliantAttributeValue): New method that gets
10562         CLSCompliantAttribute value.
10563         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10564         if exists else null.
10565         (AttributeTester): New class for CLS-Compliant verification routines.
10566
10567         * class.cs (Emit): Add CLS-Compliant verification.
10568         (Method.GetSignatureForError): Implemented.
10569         (Constructor.GetSignatureForError): Implemented
10570         (Constructor.HasCompliantArgs): Returns if constructor has
10571         CLS-Compliant arguments.
10572         (Constructor.Emit): Override.
10573         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10574         is needed to test only parameters.
10575         (FieldBase.GetSignatureForError): Implemented.
10576         (TypeContainer): New member for storing base interfaces.
10577         (TypeContainer.FindMembers): Search in base interfaces too.
10578
10579         * codegen.cs (GetClsComplianceAttribute): New method that gets
10580         assembly or module CLSCompliantAttribute value.
10581         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10582         for assembly.
10583         (ModuleClass.Emit): Add error 3012 test.
10584
10585         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10586
10587         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10588         state for all decl types.
10589         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10590         if CLS-Compliant tests are required.
10591         (IsClsCompliaceRequired): New method. Analyze whether code
10592         must be CLS-Compliant.
10593         (IsExposedFromAssembly): New method. Returns true when MemberCore
10594         is exposed from assembly.
10595         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10596         value or gets cached value.
10597         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10598         is explicitly marked with CLSCompliantAttribute.
10599         (IsIdentifierClsCompliant): New abstract method. This method is
10600         used to testing error 3005.
10601         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10602         for identifier and parameters CLS-Compliant testing.
10603         (VerifyClsCompliance): New method. The main virtual method for
10604         CLS-Compliant verifications.
10605         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10606         null. I don't know why is null (too many public members !).
10607         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10608         and get value of first CLSCompliantAttribute that found.
10609
10610         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10611         (VerifyClsCompliance): Override and add extra tests.
10612
10613         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10614         clscheck- disable CLS-Compliant verification event if assembly is has
10615         CLSCompliantAttribute(true).
10616
10617         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10618         ApllyAttribute is now called in emit section as in the other cases.
10619         Possible future Emit integration.
10620         (IsIdentifierClsCompliant): New override.
10621         (VerifyClsCompliance): New override.
10622         (GetEnumeratorName): Returns full enum name.
10623
10624         * parameter.cs (GetSignatureForError): Implemented.
10625
10626         * report.cs (WarningData): New struct for Warning message information.
10627         (LocationOfPreviousError): New method.
10628         (Warning): New method. Reports warning based on the warning table.
10629         (Error_T): New method. Reports error based on the error table.
10630
10631         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10632         verifications are done here.
10633
10634         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10635
10636         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10637         CLSCompliantAttribute.
10638         (all_imported_types): New member holds all imported types from other
10639         assemblies.
10640         (LoadAllImportedTypes): New method fills static table with exported types
10641         from all referenced assemblies.
10642         (Modules): New property returns all assembly modules.
10643
10644 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10645
10646         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10647         throwing a parser error.
10648
10649         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10650         which removes the hardcoded get_/set_ prefixes for properties, as
10651         IL allows for the properties to be named something else.  
10652
10653         Bug #56013
10654
10655         * expression.cs: Do not override operand before we know if it is
10656         non-null.  Fix 56207
10657
10658 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10659
10660         * typemanager.cs: support for pinned variables.
10661
10662 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10663
10664         * decl.cs, typemanager.cs: Avoid using an arraylist
10665         as a buffer if there is only one result set.
10666
10667 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10668
10669         * expression.cs: Make sure you cant call a static method
10670         with an instance expression, bug #56174.
10671
10672 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10673
10674         * class.cs (IsDuplicateImplementation): Improve error reporting to
10675         flag 663 (method only differs in parameter modifier).
10676
10677         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10678         in preprocessor directives.
10679
10680         * location.cs (LookupFile): Allow for the empty path.
10681
10682         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10683         better approach for some of that patch, but its failing with the
10684         CharSet enumeration.  For now try/catch will do.
10685
10686         * typemanager.cs: Do not crash if a struct does not have fields.
10687         Fixes 56150.
10688
10689 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10690
10691         * expression.cs: cs0213, cant fix a fixed expression.
10692         fixes 50231.
10693
10694 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10695
10696         * cs-parser.jay: detect invalid embeded statements gracefully.
10697         bug #51113.
10698
10699 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10700
10701         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10702         As a regex:
10703         s/
10704         the invocation type may not be a subclass of the tye of the item/
10705         The type of the item must be a subclass of the invocation item.
10706         /g
10707
10708         Fixes bug #50820.
10709
10710 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10711
10712         * attribute.cs: Added methods to get a string and a bool from an
10713         attribute. Required to information from AssemblyKeyFileAttribute,
10714         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10715         * codegen.cs: Modified AssemblyName creation to include support for
10716         strongnames. Catch additional exceptions to report them as CS1548.
10717         * compiler.csproj: Updated include CryptoConvert.cs.
10718         * compiler.csproj.user: Removed file - user specific configuration.
10719         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10720         Mono.Security assembly. The original class is maintained and tested in
10721         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10722         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10723         like CSC 8.0 (C# v2) supports.
10724         * Makefile: Added CryptoConvert.cs to mcs sources.
10725         * rootcontext.cs: Added new options for strongnames.
10726
10727 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10728
10729         * driver.cs: For --expect-error, report error code `2'
10730         if the program compiled with no errors, error code `1' if
10731         it compiled with an error other than the one expected.
10732
10733 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10734
10735         * compiler.csproj: Updated for Visual Studio .NET 2003.
10736         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10737         * compiler.sln: Updated for Visual Studio .NET 2003.
10738
10739 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10740
10741         * expression.cs: Fix bug #47234. We basically need to apply the
10742         rule that we prefer the conversion of null to a reference type
10743         when faced with a conversion to 'object' (csc behaviour).
10744
10745 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10746
10747         * statement.cs: Shorter form for foreach, eliminates
10748         a local variable. r=Martin.
10749
10750 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10751
10752         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10753         checks if we can use brtrue/brfalse to test for 0.
10754         * expression.cs: use the above in the test for using brtrue/brfalse.
10755         cleanup code a bit.
10756
10757 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10758
10759         * expression.cs: Rewrite string concat stuff. Benefits:
10760
10761         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10762         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10763         rather than a concat chain.
10764
10765         * typemanager.cs: Add lookups for more concat overloads.
10766
10767 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10768
10769         * expression.cs: Emit shorter il code for array init.
10770
10771         newarr
10772         dup
10773         // set 1
10774
10775         // set 2
10776
10777         newarr
10778         stloc.x
10779
10780         ldloc.x
10781         // set 1
10782
10783         ldloc.x
10784         // set 2
10785
10786 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10787
10788         * statement.cs: Before, two switch blocks would be merged if the
10789         total size of the blocks (end_item - begin_item + 1) was less than
10790         two times the combined sizes of the blocks.
10791
10792         Now, it will only merge if after the merge at least half of the
10793         slots are filled.
10794
10795         fixes 55885.
10796
10797 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10798
10799         * class.cs : csc build fix for GetMethods(). See bug #52503.
10800
10801 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10802
10803         * expression.cs: Make sure fp comparisons work with NaN.
10804         This fixes bug #54303. Mig approved this patch a long
10805         time ago, but we were not able to test b/c the runtime
10806         had a related bug.
10807
10808 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10809
10810         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10811
10812 2004-03-19  Martin Baulig  <martin@ximian.com>
10813
10814         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10815         two overloads may unify for some type parameter substitutions and
10816         report a CS0408 if appropriate.
10817
10818 2004-03-19  Martin Baulig  <martin@ximian.com>
10819
10820         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10821         error here and not in our caller.
10822
10823 2004-03-19  Martin Baulig  <martin@ximian.com>
10824
10825         * interface.cs: Completely killed this file.
10826         (Interface): We're now a TypeContainer and live in class.cs.
10827
10828         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10829         argument; we're now also called for interfaces.
10830         (TypeContainer.DefineMembers): Allow this method being called
10831         multiple times.
10832         (TypeContainer.GetMethods): New public method; formerly known as
10833         Interface.GetMethod().  This is used by PendingImplementation.
10834         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10835         it's now private and non-static.
10836         (Interface): Moved this here; it's now implemented similar to
10837         Class and Struct.
10838         (Method, Property, Event, Indexer): Added `bool is_interface'
10839         argument to their .ctor's.
10840         (MemberBase.IsInterface): New public field.
10841
10842         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10843         instances instead of InterfaceMethod, InterfaceProperty, etc.
10844         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10845         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10846
10847 2004-03-19  Martin Baulig  <martin@ximian.com>
10848
10849         * class.cs (MethodCore.IsDuplicateImplementation): New private
10850         method which does the CS0111 checking.
10851         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10852         Use IsDuplicateImplementation().
10853
10854 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10855
10856         * decl.cs (FindMemberToOverride): New method to find the correct
10857         method or property to override in the base class.
10858         * class.cs
10859             - Make Method/Property use the above method to find the
10860               version in the base class.
10861             - Remove the InheritableMemberSignatureCompare as it is now
10862               dead code.
10863
10864         This patch makes large code bases much faster to compile, as it is
10865         O(n) rather than O(n^2) to do this validation.
10866
10867         Also, it fixes bug 52458 which is that nested classes are not
10868         taken into account when finding the base class member.
10869
10870         Reviewed/Approved by Martin.
10871
10872 2004-03-17  Martin Baulig  <martin@ximian.com>
10873
10874         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10875         of type arguments into account; use the `real_num_type_args'
10876         approach like in DoResolveAsTypeStep().
10877
10878         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10879         nested types.
10880
10881 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10882
10883         * interface.cs: In all interface classes removed redundant
10884         member initialization.
10885
10886 2004-03-16  Martin Baulig  <martin@ximian.com>
10887
10888         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10889
10890 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * decl.cs (DefineTypeAndParents): New helper method to define a
10893         type's containers before the type itself is defined;  This is a
10894         bug exposed by the recent changes to Windows.Forms when an
10895         implemented interface was defined inside a class that had not been
10896         built yet.   
10897
10898         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10899
10900         (Check): Loop correctly to report errors modifiers
10901         (UNSAFE was not in the loop, since it was the same as TOP).
10902
10903         * interface.cs: Every interface member now takes a ModFlags,
10904         instead of a "is_new" bool, which we set on the base MemberCore. 
10905
10906         Every place where we called "UnsafeOk" in the interface, now we
10907         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10908         the unsafe settings from the member declaration instead of the
10909         container interface. 
10910
10911         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10912
10913         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10914         `set_indexer_name' to the pending bits (one per type).
10915
10916         We fixed a bug today that was picking the wrong method to
10917         override, since for properties the existing InterfaceMethod code
10918         basically ignored the method name.  Now we make sure that the
10919         method name is one of the valid indexer names.
10920
10921 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10922  
10923         * support.cs (SeekableStreamReader): Keep track of stream byte
10924         positions and don't mix them with character offsets to the buffer.
10925
10926         Patch from Gustavo Giráldez
10927
10928 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10929
10930         * interface.cs (InterfaceSetGetBase): Removed double member
10931         initialization, base class does it as well.
10932
10933 2004-03-13  Martin Baulig  <martin@ximian.com>
10934
10935         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10936         when compiling corlib.
10937
10938 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10939
10940         * convert.cs (ExplicitConversion): We were reporting an error on
10941         certain conversions (object_type source to a value type, when the
10942         expression was `null') before we had a chance to pass it through
10943         the user defined conversions.
10944
10945         * driver.cs: Replace / and \ in resource specifications to dots.
10946         Fixes 50752
10947
10948         * class.cs: Add check for duplicate operators.  Fixes 52477
10949
10950 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10951
10952         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10953         that are in the middle of the statements, not only at the end.
10954         Fixes #54987
10955
10956         * class.cs (TypeContainer.AddField): No longer set the
10957         `HaveStaticConstructor' flag, now we call it
10958         `UserDefineStaticConstructor' to diferentiate the slightly
10959         semantic difference.
10960
10961         The situation is that we were not adding BeforeFieldInit (from
10962         Modifiers.TypeAttr) to classes that could have it.
10963         BeforeFieldInit should be set to classes that have no static
10964         constructor. 
10965
10966         See:
10967
10968         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10969
10970         And most importantly Zoltan's comment:
10971
10972         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10973
10974         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10975          before its static fields are used', i.e. initialization does not need
10976          to be triggered by the first access to the type. Setting this flag
10977          helps the JIT to compile better code, since it can run the static
10978          constructor at JIT time, and does not need to generate code to call it
10979          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10980          this flag for lots of classes like String. 
10981          
10982          csc sets this flag if the type does not have an explicit static 
10983          constructor. The reasoning seems to be that if there are only static
10984          initalizers for a type, and no static constructor, then the programmer
10985          does not care when this initialization happens, so beforefieldinit
10986          can be used.
10987          
10988          This bug prevents the AOT compiler from being usable, since it 
10989          generates so many calls to mono_runtime_class_init that the AOT code
10990          is much slower than the JITted code. The JITted code is faster, 
10991          because it does not generate these calls if the vtable is type is
10992          already initialized, which is true in the majority of cases. But the
10993          AOT compiler can't do this."
10994
10995 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10996
10997         * class.cs (MethodData.Emit): Refactor the code so symbolic
10998         information is generated for destructors;  For some reasons we
10999         were taking a code path that did not generate symbolic information
11000         before. 
11001
11002 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11003
11004         * class.cs: Create a Constructor.CheckBase method that
11005         takes care of all validation type code. The method
11006         contains some code that was moved from Define.
11007
11008         It also includes new code that checks for duplicate ctors.
11009         This fixes bug #55148.
11010
11011 2004-03-09  Joshua Tauberer <tauberer@for.net>
11012
11013         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11014         a { ... }-style array creation invokes EmitStaticInitializers
11015         which is not good for reference-type arrays.  String, decimal
11016         and now null constants (NullCast) are not counted toward
11017         static initializers.
11018
11019 2004-03-05  Martin Baulig  <martin@ximian.com>
11020
11021         * location.cs (SourceFile.HasLineDirective): New public field;
11022         specifies whether the file contains or is referenced by a "#line"
11023         directive.
11024         (Location.DefineSymbolDocuments): Ignore source files which
11025         either contain or are referenced by a "#line" directive.        
11026
11027 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11028
11029         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11030         direct access to our parent, so check the method inline there.
11031
11032 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11033
11034         * expression.cs (Invocation.EmitCall): Miguel's last commit
11035         caused a regression. If you had:
11036
11037             T t = null;
11038             t.Foo ();
11039
11040         In Foo the implict this would be null.
11041
11042 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * expression.cs (Invocation.EmitCall): If the method is not
11045         virtual, do not emit a CallVirt to it, use Call.
11046
11047         * typemanager.cs (GetFullNameSignature): Improve the method to
11048         cope with ".ctor" and replace it with the type name.
11049
11050         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11051         as an argument the ConstructorBuilder where it is being defined,
11052         to catch the recursive constructor invocations.
11053
11054 2004-03-16  Martin Baulig  <martin@ximian.com>
11055
11056         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11057         ConstructedType, call ResolveType() on it to get the type rather
11058         than just using `expr.Type'.
11059
11060 2004-03-16  Martin Baulig  <martin@ximian.com>
11061
11062         * generics.cs (ConstructedType.GetMemberAccess): Take the
11063         EmitContext instead on the TypeExpr and use
11064         ec.TypeContainer.CurrentType/ec.ContainerType.
11065
11066 2004-03-16  Martin Baulig  <martin@ximian.com>
11067
11068         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11069         parameters before aliases.
11070
11071 2004-03-16  Martin Baulig  <martin@ximian.com>
11072
11073         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11074         New oublic function; checks whether two generic instances may become
11075         equal under some instantiations (26.3.1).
11076
11077         * class.cs (TypeContainer.Define): Call
11078         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11079         error.
11080
11081 2004-03-16  Martin Baulig  <martin@ximian.com>
11082
11083         * class.cs (TypeContainer.GetClassBases): Moved
11084         Error_TypeParameterAsBase() here and also check whether the base
11085         class is not an attribute.
11086
11087 2004-03-16  Martin Baulig  <martin@ximian.com>
11088
11089         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11090
11091 2004-03-16  Martin Baulig  <martin@ximian.com>
11092
11093         * class.cs (Error_TypeParameterAsBase): Use correct error number
11094         here (CS0689).  
11095
11096 2004-03-16  Martin Baulig  <martin@ximian.com>
11097
11098         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11099         for generics.
11100
11101         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11102         error reporting.
11103
11104 2004-03-15  Martin Baulig  <martin@ximian.com>
11105
11106         * typemanager.cs (TypeManager.GetFullName): New public method.
11107         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11108         argument; only return members with the correct number of type
11109         arguments.
11110         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11111         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11112         whether the number of type arguments matches.
11113
11114         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11115         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11116
11117         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11118         field; it's set by the protected .ctor when we're actually a
11119         GenericMemberAccess.
11120         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11121         arguments and pass it to MemberLookupFinal ().
11122
11123         * ecore.cs (Expression.MemberLookup): Added `int
11124         num_type_arguments' argument; only return members with the correct
11125         number of type arguments.
11126         (Expression.MemberLookupFailed): Check whether the MemberLookup
11127         failed because we did not have the correct number of type
11128         arguments; report CS0305 in this case.
11129
11130         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11131         `e.ResolveAsTypeTerminal()' already did so.
11132
11133 2004-03-15  Martin Baulig  <martin@ximian.com>
11134
11135         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11136         we're a ConstructedType; in this case, the caller must report an
11137         error (for instance CS0131).
11138
11139         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11140         (TypeArguments.Resolve): Actually report errors here.
11141
11142 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11143
11144         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11145         `set_indexer_name' to the pending bits (one per type).
11146
11147         We fixed a bug today that was picking the wrong method to
11148         override, since for properties the existing InterfaceMethod code
11149         basically ignored the method name.  Now we make sure that the
11150         method name is one of the valid indexer names.
11151
11152 2004-03-15  Martin Baulig  <martin@ximian.com>
11153
11154         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11155         for generic instances.
11156
11157 2004-03-13  Martin Baulig  <martin@ximian.com>
11158
11159         * class.cs (TypeContainer.DefineType): Call
11160         TypeManager.AddUserType() immediately after creating the
11161         TypeBuilder; pass all type parameters when creating the
11162         CurrentType.
11163
11164         * decl.cs (DeclSpace.FindNestedType): New public method.
11165         (DeclSpace.FindType): Added `int num_type_args' argument; only
11166         return types with the correct number of type parameters.
11167         (DeclSpace.CountTypeParams): New public property.
11168
11169         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11170         the number of type parameters; defaults to zero.
11171
11172         * generic.cs (TypeArguments.Count): New public property.
11173         (ConstructedType.DoResolveAsTypeStep): First call
11174         ds.FindNestedType() to find out whether we're nested in the
11175         current generic type; in this case, we inherit all type parameters
11176         from the current class.
11177
11178         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11179         num_type_args' argument.
11180         (RootContext.LookupType): Added overloaded version which takes the
11181         number of type arguments; only return types with the correct
11182         number of type arguments.
11183
11184         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11185         checks whether `Type t' has `int num_type_args'.
11186
11187 2004-03-13  Martin Baulig  <martin@ximian.com>
11188
11189         * generic.cs (GenericMethod.DefineType): New method; calls
11190         DefineType() on all the type parameters.
11191
11192         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11193         (MethodData.Define): If we're a generic method, call
11194         GenericMethod.DefineType() to define the type parameters.       
11195
11196 2004-03-10  Martin Baulig  <martin@ximian.com>
11197
11198         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11199         instead of IsAssignableFrom.    
11200
11201 2004-03-10  Martin Baulig  <martin@ximian.com>
11202
11203         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11204
11205         * support.cs (ParameterData.HasArrayParameter): New property.
11206         (ReflectionParameters.ctor): Take a MethodBase instead of a
11207         ParameterInfo[].  If we have any type parameters, get the generic
11208         method definition and ask it whether we have variable arguments.
11209
11210 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11211
11212         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11213         routines to check if a type is an enumerable/enumerator allow
11214         classes that implement the IEnumerable or IEnumerator interfaces.
11215
11216         * class.cs (Property, Operator): Implement IIteratorContainer, and
11217         implement SetYields.
11218
11219         (Property.Define): Do the block swapping for get_methods in the
11220         context of iterators.   We need to check if Properties also
11221         include indexers or not.
11222
11223         (Operator): Assign the Block before invoking the
11224         OperatorMethod.Define, so we can trigger the Iterator code
11225         replacement. 
11226
11227         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11228         Property and Operator classes are not created when we parse the
11229         declarator but until we have the block completed, so we use a
11230         singleton SimpleIteratorContainer.Simple to flag whether the
11231         SetYields has been invoked.
11232
11233         We propagate this setting then to the Property or the Operator to
11234         allow the `yield' to function.
11235
11236 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11237
11238         * codegen.cs: Implemented attribute support for modules.
11239         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11240         Assembly/Module functionality.
11241
11242         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11243         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11244         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11245
11246 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11247
11248         * interface.cs (FindMembers): The operation is performed on all base
11249         interfaces and not only on the first. It is required for future CLS Compliance patch.
11250
11251 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11252
11253         * statement.cs, codegen.cs:
11254         This patch deals with patterns such as:
11255
11256         public class List : IEnumerable {
11257
11258                 public MyEnumerator GetEnumerator () {
11259                         return new MyEnumerator(this);
11260                 }
11261
11262                 IEnumerator IEnumerable.GetEnumerator () {
11263                         ...
11264                 }
11265                 
11266                 public struct MyEnumerator : IEnumerator {
11267                         ...
11268                 }
11269         }
11270
11271         Before, there were a few things we did wrong:
11272         1) we would emit callvirt on a struct, which is illegal
11273         2) we emited ldarg when we needed to emit ldarga
11274         3) we would mistakenly call the interface methods on an enumerator
11275         type that derived from IEnumerator and was in another assembly. For example:
11276
11277         public class MyEnumerator : IEnumerator
11278
11279         Would have the interface methods called, even if there were public impls of the
11280         method. In a struct, this lead to invalid IL code.
11281
11282 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11283
11284         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11285           renamed to Emit.
11286
11287         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11288
11289 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11290
11291         * cs-parser.jay: Fix small regression: we were not testing V2
11292         compiler features correctly.
11293
11294         * interface.cs: If the emit context is null, then create one
11295
11296 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11297
11298         * decl.cs (GetSignatureForError): New virtual method to get full name
11299           for error messages.
11300
11301         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11302           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11303
11304         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11305           Duplicated members and code in these classes has been removed.
11306           Better encapsulation in these classes.
11307
11308 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11309
11310         * assign.cs (Assign.DoResolve): When dealing with compound
11311         assignments, there is a new rule in ECMA C# 2.4 (might have been
11312         there before, but it is documented here) that states that in:
11313
11314         a op= b;
11315
11316         If b is of type int, and the `op' is a shift-operator, then the
11317         above is evaluated as:
11318
11319         a = (int) a op b 
11320
11321         * expression.cs (Binary.ResolveOperator): Instead of testing for
11322         int/uint/long/ulong, try to implicitly convert to any of those
11323         types and use that in pointer arithmetic.
11324
11325         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11326         method to print information for from the type, not from the
11327         null-method we were given.
11328
11329 2004-02-01  Duncan Mak  <duncan@ximian.com>
11330
11331         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11332         parsing for cmd, fixes bug #53694.
11333
11334 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11335
11336         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11337         in the member name duplication tests. Property and operator name duplication
11338         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11339
11340 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11341
11342         * interface.cs (PopulateMethod): Fixed crash when interface method
11343         returns not existing type (error test cs0246-3.cs).
11344
11345 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11346
11347         * cs-parser.jay (interface_accessors): Re-write actions to also
11348         store attributes attached to get and set methods. Fix spelling
11349         while at it.
11350
11351         (inteface_property_declaration): Modify accordingly.
11352
11353         (InterfaceAccessorInfo): New helper class to store information to pass
11354         around between rules that use interface_accessors.
11355
11356         * interface.cs (Emit): Apply attributes on the get and set
11357         accessors of properties and indexers too.
11358
11359         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11360         right MethodBuilder when applying attributes to the get and set accessors.
11361
11362 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11363
11364         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11365
11366 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11367
11368         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11369
11370 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11371
11372         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11373         changes that treat `yield' specially when present before `break'
11374         or `return' tokens.
11375
11376         * cs-tokenizer.cs: yield is no longer a keyword.
11377
11378 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11379
11380         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11381         setting for default constructors.
11382         For default constructors are almost every time set wrong Modifier. The
11383         generated IL code has been alright. But inside mcs this values was
11384         wrong and this was reason why several of my CLS Compliance tests
11385         failed.
11386
11387 2004-02-27  Martin Baulig  <martin@ximian.com>
11388
11389         * generics.cs (ConstructedType.ResolveType): Make the nested type
11390         stuff actually work.
11391
11392 2004-02-25  Martin Baulig  <martin@ximian.com>
11393
11394         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11395         property; returns the type parameters just from the current type,
11396         ie. with the ones from outer classes.
11397         (DeclSpace.LookupGeneric): First search in the current class, then
11398         in outer classes.
11399         (DeclSpace.initialize_type_params): When hiding a type parameter
11400         from an outer class, put it into the `type_param_list' anyways.
11401
11402         * expression.cs (MemberAccess.expr): Made this field protected.
11403
11404         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11405         the type parameters from the current class.
11406
11407         * generic.cs (ConstructedType.ResolveType): Support nested generic
11408         types by taking the type parameters which we inherit from outer
11409         classes into account.
11410         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11411         support for nested generic types.
11412
11413 2004-02-23  Martin Baulig  <martin@ximian.com>
11414
11415         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11416         field and check whether we're nested inside a generic type.
11417         (DeclSpace.ResolveType): If we're resolving to a generic type
11418         definition, create a ConstructedType and return its resolved type.
11419         (DeclSpace.initialize_type_params): New private method;
11420         initializes the `type_param_list' field from the type parameters
11421         from this and all enclosing classes.
11422         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11423         we're already initialized.
11424
11425 2004-02-23  Martin Baulig  <martin@ximian.com>
11426
11427         * class.cs (Method.Define): Create the generic method before
11428         calling DoDefine().
11429         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11430         the TypeContainer one); we use this for generic methods.
11431
11432         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11433         parent's TypeBuilder.
11434
11435 2004-02-18  Martin Baulig  <martin@ximian.com>
11436
11437         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11438         to check for equality.
11439
11440 2004-02-05  Martin Baulig  <martin@ximian.com>
11441
11442         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11443         `ec.TypeContainer.CurrentType', use it instead of
11444         `ec.ContainerType' to check whether we're in the type's ctor.
11445
11446 2004-01-29  Martin Baulig  <martin@ximian.com>
11447
11448         * expression.cs (Invocation.DoResolve): If we're a
11449         `ConstructedType', then we're actually a generic method, so
11450         rewrite the expr as a GenericMemberAccess.
11451
11452         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11453         here; manually parse it into a string.
11454
11455 2004-01-28  Martin Baulig  <martin@ximian.com>
11456
11457         * typemanager.cs (TypeManager.IsEqual): New static method.
11458         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11459         check for equality instead of using `=='.
11460
11461 2004-01-26  Martin Baulig  <martin@ximian.com>
11462
11463         * decl.cs (DeclSpace.CurrentType): New public field.
11464
11465         * expression.cs (This.ResolveBase): If we have an
11466         `ec.TypeContainer.CurrentType', use it instead of
11467         `ec.ContainerType'.
11468
11469         * class.cs (TypeContainer.DefineType): If we're a generic type,
11470         create the `CurrentType' (unresolved).
11471         (TypeContainer.GenericType): New private field.
11472         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11473         it and store it in `GenericType' before creating the MemberCache.
11474         (TypeContainer.GetMembers): If we have a `GenericType', call
11475         TypeManager.FindMembers() on it.
11476
11477         * interface.cs (Interface.GenericType): New private field.
11478         (Interface.DefineType): If we're a generic type, create the
11479         `CurrentType' (unresolved).
11480         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11481         and store it in `GenericType' before creating the MemberCache.
11482         (Interface.GetMembers): If we have a `GenericType', call
11483         TypeManager.FindMembers() on it.
11484
11485 2004-01-22  Martin Baulig  <martin@ximian.com>
11486
11487         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11488         not a QualifiedIdentifier.  This is what `type_name_expression'
11489         was previously doing.
11490         (type_name_expression): Removed; the code is now in
11491         `namespace_or_type_name'.
11492         (qualified_identifier): Removed, use `namespace_or_type_name'
11493         instead.
11494         (QualifiedIdentifier): Removed this class.      
11495
11496 2004-01-22  Martin Baulig  <martin@ximian.com>
11497
11498         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11499         not a string as alias name.
11500
11501 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11502
11503         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11504         #52730 bug, and instead compute correctly the need to use a
11505         temporary variable when requesting an address based on the
11506         static/instace modified of the field and the constructor.
11507  
11508 2004-01-21  Martin Baulig  <martin@ximian.com>
11509
11510         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11511         class and namespace before looking up aliases.  Fixes #52517.
11512
11513 2004-01-21  Martin Baulig  <martin@ximian.com>
11514
11515         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11516         assinged in a 'try'; fixes exception4.cs.
11517
11518 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11519         * class.cs : Implemented parameter-less constructor for TypeContainer
11520
11521         * decl.cs: Attributes are now stored here. New property OptAttributes
11522
11523         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11524
11525         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11526
11527 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11528
11529         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11530           (CSharpSignature): New method for indexer and property signature.
11531
11532 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11533
11534         * pending.cs (IsVirtualFilter): Faster implementation.
11535
11536 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11537
11538         * typemanager.cs: Avoid inclusion of same assembly more than once.
11539
11540 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11541
11542         * cs-parser.jay: Fixed problem where the last assembly attribute
11543           has been applied also to following declaration (class, struct, etc.)
11544           
11545 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11546
11547         * class.cs: Added error CS0538, CS0539 reporting.
11548         Fixed crash on Microsoft runtime when field type is void.
11549
11550         * cs-parser.jay: Added error CS0537 reporting.
11551
11552         * pending.cs: Added error CS0535 reporting.
11553         Improved error report for errors CS0536, CS0534.
11554
11555 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11556
11557         Merge a few bits from the Anonymous Method MCS tree.
11558
11559         * statement.cs (ToplevelBlock): New class for toplevel methods,
11560         will hold anonymous methods, lifted variables.
11561
11562         * cs-parser.jay: Create toplevel blocks for delegates and for
11563         regular blocks of code. 
11564
11565 2004-01-20  Martin Baulig  <martin@ximian.com>
11566
11567         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11568         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11569         and `NeedExplicitReturn'; added `IsLastStatement'.
11570         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11571         have a `ReturnLabel' or we're not unreachable.
11572
11573         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11574         child's reachability; don't just override ours with it.  Fixes
11575         #58058 (lluis's example).
11576         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11577         InFinally(), InLoop(), InSwitch() and
11578         BreakCrossesTryCatchBoundary() methods.
11579
11580         * statement.cs (Return): Do all error checking in Resolve().
11581         Unless we are the last statement in a top-level block, always
11582         create a return label and jump to it.
11583         (Break, Continue): Do all error checking in Resolve(); also make
11584         sure we aren't leaving a `finally'.
11585         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11586         statement in a top-level block.
11587         (Block.Flags): Added `IsDestructor'.
11588         (Block.IsDestructor): New public property.
11589
11590 2004-01-20  Martin Baulig  <martin@ximian.com>
11591
11592         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11593
11594 2004-01-20  Martin Baulig  <martin@ximian.com>
11595
11596         * statement.cs (Statement.ResolveUnreachable): New public method.
11597         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11598         (Block.Resolve): Resolve unreachable statements.
11599
11600 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11601
11602         * expression.cs: We need to fix the case where we do
11603         not have a temp variable here.
11604
11605         * assign.cs: Only expression compound assignments need
11606         temporary variables.
11607
11608 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11609
11610         * flowanalysis.cs: Reduce memory allocation in a few ways:
11611           - A block with no variables should not allocate a bit
11612             vector for itself.
11613           - A method with no out parameters does not need any tracking
11614             for assignment of the parameters, so we need not allocate
11615             any data for it.
11616           - The arrays:
11617                 public readonly Type[] VariableTypes;
11618                 public readonly string[] VariableNames;
11619             Are redundant. The data is already stored in the variable
11620             map, so we need not allocate another array for it.
11621           - We need to add alot of checks for if (params | locals) == null
11622             due to the first two changes.
11623
11624 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11625
11626         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11627         implement IMemoryLocation, we store a copy on a local variable and
11628         take the address of it.  Patch from Benjamin Jemlich
11629
11630         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11631         to use a special "type_name_expression" rule which reduces the
11632         number of "QualifiedIdentifier" classes created, and instead
11633         directly creates MemberAccess expressions.
11634
11635 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11636
11637         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11638         that fixes #52853.  Null literal assignment to ValueType
11639
11640         * class.cs (MethodData.Emit): Instead of checking the name of the
11641         method to determine if its a destructor, create a new derived
11642         class from Method called Destructor, and test for that.  
11643
11644         * cs-parser.jay: Create a Destructor object instead of a Method.  
11645
11646         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11647
11648         Fixes: 52933
11649
11650 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11651
11652         * expression.cs (Binary.ResolveOperator): Perform an implicit
11653         conversion from MethodGroups to their delegate types on the
11654         Addition operation.
11655
11656         * delegate.cs: Introduce a new class DelegateCreation that is the
11657         base class for `NewDelegate' and `ImplicitDelegateCreation',
11658         factor some code in here.
11659
11660         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11661         conversion from MethodGroups to compatible delegate types. 
11662
11663         * ecore.cs (Expression.Resolve): Do not flag error 654
11664         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11665         we allow conversions from MethodGroups to delegate types now.
11666
11667         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11668         assignments in v2 either.
11669
11670 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11671
11672         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11673         static read-only fields in ctors.
11674
11675         Applied patch from Benjamin Jemlich 
11676
11677         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11678
11679 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11680
11681         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11682         here to return true, as they can be used like this:
11683
11684                 (XXX) int.MEMBER ()
11685
11686         Fixed 49836 and all the other dups
11687
11688 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11689
11690         * driver.cs: Implement /win32res and /win32icon.
11691
11692 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11693
11694         * cs-parser.jay: Add a rule to improve error handling for the
11695         common mistake of placing modifiers after the type.
11696
11697 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11698
11699         * cs-parser.jay (interface_event_declaration): Catch
11700         initialization of events on interfaces, and report cs0068
11701
11702         * cs-parser.jay (interface_event_declaration): Catch
11703         initialization of events. 
11704
11705         * ecore.cs: Better report missing constructors.
11706
11707         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11708         the error reporting done in the wrong place.  Fix.
11709
11710         * expression.cs (Binary.ResolveOperator): Catch the 
11711         operator + (E x, E y) error earlier, and later allow for implicit
11712         conversions in operator +/- (E e, U x) from U to the underlying
11713         type of E.
11714
11715         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11716         52596, if the container class is abstract, the default constructor
11717         is protected otherwise its public (before, we were always public).
11718
11719         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11720         fixed statement.
11721
11722         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11723         Jemlich that fixes bug #52597, MCS was generating invalid code for
11724         idisposable structs.   Thanks to Ben for following up with this
11725         bug as well.
11726
11727 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11728
11729         * driver.cs: Allow assemblies without code to be generated, fixes
11730         52230.
11731
11732 2004-01-07  Nick Drochak <ndrochak@gol.com>
11733
11734         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11735
11736 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11737
11738         * cs-parser.jay: Add rules to improve error reporting if fields or
11739         methods are declared at the namespace level (error 116)
11740
11741         * Add rules to catch event add/remove
11742
11743 2004-01-04  David Sheldon <dave-mono@earth.li>
11744
11745   * expression.cs: Added matching ")" to error message for 
11746   CS0077
11747
11748 2004-01-03 Todd Berman <tberman@gentoo.org>
11749
11750         * ecore.cs, attribute.cs:
11751         Applying fix from #52429.
11752
11753 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11754
11755         * ecore.cs, expression.cs, statement.cs:
11756         Total rewrite of how we handle branching. We
11757         now handle complex boolean expressions with fewer
11758         jumps. As well if (x == 0) no longer emits a ceq.
11759
11760         if (x is Foo) is much faster now, because we generate
11761         better code.
11762
11763         Overall, we get a pretty big improvement on our benchmark
11764         tests. The code we generate is smaller and more readable.
11765
11766         I did a full two-stage bootstrap. The patch was reviewed
11767         by Martin and Miguel.
11768
11769 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11770
11771         * cs-parser.jay: Make primary_expression not take a QI.
11772         we dont need this because the member_access rule covers
11773         us here. So we replace the rule with just IDENTIFIER.
11774
11775         This has two good effects. First, we remove a s/r conflict.
11776         Second, we allocate many fewer QualifiedIdentifier objects.
11777
11778 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11779
11780         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11781         set the correct information via SRE. This prevents
11782         hanging on the MS runtime. Fixes #29374.
11783
11784 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11785
11786         * convert.cs: correctly handle conversions to value types
11787         from Enum and ValueType as unboxing conversions.
11788
11789         Fixes bug #52569. Patch by Benjamin Jemlich.
11790
11791 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11792
11793         * expression.cs (BetterConversion): Prefer int -> uint
11794         over int -> ulong (csc's behaviour). This fixed bug #52046.
11795
11796 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11797
11798         * decl.cs (MemberCache.FindMembers): now returns a
11799         MemberInfo [].
11800
11801         * typemanager.cs: In general, go with with ^^.
11802         (CopyNewMethods): take an IList.
11803         (RealMemberLookup): Only allocate an arraylist
11804         if we copy from two sets of methods.
11805
11806         This change basically does two things:
11807         1) Fewer array lists allocated due to CopyNewMethods.
11808         2) the explicit cast in MemberList costed ALOT.
11809
11810 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11811
11812         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11813         a hashtable to avoid needless string allocations when an identifier is
11814         used more than once (the common case).
11815
11816 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11817
11818         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11819         is broken, it will not return anything. So, we
11820         have to use the information we have in mcs to
11821         do the task.
11822
11823         * typemanager.cs: Add a cache for GetInterfaces,
11824         since this will now be used more often (due to ^^)
11825
11826         (GetExplicitInterfaces) New method that gets the
11827         declared, not effective, interfaces on a type
11828         builder (eg, if you have interface IFoo, interface
11829         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11830         { IBar }.
11831
11832         This patch makes MCS able to bootstrap itself on
11833         Windows again.
11834
11835 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11836
11837         * expression.cs: Remove the Nop's that Miguel put
11838         in by mistake.
11839
11840 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11841
11842         * report.cs, codegen.cs: Give the real stack trace to
11843         the error when an exception is thrown.
11844
11845 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11846
11847         * decl.cs: only allocate hashtables for ifaces if 
11848         it is an iface!
11849
11850 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11851
11852         * expression.cs: fix the error from cs0121-2.cs
11853         (a parent interface has two child interfaces that
11854         have a function with the same name and 0 params
11855         and the function is called through the parent).
11856
11857 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11858
11859         * class.cs, rootcontext.cs, typmanager.cs: do not
11860         leak pointers.
11861
11862 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11863
11864         * codegen.cs: remove stack for the ec flow branching.
11865         It is already a linked list, so no need.
11866
11867 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11868
11869         * Makefile: Allow custom profiler here.
11870
11871 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11872
11873         * typemanager.cs (LookupType):
11874           - Use a static char [], because split takes
11875             a param array for args, so it was allocating
11876             every time.
11877           - Do not store true in a hashtable, it boxes.
11878
11879 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11880
11881         * flowanalysis.cs: bytify common enums.
11882
11883 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11884
11885         * modifiers.cs: Add a new set of flags for the
11886         flags allowed on explicit interface impls.
11887         * cs-parser.jay: catch the use of modifiers in
11888         interfaces correctly.
11889         * class.cs: catch private void IFoo.Blah ().
11890
11891         All related to bug #50572.
11892
11893 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11894
11895         * decl.cs: Rewrite the consistant accessability checking.
11896         Accessability is not linear, it must be implemented in
11897         a tableish way. Fixes #49704.
11898
11899 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11900
11901         * expression.cs: Handle negation in a checked context.
11902         We must use subtraction from zero. Fixes #38674.
11903
11904 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11905
11906         * class.cs: Ignore static void main in DLLs.
11907         * rootcontext.cs: Handle the target type here,
11908         since we are have to access it from class.cs
11909         * driver.cs: account for the above.
11910
11911 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11912
11913         * report.cs: Give line numbers and files if available.
11914
11915 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11916
11917         * driver.cs: Implement /addmodule.
11918
11919         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11920         ModuleBuilders.
11921
11922 2003-12-20  Martin Baulig  <martin@ximian.com>
11923
11924         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11925         (FieldBase.IsAssigned): Removed this field.
11926         (FieldBase.SetAssigned): New public method.
11927         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11928
11929 2003-12-20  Martin Baulig  <martin@ximian.com>
11930
11931         * expression.cs (LocalVariableReference.DoResolve): Don't set
11932         `vi.Used' if we're called from DoResolveLValue().
11933
11934         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11935         returns the usage vector it just merged into the current one -
11936         pass this one to UsageWarning().
11937         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11938         of the `EmitContext', don't call this recursively on our children.
11939
11940 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11941
11942         * driver.cs: Implement /target:module.
11943
11944 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11945
11946         * support.cs (CharArrayHashtable): New helper class.
11947
11948         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11949         char arrays, not strings, so we can avoid creating a string in
11950         consume_identifier if the identifier is a keyword.
11951
11952 2003-12-16  Martin Baulig  <martin@ximian.com>
11953
11954         * statement.cs (LocalInfo.Assigned): Removed this property.
11955         (LocalInfo.Flags): Removed `Assigned'.
11956         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11957         and uses flow analysis.
11958         (Block.UsageWarning): Made this method private.
11959         (Block.Resolve): Call UsageWarning() if appropriate.
11960
11961         * expression.cs (LocalVariableReference.DoResolve): Always set
11962         LocalInfo.Used here.
11963
11964 2003-12-13  Martin Baulig  <martin@ximian.com>
11965
11966         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11967         any value here; we're now using flow analysis to figure out
11968         whether a statement/block returns a value.
11969
11970 2003-12-13  Martin Baulig  <martin@ximian.com>
11971
11972         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11973         working again.
11974         (FlowBranching.MergeFinally): Don't call
11975         `branching.CheckOutParameters()' here, this is called in
11976         MergeTopBlock().
11977         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11978         when adding the `finally' vector.       
11979
11980 2003-12-13  Martin Baulig  <martin@ximian.com>
11981
11982         * flowanalysis.cs
11983         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11984         actually work and also fix #48962.
11985
11986 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11987
11988         * decl.cs: Do not check System.Object for nested types,
11989         since we know it does not have any. Big bang for buck:
11990
11991         BEFORE:
11992            Run 1:   8.35 seconds
11993            Run 2:   8.32 seconds
11994            corlib:  17.99 seconds
11995         AFTER:
11996            Run 1:   8.17 seconds
11997            Run 2:   8.17 seconds
11998            corlib:  17.39 seconds
11999
12000 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12001
12002         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12003         time we are returning 0 members, so we save alot here.
12004
12005 2003-12-11  Martin Baulig  <martin@ximian.com>
12006
12007         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12008         `MergeChild()', also just take the `FlowBranching' as argument;
12009         call Merge() on it and return the result.
12010         (FlowBranching.Merge): We don't need to do anything if we just
12011         have one sibling.
12012
12013 2003-12-11  Martin Baulig  <martin@ximian.com>
12014
12015         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12016         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12017         Maurer for this idea.
12018
12019 2003-12-11  Martin Baulig  <martin@ximian.com>
12020
12021         * flowanalysis.cs (MergeResult): This class is now gone; we now
12022         use the `UsageVector' for this.  The reason for this is that if a
12023         branching just has one sibling, we don't need to "merge" them at
12024         all - that's the next step to do.
12025         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12026         `MergeResult'.
12027
12028 2003-12-11  Martin Baulig  <martin@ximian.com>
12029
12030         Reworked flow analyis and made it more precise and bug-free.  The
12031         most important change is that we're now using a special `Reachability'
12032         class instead of having "magic" meanings of `FlowReturns'.  I'll
12033         do some more cleanups and optimizations and also add some more
12034         documentation this week.
12035
12036         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12037         largely reworked this class.
12038         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12039         the new `Reachability' class instead of having "magic" values here.
12040         (FlowBranching): We're now using an instance of `Reachability'
12041         instead of having separate `Returns', `Breaks' etc. fields.
12042
12043         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12044         based on flow analysis; ignore the return value of block.Emit ().
12045
12046 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12047
12048         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12049         if they are private.
12050
12051 2003-12-09  Martin Baulig  <martin@ximian.com>
12052
12053         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12054         call them directly on the UsageVector.
12055
12056 2003-12-09  Martin Baulig  <martin@ximian.com>
12057
12058         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12059         Changed return type from `FlowReturns' to `Reachability'.
12060
12061 2003-12-09  Martin Baulig  <martin@ximian.com>
12062
12063         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12064         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12065         `Reachable' fields with a single `Reachability' one.
12066
12067 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12068
12069         * class.cs (FindMembers): Remove foreach's.
12070
12071         Bootstrap times:
12072
12073         BEFORE
12074                 Run 1:   8.74 seconds
12075                 Run 2:   8.71 seconds
12076
12077         AFTER
12078                 Run 1:   8.64 seconds
12079                 Run 2:   8.58 seconds
12080
12081
12082 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12083
12084         * cs-parser.jay:
12085         * gen-treedump.cs:
12086         * statement.cs:
12087         This patch does a few things:
12088                 1. EmptyStatement is now a singleton, so it is never reallocated.
12089                 2. All blah is EmptyStatement constructs have been changed to
12090                    blah == EmptyStatement.Value, which is much faster and valid
12091                    now that EmptyStatement is a singleton.
12092                 3. When resolving a block, rather than allocating a new array for
12093                    the non-empty statements, empty statements are replaced with
12094                    EmptyStatement.Value
12095                 4. Some recursive functions have been made non-recursive.
12096         Mainly the performance impact is from (3), however (1) and (2) are needed for
12097         this to work. (4) does not make a big difference in normal situations, however
12098         it makes the profile look saner.
12099
12100         Bootstrap times:
12101
12102         BEFORE
12103         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12104         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12105         Total memory allocated: 56397 KB
12106
12107         AFTER
12108         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12109         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12110         Total memory allocated: 55666 KB
12111
12112 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12113
12114         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12115         than the hashtable in a hashtable version
12116
12117         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12118         we always end up concating a string. This results in a huge perf
12119         loss, because many strings have to be tracked by the GC. In this
12120         patch, we first use a hashtable that works with two keys, so that
12121         the strings do not need to be concat'ed.
12122
12123         Bootstrap times:
12124         BEFORE
12125                 Run 1:   8.74 seconds
12126                 Run 2:   8.71 seconds
12127
12128         AFTER
12129                 Run 1:   8.65 seconds
12130                 Run 2:   8.56 seconds
12131
12132 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12133
12134         * Makefile: Add a new target `do-time' that does a quick and simple
12135         profile, leaving easy to parse output.
12136
12137 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12138
12139         * codegen.cs (Init): Create the dynamic assembly with 
12140         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12141
12142 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12143
12144         * support.cs: Make the PtrHashtable use only one
12145         instance of its comparer.
12146
12147 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12148
12149         * typemanager.cs: Fix lookup of GetNamespaces.
12150
12151 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12152
12153         * expression.cs: Removed redundant line.
12154
12155         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12156         ArrayLists, use for loops with bounds.  
12157
12158         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12159         arraylist.
12160
12161         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12162         arraylists, use for loop with bounds.
12163
12164         The above three changes give us a 0.071 second performance
12165         improvement out of 3.294 seconds down to 3.223.  On my machine
12166         the above changes reduced the memory usage by 1,387 KB during
12167         compiler bootstrap.
12168
12169         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12170         QualifiedIdentifiers.  Before we created a new string through
12171         concatenation, and mostly later on, the result would be
12172         manipulated by DecomposeQI through string manipulation.
12173
12174         This reduced the compiler memory usage for bootstrapping from
12175         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12176         compile times in 0.05 seconds.
12177
12178 2003-11-28  Dick Porter  <dick@ximian.com>
12179
12180         * support.cs: Do string compares with the Invariant culture.
12181
12182         * rootcontext.cs: 
12183         * gen-treedump.cs: 
12184         * expression.cs: 
12185         * driver.cs: 
12186         * decl.cs: 
12187         * codegen.cs: 
12188         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12189         the comparison is done with the Invariant culture.
12190
12191 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12192
12193         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12194         GetEnumerator method.
12195
12196         (ProbeCollectionType): Iterate starting at the most specific type
12197         upwards looking for a GetEnumerator
12198
12199         * expression.cs: Shift count can be up to 31 for int/uint and 63
12200         for long/ulong.
12201
12202 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * statement.cs (Block.LookupLabel): Also look for the label on the
12205         children blocks.  Use a hash table to keep track of visited
12206         nodes. 
12207
12208         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12209         we actually did transform the other operand, otherwise fall back
12210         to the common codepath that casts to long.
12211
12212         * cs-tokenizer.cs: Use the same code pattern as the int case.
12213         Maybe I should do the parsing myself, and avoid depending on the
12214         Parse routines to get this done.
12215
12216 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12219         which fixes bug 51347.  This time test it.
12220
12221         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12222         attributes for example can not tell the difference between these.
12223         The difference was only a syntax feature of the language. 
12224
12225         * attribute.cs: Apply attributes to delegates.
12226
12227         * delegate.cs: Call the apply attributes method.
12228
12229 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12232         comparing 0 vs Byte.MinValue, not the value
12233
12234         (ImplicitConversionRequired): When reporting a conversion error,
12235         use error 31 to print out the constant error instead of the
12236         simpler 29.
12237
12238         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12239         which fixes bug 51347.
12240
12241 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12242
12243         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12244         which fixes the -warnaserror command line option.
12245
12246 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12247
12248         * cfold.cs (DoNumericPromotions): During constant folding of
12249         additions on UIntConstant, special case intconstants with
12250         IntConstants like we do on the expression binary operator. 
12251
12252 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * convert.cs (ImplicitReferenceConversion): We were missing a case
12255         (System.Enum are not value types or class types, so we need to
12256         classify them separatedly).
12257
12258         * driver.cs: We do not support error 2007.
12259
12260 2003-11-12 Jackson Harper <jackson@ximian.com>
12261
12262         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12263         system directory. Also use the full file name so users can
12264         libraries names mscorlib-o-tron.dll in a non system dir.
12265         
12266 2004-01-04  David Sheldon <dave-mono@earth.li>
12267
12268         * expression.cs: Added matching ")" to error message for CS0077.
12269
12270 2003-12-19  Martin Baulig  <martin@ximian.com>
12271
12272         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12273         static method; see documentation in the method.
12274         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12275
12276         * convert.cs (Convert.ImplicitReferenceConversion,
12277         Convert.ImplicitReferenceConversionExists): Add support for
12278         generic type declarations; see gen-36.cs.
12279
12280 2003-12-19  Martin Baulig  <martin@ximian.com>
12281
12282         * pending.cs (Pending.InterfaceMethod): Use
12283         `Type.IsAssignableFrom()' instead of `=='.
12284
12285 2003-12-18  Martin Baulig  <martin@ximian.com>
12286
12287         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12288         byref types first.
12289
12290         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12291         `expr_type.Equals (target_type)' instead of `=='.
12292
12293 2003-12-08  Martin Baulig  <martin@ximian.com>
12294
12295         * generics.cs (Constraints.Types): Removed.
12296         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12297         to Type's.
12298         (Constraints.ResolveTypes): New public method; resolves the
12299         TypeExpr's to Type's.
12300         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12301         longer takes the constraints.
12302         (TypeParameter.DefineMethod): Likewise.
12303         (TypeParameter.DefineType): New public method.  Calls
12304         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12305         the constraints.
12306
12307 2003-12-08  Martin Baulig  <martin@ximian.com>
12308
12309         * convert.cs (Convert.ImplicitConversionStandard): Use
12310         `expr_type.Equals (target_type)' instead of `=='.
12311
12312 2003-12-08  Martin Baulig  <martin@ximian.com>
12313
12314         * typemanager.cs (TypeManager.GetReferenceType): Call
12315         `Type.MakeByRefType ()'.
12316
12317 2003-12-08  Martin Baulig  <martin@ximian.com>
12318
12319         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12320         just has some special meaning in some situations.  For instance,
12321         it is allowed to use `where' as the name of a variable etc.
12322
12323 2003-12-04  Martin Baulig  <martin@ximian.com>
12324
12325         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12326         `Type.MakeArrayType()' for array types.
12327
12328 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12329
12330         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12331         debugging message.
12332
12333         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12334         corlib to compile.
12335
12336 2003-11-16  Martin Baulig  <martin@ximian.com>
12337
12338         * codegen.cs (EmitContext.IsGeneric): Removed.
12339
12340         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12341         ResolveGeneric() on the DeclSpace.
12342
12343 2003-11-16  Martin Baulig  <martin@ximian.com>
12344
12345         * generic.cs (TypeArguments.Resolve):
12346         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12347         `ResolveType()' on it to get the Type.
12348
12349 2003-11-15  Martin Baulig  <martin@ximian.com>
12350
12351         * generic.cs (ConstructedType.GetInterfaces): Override this.
12352
12353 2003-11-14  Martin Baulig  <martin@ximian.com>
12354
12355         * interface.cs (Interface.DefineType): Define all type parameters
12356         before adding the interfaces we inherit.
12357
12358 2003-11-11  Martin Baulig  <martin@ximian.com>
12359
12360         * generic.cs (ConstructedType.ResolveType): Always call
12361         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12362
12363 2003-11-10  Martin Baulig  <martin@ximian.com>
12364
12365         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12366         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12367         calling `ResolveType()' on them, directly assign their `Type'.
12368
12369 2003-11-08  Martin Baulig  <martin@ximian.com>
12370
12371         * generic.cs (ConstructedType): Override `IsClass' etc.
12372
12373 2003-11-08  Martin Baulig  <martin@ximian.com>
12374
12375         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12376         return value and the `out parent' parameter.
12377         (TypeContainer.DefineType): Moved the CS0644 check into
12378         GetClassBases().  Don't pass the interface types to the
12379         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12380         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12381
12382         * ecore.cs (TypeExpr.IsAttribute): New property.
12383         (TypeExpr.GetInterfaces): New method.
12384
12385         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12386         TypeExpr instead of a Type.
12387         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12388         (Interface.DefineType): Don't pass the interface types to the
12389         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12390         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12391
12392         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12393         instead of a `Type[]'.
12394         (TypeManager.RegisterBuilder): Likewise.
12395         (TypeManager.AddUserInterface): Likewise.
12396         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12397         `Type[]' and also return a `TypeExpr[]'.
12398         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12399
12400 2003-11-08  Martin Baulig  <martin@ximian.com>
12401
12402         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12403         Expression.     
12404
12405 2003-11-08  Martin Baulig  <martin@ximian.com>
12406
12407         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12408         TypeManager.ResolveExpressionTypes().
12409
12410         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12411         instead of an Expression.
12412         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12413         (TypeExpression): New public class; formerly known as `TypeExpr'.
12414
12415         * expression.cs (ComposedCast): Derive from TypeExpr.
12416
12417         * typemanager.cs (TypeManager.system_*_expr): These are now
12418         TypExpr's instead of Expression's.
12419         (TypeManager.ResolveExpressionTypes): New public static function;
12420         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12421         of them.        
12422
12423 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12424
12425         * expression.cs (New.DoResolve): Do not dereference value that
12426         might be a null return.
12427
12428         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12429         sure that the constant value has the right type.  Fixes an
12430         unreported bug, similar to 50425.
12431
12432         * const.cs (Const.LookupConstantValue): Call
12433         ImplicitStandardConversionExists before doing a conversion to
12434         avoid havng the TypeManager.ChangeType do conversions.
12435
12436         Reduced the number of casts used
12437
12438         (Const.ChangeType): New routine to enable reuse of the constant
12439         type changing code from statement.
12440
12441         * typemanager.cs (ChangeType): Move common initialization to
12442         static global variables.
12443
12444         Fixes #50425.
12445
12446         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12447         every value type to go through, even if it was void.  Fix that. 
12448
12449         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12450         character of the define, and the is_identifier_part_character for
12451         the rest of the string.
12452
12453 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * expression.cs (UnaryMutator.EmitCode): When I updated
12456         LocalVariableReference.DoResolve, I overdid it, and dropped an
12457         optimization done on local variable references.
12458
12459 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * ecore.cs: Convert the return from Ldlen into an int.
12462
12463 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12464
12465         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12466         the accessibility, this is a special case for toplevel non-public
12467         classes (internal for instance).
12468
12469 2003-10-20  Nick Drochak <ndrochak@gol.com>
12470
12471         * ecore.cs: Fix typo and build.  Needed another right paren.
12472
12473 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12476         `internal' case regular and protected, but not allowing protected
12477         to be evaluated later.  Bug 49840
12478
12479 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12480
12481         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12482         to kb.Nlast, and not the kb.nFirst to isolate the switch
12483         statement.
12484
12485         Extract the underlying type, so enumerations of long/ulong are
12486         treated like long/ulong.
12487
12488 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12489
12490         * expression.cs (New): Overload the meaning of RequestedType to
12491         track the possible creation of the NewDelegate type, since
12492         DoResolve is invoked more than once for new constructors on field
12493         initialization.
12494
12495         See bugs: #48800 and #37014
12496
12497         * cs-parser.jay (declare_local_constants): Take an arraylist
12498         instead of a single constant.
12499
12500         (local_constant_declaration): It should take a
12501         constant_declarators, not a constant_declarator.  Fixes 49487
12502
12503         * convert.cs: Fix error report.
12504
12505 2003-10-13 Jackson Harper <jackson@ximian.com>
12506
12507         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12508         bug #49611
12509         
12510 2003-11-03  Martin Baulig  <martin@ximian.com>
12511
12512         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12513         `out bool has_type_arg'; if set, we need to pass the type to
12514         ig.Emit().
12515         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12516         Stelem_Any/Ldelem_Any for generic parameters.   
12517
12518 2003-11-02  Martin Baulig  <martin@ximian.com>
12519
12520         * expression.cs (Invocation.EmitCall): Use
12521         `TypeManager.IsValueType()' to check whether it's a value type.
12522         Don't set `struct_call' when calling a method on a type parameter.
12523
12524 2003-11-02  Martin Baulig  <martin@ximian.com>
12525
12526         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12527         and removed the TypeBuilder argument.
12528
12529         * typemanager.cs (TypeManager.IsValueType): Return
12530         `t.IsGenericParameter || t.IsValueType'.
12531
12532 2003-10-25  Martin Baulig  <martin@ximian.com>
12533
12534         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12535         call ConstructedType.Resolve() on it.
12536
12537         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12538
12539 2003-10-25  Martin Baulig  <martin@ximian.com>
12540
12541         * class.cs (TypeContainer.GetClassBases): Changed
12542         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12543         CS8214 reporting here.
12544         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12545         instead of a `Type' for our parent.  In case of a recursive
12546         declaration (see tests/gen-23.cs for an example), our parent is a
12547         ConstructedType and it doesn't have its type set.  So, first
12548         create our own TypeBuilder, then call constructed.Resolve() to get
12549         the parent's type and finally TypeBuilder.SetParent() it.
12550
12551         * ecore.cs (TypeExpr.Name): New public virtual property.
12552
12553         * generic.cs
12554         (ConstructedType): We're now a TypeExpr and not just an Expression.
12555         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12556         arguments here; this is done later.
12557         (ConstructedType.Resolve): New public method to resolve the type
12558         arguments and bind them.
12559
12560 2003-10-21  Martin Baulig  <martin@ximian.com>
12561
12562         * convert.cs: Use `TypeManager.IsValueType' instead of
12563         'type.IsValueType' everywhere.
12564
12565         * typemanager.cs (TypeManager.IsValueType): Return true for type
12566         parameters.  The reason for this is that we need to box a type
12567         parameter when converting it to a reference type.
12568
12569         * cs-parser.jay: Added support for default value expressions.
12570
12571         * generics.cs (DefaultValueExpression): New public class.       
12572
12573 2003-10-17  Martin Baulig  <martin@ximian.com>
12574
12575         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12576         TypeContainer so we can also use this for Interfaces.
12577         (TypeParameter.Resolve): Likewise.
12578
12579         * interface.cs (Interface.DefineType): Added support for generic
12580         interfaces.
12581
12582         * cs-parser.jay: Added support for generic structs and interfaces.
12583
12584 2003-10-17  Martin Baulig  <martin@ximian.com>
12585
12586         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12587         call generic methods :-)
12588
12589 2003-10-16  Martin Baulig  <martin@ximian.com>
12590
12591         * cs-parser.jay (namespace_or_type_name): Only create a
12592         GenericMemberAccess if we actually have type arguments.
12593
12594 2003-10-13  Martin Baulig  <martin@ximian.com>
12595
12596         * class.cs (Method.Define): If we're a generic method, call
12597         TypeBuilder.DefineGenericMethod () before resolving
12598         the parameters.
12599         (MethodData): Added .ctor which takes an additional MethodBuilder
12600         argument; this is used for generic methods.
12601         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12602         we already have a MethodBuilder.
12603
12604 2003-10-10  Martin Baulig  <martin@ximian.com>
12605
12606         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12607         instead of a `DeclSpace'.  This is used for generic methods.
12608
12609         * cs-parser.jay (method_header): Added support for generic
12610         methods; create a `GenericMethod' instance and pass it to the
12611         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12612         parameters and locals.
12613
12614         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12615         since we already have the location.  Check whether we're a generic
12616         type declaration or a generic method and create the correct type
12617         parameter.
12618
12619         * generic.cs (TypeParameter.DefineMethod): New public method.
12620         (GenericMethod): New public class; derives from DeclSpace and is
12621         used for generic methods.       
12622
12623 2003-10-09  Martin Baulig  <martin@ximian.com>
12624
12625         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12626         to the .ctor.
12627         (MethodCore.DoDefineParameters): Removed the TypeContainer
12628         argument; use the DeclSpace which was passed to the .ctor instead.
12629         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12630         TypeContainer; we only need a DeclSpace here.
12631
12632 2003-10-09  Martin Baulig  <martin@ximian.com>
12633
12634         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12635         to the .ctor.
12636         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12637         EmitContext's .ctor.    
12638
12639 2003-10-09  Martin Baulig  <martin@ximian.com>
12640
12641         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12642         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12643         AsAccessible(), moved them as well.
12644
12645         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12646
12647 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12648
12649         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12650         generation for >=, as spotted by Paolo, bug 48679.  
12651         Patch from David Waite.
12652
12653         * cs-tokenizer.cs: Add handling for #pragma.
12654
12655         * cs-parser.jay: Allow for both yield and yield return in the
12656         syntax.  The anti-cobolization of C# fight will go on!
12657
12658         * class.cs (TypeBuilder.DefineType): Catch error condition here
12659         (Parent.DefineType erroring out and returning null).
12660
12661         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12662         coping with enumerations variables, we were mistakenly processing
12663         them as a regular value type instead of built-in types.  Fixes the
12664         bug #48063
12665
12666         * typemanager.cs (IsBuiltinOrEnum): New method.
12667
12668 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * cs-parser.jay: Upgrade: yield now needs the return clause.
12671
12672 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12673
12674         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12675
12676 2003-09-29  Martin Baulig  <martin@ximian.com>
12677
12678         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12679         inflated generic methods.
12680
12681         * generics.cs (ConstructedType): Distinguish between open and
12682         closed constructed types; correctly resolve the arguments.
12683
12684 2003-09-22  Martin Baulig  <martin@ximian.com>
12685
12686         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12687         all type arguments meet their constraints.
12688
12689 2003-09-19  Martin Baulig  <martin@ximian.com>
12690
12691         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12692         `MemberCache parent' argument.  Normally, an interface doesn't
12693         have a parent type except System.Object, but we use this in gmcs
12694         for generic type parameters.
12695
12696 2003-09-18  Martin Baulig  <martin@ximian.com>
12697
12698         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12699         on `type.IsInterface'; don't check whether the type has a parent
12700         to determine whether it's an interface.
12701
12702 2003-09-17  Martin Baulig  <martin@ximian.com>
12703
12704         * generic.cs (ConstructedType.ToString): Always use `name' as the
12705         type name.
12706
12707 2003-09-15  Martin Baulig  <martin@ximian.com>
12708
12709         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12710
12711         * generic.cs (Constraints.Resolve): New public method; this is
12712         called to resolve the constraint types and to check whether all
12713         the constraints are correct.
12714         (Constraints.Types): New public property.
12715         (TypeParameter.Resolve): New public method; resolves all the
12716         type's constraints.
12717
12718         * class.cs (TypeContainer.DefineType): Call
12719         TypeParameter.Resolve() before actually defining the type.
12720
12721 2003-09-15  Martin Baulig  <martin@ximian.com>
12722
12723         * class.cs (TypeContainer.DefineType): Added an error flag to
12724         avoid reporting duplicate CS0146's ("class definition is
12725         circular.").
12726
12727         * driver.cs (Driver.MainDriver): Abort if
12728         RootContext.ResolveTree() reported any errors.
12729
12730 2003-09-07  Martin Baulig  <martin@ximian.com>
12731
12732         * report.cs (Error, Warning): Added overloaded versions which take
12733         a `params object[] args' and call String.Format().
12734
12735 2003-09-07  Martin Baulig  <martin@ximian.com>
12736
12737         * decl.cs (DeclSpace..ctor): Don't call
12738         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12739         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12740         (DeclSpace.RecordDecl): New method.
12741
12742         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12743
12744 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12745
12746         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12747         value attributes to be applied to ParameterBuilders.
12748
12749         * class.cs (MethodCore.LabelParameters): Make static and more
12750         generic so that it can be used from other places - like interface
12751         methods, for instance.
12752
12753         * interface.cs (Interface.Emit): Call LabelParameters before
12754         emitting attributes on the InterfaceMethod.
12755
12756 2003-09-07  Martin Baulig  <martin@ximian.com>
12757
12758         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12759         if the number of type parameters doesn't match.
12760
12761 2003-09-04  Martin Baulig  <martin@ximian.com>
12762
12763         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12764         for arrays of generic type params (ie. `!0[]').
12765
12766 2003-09-04  Martin Baulig  <martin@ximian.com>
12767
12768         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12769         for the moment.
12770
12771 2003-09-04  Martin Baulig  <martin@ximian.com>
12772
12773         * decl.cs (DeclSpace.LookupGeneric): New method.
12774         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12775         moment.
12776
12777         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12778         argument, not just a string.
12779         (TypeParameter.Define): New public method; this is called to
12780         actually define the generic parameter; after this, you can use the
12781         new `Type' property to get the type.
12782
12783 2003-09-04  Martin Baulig  <martin@ximian.com>
12784
12785         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12786         is now an ArrayList; initialize the result of the `TypeParameters'
12787         property here.
12788         (DeclSpace.GetGenericData): Removed.
12789         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12790         implement this in a different way.
12791         (DeclSpace.GetTypeParameters): Removed; there's now a
12792         `TypeParameters' property.
12793         (DeclSpace.TypeParameters): New public property.
12794
12795         * generic.cs (Constraints): Make this class public.
12796         (TypeParameter): New public class.
12797
12798 2003-09-04  Martin Baulig  <martin@ximian.com>
12799
12800         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12801         generic parameters.
12802
12803         * class.cs (TypeContainer.DefineType): Call
12804         TypeBuilder.DefineGenericParameter () on all generic parameters if
12805         this is a generic type.
12806
12807 2003-08-28  Martin Baulig  <martin@ximian.com>
12808
12809         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12810         sample-stack.il".
12811
12812         * sample-hello.cs: Compile this with gmcs: "gmcs
12813         /r:sample-stack.dll sample-hello.cs".
12814
12815 2003-08-28  Martin Baulig  <martin@ximian.com>
12816
12817         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12818         the parameters to the generic type.
12819
12820 2003-08-28  Martin Baulig  <martin@ximian.com>
12821
12822         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12823
12824 2003-08-28  Martin Baulig  <martin@ximian.com>
12825
12826         * cs-parser.jay (opt_type_argument_list): Use
12827         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12828         (primary_expression): Replace `qualified_identifier' with `type_name'.
12829         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12830
12831         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12832         parser to check whether it is syntactically a type parameter list;
12833         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12834         this case.
12835
12836 2003-08-26  Martin Baulig  <martin@ximian.com>
12837
12838         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12839         resolving aliases; fixes #47927.
12840
12841 2003-08-26  Martin Baulig  <martin@ximian.com>
12842
12843         * statement.cs (Using.DoResolve): This is internally emitting a
12844         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12845         do not always return.  Fixes #47681.
12846
12847 2003-08-26  Martin Baulig  <martin@ximian.com>
12848
12849         * decl.cs (MemberCore): Moved WarningNotHiding(),
12850         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12851         into MemberBase.
12852         (AdditionResult): Make this nested in DeclSpace.
12853         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12854         argument; call NamespaceEntry.Define() unless we're nested in a
12855         class or struct.
12856
12857         * namespace.cs (Namespace.DefineName): New public function.  This
12858         is called from DeclSpace's .ctor to add 
12859         (Namespace.Lookup): Include DeclSpaces in the lookup.
12860
12861         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12862
12863         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12864
12865 2003-08-25  Martin Baulig  <martin@ximian.com>
12866
12867         * convert.cs (Convert.ExplicitReferenceConversion): When
12868         converting from an interface type to a class, unbox if the target
12869         type is a struct type.  Fixes #47822.
12870
12871 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12872
12873         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12874         #47854.
12875
12876 2003-08-22  Martin Baulig  <martin@ximian.com>
12877
12878         * class.cs (TypeManager.DefineType): When defining a nested type,
12879         call DefineType() on our parent; fixes #47801.
12880
12881 2003-08-22  Martin Baulig  <martin@ximian.com>
12882
12883         * class.cs (MethodData.Define): While checking if a method is an
12884         interface implementation, improve the test a bit more to fix #47654.
12885
12886 2003-08-22  Martin Baulig  <martin@ximian.com>
12887
12888         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12889         correctly; fixes #47722.
12890
12891 2003-08-22  Martin Baulig  <martin@ximian.com>
12892
12893         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12894         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12895
12896         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12897
12898 2003-08-22  Martin Baulig  <martin@ximian.com>
12899
12900         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12901         can only be assigned in static constructors.  Fixes #47161.
12902
12903 2003-08-22  Martin Baulig  <martin@ximian.com>
12904
12905         Rewrote and improved the flow analysis code.
12906
12907         * flowbranching.cs (FlowBranching): Make this class abstract.
12908         (FlowBranching.CreateBranching): New static function to create a
12909         new flow branching.
12910         (FlowBranchingBlock, FlowBranchingException): New classes.
12911         (FlowBranching.UsageVector.Type): New public readonly field.
12912         (FlowBranching.UsageVector.Breaks): Removed the setter.
12913         (FlowBranching.UsageVector.Returns): Removed the setter.
12914         (FlowBranching.UsageVector): Added Break(), Return(),
12915         NeverReachable() and Throw() methods to modify the reachability.
12916         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12917         done by FlowBranching.Merge().
12918         (FlowBranching.UsageVector.MergeChild): New method; merges the
12919         merge result into the current vector.
12920         (FlowBranching.Merge): New abstract method to merge a branching.
12921
12922 2003-08-12  Martin Baulig  <martin@ximian.com>
12923
12924         * expression.cs (Indirection.CacheTemporaries): Create the
12925         LocalTemporary with the pointer type, not its element type.
12926
12927 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12928
12929         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12930         token was a keyword or not.
12931
12932         Add `error' options where an IDENTIFIER was expected;  Provide
12933         CheckToken and CheckIdentifierToken convenience error reporting
12934         functions. 
12935
12936         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12937
12938         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12939         NameSpaceEntry NameSpaceEntry.
12940
12941         (LookupInterfaceOrClass): Avoid creating a full qualified name
12942         from namespace and name: avoid doing lookups when we know the
12943         namespace is non-existant.   Use new Tree.LookupByNamespace which
12944         looks up DeclSpaces based on their namespace, name pair.
12945
12946         * driver.cs: Provide a new `parser verbose' to display the
12947         exception thrown during parsing.  This is turned off by default
12948         now, so the output of a failure from mcs is more graceful.
12949
12950         * namespace.cs: Track all the namespaces defined in a hashtable
12951         for quick lookup.
12952
12953         (IsNamespace): New method
12954
12955 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12956
12957         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12958         we know that we need to concatenate (full typename can never be
12959         null). 
12960
12961         * class.cs: ditto.
12962
12963         * statement.cs: Use a bitfield;  Do not initialize to null things
12964         which are done by the constructor by default.
12965
12966         * cs-parser.jay: bug fix, parameter was 4, not 3.
12967
12968         * expression.cs: Just use the property;
12969
12970         * statement.cs: No need for GetVariableInfo method.
12971
12972 2003-08-08  Martin Baulig  <martin@ximian.com>
12973
12974         * flowanalysis.cs (FlowReturns): This is now nested in the
12975         `FlowBranching' class.
12976         (MyBitVector): Moved this here from statement.cs.
12977         (FlowBranching.SiblingType): New enum type.
12978         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12979
12980 2003-08-07  Martin Baulig  <martin@ximian.com>
12981
12982         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12983         `FlowBranching' class and called `BranchingType'.
12984
12985 2003-08-07  Martin Baulig  <martin@ximian.com>
12986
12987         * flowanalysis.cs: Moved all the control flow analysis code into
12988         its own file.
12989
12990 2003-08-07  Martin Baulig  <martin@ximian.com>
12991
12992         * assign.cs (Assign.DoResolve): `target' must either be an
12993         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12994         #37319.
12995
12996 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * expression.cs (BinaryMethod): This kind of expression is created by the
12999         Binary class if it determines that the operator has to be handled
13000         by a method.
13001
13002         (BinaryDelegate): This kind of expression is created if we are
13003         dealing with a + or - operator on delegates.
13004
13005         (Binary): remove method, argumetns, and DelegateOperator: when
13006         dealing with methods, 
13007
13008         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13009
13010         * statement.cs (Block): use bitfields for the three extra booleans
13011         we had in use.   Remove unused topblock parameter.
13012
13013         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13014
13015         * assign.cs: Drop extra unneeded tests.
13016
13017 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13018
13019         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13020
13021         * statement.cs (Foreach): Use VariableStorage instead of
13022         LocalBuilders.   
13023
13024         * codegen.cs (VariableStorage): New class used by clients that
13025         require a variable stored: locals or fields for variables that
13026         need to live across yield.
13027
13028         Maybe provide a convenience api for EmitThis+EmitLoad?
13029
13030         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13031         these bad boys.
13032
13033 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13034
13035         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13036         RemapParameterLValue): New methods that are used to turn a
13037         precomputed FieldInfo into an expression like this:
13038
13039                 instance.FieldInfo
13040
13041         The idea is to use this instead of making LocalVariableReference
13042         have more than one meaning.
13043
13044         * cs-parser.jay: Add error production to BASE.
13045
13046         * ecore.cs: Deal with TypeManager.GetField returning null, which
13047         is now a valid return value.
13048
13049         (FieldExprNoAddress): New expression for Fields whose address can
13050         not be taken.
13051
13052         * expression.cs (LocalVariableReference): During the resolve
13053         phases, create new expressions if we are in a remapping context.
13054         Remove code that dealt with remapping here.
13055
13056         (ParameterReference): same.
13057
13058         (ProxyInstance): New expression, like the `This' expression, but
13059         it is born fully resolved.  We know what we are doing, so remove
13060         the errors that are targeted to user-provided uses of `this'.
13061
13062         * statement.cs (Foreach): our variable is now stored as an
13063         Expression;  During resolution, follow the protocol, dont just
13064         assume it will return this.
13065
13066 2003-08-06  Martin Baulig  <martin@ximian.com>
13067
13068         * support.cs (SeekableStreamReader.cs): New public class.
13069
13070         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13071         SeekableStreamReader instead of the normal StreamReader.
13072
13073 2003-08-04  Martin Baulig  <martin@ximian.com>
13074
13075         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13076         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13077         deambiguate casts and delegate invocations.
13078         (parenthesized_expression): Use the new tokens to ensure this is
13079         not a cast of method invocation.
13080
13081         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13082         when reading a `)' and Deambiguate_CloseParens () was previously
13083         called.
13084
13085         * expression.cs (ParenthesizedExpression): New class.  This is
13086         just used for the CS0075 test.
13087         (Binary.DoResolve): Check for CS0075.   
13088
13089 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13090
13091         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13092         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13093         reference comparison.
13094
13095         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13096         examine the ReturnType for equality - this is necessary in the
13097         cases of implicit and explicit operators whose signature also
13098         includes the return type.
13099
13100 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13101
13102         * namespace.cs: Cache the result of the namespace computation,
13103         instead of computing it every time.
13104
13105 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * decl.cs: Use a global arraylist that we reuse over invocations
13108         to avoid excesive memory consumption.  Reduces memory usage on an
13109         mcs compile by one meg (45 average).
13110
13111         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13112         private, work around that.
13113
13114 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13115
13116         * literal.cs (IntLiteral): Define Zero and One static literals. 
13117
13118         * cs-parser.jay (integer_literal): use static literals to reduce
13119         memory usage for the most used literals (0, 1 and -1).  211kb
13120         reduced in memory usage.
13121
13122         Replace all calls to `new ArrayList' with `new
13123         ArrayList(4)' which is a good average number for most allocations,
13124         and also requires only 16 bytes of memory for its buffer by
13125         default. 
13126
13127         This reduced MCS memory usage in seven megabytes for the RSS after
13128         bootstrapping.
13129
13130 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13131
13132         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13133         handle params methods the correct way by forming only one
13134         applicable set with params and normal methods in them. Earlier we
13135         were looking at params methods only if we found no normal methods
13136         which was not the correct thing to do.
13137
13138         (Invocation.BetterFunction): Take separate arguments indicating
13139         when candidate and the best method are params methods in their
13140         expanded form.
13141
13142         This fixes bugs #43367 and #46199.
13143
13144         * attribute.cs: Documentation updates.
13145
13146         (CheckAttribute): Rename to CheckAttributeTarget.
13147         (GetValidPlaces): Rename to GetValidTargets.
13148
13149         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13150         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13151
13152         Fixes bug #44468.
13153
13154 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13155
13156         * codegen.cs: Compute IsGeneric correctly.
13157
13158         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13159         resolution. 
13160
13161         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13162         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13163         regressions, and I was chasing more bugs than I required.
13164
13165         * interface.cs: Use expressions for base type names (like classes
13166         and structs have been doing for a while now), and resolve that.
13167         This patch should probably go into head as well.
13168
13169         This makes it one less user of FindType.
13170
13171 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13172
13173         This compiler can not self host currently.  Need to fix that.
13174         
13175         * Makefile: compile to `gmcs.exe'
13176
13177         * driver.cs: Turn on v2 by default on gmcs.
13178
13179         * generic.cs (ConstructedType): Does no longer take a container
13180         type argument;  That will be taken care of later.
13181
13182         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13183         Use SimpleName to resolve for now, so we can continue the work on
13184         the parser, until we get Type.GetType that understands generics.
13185
13186         (ConstructedType.ToString): Implement
13187
13188         (TypeArguments.Resolve): Resolve the child expressions as types. 
13189         
13190         * cs-parser.jay: Rename interface_constraints to
13191         type_parameter_constraints
13192
13193         (namespace_or_type_name): Only use constructed types for the basic
13194         construction, we will deal with identifier<...> later.
13195
13196         (type/type_name): No longer call DecomposeQI, as
13197         namespace_or_type_name is always decoded now.
13198         
13199 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13200
13201         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13202         closely: we eliminate methods in base types when we have an
13203         applicable method in a top-level type.
13204
13205         Please see section 14.5.5.1 for an exact description of what goes
13206         on. 
13207
13208         This fixes bug #45127 and a host of other related to corlib compilation.
13209
13210         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13211         array is the method corresponding to the top-level type (this is
13212         because of the changes made to icall.c) so we change this
13213         accordingly.
13214
13215         (MethodGroupExpr.Name): This too.
13216
13217         * typemanager.cs (GetElementType): New method which does the right
13218         thing when compiling corlib. 
13219
13220         * everywhere: Make use of the above in the relevant places.
13221
13222 2003-07-22  Martin Baulig  <martin@ximian.com>
13223
13224         * cs-parser.jay (invocation_expression): Moved
13225         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13226         `cast_expression', but create a InvocationOrCast which later
13227         resolves to either an Invocation or a Cast.
13228
13229         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13230         method; call this before EmitStatement() to make sure that this
13231         expression can be used as a statement.
13232
13233         * expression.cs (InvocationOrCast): New class; resolves to either
13234         an Invocation or a Cast.
13235
13236         * statement.cs (StatementExpression): Call ResolveStatement() on
13237         the ExpressionStatement before emitting it.
13238
13239 2003-07-21  Martin Baulig  <martin@ximian.com>
13240
13241         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13242         `ref' and `out' attributes match; fixes #46220.
13243         (MemberAccess.ResolveMemberAccess): You can't reference a type
13244         through an expression; fixes #33180.
13245         (Indexers.GetIndexersForType): Don't return the indexers from
13246         interfaces the class implements; fixes #46502.
13247
13248 2003-07-21  Martin Baulig  <martin@ximian.com>
13249
13250         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13251         CS0661 checks; fixes bug #30442.
13252
13253 2003-07-21  Martin Baulig  <martin@ximian.com>
13254
13255         * decl.cs (AdditionResult): Added `Error'.
13256
13257         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13258
13259         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13260         cs0031.cs actually work.
13261
13262  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13263  
13264         * cs-parser.jay (namespace_name): do not use
13265         namespace_or_type_name, use qualified_identifier, because
13266         namespace_or_type_name will soon return a composed expression
13267         instead of a string.
13268  
13269         (namespace_or_type_name): Instead of returning a string, now this
13270         production returns an expression.
13271  
13272         * codegen.cs (EmitContext): Setup IsGeneric property based on
13273         whether our DeclSpace is generic, our the method is generic.
13274  
13275         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13276         the method is generic.
13277  
13278         * cs-parser.jay (type_arguments, opt_type_argument_list,
13279         type_parameters, type_parameter_list, opt_type_parameter_list,
13280         type_parameter,, opt_type_parameter_constraints_clauses,
13281         type_parameter_constraints_clauses,
13282         type_parameter_constraint_clause, type_parameter_constraint,
13283         interface_constraints): Add new production
13284  
13285         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13286         DeclSpace is generic or not.
13287  
13288         (DeclSpace.SetParameterInfo): New routine, used to set the
13289         parameter info for a type.
13290  
13291         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13292         returns a GenericTypeExpr
13293  
13294         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13295         generic, lookup the generic argument.
13296  
13297         * attribute.cs: Do not allow TypeParameterExpressions in
13298         Attributes.
13299  
13300         * class.cs: Do not allow the Main method to be defined in a
13301         Generic container.
13302  
13303         * expression.cs (SizeOf): Do not allow generic types to be used as
13304         arguments to sizeof.
13305  
13306         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13307         it: whether a type is generic or not.  Only works for types we are
13308         currently building for now.
13309         
13310 2003-07-20  Martin Baulig  <martin@ximian.com>
13311
13312         * namespace.cs: Fixed that bug which caused a crash when compiling
13313         the debugger's GUI.
13314
13315 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13316
13317         * typemanager.cs (LookupTypeReflection): Never expose types which
13318         are NotPublic, NestedPrivate, NestedAssembly, or
13319         NestedFamANDAssem.  We used to return these, and later do a check
13320         that would report a meaningful error, but the problem is that we
13321         would not get the real match, if there was a name override.
13322
13323 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13324
13325         * namespace.cs (Namespace, Name): Do not compute the namespace
13326         name dynamically, compute it in the constructor.  This reduced
13327         memory usage by 1697 KB.
13328
13329         * driver.cs: Use --pause to pause at the end.
13330
13331 2003-07-17  Peter Williams  <peter@newton.cx>
13332
13333         * Makefile: Change the name of the test target so that it doesn't
13334         conflict with the recursive test target.
13335
13336 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13339         AddressOf): Do not use EmitThis, that was wrong, use the actual
13340         this pointer.
13341
13342 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13343
13344         * class.cs (MethodData.Define): While checking if a method is an
13345         interface implementation, improve the test: If we are not public
13346         (use new test here: use the computed MethodAttributes directly,
13347         instead of the parsed modifier flags) check if the `implementing'
13348         method comes from an interface or not.
13349
13350         * pending.cs (VerifyPendingMethods): Slightly better error
13351         message.
13352
13353         * makefile: add test target that does the mcs bootstrap.
13354
13355 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13356
13357         * interface.cs (Define): Do nothing here since there are no
13358         members to populate etc. Move the attribute emission out of here
13359         since this was just totally the wrong place to put it. Attribute
13360         application happens during the 'Emit' phase, not in the 'Define'
13361         phase.
13362
13363         (Emit): Add this method and move the attribute emission here
13364
13365         * rootcontext.cs (EmitCode): Call the Emit method on interface
13366         types too.
13367
13368 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13369
13370         * expression.cs (OverloadResolve): Report error only if Location
13371         is not 'Null' which means that there was a probe going on.
13372
13373 2003-07-14  Martin Baulig  <martin@ximian.com>
13374
13375         * expression.cs (ConditionalLogicalOperator): New public class to
13376         implement user defined conditional logical operators.
13377         This is section 14.11.2 in the spec and bug #40505.
13378
13379 2003-07-14  Martin Baulig  <martin@ximian.com>
13380
13381         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13382
13383 2003-07-14  Martin Baulig  <martin@ximian.com>
13384
13385         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13386
13387         * ecore.cs (IVariable.VerifyFixed): New interface method.
13388
13389         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13390         operator, check whether the variable is actually fixed.  Fixes bug
13391         #36055.  Set a variable definitely assigned when taking its
13392         address as required by the spec.
13393
13394         * statement.cs (LocalInfo.IsFixed): New field.
13395         (LocalInfo.MakePinned): Set `IsFixed' to true.
13396
13397 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13398
13399         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13400         for .ctors, ensure that we only ask for members declared in the
13401         attribute type (BindingFlags.DeclaredOnly).
13402
13403         Fixes bug #43632.
13404
13405         * expression.cs (Error_WrongNumArguments): Report error 1501
13406         correctly the way CSC does.
13407
13408 2003-07-13  Martin Baulig  <martin@ximian.com>
13409
13410         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13411         lookup on the fully qualified name, to make things like "X.X" work
13412         where "X.X" is a fully qualified type name, but we also have a
13413         namespace "X" in the using list.  Fixes #41975.
13414
13415 2003-07-13  Martin Baulig  <martin@ximian.com>
13416
13417         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13418         function. If we're a CompoundAssign, we need to create an embedded
13419         CompoundAssign, not an embedded Assign.
13420         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13421         Fixes #45854.
13422
13423 2003-07-13  Martin Baulig  <martin@ximian.com>
13424
13425         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13426         work to fix bug #46088.
13427
13428 2003-07-13  Ravi Pratap <ravi@ximian.com>
13429
13430         * class.cs (Operator.Emit): Do not emit attributes here - it is
13431         taken care of by the Method class that we delegate too. This takes
13432         care of bug #45876.
13433
13434 2003-07-10  Martin Baulig  <martin@ximian.com>
13435
13436         * expression.cs (TypeOfVoid): New class.
13437         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13438
13439 2003-07-10  Martin Baulig  <martin@ximian.com>
13440
13441         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13442         bug #35957.
13443
13444 2003-07-10  Martin Baulig  <martin@ximian.com>
13445
13446         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13447         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13448
13449         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13450
13451         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13452
13453 2003-07-10  Martin Baulig  <martin@ximian.com>
13454
13455         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13456         of decimal.  Fixes #42850.
13457
13458         NOTE: I also fixed the created byte blob, but this doesn't work on
13459         the MS runtime and csc never produces any byte blobs for decimal
13460         arrays.
13461
13462 2003-07-10  Martin Baulig  <martin@ximian.com>
13463
13464         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13465         structs; fixes #32068.
13466         (Block.AddChildVariableNames): Fixed #44302.
13467
13468 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13469
13470         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13471
13472 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13473
13474         * attribute.cs: And this test is onger needed.
13475
13476 2003-07-08  Martin Baulig  <martin@ximian.com>
13477
13478         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13479         inaccessible types.  Fixes #36313.
13480
13481         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13482
13483         * namespace.cs (NamespaceEntry): Create implicit entries for all
13484         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13485         implicit entries for N1.N2 and N1.
13486
13487 2003-07-08  Martin Baulig  <martin@ximian.com>
13488
13489         Rewrote the handling of namespaces to fix a lot of the issues
13490         wrt. `using' aliases etc.
13491
13492         * namespace.cs (Namespace): Splitted this class into a
13493         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13494
13495         * typemanager.cs (TypeManager.IsNamespace): Removed.
13496         (TypeManager.ComputeNamespaces): Only compute namespaces from
13497         loaded assemblies here, not the namespaces from the assembly we're
13498         currently compiling.
13499
13500 2003-07-08  Martin Baulig  <martin@ximian.com>
13501
13502         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13503
13504 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13505
13506         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13507         already fixed it.  
13508
13509         I thought about the memory savings here, but LookupTypeReflection
13510         is used under already very constrained scenarios.  Compiling
13511         corlib or mcs only exposes one hit, so it would not really reduce
13512         any memory consumption.
13513
13514 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13515
13516         * typemanager.cs: fixes bug #45889 by only adding public types from
13517         other assemblies to the list of known types.
13518
13519 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13520
13521         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13522         on the type we resolved.
13523
13524 2003-07-05  Martin Baulig  <martin@ximian.com>
13525
13526         * pending.cs (PendingImplementation.ParentImplements): Don't
13527         create the proxy if the parent is abstract.
13528
13529         * class.cs (TypeContainer.DefineIndexers): Process explicit
13530         interface implementations first.  Fixes #37714.
13531
13532 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13533
13534         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13535         defined recursively;  but since we modify the input parameters
13536         (left is set to `this' temporarily), we reset this value if the
13537         left_is_explicit is false, which gives the original semantics to
13538         the code.  
13539
13540         * literal.cs (NullPointer): new class used to represent a null
13541         literal in a pointer context.
13542
13543         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13544         type is a pointer, use a NullPointer object instead of a
13545         NullLiteral.   Closes 43687
13546
13547         (ExplicitConversion): Convert pointer values using
13548         the conv opcode to the proper type.
13549
13550         * ecore.cs (New): change ValueTypeVariable property into a method,
13551         that returns whether the valuetype is suitable for being used.
13552
13553         * expression.cs (Binary.DoNumericPromotions): Only return if we
13554         the int constant was a valid uint, and we can return both left and
13555         right as uints.  If not, we continue processing, to trigger the
13556         type conversion.  This fixes 39018.
13557
13558         * statement.cs (Block.EmitMeta): During constant resolution, set
13559         the CurrentBlock property on the emitcontext, so that we resolve
13560         constants propertly.
13561
13562 2003-07-02  Martin Baulig  <martin@ximian.com>
13563
13564         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13565         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13566
13567         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13568         than emitting it here.
13569
13570         * statement.cs: Fixed some more flow analysis bugs.
13571
13572 2003-07-02  Martin Baulig  <martin@ximian.com>
13573
13574         * class.cs (MethodData.Define): When implementing interface
13575         methods, set Final unless we're Virtual.
13576
13577         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13578         check work for interface methods.
13579
13580 2003-07-01  Martin Baulig  <martin@ximian.com>
13581
13582         * ecore.cs (EmitContext.This): Replaced this property with a
13583         GetThis() method which takes a Location argument.  This ensures
13584         that we get the correct error location for a CS0188.
13585
13586 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13589         ImplicitStandardConversion.
13590
13591         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13592
13593 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13594
13595         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13596         optimization.
13597
13598 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13599
13600         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13601         constructors.
13602
13603         (MethodData.Define): Turn off initlocals for unsafe methods.
13604
13605 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13606
13607         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13608         complete;  Fixes #37521.
13609
13610         * delegate.cs: Use Modifiers.TypeAttr to compute the
13611         TypeAttributes, instead of rolling our own.  This makes the flags
13612         correct for the delegates.
13613
13614 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13615
13616         * class.cs (Constructor.Define): Set the private flag for static
13617         constructors as well.
13618
13619         * cs-parser.jay (statement_expression): Set the return value to
13620         null, to avoid a crash when we catch an error.
13621
13622 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * cs-parser.jay: Applied patch from Jackson that adds support for
13625         extern and unsafe modifiers to destructor declarations.
13626
13627         * expression.cs: Report error 21 if the user is trying to index a
13628         System.Array.
13629
13630         * driver.cs: Add an error message, suggested by the bug report.
13631
13632         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13633         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13634
13635 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13636
13637         * namespace.cs: Add some information to reduce FAQs.
13638
13639 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13640
13641         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13642         underlying enumeration types.  Fixes #43915.
13643
13644         * expression.cs: Treat ushort/short as legal values to be used in
13645         bitwise operations.
13646
13647 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13648
13649         * delegate.cs: transfer custom attributes for paramenters from
13650         the delegate declaration to Invoke and BeginInvoke.
13651
13652 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13653
13654         * attribute.cs: handle custom marshalers and emit marshal info
13655         for fields, too.
13656
13657 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13658
13659         * makefile.gnu: Added anonymous.cs to the compiler sources.
13660
13661 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13662
13663         * iterators.cs: Change the name of the proxy class to include two
13664         underscores.
13665
13666         * cs-parser.jay: Update grammar to include anonymous methods.
13667
13668         * anonymous.cs: new file.
13669
13670 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13671
13672         * class.cs (Field.Define): Add missing test for pointers and
13673         safety. 
13674
13675 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13676
13677         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13678         we use the stobj opcode.
13679
13680         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13681         since it wasn't the correct fix. 
13682
13683         It still is puzzling that we are required to use stobj for IntPtr
13684         which seems to be a ValueType.
13685
13686 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13687
13688         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13689         during regular simple name resolution.   Now, the trick is that
13690         instead of returning for processing the simplename, we do a
13691         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13692         contextual lookup type).   If a match is found, return that, if
13693         not, return for further composition.
13694
13695         This fixes long-standing 30485.
13696
13697         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13698         using the address to initialize an object, do an Stobj instead of
13699         using the regular Stelem.
13700
13701         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13702         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13703         Because if we are a BaseIndexerAccess that value will be true.
13704         Fixes 43643.
13705
13706         * statement.cs (GotoCase.Resolve): Return after reporting an
13707         error, do not attempt to continue. 
13708
13709         * expression.cs (PointerArithmetic.Emit): If our operand is a
13710         long, convert our constants to match the operand before
13711         multiplying.  Convert to I type before adding.   Fixes 43670.
13712
13713 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13714
13715         * enum.cs (ImplicitConversionExists) : Rename to
13716         ImplicitEnumConversionExists to remove ambiguity. 
13717
13718         * ecore.cs (NullCast): New type of cast expression class which
13719         basically is very similar to EmptyCast with the difference being
13720         it still is a constant since it is used only to cast a null to
13721         something else
13722         (eg. (string) null)
13723
13724         * convert.cs (ImplicitReferenceConversion): When casting a null
13725         literal, we return a NullCast.
13726
13727         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13728         should be around anymore.
13729
13730         The renaming (reported was slightly wrong). Corrections:
13731
13732         ConvertImplicitStandard -> ImplicitConversionStandard
13733         ConvertExplicitStandard -> ExplicitConversionStandard
13734
13735         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13736         before passing them in !
13737
13738         * convert.cs (ImplicitConversionStandard): When comparing for
13739         equal expr and target types, ensure that expr is not a
13740         NullLiteral.
13741
13742         In general, we must not be checking (expr_type ==
13743         target_type) in the top level conversion methods
13744         (ImplicitConversion, ExplicitConversion etc). This checking is
13745         done in the methods that they delegate to.
13746
13747 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13748
13749         * convert.cs: Move Error_CannotConvertType,
13750         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13751         ImplicitNumericConversion, ImplicitConversionExists,
13752         ImplicitUserConversionExists, StandardConversionExists,
13753         FindMostEncompassedType, FindMostSpecificSource,
13754         FindMostSpecificTarget, ImplicitUserConversion,
13755         ExplicitUserConversion, GetConversionOperators,
13756         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13757         TryImplicitIntConversion, Error_CannotConvertImplicit,
13758         ConvertImplicitRequired, ConvertNumericExplicit,
13759         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13760         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13761         its own file.
13762
13763         Perform the following renames:
13764
13765         StandardConversionExists -> ImplicitStandardConversionExists
13766         ConvertImplicit -> ImplicitConversion
13767         ConvertImplicitStandard -> ImplicitStandardConversion
13768         TryImplicitIntConversion -> ImplicitIntConversion
13769         ConvertImplicitRequired -> ImplicitConversionRequired
13770         ConvertNumericExplicit -> ExplicitNumericConversion
13771         ConvertReferenceExplicit -> ExplicitReferenceConversion
13772         ConvertExplicit -> ExplicitConversion
13773         ConvertExplicitStandard -> ExplicitStandardConversion
13774
13775 2003-05-19  Martin Baulig  <martin@ximian.com>
13776
13777         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13778         (TypeInfo): Added support for structs having structs as fields.
13779
13780         * ecore.cs (FieldExpr): Implement IVariable.
13781         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13782         VariableInfo for the field.
13783
13784 2003-05-18  Martin Baulig  <martin@ximian.com>
13785
13786         * expression.cs (This.DoResolve): Report a CS0027 if we're
13787         emitting a field initializer.
13788
13789 2003-05-18  Martin Baulig  <martin@ximian.com>
13790
13791         * expression.cs (This.ResolveBase): New public function.
13792         (This.DoResolve): Check for CS0188.
13793
13794         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13795         This.Resolve().
13796
13797         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13798         `instance_expression' to null if we don't have any non-static
13799         methods.
13800
13801 2003-05-18  Martin Baulig  <martin@ximian.com>
13802
13803         Reworked the way how local variables and parameters are handled by
13804         the flow analysis code.
13805
13806         * statement.cs (TypeInfo, VariableMap): New public classes.
13807         (VariableInfo): New public class.  This is now responsible for
13808         checking whether a variable has been assigned.  It is used for
13809         parameters and local variables.
13810         (Block.EmitMeta): Take the InternalParameters as argument; compute
13811         the layout of the flow vectors here.
13812         (Block.LocalMap, Block.ParameterMap): New public properties.
13813         (FlowBranching): The .ctor doesn't get the InternalParameters
13814         anymore since Block.EmitMeta() now computes the layout of the flow
13815         vector.
13816         (MyStructInfo): This class is now known as `StructInfo' and nested
13817         in `TypeInfo'; we don't access this directly anymore.
13818
13819         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13820         property and removed IsAssigned(), IsFieldAssigned(),
13821         SetAssigned() and SetFieldAssigned(); we now call them on the
13822         VariableInfo so we don't need to duplicate this code everywhere.
13823
13824         * expression.cs (ParameterReference): Added `Block block' argument
13825         to the .ctor.
13826         (LocalVariableReference, ParameterReference, This): The new
13827         VariableInfo class is now responsible for all the definite
13828         assignment stuff.
13829
13830         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13831         IsParameterAssigned, SetParameterAssigned): Removed.
13832
13833 2003-05-18  Martin Baulig  <martin@ximian.com>
13834
13835         * typemanager.cs (InitCoreTypes): Try calling
13836         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13837         the 3-args-version.  Corlib now also needs our `void_type'.
13838         (GetMethod): Added overloaded version which takes an optional
13839         `bool report_errors' to allow lookups of optional methods.
13840
13841 2003-05-12  Martin Baulig  <martin@ximian.com>
13842
13843         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13844         only used for locals and not for parameters.
13845
13846 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13847
13848         * support.cs (InternalParameters.ParameterType): Return the
13849         ExternalType of the parameter.
13850
13851         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13852         they were unused.
13853
13854 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * class.cs (MethodData.Define): Do not set the `newslot' on
13857         interface members, if they are also flagged as "override".
13858
13859         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13860         better code for ++i and i++.  This only works for static fields
13861         and local variables.
13862
13863         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13864         want to pull the DeclSpace out of the builder_to_declspace instead
13865         of the TypeBuilder (like in TypeContainer.FindMembers).
13866
13867         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13868         instead of LookupTypeContainer.  Fixes the crash on .NET for
13869         looking up interface members.
13870
13871         * const.cs: Create our own emit context during the Definition
13872         stage, so that constants are evaluated in the proper context, when
13873         a recursive definition happens.
13874
13875 2003-05-11  Martin Baulig  <martin@ximian.com>
13876
13877         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13878         new block for a switch section.
13879         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13880         the adding/lookup in the switch block.  Fixes #39828.
13881
13882 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13883
13884         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13885         functionality: I needed to convert the data after I had performed
13886         the add/sub operation into the operands type size.
13887
13888         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13889         pass the type for the box operation, otherwise the resulting
13890         object would have been of type object.
13891
13892         (BoxedCast): Add constructor to specify the type to box as.
13893
13894 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13895
13896         * iterators.cs: I was reusing the `count' variable inadvertently,
13897         take steps to not allow this to happen.
13898
13899 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13902         by creating an array at the point where the params starts and
13903         putting all those arguments there, then adjusting the size of the
13904         array.
13905
13906 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13907
13908         * expression.cs (New.AddressOf): Implement interface
13909         IMemoryLocation.  This is used when the `new' operator is used in
13910         the context of an invocation to a method on a value type.
13911
13912         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13913         example. 
13914
13915         * namespace.cs: Also check the using aliases here.
13916
13917         * driver.cs: Move the test for using validity after the types have
13918         been entered, so we do a single pass that also includes the using
13919         aliases. 
13920
13921         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13922         in the regular case.   CreateSiblingForFinally is doing extra
13923         error checking.
13924
13925         * attribute.cs (GetAttributeArgumentExpression): Store the result
13926         on an out value, and use the return value to indicate failure
13927         instead of using null (which is a valid return for Constant.GetValue).
13928
13929         * statement.cs: Perform the analysis flow for the increment
13930         portion after the statement, because this will be the real flow of
13931         execution.  Fixes #42385
13932
13933         * codegen.cs (EmitContext.EmitArgument,
13934         EmitContext.EmitStoreArgument): New helper functions when the
13935         RemapToProxy flag is set.
13936
13937         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13938         function.
13939
13940         Add support for remapping parameters. 
13941
13942         * iterators.cs: Propagate parameter values;  Store parameter
13943         values in the proxy classes.
13944
13945 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13948         need a proxy reference;  I do not know what I was thinking
13949
13950         * cs-parser.jay (constructor_initializer): catch another error,
13951         and display nice message.
13952
13953         (field_declaration): catch void field declaration
13954         to flag a better error. 
13955
13956         * class.cs (MemberBase.CheckBase): Report an error instead of a
13957         warning if a new protected member is declared in a struct. 
13958         (Field.Define): catch the error of readonly/volatile.
13959
13960         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13961
13962         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13963         volatile variable is taken
13964
13965 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13966
13967         * statement.cs (Fixed.Resolve): Report an error if we are not in
13968         an unsafe context.
13969
13970 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13971
13972         * typemanager.cs: reuse the code that handles type clashes for
13973         delegates and enumerations.
13974
13975         * class.cs (Report28): Always report.
13976
13977         * expression.cs (EncodeAsAttribute): Allow nulls here.
13978
13979 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13980
13981         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13982         the functionality for testing whether an expression is valid for
13983         an attribute here.  Also handle the case of arrays of elements
13984         being stored. 
13985
13986         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13987         encoding a linear array into an array of objects that are suitable
13988         to be passed to an CustomAttributeBuilder.
13989
13990         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13991
13992         * ecore.cs: (FieldExpr): Handle field remapping here.
13993
13994         * iteratators.cs: Pass the instance variable (if the method is an
13995         instance method) to the constructors, so we can access the field
13996         variables on the class.
13997
13998         TODO: Test this with structs.  I think the THIS variable on
13999         structs might have to be a pointer, and not a refenrece
14000
14001 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14002
14003         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14004         local variables to fields in a proxy class.
14005
14006         * iterators.cs (PopulateProxy): Rename our internal fields to
14007         <XXX>.  
14008         Create a <THIS> field if we are an instance method, so we can
14009         reference our parent container variables.
14010         (MapVariable): Called back from the EmitContext code to enter a
14011         new variable to field mapping into the proxy class (we just create
14012         a FieldBuilder).
14013
14014         * expression.cs
14015         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14016         for using the remapped locals to fields.
14017
14018         I placed the code here, because that gives the same semantics to
14019         local variables, and only changes the Emit code.
14020
14021         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14022         statements inside iterators.
14023         (VariableInfo): Add a FieldBuilder for the cases when we are
14024         remapping local variables to fields in a proxy class
14025
14026         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14027         current_block != null.
14028
14029         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14030         not cope with strings, as it has been moved to the
14031         TableSwitchEmit.  Fixed bug in switch generation.
14032
14033         * expression.cs (New.DoResolve): Provide more context for the user
14034         when reporting an error.
14035
14036         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14037         pointers. 
14038
14039         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14040         check the permissions for it.  Note than in a type-resolution
14041         context the check was already present in DeclSpace.ResolveType,
14042         but was missing from the MemberAccess.
14043
14044         (ArrayCreation.CheckIndices): warn if the user has
14045         more nested levels of expressions, but there are no more
14046         dimensions specified.  Avoids crash on bug 41906.
14047
14048 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14049
14050         * statement.cs (Block): replace Implicit bool, for a generic
14051         flags.   
14052         New flag: `Unchecked'.  This is used during the EmitMeta phase
14053         (which is out-of-line with the regular Resolve/Emit process for a
14054         statement, as this is done ahead of time, but still gets a chance
14055         to call constant resolve).
14056
14057         (Block.Flags): new enum for adding a new flag.
14058
14059         (Block.EmitMeta): track the state of unchecked.
14060
14061         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14062         to enable constant resolution to work there as well.
14063
14064 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * typemanager.cs (ienumerable_type): Also look up
14067         System.Collections.IEnumerable. 
14068
14069 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14070
14071         TODO: Test more than one conditional per method.
14072
14073         * class.cs (Indexer.Define): Report the location where the user is
14074         referencing the unsupported feature.
14075
14076         (MethodData): Overload the use of `conditionals' to
14077         minimize the creation of needless ArrayLists.   This saves roughly
14078         212kb on my machine.
14079
14080         (Method): Implement the new IIteratorContainer interface.
14081         (Method.SetYields): Implement the method by setting the ModFlags
14082         to contain METHOD_YIELDS.
14083
14084         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14085         which just got set to null.
14086
14087         * iterators.cs: New file.
14088
14089         (Yield, YieldBreak): New statements.
14090
14091         * statement.cs (Return.Resolve): Flag an error if we are used in
14092         an iterator method.
14093
14094         * codegen.cs (InIterator): New flag set if the code is being
14095         compiled in an iterator method.
14096
14097         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14098         internal modifier, and we just use it to avoid adding extra
14099         fields, as this is seldom used.  
14100
14101         * cs-parser.jay: Add yield_statement (yield and yield break).
14102
14103         * driver.cs: New flag -v2 to turn on version 2 features. 
14104
14105         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14106         hashtable when v2 is enabled.
14107
14108 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14109
14110         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14111         there is already a namespace defined with this name.
14112
14113         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14114         people upgraded their corlibs.
14115
14116         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14117         always use fully qualified types, no need to use the compiler
14118         front end.
14119
14120         (TypeManager.IsNamespace): Use binarysearch.
14121
14122         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14123         AddDelegate): I did not quite use the new IsValid API properly: I
14124         have to pass the short-name and the fullname.  I was passing only
14125         the basename instead of the fullname sometimes. 
14126
14127         (TypeContainer.DefineType): call NamespaceClash.
14128
14129         * interface.cs (Interface.DefineType): use NamespaceClash before
14130         defining the type.
14131
14132         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14133         defining the type.
14134
14135         * enum.cs: (Enum.DefineType): use NamespaceClash before
14136         defining the type.
14137
14138         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14139         speed increase.  First, use the negative_hits cache when we get a
14140         negative.  Second, add the type with its full original name
14141         instead of the new . and + encoded name (reflection uses + to
14142         separate type from a nested type).  Use LookupTypeReflection
14143         directly which bypasses the type->name hashtable (that we already
14144         know does not contain the type.
14145
14146         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14147         location/container type. 
14148
14149         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14150
14151 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14154
14155         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14156         method is being referenced in the method group from a static
14157         context, and report error 120 if so.
14158
14159         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14160         Error118. 
14161
14162         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14163         is created, we create the A namespace).
14164
14165         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14166         Fixes #41591
14167
14168 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14169
14170         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14171         invocation to ModuleBuilder.GetType with the same values will
14172         return a new type instance, so we need to cache its return
14173         values. 
14174
14175         * expression.cs (Binary.ResolveOperator): Only allow the compare
14176         operators on enums if they are of the same type.
14177
14178         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14179         types of ValueType on their own case.  Before we were giving them
14180         the same treatment as objects.
14181
14182         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14183         fullname.  Short name is used to compare against container name.
14184         Fullname is used to check against defined namespace names.
14185
14186         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14187         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14188
14189         (Method.CheckBase): Call parent.
14190         (MemberBase.CheckBase): Check for protected members on sealed
14191         classes.
14192         (PropertyBase.CheckBase): Call parent.
14193         (Field.Define): Call parent.
14194
14195         * report.cs: Negative error codes are now mapped to 8000 - code,
14196         so that the display is render more nicely.
14197
14198         * typemanager.cs: Do not use try/catch, instead report a regular
14199         error. 
14200
14201         (GetPointerType, GetReferenceType): These methods provide
14202         mechanisms to obtain the T* and T& from a T.  We had the code
14203         previously scattered around the code base, and it also used
14204         TypeManager.LookupType that would go through plenty of caches.
14205         This one goes directly to the type source.
14206
14207         In some places we did the Type.GetType followed by
14208         ModuleBuilder.GetType, but not in others, so this unifies the
14209         processing as well.
14210
14211         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14212         statements now that we have namespace information.
14213
14214         * typemanager.cs (IsNamespace): New method, returns whether the
14215         string presented is a namespace or not.
14216
14217         (ComputeNamespaces): New public entry point, computes the list of
14218         available namespaces, using the GetNamespaces API call in Mono, or
14219         the slower version in MS.NET.   
14220
14221         Now before we start the semantic analysis phase, we have a
14222         complete list of namespaces including everything that the user has
14223         provided.
14224
14225         Deleted old code to cache namespaces in .nsc files.
14226
14227 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14228
14229         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14230         class/struct location definition Location for the implicit
14231         constructor location.
14232
14233         (Operator.Define): Use the location of the operator for the
14234         implicit Method definition.
14235
14236         (Constructor.Emit): use the constructor location for the implicit
14237         base initializer constructor.
14238
14239         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14240         and the Expression class now contains two new methods:
14241
14242         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14243         isolate type lookup from the rest of the resolution process.
14244
14245         Since we use Expressions to hold type definitions due to the way
14246         we parse the input we have historically overloaded Resolve to
14247         perform the Type lookups if a special flag is passed.  Now this is
14248         eliminated and two methods take their place. 
14249
14250         The differences in the two methods between xStep and xTerminal is
14251         that xStep is involved in our current lookup system that uses
14252         SimpleNames to compose a name, while xTerminal is used just to
14253         catch the case where the simplename lookup failed.
14254
14255 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * expression.cs (ResolveMemberAccess): Remove redundant code.
14258         TypeExpr expressions are always born fully resolved.
14259
14260         * interface.cs (PopulateMethod): Do not lookup the types twice.
14261         We were doing it once during SemanticAnalysis and once during
14262         PopulateMethod.
14263
14264         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14265         in local variable type definitions, were being returned as a
14266         SimpleName (we decomposed everything into a string), that is
14267         because primary_expression was being used instead of a type in the
14268         grammar (reduce/reduce conflicts).
14269
14270         The part that was wrong is that we converted the expression into a
14271         string (an oversimplification in one hand, compounded with primary
14272         expressions doing string concatenation).
14273
14274         So things like:
14275
14276         A.B.C [] x;
14277
14278         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14279         using clauses from working on this particular context.  And a type
14280         was being matched directly against "A.B.C[]".
14281
14282         We now use the correct approach, and allow for ComposedCast to be
14283         part of the unary expression.  So the "A.B.C []" become a composed
14284         cast of "A.B.C" (as a nested group of MemberAccess with a
14285         SimpleName at the end) plus the rank composition "[]". 
14286
14287         Also fixes 35567
14288
14289 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14290
14291         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14292         for the access level checking.
14293
14294         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14295         `TypeContainer container', because I kept getting confused when I
14296         was debugging this code.
14297
14298         * expression.cs (Indexers): Instead of tracking getters/setters,
14299         we now track them in parallel.  We create one arraylist less, but
14300         most importantly it is possible now for the LValue code to find a
14301         matching get for a set.
14302
14303         (IndexerAccess.DoResolveLValue): Update the code.
14304         GetIndexersForType has been modified already to extract all the
14305         indexers from a type.  The code assumed it did not.
14306
14307         Also make the code set the correct return type for the indexer.
14308         This was fixed a long time ago for properties, but was missing for
14309         indexers.  It used to be void_type.
14310
14311         (Binary.Emit): Test first for doubles instead of
14312         floats, as they are more common.
14313
14314         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14315         when dealing with floats and the <=, >= operators.  This fixes bug
14316         #39314 
14317
14318         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14319         to load the array value by emitting a load on the foreach variable
14320         type.  This was incorrect.  
14321
14322         We now emit the code to load an element using the the array
14323         variable type, and then we emit the conversion operator.
14324
14325         Fixed #40176
14326
14327 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14328
14329         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14330
14331 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14332
14333         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14334         test for protection before we test for signatures. 
14335
14336         (MethodSignature.ToString): implement.
14337
14338         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14339         to the case where we reduced into a LongConstant.
14340
14341         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14342         depend on whether the information is acurrate, because the
14343         Microsoft runtime will always claim that the array type is public,
14344         regardless of the real state.
14345
14346         If the type is a pointer, another problem happens: the type is
14347         reported as non-public in Microsoft.  
14348
14349         In both cases we have to call CheckAccessLevel recursively with
14350         the underlying type as the argument to be tested.
14351
14352 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * assign.cs (Assign.Emit): If we are dealing with a compound
14355         assignment expression, we should use the code path that stores the
14356         intermediate result in a temporary value.  This fixes #40903.
14357
14358         *expression.cs (Indirection.ToString): Provide ToString method for
14359         debugging. 
14360
14361 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14362
14363         * class.cs: Null out fields holding references to Block objects so
14364         they can be garbage collected.
14365
14366         * expression.cs (OverloadResolve): Remove unused local.
14367
14368 2003-04-07  Martin Baulig  <martin@ximian.com>
14369
14370         * codegen.cs (EmitContext.CurrentFile): New public field.
14371         (EmitContext.Mark): Use the CurrentFile to check whether the
14372         location is in the correct file.
14373         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14374
14375 2003-04-07  Martin Baulig  <martin@ximian.com>
14376
14377         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14378
14379         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14380         location.  [FIXME: The location argument which gets passed to this
14381         method is sometimes wrong!]
14382
14383 2003-04-07  Nick Drochak <ndrochak@gol.com>
14384
14385         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14386
14387 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14388
14389         * expression.cs (Indirection.EmitAssign): We were using the
14390         temporary, but returning immediately instead of continuing the
14391         EmitAssing flow.
14392
14393 2003-04-06  Martin Baulig  <martin@ximian.com>
14394
14395         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14396         if it's a nested child, but also deriving from the outer class.
14397         See test 190.cs.
14398
14399         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14400         nested child, but also deriving from the outer class.  See
14401         test-190.cs.
14402         (FilterWithClosure): We may access private members of the outer
14403         class if we're a nested child and deriving from the outer class.
14404         (RealMemberLookup): Only set `closure_private_ok' if the
14405         `original_bf' contained BindingFlags.NonPublic.
14406
14407 2003-04-05  Martin Baulig  <martin@ximian.com>
14408
14409         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14410         probe if its a type parameter, and if so, flag an error.
14411
14412         * decl.cs: Move here the SetParameterInfo code from class.cs.
14413         Handle IsGeneric here.
14414
14415         Handle a variety of errors in the parameter info definition.
14416
14417         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14418         type parameters here.
14419
14420         * cs-parser.jay (class_declaration): report errors for parameters
14421         here as well.
14422
14423 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14424
14425         * generic.cs: New file, contains support code for generics.
14426
14427         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14428         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14429
14430         Update parser for the above removals.
14431
14432         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14433         now taken care of in the parser.
14434
14435 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14436
14437         * class.cs (Event.Define): Do not allow abstract events to have
14438         initializers. 
14439
14440 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14443         block in event declarations.
14444
14445         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14446         value type, get its address.
14447
14448         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14449         leaving a class on the stack instead of a boolean value (int
14450         0/1).  Change the code so we compare against null, and then the
14451         result against zero.
14452
14453         * class.cs (TypeContainer.GetClassBases): We were checking for the
14454         parent class being sealed too late.
14455
14456         * expression.cs (Binary.Emit): For <= and >= when dealing with
14457         floating point values, use cgt.un and clt.un instead of cgt and
14458         clt alone.
14459
14460 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14461
14462         * statement.cs: Apply the same optimization as MS: skip the 
14463         GetEnumerator returning an IEnumerator, and use the one returning a 
14464         CharEnumerator instead. This allows us to avoid the try-finally block 
14465         and the boxing.
14466
14467 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14468
14469         * cs-parser.jay: Attributes cannot be applied to
14470                          namespaces. Fixes #40473
14471
14472 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14473
14474         * class.cs:
14475         (Add*): check if the name is valid using the full name for constants,
14476         fields, properties and events.
14477
14478 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14479
14480         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14481         char constants to be part of the enumeration.
14482
14483         * expression.cs (Conditional.DoResolve): Add support for operator
14484         true. Implements the missing functionality from 14.12
14485
14486         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14487         operator true/false as required by the spec.
14488
14489         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14490         implicit conversion to boolean.
14491
14492         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14493         also one where the type implements `operator true'. 
14494
14495         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14496         get an expression that will invoke operator true based on an
14497         expression.  
14498
14499         (GetConversionOperators): Removed the hack that called op_True
14500         here.  
14501
14502         (Expression.ResolveBoolean): Move this from Statement.
14503
14504 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14505
14506         * ecore.cs (FieldExpr): do not allow initialization of initonly
14507         fields on derived classes
14508
14509 2003-03-13  Martin Baulig  <martin@ximian.com>
14510
14511         * statement.cs (Block.Emit): Call ig.BeginScope() and
14512         ig.EndScope() when compiling with debugging info; call
14513         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14514
14515 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14516
14517         * expression.cs (Indexers): Do not construct immediately, allow
14518         for new members to be appended as we go.  Fixes 38143
14519
14520 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14521
14522         * expression.cs: save/restore context when resolving an unchecked
14523         expression.
14524
14525 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14526
14527         * cfold.cs: Catch division by zero in modulus operator during
14528         constant folding.
14529
14530 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * interface.cs (Interface.DefineMembers): Avoid defining members
14533         twice. 
14534
14535 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * driver.cs: handle the +/- options for -noconfig
14538
14539         * statement.cs (Unckeched.Resolve): Also track the state of
14540         unchecked in the Resolve phase.
14541
14542 2003-02-27  Martin Baulig  <martin@ximian.com>
14543
14544         * ecore.cs (Expression.MemberLookup): Don't create a
14545         MethodGroupExpr for something which is not a method.  Fixes #38291.
14546
14547 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14548
14549         * class.cs (MemberBase.CheckParameters): Also check that the type
14550         is unmanaged if it is a pointer.
14551
14552         * expression.cs (SizeOf.Resolve): Add location information.
14553
14554         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14555         a managed type is declared.
14556
14557         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14558         parameter modifiers as well.  Fixes bug 38606
14559
14560         * class.cs: Very sad.  Am backing out the speed up changes
14561         introduced by the ArrayList -> Array in the TypeContainer, as they
14562         were not actually that much faster, and introduced a bug (no error
14563         reports on duplicated methods).
14564
14565         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14566         source first, this will guarantee that we have a valid expression
14567         before calling in lower levels functions that will require a
14568         resolved object.  Then use this original_source in the
14569         target.ResolveLValue instead of the original source that was
14570         passed to us.
14571
14572         Another change.  Use target.Resolve instead of LValueResolve.
14573         Although we are resolving for LValues, we will let the Assign code
14574         take care of that (it will be called again from Resolve).  This
14575         basically allows code like this:
14576
14577         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14578         class Y { void A (X x) { x [0] += o; }
14579
14580         The problem was that the indexer was trying to resolve for
14581         set_Item (idx, object o) and never finding one.  The real set_Item
14582         was set_Item (idx, X).  By delaying the process we get the right
14583         semantics. 
14584
14585         Fixes bug 36505
14586
14587 2003-02-23  Martin Baulig  <martin@ximian.com>
14588
14589         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14590         while calling DoEmit ().
14591
14592         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14593         source files; if you use the #line directive inside a method, the
14594         compiler stops emitting line numbers for the debugger until it
14595         reaches the end of the method or another #line directive which
14596         restores the original file.
14597
14598 2003-02-23  Martin Baulig  <martin@ximian.com>
14599
14600         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14601
14602 2003-02-23  Martin Baulig  <martin@ximian.com>
14603
14604         * statement.cs (Block.AddChildVariableNames): We need to call this
14605         recursively, not just for our immediate children.
14606
14607 2003-02-23  Martin Baulig  <martin@ximian.com>
14608
14609         * class.cs (Event.Define): Always make the field private, like csc does.
14610
14611         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14612         actually work, fixes bug #37521.
14613
14614 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14615
14616         * delegate.cs: When creating the various temporary "Parameters"
14617         classes, make sure that we call the ComputeAndDefineParameterTypes
14618         on those new parameters (just like we do with the formal ones), to
14619         allow them to be resolved in the context of the DeclSpace.
14620
14621         This fixes the bug that Dick observed in Bugzilla #38530.
14622
14623 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * expression.cs (ResolveMemberAccess): When resolving a constant,
14626         do not attempt to pull a constant if the value was not able to
14627         generate a valid constant.
14628
14629         * const.cs (LookupConstantValue): Do not report more errors than required.
14630
14631 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14632
14633         * expression.cs: fixes bug #38328.
14634
14635 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14636
14637         * class.cs: Changed all the various members that can be part of a
14638         class from being an ArrayList to be an Array of the right type.
14639         During the DefineType type_list, interface_list, delegate_list and
14640         enum_list are turned into types, interfaces, delegates and enums
14641         arrays.  
14642
14643         And during the member population, indexer_list, event_list,
14644         constant_list, field_list, instance_constructor_list, method_list,
14645         operator_list and property_list are turned into their real arrays.
14646
14647         Although we could probably perform this operation earlier, for
14648         good error reporting we need to keep the lists and remove the
14649         lists for longer than required.
14650
14651         This optimization was triggered by Paolo profiling the compiler
14652         speed on the output of `gen-sample-program.pl' perl script. 
14653
14654         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14655         not crash in methods like MemberLookupFailed that use this field.  
14656
14657         This problem arises when the compiler fails to resolve a type
14658         during interface type definition for example.
14659
14660 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14663         inherit from System.Object, so we have to stop at null, not only
14664         when reaching System.Object.
14665
14666 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14667
14668         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14669         DeclaredOnly because the parent indexer might have had a different
14670         name, but did not loop until the top of the hierarchy was reached.
14671
14672         The problem this one fixes is 35492: when a class implemented an
14673         indexer from an interface, we were getting the interface method
14674         (which was abstract) and we were flagging an error (can not invoke
14675         abstract method).
14676
14677         This also keeps bug 33089 functioning, and test-148 functioning.
14678
14679         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14680         out if a method is special is to see if it is declared in a
14681         property or event, or whether it is one of the predefined operator
14682         names.   This should fix correctly #36804.
14683
14684 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14685
14686         The goal here is to remove the dependency on EmptyCast.Peel ().
14687         Killing it completely.
14688
14689         The problem is that currently in a number of places where
14690         constants are expected, we have to "probe" for an EmptyCast, and
14691         Peel, which is not the correct thing to do, as this will be
14692         repetitive and will likely lead to errors. 
14693
14694         The idea is to remove any EmptyCasts that are used in casts that
14695         can be reduced to constants, so we only have to cope with
14696         constants. 
14697
14698         This bug hunt was triggered by Bug 37363 and the desire to remove
14699         the duplicate pattern where we were "peeling" emptycasts to check
14700         whether they were constants.  Now constants will always be
14701         constants.
14702
14703         * ecore.cs: Use an enumconstant here instead of wrapping with
14704         EmptyCast.  
14705
14706         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14707         throwing me off.  By handling this we can get rid of a few hacks.
14708
14709         * statement.cs (Switch): Removed Peel() code.
14710
14711 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14712
14713         * class.cs: Location information for error 508
14714
14715         * expression.cs (New.DoResolve): Add a guard against double
14716         resolution of an expression.  
14717
14718         The New DoResolve might be called twice when initializing field
14719         expressions (see EmitFieldInitializers, the call to
14720         GetInitializerExpression will perform a resolve on the expression,
14721         and later the assign will trigger another resolution
14722
14723         This leads to bugs (#37014)
14724
14725         * delegate.cs: The signature for EndInvoke should contain any ref
14726         or out parameters as well.  We were not doing this in the past. 
14727
14728         * class.cs (Field.Define): Do not overwrite the type definition
14729         inside the `volatile' group.  Turns out that volatile enumerations
14730         were changing the type here to perform a validity test, which
14731         broke conversions. 
14732
14733 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14734
14735         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14736         and structs, we do not want to load the instance variable
14737
14738         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14739         enum_type has to be handled like an object reference (implicit
14740         conversions exists from this to object), but the regular IsClass
14741         and IsValueType tests will never return true for this one.
14742
14743         Also we use TypeManager.IsValueType instead of type.IsValueType,
14744         just for consistency with the rest of the code (this is only
14745         needed if we ever use the construct exposed by test-180.cs inside
14746         corlib, which we dont today).
14747
14748 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14749
14750         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14751         just InternalCall.
14752
14753 2003-02-09  Martin Baulig  <martin@ximian.com>
14754
14755         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14756         (Namespace.DefineNamespaces): New static public method; this is
14757         called when we're compiling with debugging to add all namespaces
14758         to the symbol file.
14759
14760         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14761         pass it to the Namespace's .ctor.
14762
14763         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14764         and MethodBase arguments; pass the namespace ID to the symwriter;
14765         pass the MethodBase instead of the token to the symwriter.
14766         (SymbolWriter.DefineNamespace): New method to add a namespace to
14767         the symbol file.
14768
14769 2003-02-09  Martin Baulig  <martin@ximian.com>
14770
14771         * symbolwriter.cs: New file.  This is a wrapper around
14772         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14773         methods here in near future.
14774
14775 2003-02-09  Martin Baulig  <martin@ximian.com>
14776
14777         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14778         ILGenerator.MarkSequencePoint() which are actually used by the
14779         symbol writer.
14780
14781 2003-02-09  Martin Baulig  <martin@ximian.com>
14782
14783         * location.cs (SourceFile): New public sealed class.  This
14784         contains the name and an index which is used in the location's token.
14785         (Location): Reserve an appropriate number of bits in the token for
14786         the source file instead of walking over that list, this gives us a
14787         really huge performance improvement when compiling with debugging.
14788
14789         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14790         `SourceFile' argument instead of a string.
14791         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14792         but don't parse/tokenize here, we need to generate the list of all
14793         source files before we do that.
14794         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14795         the files.
14796
14797         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14798         instead of a string.
14799
14800         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14801         of a string.
14802
14803 2003-02-09  Martin Baulig  <martin@ximian.com>
14804
14805         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14806         filename on `#line default'.
14807
14808 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14809
14810         * statement.cs: don't clear the pinned var when the fixed statement
14811         returns from the method (fixes bug#37752).
14812
14813 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14814
14815         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14816         to IsValueType.
14817
14818 2003-02-07  Martin Baulig  <martin@ximian.com>
14819
14820         * driver.cs: Removed the `--debug-args' command line argument.
14821
14822         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14823         automatically by the AsssemblyBuilder.
14824         (CodeGen.InitializeSymbolWriter): We don't need to call any
14825         initialization function on the symbol writer anymore.  This method
14826         doesn't take any arguments.
14827
14828 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14829
14830         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14831         from referenced assemblies as well.
14832
14833 2003-02-02  Martin Baulig  <martin@ximian.com>
14834
14835         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14836
14837 2003-02-02  Martin Baulig  <martin@ximian.com>
14838
14839         * class.cs (Constructor.Emit): Open the symbol writer before
14840         emitting the constructor initializer.
14841         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14842         single-stepping through constructor initializers.
14843
14844 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14845
14846         * class.cs: Handle error 549: do not allow virtual methods in
14847         sealed classes. 
14848
14849 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14850
14851         * decl.cs: Check access levels when resolving types
14852
14853 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14854
14855         * statement.cs: Add parameters and locals set in catch blocks that might 
14856         return to set vector
14857
14858 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14859
14860         * class.cs (Operator): Set the SpecialName flags for operators.
14861
14862         * expression.cs (Invocation.DoResolve): Only block calls to
14863         accessors and operators on SpecialName methods.
14864
14865         (Cast.TryReduce): Handle conversions from char constants.
14866
14867
14868 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14869
14870         * statement.cs: small memory and time optimization in FlowBranching.
14871
14872 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14873
14874         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14875         problem that the last fix but in the other sid (Set).
14876
14877         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14878         access when there is no indexer in the hierarchy.
14879
14880 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14881
14882         * class.cs: Combine some if statements.
14883
14884 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14885
14886         * driver.cs: fixed bug #37187.
14887
14888 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14889
14890         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14891         any indexer, it's needed to build a list with all the indexers in the
14892         hierarchy (AllGetters), else we have problems. Fixes #35653.
14893
14894 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14895
14896         * class.cs (MethodData.Define): It is wrong for an interface
14897         implementation to be static in both cases: explicit and implicit.
14898         We were only handling this in one case.
14899
14900         Improve the if situation there to not have negations.
14901
14902         * class.cs (Field.Define): Turns out that we do not need to check
14903         the unsafe bit on field definition, only on usage.  Remove the test.
14904
14905 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14906
14907         * driver.cs: use assembly.Location instead of Codebase (the latest
14908         patch made mcs fail when using MS assemblies).
14909
14910 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14911
14912         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14913         get the path to *corlib.dll.
14914
14915 2003-01-21  Nick Drochak <ndrochak@gol.com>
14916
14917         * cs-tokenizer.cs:
14918         * pending.cs:
14919         * typemanager.cs: Remove compiler warnings
14920
14921 2003-01-20  Duncan Mak  <duncan@ximian.com>
14922
14923         * AssemblyInfo.cs: Bump the version number to 0.19.
14924
14925 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14926
14927         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14928
14929 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14930
14931         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14932
14933 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14934
14935         * cs-parser.jay: Small fix: we were not comparing the constructor
14936         name correctly.   Thanks to Zoltan for the initial pointer.
14937
14938 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14939
14940         * cs-tokenizer.cs: Set file name when specified with #line
14941
14942 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14943
14944         * cs-parser.jay: Only perform the constructor checks here if we
14945         are named like the class;  This will help provider a better
14946         error.  The constructor path is taken when a type definition is
14947         not found, but most likely the user forgot to add the type, so
14948         report that rather than the constructor error.
14949
14950 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14951
14952         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14953         allocations.
14954
14955 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14956
14957         * cs-parser.jay: Add cleanup call.
14958
14959 2003-01-13  Duncan Mak  <duncan@ximian.com>
14960
14961         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14962         consistent with other methods.
14963
14964 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14965
14966         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14967
14968 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14969
14970         * attribute.cs: only set GuidAttr to true when we have a
14971         GuidAttribute.
14972
14973 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14974
14975         * ecore.cs:
14976         * expression.cs:
14977         * typemanager.cs: fixes to allow mcs compile corlib with the new
14978         Type.IsSubclassOf fix.
14979
14980 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14981
14982         * expression.cs (LocalVariableReference.DoResolve): Classify a
14983         constant as a value, not as a variable.   Also, set the type for
14984         the variable.
14985
14986         * cs-parser.jay (fixed_statement): take a type instead of a
14987         pointer_type, so we can produce a better error message later.
14988
14989         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14990         as an error.  
14991
14992         (For.DoEmit): Make inifinite loops have a
14993         non-conditional branch back.
14994
14995         (Fixed.DoEmit): First populate the pinned variables, then emit the
14996         statement, then clear the variables.  Before I was emitting the
14997         code once for each fixed piece.
14998
14999
15000 2003-01-08  Martin Baulig  <martin@ximian.com>
15001
15002         * statement.cs (FlowBranching.MergeChild): A break in a
15003         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15004
15005 2003-01-08  Martin Baulig  <martin@ximian.com>
15006
15007         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15008         lives in the same number space than `param_map'.  Fixes #36154.
15009
15010 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * cs-parser.jay (constructor_declaration): Set the
15013         Constructor.ModFlags before probing for it.  This makes the
15014         compiler report 514, 515 and 132 (the code was there, but got
15015         broken). 
15016
15017         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15018         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15019         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15020
15021 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15022
15023         * enum.cs: create the enum static fields using the enum type.
15024
15025 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15026
15027         * class.cs: don't try to create the ParamBuilder for the return
15028         type if it's not needed (and handle it breaking for the ms runtime
15029         anyway).
15030
15031 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15032
15033         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15034
15035 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15036
15037         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15038         the command.   This showed up while compiling the JANET source
15039         code, which used \r as its only newline separator.
15040
15041 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * class.cs (Method.Define): If we are an operator (because it
15044         reuses our code), then set the SpecialName and HideBySig.  #36128
15045
15046 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15047
15048         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15049         exception, report error 120 `object reference required'.
15050
15051         * driver.cs: Add --pause option, used during to measure the size
15052         of the process as it goes with --timestamp.
15053
15054         * expression.cs (Invocation.DoResolve): Do not allow methods with
15055         SpecialName to be invoked.
15056
15057 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15060         number before adding it.
15061
15062 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15063
15064         * ecore.cs (StandardImplicitConversion): When in an unsafe
15065         context, we allow conversion between void * to any other pointer
15066         type. This fixes bug #35973.
15067
15068 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15069
15070         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15071         is not thrown when extensionless outputs are used 
15072
15073 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15074
15075         * rootcontext.cs: fixed compilation of corlib.
15076
15077 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15078
15079         * attribute.cs (Attributes.Contains): Add new method.
15080
15081         * class.cs (MethodCore.LabelParameters): if the parameter is an
15082         `out' parameter, check that no attribute `[In]' has been passed.
15083
15084         * enum.cs: Handle the `value__' name in an enumeration.
15085
15086 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15087
15088         * decl.cs: Added special case to allow overrides on "protected
15089         internal" methods
15090
15091 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15092
15093         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15094         since it makes much more sense.
15095
15096         (Attributes.ctor): Don't require a Location parameter.
15097
15098         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15099
15100         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15101         since we already have that information per attribute.
15102
15103         * everywhere : make appropriate changes.
15104
15105         * class.cs (LabelParameters): Write the code which actually
15106         applies attributes to the return type. We can't do this on the MS
15107         .NET runtime so we flag a warning in the case an exception is
15108         thrown.
15109
15110 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15111
15112         * const.cs: Handle implicit null conversions here too.
15113
15114 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15115
15116         * class.cs (MethodCore.LabelParameters): Remove the extra
15117         Type [] parameter since it is completely unnecessary. Instead
15118         pass in the method's attributes so that we can extract
15119         the "return" attribute.
15120
15121 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15124         of ignoring it and letting the compile continue.
15125
15126         * typemanager.cs (ChangeType): use an extra argument to return an
15127         error condition instead of throwing an exception.
15128
15129 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15130
15131         * expression.cs (Unary.TryReduce): mimic the code for the regular
15132         code path.  Perform an implicit cast in the cases where we can
15133         implicitly convert to one of the integral types, and then reduce
15134         based on that constant.   This fixes bug #35483.
15135
15136 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15137
15138         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15139
15140 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15141
15142         * namespace.cs: fixed bug #35489.
15143
15144 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15145
15146         * class.cs: Remove some dead code.
15147
15148         * cs-parser.jay: Estimate the number of methods needed
15149         (RootContext.MethodCount);
15150
15151         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15152         numbers instead of StringBuilders.
15153
15154         * support.cs (PtrHashtable): Add constructor with initial size;
15155         We can now reduce reallocations of the method table.
15156
15157 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15158
15159         * attribute.cs (ApplyAttributes): Keep track of the emitted
15160         attributes on a per-target basis. This fixes bug #35413.
15161
15162 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15163
15164         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15165         default to the Windows 1252 encoding.
15166
15167         (UnixParseOption): Support version, thanks to Alp for the missing
15168         pointer. 
15169
15170         * AssemblyInfo.cs: Add nice assembly information.
15171
15172         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15173         (bug 35169).
15174
15175         * cs-parser.jay: Allow a trailing comma before the close bracked
15176         in the attribute_section production.
15177
15178         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15179         address of the instance was being taken, I will take this out,
15180         because we take the address of the object immediately here.
15181
15182 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15183
15184         * typemanager.cs (AreMultipleAllowed): Take care of the most
15185         obvious case where attribute type is not in the current assembly -
15186         stupid me ;-)
15187
15188 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15189
15190         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15191         definitions, instead of doing that afterwards.  
15192
15193         Also we use a nice little hack, depending on the constructor, we
15194         know if we are a "composed" name or a simple name.  Hence, we
15195         avoid the IndexOf test, and we avoid 
15196
15197         * codegen.cs: Add code to assist in a bug reporter to track down
15198         the source of a compiler crash. 
15199
15200 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15201
15202         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15203         types have been emitted for a given element and flag an error
15204         if something which does not have AllowMultiple set is used more
15205         than once.
15206
15207         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15208         attribute types and their corresponding AllowMultiple properties
15209
15210         (AreMultipleAllowed): Check the property for a given type.
15211
15212         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15213         property in the case we have a TypeContainer.
15214
15215         (Attributes.AddAttribute): Detect duplicates and just skip on
15216         adding them. This trivial fix catches a pretty gross error in our
15217         attribute emission - global attributes were being emitted twice!
15218
15219         Bugzilla bug #33187 is now fixed.
15220
15221 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15222
15223         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15224         instead of pp_and).
15225
15226         * expression.cs (Binary.ResolveOperator): I can only use the
15227         Concat (string, string, string) and Concat (string, string,
15228         string, string) if the child is actually a concatenation of
15229         strings. 
15230
15231 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15232
15233         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15234         context where we need a 2-character lookahead.
15235
15236         * pending.cs (PendingImplementation): Rework so we can keep track
15237         of interface types all the time, and flag those which were
15238         implemented by parents as optional.
15239
15240 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15241
15242         * expression.cs (Binary.ResolveOperator): Use
15243         String.Concat(string,string,string) or
15244         String.Concat(string,string,string,string) when possible. 
15245
15246         * typemanager: More helper methods.
15247
15248
15249 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15250
15251         * pending.cs: remove the bogus return from GetMissingInterfaces()
15252         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15253
15254 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15255
15256         * namespace.cs: avoid duplicated 'using xxx' being added to
15257         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15258         when we get more than one 'using' statement for the same namespace.
15259         Report a CS0105 warning for it.
15260
15261 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15262
15263         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15264         of calling getChar/putback, uses internal knowledge of it.    
15265
15266         (xtoken): Reorder tokenizer so most common patterns are checked
15267         first.  This reduces the compilation time in another 5% (from 8.11s
15268         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15269
15270         The parsing time is 22% of the compilation in mcs, and from that
15271         64% is spent on the tokenization process.  
15272
15273         I tried using a binary search for keywords, but this is slower
15274         than the hashtable.  Another option would be to do a couple of
15275         things:
15276
15277                 * Not use a StringBuilder, instead use an array of chars,
15278                   with a set value.  Notice that this way we could catch
15279                   the 645 error without having to do it *afterwards*.
15280
15281                 * We could write a hand-parser to avoid the hashtable
15282                   compares altogether.
15283
15284         The identifier consumption process takes 37% of the tokenization
15285         time.  Another 15% is spent on is_number.  56% of the time spent
15286         on is_number is spent on Int64.Parse:
15287
15288                 * We could probably choose based on the string length to
15289                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15290                   computations. 
15291
15292         Another 3% is spend on wrapping `xtoken' in the `token' function.
15293
15294         Handle 0xa0 as whitespace (#34752)
15295
15296 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * typemanager.cs (IsCLRType): New routine to tell whether a type
15299         is one of the builtin types.  
15300
15301         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15302         typecode in more places instead of doing pointer comparissions.
15303         We could leverage some knowledge about the way the typecodes are
15304         laid out.
15305
15306         New code to cache namespaces in assemblies, it is currently not
15307         invoked, to be used soon.
15308
15309         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15310
15311         * expression.cs (Binary.ResolveOperator): specially handle
15312         strings, and do not perform user-defined operator overloading for
15313         built-in types.
15314
15315 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15318         internalcall as it is a pretty simple operation;  Avoid whenever
15319         possible to call Char.IsLetter.
15320
15321         (consume_identifier): Cut by half the number of
15322         hashtable calls by merging the is_keyword and GetKeyword behavior.
15323
15324         Do not short-circuit, because if we do, we
15325         report errors (ie, #if false && true would produce an invalid
15326         directive error);
15327
15328
15329 2002-11-24  Martin Baulig  <martin@ximian.com>
15330
15331         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15332         check constant ranges and report a CS0221.  Fixes #33186.
15333
15334 2002-11-24  Martin Baulig  <martin@ximian.com>
15335
15336         * cs-parser.jay: Make this work for uninitialized variable
15337         declarations in the `for' initializer.  Fixes #32416.
15338
15339 2002-11-24  Martin Baulig  <martin@ximian.com>
15340
15341         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15342         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15343
15344 2002-11-24  Martin Baulig  <martin@ximian.com>
15345
15346         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15347         argument; if true, we also check for user-defined conversions.
15348         This is only needed if both arguments are of a user-defined type.
15349         Fixes #30443, added test-175.cs.
15350         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15351
15352         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15353
15354 2002-11-24  Martin Baulig  <martin@ximian.com>
15355
15356         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15357         function to get the store opcode.
15358         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15359         only emit the Ldelema if the store opcode is Stobj.  You must run
15360         both test-34 and test-167 to test this.  Fixes #34529.
15361
15362 2002-11-23  Martin Baulig  <martin@ximian.com>
15363
15364         * ecore.cs (Expression.MemberLookup): Added additional
15365         `qualifier_type' argument which is used when we're being called
15366         from MemberAccess.DoResolve() and null if we're called from a
15367         SimpleName lookup.
15368         (Expression.MemberLookupFailed): New method to report errors; this
15369         does the CS1540 check and reports the correct error message.
15370
15371         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15372         argument for the CS1540 check and redone the way how we're dealing
15373         with private members.  See the comment in the source code for details.
15374         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15375         `closure_start_type' to `closure_qualifier_type' and check whether
15376         it's not null.  It was not this filter being broken, it was just
15377         being called with the wrong arguments.
15378
15379         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15380         and pass it the correct `qualifier_type'; this also does the error
15381         handling for us.
15382
15383 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15384
15385         * expression.cs (Invocation.EmitParams): If the we are dealing
15386         with a non-built-in value type, load its address as well.
15387
15388         (ArrayCreation): Use a a pretty constant instead
15389         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15390         static initializers.  
15391
15392         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15393         because they are not really value types, just glorified integers. 
15394
15395         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15396
15397         * ecore.cs: Remove redundant code for enumerations, make them use
15398         the same code path as everything else, fixes the casting issue
15399         with enumerations in Windows.Forms.
15400
15401         * attribute.cs: Do only cast to string if it is a string, the
15402         validation happens later.
15403
15404         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15405         people upgrade their corlibs.
15406
15407         * ecore.cs: Oops, enumerations were not following the entire code path
15408
15409 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15410
15411         * typemanager.cs (FilterWithClosure): Commented out the test for
15412         1540 in typemanager.cs, as it has problems when accessing
15413         protected methods from a parent class (see test-174.cs). 
15414
15415         * attribute.cs (Attribute.ValidateGuid): new method.
15416         (Attribute.Resolve): Use above.
15417
15418 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15421
15422         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15423         handling for enumerations, as we only needed the TypeContainer
15424         functionality to begin with (this is required for the fix below to
15425         work for enums that reference constants in a container class for
15426         example). 
15427
15428         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15429
15430         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15431         a valid TypeBuilder to perform lookups on.o
15432
15433         * class.cs (InheritableMemberSignatureCompare): Use true in the
15434         call to GetGetMethod and GetSetMethod, because we are comparing
15435         the signature, and we need to get the methods *even* if they are
15436         private. 
15437
15438         (PropertyBase.CheckBase): ditto.
15439
15440         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15441         GotoCase.Resolve): Use Peel on EmpytCasts.
15442
15443         * ecore.cs (EmptyCast): drop child, add Peel method.
15444
15445 2002-11-17  Martin Baulig  <martin@ximian.com>
15446
15447         * ecore.cs (EmptyCast.Child): New public property.
15448
15449         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15450         label resolved to an EmptyCast.  Fixes #34162.
15451         (GotoCase.Resolve): Likewise.
15452         (Block.EmitMeta): Likewise.
15453
15454 2002-11-17  Martin Baulig  <martin@ximian.com>
15455
15456         * expression.cs (Invocation.BetterConversion): Prefer int over
15457         uint; short over ushort; long over ulong for integer literals.
15458         Use ImplicitConversionExists instead of StandardConversionExists
15459         since we also need to check for user-defined implicit conversions.
15460         Fixes #34165.  Added test-173.cs.
15461
15462 2002-11-16  Martin Baulig  <martin@ximian.com>
15463
15464         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15465         with the `true' and `false' literals.  Fixes #33151.
15466
15467 2002-11-16  Martin Baulig  <martin@ximian.com>
15468
15469         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15470         October 22nd; don't do the cs1540 check for static members.
15471
15472         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15473         now using our own filter here and doing the cs1540 check again.
15474
15475 2002-11-16  Martin Baulig  <martin@ximian.com>
15476
15477         * support.cs (InternalParameters): Don't crash if we don't have
15478         any fixed parameters.  Fixes #33532.
15479
15480 2002-11-16  Martin Baulig  <martin@ximian.com>
15481
15482         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15483         when looking up static methods to make this work on Windows.
15484         Fixes #33773.
15485
15486 2002-11-16  Martin Baulig  <martin@ximian.com>
15487
15488         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15489         a setter rather than using PropertyInfo.CanWrite.
15490
15491 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15492
15493         * class.cs: Allow acces to block member by subclasses. Fixes build
15494         breaker.
15495
15496 2002-11-14  Martin Baulig  <martin@ximian.com>
15497
15498         * class.cs (Constructor.Emit): Added the extern/block check.
15499         Fixes bug #33678.
15500
15501 2002-11-14  Martin Baulig  <martin@ximian.com>
15502
15503         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15504         iteration while looking for indexers, this is needed because the
15505         indexer may have a different name in our base classes.  Fixed the
15506         error reporting (no indexers at all, not get accessor, no
15507         overloaded match).  Fixes bug #33089.
15508         (IndexerAccess.DoResolveLValue): Likewise.
15509
15510 2002-11-14  Martin Baulig  <martin@ximian.com>
15511
15512         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15513         indexers.  Fixes the first part of bug #33089.
15514         (MethodSignature.InheritableMemberSignatureCompare): Added support
15515         for properties.
15516
15517 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15518
15519         * attribute.cs (Attribute.Resolve): Catch the
15520         NullReferenceException and report it since it isn't supposed to
15521         happen. 
15522
15523 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15524
15525         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15526         LogicalOr and LogicalAnd that can benefit from recursively
15527         handling EmitBranchable.  The code now should be nice for Paolo.
15528
15529 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15532         the Type lookups, as we perform quite a number of lookups on
15533         non-Types.  This can be removed once we can deterministically tell
15534         whether we have a type or a namespace in advance.
15535
15536         But this might require special hacks from our corlib.
15537
15538         * TODO: updated.
15539
15540         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15541         and double which avoids a conversion from an integer to a double.
15542
15543         * expression.cs: tiny optimization, avoid calling IsConstant,
15544         because it effectively performs the lookup twice.
15545
15546 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15547
15548         But a bogus return here to keep the semantics of the old code
15549         until the Mono runtime is fixed.
15550
15551         * pending.cs (GetMissingInterfaces): New method used to remove all
15552         the interfaces that are already implemented by our parent
15553         classes from the list of pending methods. 
15554
15555         * interface.cs: Add checks for calls after ResolveTypeExpr.
15556
15557 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15558
15559         * class.cs (Class.Emit): Report warning 67: event not used if the
15560         warning level is beyond 3.
15561
15562         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15563         being a NullLiteral.
15564
15565         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15566         specifiers. 
15567
15568         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15569         path that might fail if a type can not be resolved.
15570
15571         * expression.cs (Binary.Emit): Emit unsigned versions of the
15572         operators. 
15573
15574         * driver.cs: use error 5.
15575
15576 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15577
15578         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15579
15580 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * cs-parser.jay (switch_section): A beautiful patch from Martin
15583         Baulig that fixed 33094.
15584
15585 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15588         Check whether the base is abstract and report an error if so.
15589
15590         * expression.cs (IndexerAccess.DoResolveLValue,
15591         IndexerAccess.DoResolve): ditto. 
15592
15593         (Invocation.DoResolve): ditto.
15594
15595         (Invocation.FullMethodDesc): Improve the report string.
15596
15597         * statement.cs (Block): Eliminate IsVariableDefined as it is
15598         basically just a wrapper for GetVariableInfo.
15599
15600         * ecore.cs (SimpleName): Use new 
15601
15602         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15603         type, as we return the actual parameter ref/unref state on a
15604         different call.
15605
15606 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * support.cs: Return proper flags REF/OUT fixing the previous
15609         commit.  
15610
15611         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15612         not used to mean `ref' but `ref or out' in ParameterReference
15613
15614         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15615         full type signature instead of calling TypeManger.CSharpName
15616         ourselves. 
15617
15618         * support.cs (InternalParameters.ParameterDesc): Do not compare
15619         directly to the modflags, because REF/OUT will actually be bitsets
15620         if set. 
15621
15622         * delegate.cs (VerifyMethod): Check also the modifiers.
15623
15624         * cs-tokenizer.cs: Fix bug where floating point values with an
15625         exponent where a sign was missing was ignored.
15626
15627         * driver.cs: Allow multiple assemblies to be specified in a single
15628         /r: argument
15629
15630 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15631
15632         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15633         because identifiers after a parenthesis would end up in this kind
15634         of production, and we needed to desamiguate it for having casts
15635         like:
15636
15637                 (UserDefinedType *) xxx
15638
15639 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15640
15641         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15642         we should set on the Bindingflags.NonPublic, but not turn on
15643         private_ok.  private_ok controls whether a Private member is
15644         returned (this is chekced on the filter routine), while the
15645         BindingFlags.NonPublic just controls whether private/protected
15646         will be allowed.   This fixes the problem part of the problem of
15647         private properties being allowed to be used in derived classes.
15648
15649         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15650         so we can call the children DoResolveLValue method (this will
15651         properly signal errors on lvalue assignments to base properties)
15652
15653         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15654         getter are null, and we have a property info, we know that this
15655         happened because the lookup failed, so we report an error 122 for
15656         protection level violation.
15657
15658         We also silently return if setter and getter are null in the
15659         resolve functions, this condition only happens if we have flagged
15660         the error before.  This is the other half of the problem. 
15661
15662         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15663         not have accessibility information, that is why we were returning
15664         true in the filter function in typemanager.cs.
15665
15666         To properly report 122 (property is inaccessible because of its
15667         protection level) correctly, we report this error in ResolveAccess
15668         by failing if both the setter and the getter are lacking (ie, the
15669         lookup failed). 
15670
15671         DoResolve and DoLResolve have been modified to check for both
15672         setter/getter being null and returning silently, the reason being
15673         that I did not want to put the knowledge about this error in upper
15674         layers, like:
15675
15676         int old = Report.Errors;
15677         x = new PropertyExpr (...);
15678         if (old != Report.Errors)
15679                 return null;
15680         else
15681                 return x;
15682
15683         So the property expr is returned, but it is invalid, so the error
15684         will be flagged during the resolve process. 
15685
15686         * class.cs: Remove InheritablePropertySignatureCompare from the
15687         class, as we no longer depend on the property signature to compute
15688         whether it is possible to implement a method or not.
15689
15690         The reason is that calling PropertyInfo.GetGetMethod will return
15691         null (in .NET, in Mono it works, and we should change this), in
15692         cases where the Get Method does not exist in that particular
15693         class.
15694
15695         So this code:
15696
15697         class X { public virtual int A { get { return 1; } } }
15698         class Y : X { }
15699         class Z : Y { public override int A { get { return 2; } } }
15700
15701         Would fail in Z because the parent (Y) would not have the property
15702         defined.  So we avoid this completely now (because the alternative
15703         fix was ugly and slow), and we now depend exclusively on the
15704         method names.
15705
15706         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15707         reference method, instead of using the property.
15708
15709         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15710         routines are gone now.
15711
15712         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15713         names, they were incorrectly named.
15714
15715         * cs-tokenizer.cs: Return are more gentle token on failure. 
15716
15717         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15718         had an out-of-sync index variable, which caused it to remove from
15719         the list of pending methods the wrong method sometimes.
15720
15721 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15722
15723         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15724         CanWrite, because those refer to this particular instance of the
15725         property, and do not take into account the fact that we can
15726         override single members of a property.
15727
15728         Constructor requires an EmitContext.  The resolution process does
15729         not happen here, but we need to compute the accessors before,
15730         because the resolution does not always happen for properties.
15731
15732         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15733         subclass, before we did not update this flag, but we did update
15734         bindingflags. 
15735
15736         (GetAccessors): Drop this routine, as it did not work in the
15737         presence of partially overwritten set/get methods. 
15738
15739         Notice that this broke the cs1540 detection, but that will require
15740         more thinking. 
15741
15742 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15743
15744         * class.cs:
15745         * codegen.cs:
15746         * driver.cs: issue a warning instead of an error if we don't support
15747         debugging for the platform. Also ignore a couple of errors that may
15748         arise when trying to write the symbols. Undo my previous patch.
15749
15750 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15751
15752         * driver.cs: ignore /debug switch except for Unix platforms.
15753
15754 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15755
15756         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15757
15758 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15759
15760         * driver.cs: Do not make mcs-debug conditional, so we do not break
15761         builds that use it.
15762
15763         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15764         review this patch.  But basically after all the children variables
15765         have been merged, the value of "Breaks" was not being set to
15766         new_breaks for Switch blocks.  I think that it should be set after
15767         it has executed.  Currently I set this to the value of new_breaks,
15768         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15769         conservative, but I do not understand this code very well.
15770
15771         I did not break anything in the build, so that is good ;-)
15772
15773         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15774
15775 2002-10-20  Mark Crichton  <crichton@gimp.org>
15776
15777         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15778
15779 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15780
15781         * cfold.cs: Fixed compile blocker.
15782
15783 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * driver.cs: I was chekcing the key, not the file.
15786
15787 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15788
15789         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15790         message that we were generating - we just need to silently return
15791         a null.
15792
15793 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * class.cs (Event.Define): Change my previous commit, as this
15796         breaks the debugger.  This is a temporary hack, as it seems like
15797         the compiler is generating events incorrectly to begin with.
15798
15799         * expression.cs (Binary.ResolveOperator): Added support for 
15800         "U operator - (E x, E y)"
15801
15802         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15803         y)".
15804
15805         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15806         init-only variables, but this path did not take into account that
15807         there might be also instance readonly variables.  Correct this
15808         problem. 
15809
15810         This fixes bug 32253
15811
15812         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15813         delegates as well.
15814
15815         * driver.cs: Change the extension for modules to `netmodule'
15816
15817         * cs-parser.jay: Improved slightly the location tracking for
15818         the debugger symbols.
15819
15820         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15821         modifiers that were specified instead of the hardcoded value
15822         (FamAndAssem).  This was basically ignoring the static modifier,
15823         and others.  Fixes 32429.
15824
15825         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15826         fixed a bug in the process (32476)
15827
15828         * expression.cs (ArrayAccess.EmitAssign): Patch from
15829         hwang_rob@yahoo.ca that fixes bug 31834.3
15830
15831 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15832
15833         * driver.cs: Make the module extension .netmodule.
15834
15835 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15836
15837         * driver.cs: Report an error if the resource file is not found
15838         instead of crashing.
15839
15840         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15841         false, like Emit does.
15842
15843 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15844
15845         * typemanager.cs: Remove unused private member.  Also reported mcs
15846         bug to report this as a warning like csc.
15847
15848 2002-10-15  Martin Baulig  <martin@gnome.org>
15849
15850         * statement.cs (Statement.Emit): Made this a virtual method; emits
15851         the line number info and calls DoEmit().
15852         (Statement.DoEmit): New protected abstract method, formerly knows
15853         as Statement.Emit().
15854
15855         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15856
15857 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15858
15859         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15860         have fixed a remaining problem: not every AddXXXX was adding a
15861         fully qualified name.  
15862
15863         Now everyone registers a fully qualified name in the DeclSpace as
15864         being defined instead of the partial name.  
15865
15866         Downsides: we are slower than we need to be due to the excess
15867         copies and the names being registered this way.  
15868
15869         The reason for this is that we currently depend (on the corlib
15870         bootstrap for instance) that types are fully qualified, because
15871         we dump all the types in the namespace, and we should really have
15872         types inserted into the proper namespace, so we can only store the
15873         basenames in the defined_names array.
15874
15875 2002-10-10  Martin Baulig  <martin@gnome.org>
15876
15877         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15878         from bug #31834, see the bug report for a testcase which is
15879         miscompiled.
15880
15881 2002-10-10  Martin Baulig  <martin@gnome.org>
15882
15883         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15884         flow analysis code for this.
15885
15886         * statement.cs (Do, While, For): Tell the flow analysis code about
15887         infinite loops.
15888         (FlowBranching.UsageVector): Added support for infinite loops.
15889         (Block.Resolve): Moved the dead code elimination here and use flow
15890         analysis to do it.
15891
15892 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15893
15894         * class.cs (Field.Define): Catch cycles on struct type
15895         definitions. 
15896
15897         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15898         fields if the fields are static.  We only need to check instance
15899         fields. 
15900
15901         * expression.cs (As.DoResolve): Test for reference type.
15902
15903         * statement.cs (Using.ResolveExpression): Use
15904         ConvertImplicitRequired, not ConvertImplicit which reports an
15905         error on failture
15906         (Using.ResolveLocalVariableDecls): ditto.
15907
15908         * expression.cs (Binary.ResolveOperator): Report errors in a few
15909         places where we had to.
15910
15911         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15912
15913 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15914
15915         * expression.cs: Use StoreFromPtr instead of extracting the type
15916         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15917
15918         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15919         an enumeration value to a System.Enum, but System.Enum is not a
15920         value type, but an class type, so we need to box.
15921
15922         (Expression.ConvertExplicit): One codepath could return
15923         errors but not flag them.  Fix this.  Fixes #31853
15924
15925         * parameter.cs (Resolve): Do not allow void as a parameter type.
15926
15927 2002-10-06  Martin Baulig  <martin@gnome.org>
15928
15929         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15930         if it's a class type and not a struct.  Fixes #31815.
15931
15932 2002-10-06  Martin Baulig  <martin@gnome.org>
15933
15934         * statement.cs: Reworked the flow analysis code a bit to make it
15935         usable for dead code elimination.
15936
15937 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15938
15939         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15940
15941 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15944         to fix the test 165, will investigate deeper.
15945
15946 2002-10-04  Martin Baulig  <martin@gnome.org>
15947
15948         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15949         finally blocks actually work.
15950         (Try.Resolve): We don't need to create a sibling for `finally' if
15951         there is no finally block.
15952
15953 2002-10-04  Martin Baulig  <martin@gnome.org>
15954
15955         * class.cs (Constructor.Define): The default accessibility for a
15956         non-default constructor is private, not public.
15957
15958 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * class.cs (Constructor): Make AllowedModifiers public, add
15961         EXTERN.
15962
15963         * cs-parser.jay: Perform the modifiers test here, as the
15964         constructor for the Constructor class usually receives a zero
15965         because of the way we create it (first we create, later we
15966         customize, and we were never checking the modifiers).
15967
15968         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15969         is a version of LookupTypeReflection that includes the type-name
15970         cache.  This can be used as a fast path for functions that know
15971         the fully qualified name and are only calling into *.GetType() to
15972         obtain a composed type.
15973
15974         This is also used by TypeManager.LookupType during its type
15975         composition.
15976
15977         (LookupType): We now also track the real type name, as sometimes
15978         we can get a quey for the real type name from things like
15979         ComposedCast.  This fixes bug 31422.
15980
15981         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15982         complete type fullname, it does not have to go through the type
15983         resolution system to obtain the composed version of the type (for
15984         obtaining arrays or pointers).
15985
15986         (Conditional.Emit): Use the EmitBoolExpression to
15987         generate nicer code, as requested by Paolo.
15988
15989         (ArrayCreation.CheckIndices): Use the patch from
15990         hwang_rob@yahoo.ca to validate the array initializers. 
15991
15992 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15993
15994         * class.cs (ConstructorInitializer.Emit): simplify code by using
15995         Invocation.EmitCall, and at the same time, fix the bugs in calling
15996         parent constructors that took variable arguments. 
15997
15998         * ecore.cs (Expression.ConvertNumericExplicit,
15999         Expression.ImplicitNumericConversion): Remove the code that
16000         manually wrapped decimal (InternalTypeConstructor call is now gone
16001         as well).
16002
16003         * expression.cs (Cast.TryReduce): Also handle decimal types when
16004         trying to perform a constant fold on the type.
16005
16006         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16007
16008         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16009         that only turned off an error report, and did nothing else. 
16010
16011 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * driver.cs: Handle and ignore /fullpaths
16014
16015 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16016
16017         * expression.cs (Binary.ResolveOperator): Catch the case where
16018         DoNumericPromotions returns true, 
16019
16020         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16021
16022 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16023
16024         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16025         report error 70.
16026
16027 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16030         conversion exists, but it is also required that the conversion be
16031         performed.  This manifested in "(Type64Enum) 2".  
16032
16033         * class.cs (TypeManager.AddMethod): The fix is not to change
16034         AddEnum, because that one was using a fully qualified name (every
16035         DeclSpace derivative does), but to change the AddMethod routine
16036         that was using an un-namespaced name.  This now correctly reports
16037         the duplicated name.
16038
16039         Revert patch until I can properly fix it.  The issue
16040         is that we have a shared Type space across all namespaces
16041         currently, which is wrong.
16042
16043         Options include making the Namespace a DeclSpace, and merge
16044         current_namespace/current_container in the parser.
16045
16046 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16047
16048         * cs-parser.jay: Improve error reporting when we get a different
16049         kind of expression in local_variable_type and
16050         local_variable_pointer_type. 
16051
16052         Propagate this to avoid missleading errors being reported.
16053
16054         * ecore.cs (ImplicitReferenceConversion): treat
16055         TypeManager.value_type as a target just like object_type.   As
16056         code like this:
16057
16058         ValueType v = 1;
16059
16060         Is valid, and needs to result in the int 1 being boxed before it
16061         is assigned to the value type v.
16062
16063         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16064         to validate the enumeration name.
16065
16066         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16067         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16068         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16069
16070         * ecore.cs (TryImplicitIntConversion): When doing an
16071         implicit-enumeration-conversion, check if the type is 64-bits and
16072         perform a conversion before passing to EnumConstant.
16073
16074 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16077         report ambiguous type references.  Unlike the MS version, we
16078         report what the ambiguity is.   Innovation at work ;-)
16079
16080         (DeclSpace.FindType): Require a location argument to
16081         display when we display an ambiguous error.
16082
16083         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16084
16085         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16086
16087         * expression.cs (EmitDynamicInitializers): Apply patch from
16088         hwang_rob@yahoo.ca that fixes the order in which we emit our
16089         initializers. 
16090
16091 2002-09-21  Martin Baulig  <martin@gnome.org>
16092
16093         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16094         delegate takes no arguments.
16095
16096 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16099         from integers.
16100
16101         * expression.cs: Extract the underlying type.
16102
16103         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16104
16105         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16106
16107 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * class.cs (TypeContainer.DefineType): We can not use the nice
16110         PackingSize with the size set to 1 DefineType method, because it
16111         will not allow us to define the interfaces that the struct
16112         implements.
16113
16114         This completes the fixing of bug 27287
16115
16116         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16117         means also structs.  This fixes part of the problem. 
16118         (Expresion.ImplicitReferenceConversionExists): ditto.
16119
16120         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16121         error if there were no errors reported during the type lookup
16122         process, to avoid duplicates or redundant errors.  Without this
16123         you would get an ambiguous errors plus a type not found.  We have
16124         beaten the user enough with the first error.  
16125
16126         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16127         reference. 
16128
16129         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16130         during the resolution process, stop the lookup, this avoids
16131         repeated error reports (same error twice).
16132
16133         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16134
16135         * typemanager.cs (LookupType): Redo the type lookup code to match
16136         the needs of System.Reflection.  
16137
16138         The issue is that System.Reflection requires references to nested
16139         types to begin with a "+" sign instead of a dot.  So toplevel
16140         types look like: "NameSpace.TopLevelClass", and nested ones look
16141         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16142         levels. 
16143
16144 2002-09-19  Martin Baulig  <martin@gnome.org>
16145
16146         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16147         says that a method always returns or always throws an exception,
16148         don't report the CS0161.
16149
16150         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16151         set `Returns = new_returns'.
16152
16153 2002-09-19  Martin Baulig  <martin@gnome.org>
16154
16155         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16156         to an enum constant, check for a CS0176.
16157
16158 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16159
16160         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16161         for operators that must be in pairs and report errors.
16162
16163         * ecore.cs (SimpleName.DoResolveType): During the initial type
16164         resolution process, when we define types recursively, we must
16165         check first for types in our current scope before we perform
16166         lookups in the enclosing scopes.
16167
16168         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16169
16170         (Invocation.VerifyArgumentsCompat): Call
16171         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16172         I thought we were supposed to always call this, but there are a
16173         few places in the code where we dont do it.
16174
16175 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16176
16177         * driver.cs: Add support in -linkres and -resource to specify the
16178         name of the identifier.
16179
16180 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16181
16182         * ecore.cs (StandardConversionExists): Sync with the conversion
16183         code: allow anything-* to void* conversions.
16184
16185         (FindMostSpecificSource): Use an Expression argument
16186         instead of a Type, because we might be handed over a Literal which
16187         gets a few more implicit conversions that plain types do not.  So
16188         this information was being lost.
16189
16190         Also, we drop the temporary type-holder expression when not
16191         required.
16192
16193 2002-09-17  Martin Baulig  <martin@gnome.org>
16194
16195         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16196         this is an explicit interface implementation.
16197
16198 2002-09-17  Martin Baulig  <martin@gnome.org>
16199
16200         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16201         different `IndexerName' attributes.
16202
16203         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16204         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16205         virtual CommonResolve().
16206
16207 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16210         and convert that to the UnderlyingType.
16211
16212         * statement.cs (Foreach.Resolve): Indexers are just like variables
16213         or PropertyAccesses.
16214
16215         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16216         inside quoted strings, we were not doing this before.
16217
16218 2002-09-16  Martin Baulig  <martin@gnome.org>
16219
16220         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16221         resolve it.  This is needed for the definite assignment check of the
16222         instance expression, fixes bug #29846.
16223         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16224
16225 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16226
16227         * parameter.cs: Fix compile error.  Cannot reference static member
16228         from an instance object.  Is this an mcs bug?
16229
16230 2002-09-14  Martin Baulig  <martin@gnome.org>
16231
16232         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16233         multiple times.  Fixes bug #30295, added test-166.cs.
16234
16235 2002-09-14  Martin Baulig  <martin@gnome.org>
16236
16237         * statement.cs (Block.Emit): Don't emit unreachable code.
16238         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16239         `break' statements.
16240         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16241
16242 2002-09-14  Martin Baulig  <martin@gnome.org>
16243
16244         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16245         is set.
16246
16247 2002-09-14  Martin Baulig  <martin@gnome.org>
16248
16249         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16250         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16251         be false on the ms runtime.
16252
16253 2002-09-13  Martin Baulig  <martin@gnome.org>
16254
16255         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16256         the CS0038 error message.
16257
16258 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16261         constant inside, return it.
16262
16263 2002-09-12  Martin Baulig  <martin@gnome.org>
16264
16265         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16266         implicit conversion can be done between enum types.
16267
16268         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16269         check whether an implicit conversion to the current enum's UnderlyingType
16270         exists and report an error if not.
16271
16272         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16273         without debugging support.
16274
16275         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16276         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16277
16278 2002-09-12  Martin Baulig  <martin@gnome.org>
16279
16280         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16281
16282         * ecore.cs (IMemberExpr.DeclaringType): New property.
16283         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16284         nonstatic member of an outer type (CS0038).
16285
16286 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16287
16288         * driver.cs: Activate the using-error detector at warning level
16289         4 (at least for MS-compatible APIs).
16290
16291         * namespace.cs (VerifyUsing): Small buglett fix.
16292
16293         * pending.cs (PendingImplementation): pass the container pointer. 
16294
16295         * interface.cs (GetMethods): Allow for recursive definition.  Long
16296         term, I would like to move every type to support recursive
16297         definitions, not the current ordering mechanism that we have right
16298         now.
16299
16300         The situation is this: Attributes are handled before interfaces,
16301         so we can apply attributes to interfaces.  But some attributes
16302         implement interfaces, we will now handle the simple cases
16303         (recursive definitions will just get an error).  
16304
16305         * parameter.cs: Only invalidate types at the end if we fail to
16306         lookup all types.  
16307
16308 2002-09-09  Martin Baulig  <martin@gnome.org>
16309
16310         * ecore.cs (PropertyExpr.Emit): Also check for
16311         TypeManager.system_int_array_get_length so this'll also work when
16312         compiling corlib.  Fixes #30003.
16313
16314 2002-09-09  Martin Baulig  <martin@gnome.org>
16315
16316         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16317         and throw an exception if we can't get the type's size.  Fixed #30040,
16318         added test-165.cs.
16319
16320 2002-09-09  Martin Baulig  <martin@gnome.org>
16321
16322         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16323
16324         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16325         context.  Fixes bug #30027.
16326
16327         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16328         virtual functions.  Fixes bug #30043, added test-164.cs.
16329
16330 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16331
16332         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16333
16334 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16335
16336         * driver.cs: Use an object to get the windows codepage since it's not a
16337         static property.
16338
16339 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16340
16341         * statement.cs (For.Emit): for infinite loops (test == null)
16342         return whether there is a break inside, not always "true".
16343
16344         * namespace.cs (UsingEntry): New struct to hold the name of the
16345         using definition, the location where it is defined, and whether it
16346         has been used in a successful type lookup.
16347
16348         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16349         strings.
16350
16351         * decl.cs: ditto.
16352
16353 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16354
16355         * attribute.cs : Fix incorrect code which relied on catching
16356         a NullReferenceException to detect a null being passed in
16357         where an object was expected.
16358
16359 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16360
16361         * statement.cs (Try): flag the catch variable as assigned
16362
16363         * expression.cs (Cast): Simplified by using ResolveType instead of
16364         manually resolving.
16365
16366         * statement.cs (Catch): Fix bug by using ResolveType.
16367
16368 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16369
16370         * expression.cs (BetterConversion): Special case for when we have
16371         a NullLiteral as the argument and we have to choose between string
16372         and object types - we choose string the way csc does.
16373
16374         * attribute.cs (Attribute.Resolve): Catch the
16375         NullReferenceException and report error #182 since the Mono
16376         runtime no more has the bug and having this exception raised means
16377         we tried to select a constructor which takes an object and is
16378         passed a null.
16379
16380 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16381
16382         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16383         message (1502, 1503) when we can't locate a method after overload
16384         resolution. This is much more informative and closes the bug
16385         Miguel reported.
16386
16387         * interface.cs (PopulateMethod): Return if there are no argument
16388         types. Fixes a NullReferenceException bug.
16389
16390         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16391         expressions too. Previously we were checking only in one place for
16392         positional arguments leaving out named arguments.
16393
16394         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16395         type to the enum type is not allowed. Remove code corresponding to
16396         that.
16397
16398         (ConvertNumericExplicit): Allow explicit conversions from
16399         the underlying type to enum type. This precisely follows the spec
16400         and closes a bug filed by Gonzalo.
16401
16402 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16403
16404         * compiler.csproj:
16405         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16406
16407 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16410         it was important that we stored the right value after the
16411         reduction in `converted'.
16412
16413 2002-09-04  Martin Baulig  <martin@gnome.org>
16414
16415         * location.cs (Location.SymbolDocument): Use full pathnames for the
16416         source files.
16417
16418 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16419
16420         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16421         of the expression resolve mechanism, because that will catch the
16422         SimpleName error failures.
16423
16424         (Conditional): If we can not resolve the
16425         expression, return, do not crash.
16426
16427 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16428
16429         * cs-tokenizer.cs:
16430         (location): display token name instead of its number.
16431
16432 2002-08-28  Martin Baulig  <martin@gnome.org>
16433
16434         * expression.cs (Binary.ResolveOperator): Don't silently return
16435         but return an error if an operator cannot be applied between two
16436         enum types.
16437
16438 2002-08-28  Martin Baulig  <martin@gnome.org>
16439
16440         * class.cs (Constructor.Define): Set the permission attributes
16441         correctly instead of making all constructors public.
16442
16443 2002-08-28  Martin Baulig  <martin@gnome.org>
16444
16445         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16446         for private members before reporting a CS0103; if we find anything,
16447         it's a CS0122.
16448
16449 2002-08-28  Martin Baulig  <martin@gnome.org>
16450
16451         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16452         to check whether `closure_start_type == closure_invocation_type',
16453         we also need to check whether `m.DeclaringType == closure_invocation_type'
16454         before bypassing the permission checks.  We might be accessing
16455         protected/private members from the base class.
16456         (TypeManager.RealMemberLookup): Only set private_ok if private
16457         members were requested via BindingFlags.NonPublic.
16458
16459         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16460
16461         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16462         MethodGroupExpr.IsExplicitImpl if appropriate.
16463         (Invocation.DoResolve): Don't report the CS0120 for explicit
16464         interface implementations.
16465
16466 2002-08-27  Martin Baulig  <martin@gnome.org>
16467
16468         * expression.cs (Invocation.DoResolve): If this is a static
16469         method and we don't have an InstanceExpression, we must report
16470         a CS0120.
16471
16472 2002-08-25  Martin Baulig  <martin@gnome.org>
16473
16474         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16475         `==' between a valuetype and an object.
16476
16477 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16478
16479         * ecore.cs (TypeExpr): Provide a ToString method.
16480
16481 2002-08-24  Martin Baulig  <martin@gnome.org>
16482
16483         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16484         now called proggie.dbg and it's a binary file.
16485
16486 2002-08-23  Martin Baulig  <martin@gnome.org>
16487
16488         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16489
16490 2002-08-23  Martin Baulig  <martin@gnome.org>
16491
16492         * struct.cs (MyStructInfo.ctor): Make this work with empty
16493         structs; it's not allowed to use foreach() on null.
16494
16495 2002-08-23  Martin Baulig  <martin@gnome.org>
16496
16497         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16498         writer the full pathname of the generated assembly.
16499
16500 2002-08-23  Martin Baulig  <martin@gnome.org>
16501
16502         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16503         A `finally' block never returns or breaks; improved handling of
16504         unreachable code.
16505
16506 2002-08-23  Martin Baulig  <martin@gnome.org>
16507
16508         * statement.cs (Throw.Resolve): Allow `throw null'.
16509
16510 2002-08-23  Martin Baulig  <martin@gnome.org>
16511
16512         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16513         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16514         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16515         MemberLookup would return a wrong event if this is an explicit
16516         interface implementation and the class has an event with the same
16517         name.
16518
16519 2002-08-23  Martin Baulig  <martin@gnome.org>
16520
16521         * statement.cs (Block.AddChildVariableNames): New public method.
16522         (Block.AddChildVariableName): Likewise.
16523         (Block.IsVariableNameUsedInChildBlock): Likewise.
16524         (Block.AddVariable): Check whether a variable name has already
16525         been used in a child block.
16526
16527         * cs-parser.jay (declare_local_variables): Mark all variable names
16528         from the current block as being used in a child block in the
16529         implicit block.
16530
16531 2002-08-23  Martin Baulig  <martin@gnome.org>
16532
16533         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16534         find the symbol writer.
16535
16536         * driver.cs: csc also allows the arguments to /define being
16537         separated by commas, not only by semicolons.
16538
16539 2002-08-23  Martin Baulig  <martin@gnome.org>
16540
16541         * interface.cs (Interface.GetMembers): Added static check for events.
16542
16543 2002-08-15  Martin Baulig  <martin@gnome.org>
16544
16545         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16546         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16547
16548         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16549         why the MethodData.EmitDestructor() change was necessary.
16550
16551 2002-08-20  Martin Baulig  <martin@gnome.org>
16552
16553         * class.cs (TypeContainer.FindMembers): Added static check for events.
16554
16555         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16556
16557         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16558         use Type.GetEvents(), not Type.FindMembers().
16559
16560 2002-08-20  Martin Baulig  <martin@gnome.org>
16561
16562         * decl.cs (MemberCache): Added a special method cache which will
16563         be used for method-only searched.  This ensures that a method
16564         search will return a MethodInfo with the correct ReflectedType for
16565         inherited methods.      
16566
16567 2002-08-20  Martin Baulig  <martin@gnome.org>
16568
16569         * decl.cs (DeclSpace.FindMembers): Made this public.
16570
16571 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16572
16573         * delegate.cs: fixed build on windows.
16574         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16575
16576 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16577
16578         * ecore.cs (StandardConversionExists): Return a false
16579         if we are trying to convert the void type to anything else
16580         since that is not allowed.
16581
16582         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16583         we flag error 70 in the event an event is trying to be accessed
16584         directly from outside the declaring type.
16585
16586 2002-08-20  Martin Baulig  <martin@gnome.org>
16587
16588         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16589         MemberCache from typemanager.cs to decl.cs.
16590
16591 2002-08-19  Martin Baulig  <martin@gnome.org>
16592
16593         * class.cs (TypeContainer): Implement IMemberContainer.
16594         (TypeContainer.DefineMembers): Create the MemberCache.
16595         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16596         return public members if BindingFlags.Public was given, check
16597         whether members are static.
16598
16599 2002-08-16  Martin Baulig  <martin@gnome.org>
16600
16601         * decl.cs (DeclSpace.Define): Splitted this in Define and
16602         DefineMembers.  DefineMembers is called first and initializes the
16603         MemberCache.
16604
16605         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16606         DefineMembers() on all our DeclSpaces.
16607
16608         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16609         but call DefineMembers() on all nested interfaces.  We call their
16610         Define() in our new Define() function.
16611
16612         * interface.cs (Interface): Implement IMemberContainer.
16613         (Interface.Define): Moved all code except the attribute stuf to
16614         DefineMembers().
16615         (Interface.DefineMembers): Initialize the member cache.
16616
16617         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16618         need this anymore since we can use MemberCache.FindMembers directly.
16619
16620 2002-08-19  Martin Baulig  <martin@gnome.org>
16621
16622         * typemanager.cs (MemberCache): When creating the cache for an
16623         interface type, add all inherited members.
16624         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16625         to `out bool used_cache' and documented it.
16626         (TypeManager.MemberLookup): If we already used the cache in the first
16627         iteration, we don't need to do the interfaces check.
16628
16629 2002-08-19  Martin Baulig  <martin@gnome.org>
16630
16631         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16632         here from IMemberFinder and don't implement this interface anymore.
16633         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16634
16635         * typemanager.cs (IMemberFinder): This interface is now only used by
16636         classes which actually support the member cache.
16637         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16638         since we only put DeclSpaces into this Hashtable.
16639         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16640         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16641
16642 2002-08-16  Martin Baulig  <martin@gnome.org>
16643
16644         * typemanager.cs (ICachingMemberFinder): Removed.
16645         (IMemberFinder.MemberCache): New property.
16646         (TypeManager.FindMembers): Merged this with RealFindMembers().
16647         This function will never be called from TypeManager.MemberLookup()
16648         so we can't use the cache here, just the IMemberFinder.
16649         (TypeManager.MemberLookup_FindMembers): Check whether the
16650         IMemberFinder has a MemberCache and call the cache's FindMembers
16651         function.
16652         (MemberCache): Rewrote larger parts of this yet another time and
16653         cleaned it up a bit.
16654
16655 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16656
16657         * driver.cs (LoadArgs): Support quoting.
16658
16659         (Usage): Show the CSC-like command line arguments.
16660
16661         Improved a few error messages.
16662
16663 2002-08-15  Martin Baulig  <martin@gnome.org>
16664
16665         * typemanager.cs (IMemberContainer.Type): New property.
16666         (IMemberContainer.IsInterface): New property.
16667
16668         The following changes are conditional to BROKEN_RUNTIME, which is
16669         defined at the top of the file.
16670
16671         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16672         class'es members, but add all members from TypeHandle.ObjectType
16673         if we're an interface.
16674         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16675         is the current type.
16676         (MemberCache.CacheEntry.Container): Removed this field.
16677         (TypeHandle.GetMembers): Include inherited members.
16678
16679 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16680
16681         * typemanager.cs: fixed compilation and added a comment on a field that
16682         is never used.
16683
16684 2002-08-15  Martin Baulig  <martin@gnome.org>
16685
16686         * class.cs (ConstructorInitializer.Resolve): In the
16687         Expression.MemberLookup call, use the queried_type as
16688         invocation_type.
16689
16690         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16691         declared' attribute, it's always true.
16692         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16693         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16694         temporary wrapper for FindMembers which tells MemberLookup whether
16695         members from the base classes are included in the return value.
16696         This will go away soon.
16697         (TypeManager.MemberLookup): Use this temporary hack here; once the
16698         new MemberCache is completed, we don't need to do the DeclaredOnly
16699         looping here anymore since the MemberCache will take care of this.
16700         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16701         (MemberCache): When creating the MemberCache for a class, get
16702         members from the current class and all its base classes.
16703         (MemberCache.CacheEntry.Container): New field.  This is a
16704         temporary hack until the Mono runtime is fixed to distinguish
16705         between ReflectedType and DeclaringType.  It allows us to use MCS
16706         with both the MS runtime and the unfixed Mono runtime without
16707         problems and without accecting performance.
16708         (MemberCache.SearchMembers): The DeclaredOnly looping from
16709         TypeManager.MemberLookup is now done here.      
16710
16711 2002-08-14  Martin Baulig  <martin@gnome.org>
16712
16713         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16714         Type.GetFields on dynamic types but get the fields from the
16715         corresponding TypeContainer.
16716         (MyStructInfo.GetStructInfo): Added check for enum types.
16717
16718         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16719         (MemberList.SyncRoot): Implemented.
16720         (TypeManager.FilterWithClosure): No need to check permissions if
16721         closure_start_type == closure_invocation_type, don't crash if
16722         closure_invocation_type is null.
16723
16724 2002-08-13  Martin Baulig  <martin@gnome.org>
16725
16726         Rewrote TypeContainer.FindMembers to use a member cache.  This
16727         gives us a speed increase of about 35% for the self-hosting MCS
16728         build and of about 15-20% for the class libs (both on GNU/Linux).
16729
16730         * report.cs (Timer): New class to get enhanced profiling.  This
16731         whole class is "TIMER" conditional since it remarkably slows down
16732         compilation speed.
16733
16734         * class.cs (MemberList): New class.  This is an IList wrapper
16735         which we're now using instead of passing MemberInfo[]'s around to
16736         avoid copying this array unnecessarily.
16737         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16738         (ICachingMemberFinder, IMemberContainer): New interface.
16739         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16740         has already been checked, otherwise use it for the name comparision.
16741         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16742         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16743         if possible.  Returns a MemberList, not a MemberInfo [].
16744         (TypeHandle): New class, implements IMemberContainer.  We create
16745         one instance of this class per type, it contains a MemberCache
16746         which is used to do the member lookups.
16747         (MemberCache): New class.  Each instance of this class contains
16748         all members of a type and a name-based hash table.
16749         (MemberCache.FindMembers): This is our new member lookup
16750         function.  First, it looks up all members of the requested name in
16751         the hash table.  Then, it walks this list and sorts out all
16752         applicable members and returns them.
16753
16754 2002-08-13  Martin Baulig  <martin@gnome.org>
16755
16756         In addition to a nice code cleanup, this gives us a performance
16757         increase of about 1.4% on GNU/Linux - not much, but it's already
16758         half a second for the self-hosting MCS compilation.
16759
16760         * typemanager.cs (IMemberFinder): New interface.  It is used by
16761         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16762         Enum, Delegate or Interface.
16763         (TypeManager.finder_to_member_finder): New PtrHashtable.
16764         (TypeManager.finder_to_container): Removed.
16765         (TypeManager.finder_to_delegate): Removed.
16766         (TypeManager.finder_to_interface): Removed.
16767         (TypeManager.finder_to_enum): Removed.
16768
16769         * interface.cs (Interface): Implement IMemberFinder.
16770
16771         * delegate.cs (Delegate): Implement IMemberFinder.
16772
16773         * enum.cs (Enum): Implement IMemberFinder.
16774
16775         * class.cs (TypeContainer): Implement IMemberFinder.
16776
16777 2002-08-12  Martin Baulig  <martin@gnome.org>
16778
16779         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16780
16781 2002-08-12  Martin Baulig  <martin@gnome.org>
16782
16783         * ecore.cs (ITypeExpression): New interface for expressions which
16784         resolve to a type.
16785         (TypeExpression): Renamed to TypeLookupExpression.
16786         (Expression.DoResolve): If we're doing a types-only lookup, the
16787         expression must implement the ITypeExpression interface and we
16788         call DoResolveType() on it.
16789         (SimpleName): Implement the new ITypeExpression interface.
16790         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16791         hack, the situation that we're only looking up types can't happen
16792         anymore when this method is called.  Moved the type lookup code to
16793         DoResolveType() and call it.
16794         (SimpleName.DoResolveType): This ITypeExpression interface method
16795         is now doing the types-only lookup.
16796         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16797         (ResolveFlags): Added MaskExprClass.
16798
16799         * expression.cs (MemberAccess): Implement the ITypeExpression
16800         interface.
16801         (MemberAccess.DoResolve): Added support for a types-only lookup
16802         when we're called via ITypeExpression.DoResolveType().
16803         (ComposedCast): Implement the ITypeExpression interface.
16804
16805         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16806         Expression.Resolve() with ResolveFlags.Type instead.
16807
16808 2002-08-12  Martin Baulig  <martin@gnome.org>
16809
16810         * interface.cs (Interface.Define): Apply attributes.
16811
16812         * attribute.cs (Attribute.ApplyAttributes): Added support for
16813         interface attributes.
16814
16815 2002-08-11  Martin Baulig  <martin@gnome.org>
16816
16817         * statement.cs (Block.Emit): Only check the "this" variable if we
16818         do not always throw an exception.
16819
16820         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16821         whether the property has a set accessor.
16822
16823 2002-08-11  Martin Baulig  <martin@gnome.org>
16824
16825         Added control flow analysis support for structs.
16826
16827         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16828         with control flow analysis turned off.
16829         (IVariable): New interface.
16830         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16831         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16832         (FieldExpr.DoResolve): Resolve the instance expression with flow
16833         analysis turned off and do the definite assignment check after the
16834         resolving when we know what the expression will resolve to.
16835
16836         * expression.cs (LocalVariableReference, ParameterReference):
16837         Implement the new IVariable interface, only call the flow analysis
16838         code if ec.DoFlowAnalysis is true.
16839         (This): Added constructor which takes a Block argument.  Implement
16840         the new IVariable interface.
16841         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16842         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16843         This does the definite assignment checks for struct members.
16844
16845         * class.cs (Constructor.Emit): If this is a non-static `struct'
16846         constructor which doesn't have any initializer, call
16847         Block.AddThisVariable() to tell the flow analysis code that all
16848         struct elements must be initialized before control returns from
16849         the constructor.
16850
16851         * statement.cs (MyStructInfo): New public class.
16852         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16853         argument to this indexer.  If non-zero, check an individual struct
16854         member, not the whole struct.
16855         (FlowBranching.CheckOutParameters): Check struct members.
16856         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16857         overloaded versions of these methods which take an additional
16858         `int field_idx' argument to check struct members.
16859         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16860         overloaded versions of these methods which take an additional
16861         `string field_name' argument to check struct member.s
16862         (VariableInfo): Implement the IVariable interface.
16863         (VariableInfo.StructInfo): New public property.  Returns the
16864         MyStructInfo instance of the variable if it's a struct or null.
16865         (Block.AddThisVariable): New public method.  This is called from
16866         Constructor.Emit() for non-static `struct' constructor which do
16867         not have any initializer.  It creates a special variable for the
16868         "this" instance variable which will be checked by the flow
16869         analysis code to ensure that all of the struct's fields are
16870         initialized before control returns from the constructor.
16871         (UsageVector): Added support for struct members.  If a
16872         variable/parameter is a struct with N members, we reserve a slot
16873         in the usage vector for each member.  A struct is considered fully
16874         initialized if either the struct itself (slot 0) or all its
16875         members are initialized.
16876
16877 2002-08-08  Martin Baulig  <martin@gnome.org>
16878
16879         * driver.cs (Driver.MainDriver): Only report an error CS5001
16880         if there were no compilation errors.
16881
16882         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16883         `UnsafeContext' property to determine whether the parent is in
16884         unsafe context rather than checking the parent's ModFlags:
16885         classes nested in an unsafe class are unsafe as well.
16886
16887 2002-08-08  Martin Baulig  <martin@gnome.org>
16888
16889         * statement.cs (UsageVector.MergeChildren): Distinguish between
16890         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16891         we return.  Added test17() and test18() to test-154.cs.
16892
16893 2002-08-08  Martin Baulig  <martin@gnome.org>
16894
16895         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16896         Family access, make sure the invoking type isn't a subclass of the
16897         queried type (that'd be a CS1540).
16898
16899         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16900         this method which takes an additional `Type invocation_type'.
16901
16902         * expression.cs (BaseAccess.DoResolve): Use the base type as
16903         invocation and query type.
16904         (MemberAccess.DoResolve): If the lookup failed and we're about to
16905         report a CS0122, try a lookup with the ec.ContainerType - if this
16906         succeeds, we must report a CS1540.
16907
16908 2002-08-08  Martin Baulig  <martin@gnome.org>
16909
16910         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16911         (MethodGroupExpr): Implement the IMemberExpr interface.
16912
16913         * expression (MemberAccess.ResolveMemberAccess): No need to have
16914         any special code for MethodGroupExprs anymore, they're now
16915         IMemberExprs.   
16916
16917 2002-08-08  Martin Baulig  <martin@gnome.org>
16918
16919         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16920         Family, FamANDAssem and FamORAssem permissions.
16921         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16922
16923 2002-08-08  Martin Baulig  <martin@gnome.org>
16924
16925         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16926         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16927         or loop block.
16928
16929 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16930
16931         * driver.cs: implemented /resource option to embed managed resources.
16932
16933 2002-08-07  Martin Baulig  <martin@gnome.org>
16934
16935         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16936         (FieldBase.HasFieldInitializer): New public property.
16937         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16938         returns the field initializer and makes sure it is only resolved once.
16939         (TypeContainer.EmitFieldInitializers): Call
16940         FieldBase.GetInitializerExpression to get the initializer, this ensures
16941         that it isn't resolved multiple times.
16942
16943         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16944         the resolving process (SimpleName/MemberLookup) that we're currently
16945         emitting a field initializer (which must not access any instance members,
16946         this is an error CS0236).
16947
16948         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16949         argument, if the `IsFieldInitializer' flag is set, we must report and
16950         error CS0236 and not an error CS0120.   
16951
16952 2002-08-07  Martin Baulig  <martin@gnome.org>
16953
16954         * ecore.cs (IMemberExpr): New public interface.
16955         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16956         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16957         if the expression is an IMemberExpr.
16958
16959         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16960         to be null, implicitly default to `this' if we're non-static in
16961         this case.  Simplified the code a lot by using the new IMemberExpr
16962         interface.  Also fixed bug #28176 here.
16963
16964 2002-08-06  Martin Baulig  <martin@gnome.org>
16965
16966         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16967         ParameterReferences during semantic analysis so that we can do a
16968         type-only search when resolving Cast, TypeOf and SizeOf.
16969         (block): Pass the `current_local_parameters' to the Block's
16970         constructor.
16971
16972         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16973         argument to the constructor.
16974         (ConstructorInitializer.Resolve): Create a temporary implicit
16975         block with the parameters.
16976
16977         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16978         references here if we aren't doing a type-only search.
16979
16980         * statement.cs (Block): Added constructor which takes a
16981         `Parameters parameters' argument.
16982         (Block.Parameters): New public property.
16983
16984         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16985         to `Parameters' and made it public readonly.
16986
16987 2002-08-06  Martin Baulig  <martin@gnome.org>
16988
16989         * ecore.cs (Expression.Warning): Made this public as well.
16990
16991         * report.cs (Report.Debug): Print the contents of collections.
16992
16993 2002-08-06  Martin Baulig  <martin@gnome.org>
16994
16995         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16996         used to tell Resolve() which kinds of expressions it may return.
16997         (Expression.Resolve): Added overloaded version of this method which
16998         takes a `ResolveFlags flags' argument.  This can be used to tell
16999         Resolve() which kinds of expressions it may return.  Reports a
17000         CS0118 on error.
17001         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17002         ResolveFlags.SimpleName.
17003         (Expression.Error118): Added overloaded version of this method which
17004         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17005         which kinds of expressions are allowed.
17006
17007         * expression.cs (Argument.ResolveMethodGroup): New public method.
17008         Resolves an argument, but allows a MethodGroup to be returned.
17009         This is used when invoking a delegate.
17010
17011         * TODO: Updated a bit.
17012
17013 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17014
17015         Fixed compilation with csc.
17016
17017         * ecore.cs: Expression.Error made public. Is this correct? Should
17018         Warning be made public too?
17019
17020         * expression.cs: use ea.Location instead of ea.loc.
17021         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17022
17023 2002-08-06  Martin Baulig  <martin@gnome.org>
17024
17025         * ecore.cs (Expression.loc): Moved the location here instead of
17026         duplicating it in all derived classes.
17027         (Expression.Location): New public property.
17028         (Expression.Error, Expression.Warning): Made them non-static and
17029         removed the location argument.
17030         (Expression.Warning): Added overloaded version which takes an
17031         `int level' argument.
17032         (Expression.Error118): Make this non-static and removed the
17033         expression and location arguments.
17034         (TypeExpr): Added location argument to the constructor.
17035
17036         * expression.cs (StaticCallExpr): Added location argument to
17037         the constructor.
17038         (Indirection, PointerArithmetic): Likewise.
17039         (CheckedExpr, UnCheckedExpr): Likewise.
17040         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17041         (StringPtr): Likewise.
17042
17043
17044 2002-08-05  Martin Baulig  <martin@gnome.org>
17045
17046         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17047
17048         * assign.cs (Assign.DoResolve): Check whether the source
17049         expression is a value or variable.
17050
17051         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17052         while resolving the corresponding blocks.
17053
17054         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17055         an error, don't silently return null.
17056
17057         * statement.cs (Block.AddVariable): Do the error reporting here
17058         and distinguish between CS0128 and CS0136.
17059         (Block.DoResolve): Report all unused labels (warning CS0164).
17060         (LabeledStatement): Pass the location to the constructor.
17061         (LabeledStatement.HasBeenReferenced): New property.
17062         (LabeledStatement.Resolve): Set it to true here.
17063
17064         * statement.cs (Return.Emit): Return success even after reporting
17065         a type mismatch error (CS0126 or CS0127), this is what csc does and
17066         it avoids confusing the users with any consecutive errors.
17067
17068 2002-08-05  Martin Baulig  <martin@gnome.org>
17069
17070         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17071
17072         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17073
17074         * expression.cs (MemberAccess.DoResolve): Silently return if an
17075         error has already been reported.
17076
17077         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17078         error has already been reported.
17079
17080 2002-08-05  Martin Baulig  <martin@gnome.org>
17081
17082         * statement.cs (UsageVector): Only initialize the `parameters'
17083         vector if we actually have any "out" parameters.
17084
17085 2002-08-05  Martin Baulig  <martin@gnome.org>
17086
17087         * expression.cs (Binary.ResolveOperator): When combining delegates,
17088         they must have the same type.
17089
17090 2002-08-05  Martin Baulig  <martin@gnome.org>
17091
17092         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17093         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17094         work with the ms runtime and we also don't need it: if we're a
17095         PropertyBuilder and not in the `indexer_arguments' hash, then we
17096         are a property and not an indexer.
17097
17098         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17099         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17100         since the latter one doesn't work with the ms runtime.
17101
17102 2002-08-03  Martin Baulig  <martin@gnome.org>
17103
17104         Fixed bugs #27998 and #22735.
17105
17106         * class.cs (Method.IsOperator): New public field.
17107         (Method.CheckBase): Report CS0111 if there's already a method
17108         with the same parameters in the current class.  Report CS0508 when
17109         attempting to change the return type of an inherited method.
17110         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17111         and it's not marked abstract or extern.
17112         (PropertyBase): New abstract base class for Property and Indexer.
17113         (PropertyBase.CheckBase): Moved here from Property and made it work
17114         for indexers.
17115         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17116         the same so we can reuse it there.
17117         (Property, Indexer): Derive from PropertyBase.
17118         (MethodSignature.inheritable_property_signature_filter): New delegate
17119         to find properties and indexers.
17120
17121         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17122         argument and improved error reporting.
17123
17124         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17125         EmptyReadOnlyParameters and made it a property.
17126
17127         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17128         version of this method which takes a `PropertyInfo indexer'.
17129         (TypeManager.RegisterIndexer): New method.
17130
17131         * class.cs: Added myself as author of this file :-)
17132
17133 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17134
17135         * class.cs: fixed compilation on windoze.
17136
17137 2002-08-03  Martin Baulig  <martin@gnome.org>
17138
17139         * interface.cs (Interface.GetInterfaceBases): Check whether all
17140         base interfaces are at least as accessible than the current one.
17141
17142         * class.cs (TypeContainer.GetClassBases): Check whether base types
17143         are at least as accessible than the current type.
17144         (TypeContainer.AsAccessible): Implemented and made non-static.
17145         (MemberBase.CheckParameters): Report errors if the accessibility
17146         checks fail.
17147
17148         * delegate.cs (Delegate.Delegate): The default visibility is
17149         internal for top-level types and private for nested types.
17150         (Delegate.Define): Report errors if the accessibility checks fail.
17151
17152         * enum.cs (Enum.Enum): The default visibility is internal for
17153         top-level types and private for nested types.
17154         (Enum.DefineType): Compute the correct visibility.
17155
17156         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17157         function which takes a `bool is_toplevel' instead of a TypeContainer.
17158
17159         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17160         builtin type.
17161
17162 2002-08-02  Martin Baulig  <martin@gnome.org>
17163
17164         * expression.cs (LocalVariableReferenc): Added constructor which
17165         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17166         (LocalVariableReference.IsReadOnly): New property.
17167         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17168         variable is readonly, use our own readonly flag to do this; you can
17169         use the new constructor to get a writable reference to a read-only
17170         variable.
17171
17172         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17173         reference to the local variable.
17174
17175 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17176
17177         * rootcontext.cs (ResolveCore): Also include System.Exception
17178
17179         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17180         we reach an EmptyStatement.
17181
17182         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17183         is also fine.
17184
17185         * expression.cs (Binary.ResolveOperator): Check error result in
17186         two places.
17187
17188         use brtrue/brfalse directly and avoid compares to null.
17189
17190 2002-08-02  Martin Baulig  <martin@gnome.org>
17191
17192         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17193         Fixes bug #28407, added test-155.cs.
17194
17195 2002-08-01  Martin Baulig  <martin@gnome.org>
17196
17197         * class.cs (Event.EmitDefaultMethod): Make this work with static
17198         events.  Fixes #28311, added verify-3.cs.
17199
17200 2002-08-01  Martin Baulig  <martin@gnome.org>
17201
17202         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17203         `is_disposable' fields.
17204         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17205         `hm.is_disposable' if we're using the collection pattern.
17206         (Foreach.EmitCollectionForeach): Use the correct type for the
17207         enumerator's local variable, only emit the try/finally block if
17208         necessary (fixes #27713).
17209
17210 2002-08-01  Martin Baulig  <martin@gnome.org>
17211
17212         * ecore.cs (Expression.report118): Renamed to Error118 and made
17213         it public static.
17214
17215         * statement.cs (Throw.Resolve): Check whether the expression is of
17216         the correct type (CS0118) and whether the type derives from
17217         System.Exception (CS0155).
17218         (Catch.Resolve): New method.  Do the type lookup here and check
17219         whether it derives from System.Exception (CS0155).
17220         (Catch.CatchType, Catch.IsGeneral): New public properties.
17221
17222         * typemanager.cs (TypeManager.exception_type): Added.
17223
17224 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17225
17226         * driver.cs: Updated About function.
17227
17228 2002-07-31  Martin Baulig  <martin@gnome.org>
17229
17230         Implemented Control Flow Analysis.
17231
17232         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17233         (EmitContext.CurrentBranching): Added.
17234         (EmitContext.StartFlowBranching): Added.
17235         (EmitContext.EndFlowBranching): Added.
17236         (EmitContext.KillFlowBranching): Added.
17237         (EmitContext.IsVariableAssigned): Added.
17238         (EmitContext.SetVariableAssigned): Added.
17239         (EmitContext.IsParameterAssigned): Added.
17240         (EmitContext.SetParameterAssigned): Added.
17241         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17242         Added control flow analysis stuff here.
17243
17244         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17245         resolve the expression as lvalue.
17246         (LocalVariableReference.DoResolve): Check whether the variable has
17247         already been assigned.
17248         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17249         the parameter as assigned here.
17250         (ParameterReference.DoResolve): Check whether the parameter has already
17251         been assigned.
17252         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17253         expression as lvalue.
17254
17255         * statement.cs (FlowBranching): New class for the flow analysis code.
17256         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17257         (LabeledStatement.IsDefined): New public property.
17258         (LabeledStatement.AddUsageVector): New public method to tell flow
17259         analyis that the label may be reached via a forward jump.
17260         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17261         flow analysis.
17262         (VariableInfo.Number): New public field.  This is used by flow analysis
17263         to number all locals of a block.
17264         (Block.CountVariables): New public property.  This is the number of
17265         local variables in this block (including the locals from all parent
17266         blocks).
17267         (Block.EmitMeta): Number all the variables.
17268
17269         * statement.cs: Added flow analysis support to all classes.
17270
17271 2002-07-31  Martin Baulig  <martin@gnome.org>
17272
17273         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17274         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17275         then use this argument.
17276
17277         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17278
17279         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17280         use this to specify /define options.
17281
17282 2002-07-29  Martin Baulig  <martin@gnome.org>
17283
17284         * statement.cs (Fixed): Moved all code that does variable lookups
17285         and resolvings from Emit to Resolve.
17286
17287         * statement.cs (For): Moved all code that does variable lookups
17288         and resolvings from Emit to Resolve.
17289
17290         * statement.cs (Using): Moved all code that does variable lookups
17291         and resolvings from Emit to Resolve.
17292
17293 2002-07-29  Martin Baulig  <martin@gnome.org>
17294
17295         * attribute.cs (Attribute.Resolve): Explicitly catch a
17296         System.NullReferenceException when creating the
17297         CustromAttributeBuilder and report a different warning message.
17298
17299 2002-07-29  Martin Baulig  <martin@gnome.org>
17300
17301         * support.cs (ParameterData.ParameterName): Added method to
17302         get the name of a parameter.
17303
17304         * typemanager.cs (TypeManager.IsValueType): New public method.
17305
17306 2002-07-29  Martin Baulig  <martin@gnome.org>
17307
17308         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17309         is a flag which specifies that it's either ref or out.
17310         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17311         the out parameter to `out Parameter.Modifier mod', also set the
17312         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17313
17314         * support.cs (InternalParameters.ParameterModifier): Distinguish
17315         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17316         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17317
17318         * expression.cs (Argument.GetParameterModifier): Distinguish
17319         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17320         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17321
17322 2002-07-29  Martin Baulig  <martin@gnome.org>
17323
17324         * expression.cs (ParameterReference.ParameterReference): Added
17325         `Location loc' argument to the constructor.
17326
17327         * cs-parser.jay: Pass location to ParameterReference.
17328
17329 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17330
17331         * statement.cs (Try): Initialize the location.
17332
17333         * cs-parser.jay: pass location to Try.
17334
17335         * expression.cs (Unary.Reduce): Change the prototype to return
17336         whether a constant fold could be performed or not.  The result is
17337         returned in an out parameters.  In the case of Indirection and
17338         AddressOf, we want to perform the full tests.
17339
17340 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * statement.cs (Statement.Emit): Flag dead code.
17343
17344 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17345
17346         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17347
17348 2002-07-27  Martin Baulig  <martin@gnome.org>
17349
17350         * class.cs (MethodData.Define): Put back call to
17351         TypeManager.AddMethod(), accidentally commented this out.
17352
17353         * report.cs (Debug): New public method to print debugging information,
17354         this is `[Conditional ("DEBUG")]'.
17355
17356 2002-07-26  Martin Baulig  <martin@gnome.org>
17357
17358         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17359         (switch_statement): Push the current_block to the switch_stack and
17360         pop it again when we're done with the switch.
17361         (switch_section): The new block is a child of the current_block.
17362         Fixes bug #24007, added test-152.cs.
17363
17364 2002-07-27  Martin Baulig  <martin@gnome.org>
17365
17366         * expression.cs (Invocation.EmitArguments): When calling a varargs
17367         function with only its fixed arguments, we need to pass an empty
17368         array.
17369
17370 2002-07-27  Martin Baulig  <martin@gnome.org>
17371
17372         Mono 0.13 has been released.
17373
17374 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17375
17376         * driver.cs: Rename --resource to --linkres, because that is what
17377         we do currently, we dont support --resource yet.
17378
17379         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17380
17381 2002-07-25  Martin Baulig  <martin@gnome.org>
17382
17383         * class.cs (MethodData): New public class.  This is a `method builder'
17384         class for a method or one accessor of a Property/Indexer/Event.
17385         (MethodData.GetMethodFlags): Moved here from MemberBase.
17386         (MethodData.ApplyAttributes): Likewise.
17387         (MethodData.ApplyObsoleteAttribute): Likewise.
17388         (MethodData.ApplyConditionalAttribute): Likewise.
17389         (MethodData.ApplyDllImportAttribute): Likewise.
17390         (MethodData.CheckAbstractAndExternal): Likewise.
17391         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17392         (MethodData.Emit): Formerly known as Method.Emit().
17393         (MemberBase): Moved everything which was specific to a single
17394         accessor/method to MethodData.
17395         (Method): Create a new MethodData and call Define() and Emit() on it.
17396         (Property, Indexer, Event): Create a new MethodData objects for each
17397         accessor and call Define() and Emit() on them.
17398
17399 2002-07-25  Martin Baulig  <martin@gnome.org>
17400
17401         Made MethodCore derive from MemberBase to reuse the code from there.
17402         MemberBase now also checks for attributes.
17403
17404         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17405         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17406         as virtual.
17407         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17408         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17409         (MemberBase.ApplyAttributes): New virtual method; applies the
17410         attributes to a method or accessor.
17411         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17412         (MemberBase.ApplyConditionalAttribute): Likewise.
17413         (MemberBase.ApplyDllImportAttribute): Likewise.
17414         (MemberBase.CheckAbstractAndExternal): Likewise.
17415         (MethodCore.ParameterTypes): This is now a property instead of a
17416         method, it's initialized from DoDefineParameters().
17417         (MethodCore.ParameterInfo): Removed the set accessor.
17418         (MethodCore.DoDefineParameters): New protected virtual method to
17419         initialize ParameterTypes and ParameterInfo.
17420         (Method.GetReturnType): We can now simply return the MemberType.
17421         (Method.GetMethodFlags): Override the MemberBase version and add
17422         the conditional flags.
17423         (Method.CheckBase): Moved some code from Define() here, call
17424         DoDefineParameters() here.
17425         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17426         here to avoid some larger code duplication.
17427         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17428         ensure that abstract and external accessors don't declare a body.
17429
17430         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17431         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17432         lookup in the attribute's parent classes, so we need to abort as soon
17433         as we found the first match.
17434         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17435         the attribute has no arguments.
17436
17437         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17438         of a Method.
17439
17440 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17441
17442         * cs-parser.jay: reverted previous patch.
17443
17444 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17445
17446         * cs-parser.jay: fixed bug #22119.
17447
17448 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17449
17450         * attribute.cs: fixed compilation. The error was:
17451         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17452         be assigned to before control leaves the current method."
17453         [FIXME:  Filed as bug #28186: MCS must report this error.]
17454
17455 2002-07-25  Martin Baulig  <martin@gnome.org>
17456
17457         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17458         method to pull the condition name ouf of a Conditional attribute.
17459         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17460         the obsolete message and error flag out of an Obsolete attribute.
17461
17462         * class.cs (Method.GetMethodFlags): New public method to get the
17463         TypeManager.MethodFlags for this method.
17464         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17465         private methods.
17466         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17467         if we're overriding a virtual function, set the new private variable
17468         `parent_method'; call the new TypeManager.AddMethod().
17469
17470         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17471         the MethodBuilder and the Method in a PtrHashtable.
17472         (TypeManager.builder_to_method): Added for this purpose.
17473         (TypeManager.MethodFlags): Added IsObsoleteError.
17474         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17475         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17476         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17477         the message from the attribute.
17478
17479 2002-07-24  Martin Baulig  <martin@gnome.org>
17480
17481         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17482         preprocessor directives, ensure that the argument to #define/#undef is
17483         exactly one identifier and that it's actually an identifier.
17484
17485         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17486         did not work ....
17487
17488 2002-07-24  Martin Baulig  <martin@gnome.org>
17489
17490         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17491         initialize it to TypeManager.object_type in the constructor.
17492         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17493         of the `hm.get_current' method if we're using the collection pattern.
17494         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17495         for the explicit conversion to make it work when we're using the collection
17496         pattern and the `Current' property has a different return type than `object'.
17497         Fixes #27713.
17498
17499 2002-07-24  Martin Baulig  <martin@gnome.org>
17500
17501         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17502         does not match, but don't report any errors.  This method is called in
17503         order for all methods in a MethodGroupExpr until a matching method is
17504         found, so we don't want to bail out if the first method doesn't match.
17505         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17506         matches, report the 123.  Fixes #28070.
17507
17508 2002-07-24  Martin Baulig  <martin@gnome.org>
17509
17510         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17511         TypeManager.TypeToCoreType() to the top of the method so the
17512         following equality checks will work.  Fixes #28107.
17513
17514 2002-07-24  Martin Baulig  <martin@gnome.org>
17515
17516         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17517         operand is of type uint, and the other operand is of type sbyte,
17518         short or int, the operands are converted to type long." -
17519         Actually do what this comment already told us.  Fixes bug #28106,
17520         added test-150.cs.
17521
17522 2002-07-24  Martin Baulig  <martin@gnome.org>
17523
17524         * class.cs (MethodBase): New abstract class.  This is now a base
17525         class for Property, Indexer and Event to avoid some code duplication
17526         in their Define() and DefineMethods() methods.
17527         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17528         generic methods for Define() and DefineMethods().
17529         (FieldBase): Derive from MemberBase, not MemberCore.
17530         (Property): Derive from MemberBase, not MemberCore.
17531         (Property.DefineMethod): Moved all the code from this method to the
17532         new MethodBase.DefineAccessor(), just call it with appropriate
17533         argumetnts.
17534         (Property.Define): Call the new Property.DoDefine(), this does some
17535         sanity checks and we don't need to duplicate the code everywhere.
17536         (Event): Derive from MemberBase, not MemberCore.
17537         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17538         accessors, this will also make them work with interface events.
17539         (Indexer): Derive from MemberBase, not MemberCore.
17540         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17541         (Indexer.Define): Use the new MethodBase functions.
17542
17543         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17544         argument to the constructor.
17545         (Interface.FindMembers): Added support for interface events.
17546         (Interface.PopluateEvent): Implemented.
17547
17548         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17549
17550 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17551
17552         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17553         but this is required to check for a method name being the same as
17554         the containing class.  
17555
17556         Handle this now.
17557
17558 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17559
17560         * interface.cs: initialize variable.
17561
17562 2002-07-23  Martin Baulig  <martin@gnome.org>
17563
17564         Implemented the IndexerName attribute in interfaces.
17565
17566         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17567         name if this is an explicit interface implementation.
17568         (Indexer.InterfaceIndexerName): New public variable.  If we're
17569         implementing an interface indexer, this is the IndexerName in that
17570         interface.  Otherwise, it's the IndexerName.
17571         (Indexer.DefineMethod): If we're implementing interface indexer,
17572         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17573         and Pending.ImplementIndexer methods.
17574         (Indexer.Define): Also define the PropertyBuilder if we're
17575         implementing an interface indexer and this is neither an explicit
17576         interface implementation nor do the IndexerName match the one in
17577         the interface.
17578
17579         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17580         If a method is defined here, then we always need to create a proxy
17581         for it.  This is used when implementing interface indexers.
17582         (Pending.IsInterfaceIndexer): New public method.
17583         (Pending.ImplementIndexer): New public method.
17584         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17585         This is used when implementing interface indexers to define a proxy
17586         if necessary.
17587         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17588         define a proxy if necessary.
17589
17590         * interface.cs (Interface.IndexerName): New public variable.
17591         (Interface.PopulateIndexer): Set the IndexerName.
17592         (Interface.DefineIndexers): New private method.  Populate all the
17593         indexers and make sure their IndexerNames match.
17594
17595         * typemanager.cs (IndexerPropertyName): Added support for interface
17596         indexers.
17597
17598 2002-07-22  Martin Baulig  <martin@gnome.org>
17599
17600         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17601         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17602         ret if HasReturnLabel.
17603         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17604         variables.
17605
17606         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17607         and set the ec.LoopBeginTryCatchLevel.
17608         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17609         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17610         the current ec.TryCatchLevel, the branch goes out of an exception
17611         block.  In this case, we need to use Leave and not Br.
17612
17613 2002-07-22  Martin Baulig  <martin@gnome.org>
17614
17615         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17616         block unless the block does not always return or it is contained in
17617         another try { ... } catch { ... } block.  Fixes bug #26506.
17618         Added verify-1.cs to the test suite.
17619
17620 2002-07-22  Martin Baulig  <martin@gnome.org>
17621
17622         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17623         then we do not always return.  Fixes bug #24985.
17624
17625 2002-07-22  Martin Baulig  <martin@gnome.org>
17626
17627         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17628         lookup on a per-class level; ie. walk up the class hierarchy until we
17629         found at least one applicable method, then choose the best among them.
17630         Fixes bug #24463 and test-29.cs.
17631
17632 2002-07-22  Martin Baulig  <martin@gnome.org>
17633
17634         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17635         return types of the methods.  The return type is not part of the
17636         signature and we must not check it to make the `new' modifier work.
17637         Fixes bug #27999, also added test-147.cs.
17638         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17639
17640         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17641         on the method's return type.
17642
17643 2002-07-21  Martin Baulig  <martin@gnome.org>
17644
17645         * assign.cs: Make this work if the rightmost source is a constant and
17646         we need to do an implicit type conversion.  Also adding a few more tests
17647         to test-38.cs which should have caught this.
17648
17649         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17650         target in the makefile for this.  The makefile.gnu is primarily intended
17651         for end-users who don't want to debug the compiler.
17652
17653 2002-07-21  Martin Baulig  <martin@gnome.org>
17654
17655         * assign.cs: Improved the Assign class so it can now handle embedded
17656         assignments (X = Y = Z = something).  As a side-effect this'll now also
17657         consume less local variables.  test-38.cs now passes with MCS, added
17658         a few new test cases to that test.
17659
17660 2002-07-20  Martin Baulig  <martin@gnome.org>
17661
17662         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17663         instructions.  Fixes bug #27977, also added test-146.cs.
17664
17665 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17666
17667         * cs-tokenizer.cs: fixed getHex ().
17668
17669 2002-07-19  Martin Baulig  <martin@gnome.org>
17670
17671         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17672         not Type.GetType() to lookup the array type.  This is needed when
17673         we're constructing an array of a user-defined type.
17674         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17675         single-dimensional arrays, but also for single-dimensial arrays of
17676         type decimal.
17677
17678 2002-07-19  Martin Baulig  <martin@gnome.org>
17679
17680         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17681         this function is called, it's not allowed to share LocalBuilders
17682         among ILGenerators.
17683
17684 2002-07-19  Martin Baulig  <martin@gnome.org>
17685
17686         * expression.cs (Argument.Resolve): Report an error 118 when trying
17687         to pass a type as argument.
17688
17689 2002-07-18  Martin Baulig  <martin@gnome.org>
17690
17691         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17692         Conv_R_Un for the signed `long' type.
17693
17694 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17695
17696         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17697         `expr' for the temporary result, as that will fail if we do
17698         multiple resolves on the same expression.
17699
17700 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17701
17702         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17703         ec.TypeContainer for looking up aliases. 
17704
17705         * class.cs (TypeContainer): Remove LookupAlias from here.
17706
17707         * decl.cs (DeclSpace); Move here.
17708
17709 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17710
17711         * class.cs (FindMembers): Only call filter if the constructor
17712         bulider is not null.
17713
17714         Also handle delegates in `NestedTypes' now.  Now we will perform
17715         type lookups using the standard resolution process.  This also
17716         fixes a bug.
17717
17718         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17719         This uses Expressions (the limited kind that can be parsed by the
17720         tree) instead of strings.
17721
17722         * expression.cs (ComposedCast.ToString): Implement, used to flag
17723         errors since now we have to render expressions.
17724
17725         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17726         FormArrayType. 
17727
17728         * ecore.cs (SimpleName.ToString): ditto.
17729
17730         * cs-parser.jay: Instead of using strings to assemble types, use
17731         Expressions to assemble the type (using SimpleName, ComposedCast,
17732         MemberAccess).  This should fix the type lookups in declarations,
17733         because we were using a different code path for this.
17734
17735         * statement.cs (Block.Resolve): Continue processing statements
17736         even when there is an error.
17737
17738 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * class.cs (Event.Define): Also remove the `remove' method from
17741         the list of pending items.
17742
17743         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17744         generate more compact code. 
17745
17746 2002-07-17  Martin Baulig  <martin@gnome.org>
17747
17748         * const.cs (Const.LookupConstantValue): Add support for constant
17749         `unchecked' and `checked' expressions.
17750         Also adding test case test-140.cs for this.
17751
17752 2002-07-17  Martin Baulig  <martin@gnome.org>
17753
17754         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17755         check whether mi.ReturnType implements the IEnumerator interface; the
17756         `==' and the IsAssignableFrom() will fail in this situation.
17757
17758 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17759
17760         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17761         here too.
17762
17763 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17764
17765         * expression.cs: fixed bug #27811.
17766
17767 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17768
17769         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17770         Molaro: when we are a ref, the value already contains a pointer
17771         value, do not take the address of it.
17772
17773 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17774         * removed mb-parser.jay and mb-tokenizer.cs
17775
17776 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17777
17778         * expression.cs: check against the building corlib void type.
17779
17780 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17781
17782         * ecore.cs: fix for valuetype static readonly fields: when 
17783         initializing them, we need their address, not the address of a copy.
17784
17785 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17786
17787         * typemanager.cs: register also enum_type in corlib.
17788
17789 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17790
17791         * class.cs: allow calling this (but not base) initializers in structs.
17792
17793 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17794
17795         * ecore.cs: make sure we compare against the building base types
17796         in GetTypeSize ().
17797
17798 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17799
17800         * typemanager.cs: fix TypeToCoreType() to handle void and object
17801         (corlib gets no more typerefs after this change).
17802
17803 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17804
17805         * expression.cs (ArrayCreation.EmitArrayArguments): use
17806         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17807
17808         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17809         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17810         array indexes, the runtime actually forbids them.
17811
17812         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17813         for array arguments here.
17814
17815         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17816         instead of the default for ValueTypes.
17817
17818         (New.DoEmit): Use IsValueType instead of
17819         IsSubclassOf (value_type)
17820         (New.DoResolve): ditto.
17821         (Invocation.EmitCall): ditto.
17822
17823         * assign.cs (Assign): ditto.
17824
17825         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17826         Statements *are* currently doing part of their resolution during
17827         Emit.  
17828
17829         Expressions do always resolve during resolve, but statements are
17830         only required to propagate resolution to their children.
17831
17832 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17835
17836         (LoadAssembly): Do not add the dll if it is already specified
17837
17838         (MainDriver): Add the System directory to the link path at the end,
17839         after all the other -L arguments. 
17840
17841         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17842         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17843         ldelem.u1) and using the opposite for sbytes.
17844
17845         This fixes Digger, and we can finally run it.
17846
17847         * driver.cs (UnixParseOption): Move the option parsing here.  
17848         (CSCParseOption): Implement CSC-like parsing of options.
17849
17850         We now support both modes of operation, the old Unix way, and the
17851         new CSC-like way.  This should help those who wanted to make cross
17852         platform makefiles.
17853
17854         The only thing broken is that /r:, /reference: and /lib: are not
17855         implemented, because I want to make those have the same semantics
17856         as the CSC compiler has, and kill once and for all the confussion
17857         around this.   Will be doing this tomorrow.
17858
17859         * statement.cs (Unsafe.Resolve): The state is checked during
17860         resolve, not emit, so we have to set the flags for IsUnsfe here.
17861
17862 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17863
17864         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17865         not catch the Error_ObjectRefRequired in SimpleName (as it is
17866         possible to have a class/instance variable name that later gets
17867         deambiguated), we have to check this here.      
17868
17869 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17870
17871         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17872         make static and put into Expression.
17873
17874         (Event.Define): Register the private field of the event with the 
17875         TypeManager so that GetFieldFromEvent can get at it.
17876
17877         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17878         keep track of the private field associated with an event which
17879         has no accessors.
17880
17881         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17882         private field.
17883
17884         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17885
17886 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * expression.cs (Binary.EmitBranchable): this routine emits the
17889         Binary expression in a branchable context.  This basically means:
17890         we need to branch somewhere, not just get the value on the stack.
17891
17892         This works together with Statement.EmitBoolExpression.
17893
17894         * statement.cs (Statement.EmitBoolExpression): Use
17895         EmitBranchable. 
17896
17897 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17898
17899         * statement.cs (For): Reduce the number of jumps in loops.
17900
17901         (For): Implement loop inversion for the For statement.
17902
17903         (Break): We can be breaking out of a Try/Catch controlled section
17904         (foreach might have an implicit try/catch clause), so we need to
17905         use Leave instead of Br.
17906
17907         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17908         now).  If the instace expression supports IMemoryLocation, we use
17909         the AddressOf method from the IMemoryLocation to extract the
17910         address instead of emitting the instance.
17911
17912         This showed up with `This', as we were emitting the instance
17913         always (Emit) instead of the Address of This.  Particularly
17914         interesting when This is a value type, as we dont want the Emit
17915         effect (which was to load the object).
17916
17917 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17918
17919         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17920
17921         * statement.cs (Checked): Set the CheckedState during the resolve
17922         process too, as the ConvCast operations track the checked state on
17923         the resolve process, and not emit.
17924
17925         * cs-parser.jay (namespace_member_declaration): Flag that we have
17926         found a declaration when we do.  This is used to flag error 1529
17927
17928         * driver.cs: Report ok when we display the help only.
17929
17930 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17931
17932         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17933
17934 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17935
17936         * cs-tokenizer.cs (define): We also have to track locally the
17937         defines.  AllDefines is just used for the Conditional Attribute,
17938         but we also need the local defines for the current source code. 
17939
17940 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17941
17942         * statement.cs (While, For, Do): These loops can exit through a
17943         Break statement, use this information to tell whether the
17944         statement is the last piece of code.
17945
17946         (Break): Flag that we break.
17947
17948         * codegen.cs (EmitContexts): New `Breaks' state variable.
17949
17950 2002-07-03  Martin Baulig  <martin@gnome.org>
17951
17952         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17953         modifiers in method declarations in structs.  Otherwise, you won't
17954         be able to override things like Object.Equals().
17955
17956 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17957
17958         * class.cs (Method, Property, Indexer): Do not allow the public
17959         modifier to be used in explicit interface implementations.
17960
17961         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17962         override modifiers in method declarations in structs
17963
17964 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17965
17966         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17967         integer or real overflow, report an error
17968
17969 2002-07-02  Martin Baulig  <martin@gnome.org>
17970
17971         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17972         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17973         to tell the runtime about our newly created System.Object and
17974         System.ValueType types.
17975
17976 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17977
17978         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17979         struct instead of Ldarg/Starg.
17980
17981 2002-07-02  Martin Baulig  <martin@gnome.org>
17982
17983         * expression.cs (Indirection.Indirection): Call
17984         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17985
17986 2002-07-02  Martin Baulig  <martin@gnome.org>
17987
17988         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17989         ValueType, call TypeManager.TypeToCoreType() on it.
17990         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17991         the OpCodes.Newarr argument.
17992
17993 2002-07-02  Martin Baulig  <martin@gnome.org>
17994
17995         * expression.cs (Invocation.EmitCall): When compiling corlib,
17996         replace all calls to the system's System.Array type to calls to
17997         the newly created one.
17998
17999         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18000         System.Array methods.
18001         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18002         from the system's System.Array type which must be replaced.
18003
18004 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18005
18006         * typemanager.cs: load unverifiable_code_ctor so we can build
18007         corlib using the correct type. Avoid using GetTypeCode() with
18008         TypeBuilders.
18009         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18010         TypeManager.object_type to allow building corlib.
18011
18012 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18013
18014         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18015
18016 2002-07-01  Martin Baulig  <martin@gnome.org>
18017
18018         * class.cs: Make the last change actually work, we need to check
18019         whether `ifaces != null' to avoid a crash.
18020
18021 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18022
18023         * class.cs: when we build structs without fields that implement
18024         interfaces, we need to add the interfaces separately, since there is
18025         no API to both set the size and add the interfaces at type creation
18026         time.
18027
18028 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18029
18030         * expression.cs: the dimension arguments to the array constructors
18031         need to be converted if they are a long.
18032
18033 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18034
18035         * class.cs: don't emit ldarg.0 if there is no parent constructor
18036         (fixes showstopper for corlib).
18037
18038 2002-06-29  Martin Baulig  <martin@gnome.org>
18039
18040         MCS now compiles corlib on GNU/Linux :-)
18041
18042         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18043         ie. check for MethodImplOptions.InternalCall.
18044
18045         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18046         and TypeManager.attribute_type are null, so we must explicitly check
18047         whether parent is not null to find out whether it's an attribute type.
18048         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18049         and SetBuilder, not only if the property is neither abstract nor external.
18050         This is necessary to set the MethodImplOptions on the accessor methods.
18051         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18052         SetBuilder, see Property.Emit().
18053
18054         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18055         populate "System.Object", "System.ValueType" and "System.Attribute" since
18056         they've already been populated from BootCorlib_PopulateCoreTypes().
18057
18058 2002-06-29  Martin Baulig  <martin@gnome.org>
18059
18060         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18061         is the NullLiteral, we also need to make sure that target_type is not
18062         an enum type.   
18063
18064 2002-06-29  Martin Baulig  <martin@gnome.org>
18065
18066         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18067         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18068         before calling BootstrapCorlib_ResolveDelegate ().
18069
18070 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18071
18072         * statement.cs: fixed build-breaker. All tests passed ok.
18073
18074 2002-06-27  Martin Baulig  <martin@gnome.org>
18075
18076         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18077         for System.Decimal when compiling corlib.
18078
18079 2002-06-27  Martin Baulig  <martin@gnome.org>
18080
18081         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18082         switch blocks which contain nothing but a default clause.
18083
18084 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18085
18086        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18087
18088 2002-06-27  Martin Baulig  <martin@gnome.org>
18089
18090         * ecore.cs (PropertyExpr.PropertyExpr): Call
18091         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18092
18093         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18094         is already a TypeBuilder.
18095
18096 2002-06-27  Martin Baulig  <martin@gnome.org>
18097
18098         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18099         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18100         the "from an array-type to System.Array" case.  This makes it work
18101         when compiling corlib.
18102
18103 2002-06-27  Martin Baulig  <martin@gnome.org>
18104
18105         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18106         non-static PropertyExpr, set its InstanceExpression.  This makes
18107         the `ICollection.Count' property work in System/Array.cs.
18108
18109 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18110
18111         * driver.cs: Made error handling more consistent.  Errors now
18112         tracked by Report class, so many methods which used to return int
18113         now return void.  Main() now prints success/failure and 
18114         errors/warnings message.
18115
18116         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18117         the magic number return values (123 and 124).  Now, if the
18118         expected error occurs, the compiler exits with success (exit value
18119         0).  If the compilation completes without seeing that particular
18120         error, the compiler exits with failure (exit value 1).  The
18121         makefile in mcs/errors has been changed to handle the new behaviour.
18122
18123         * report.cs: Made 'expected error' number a property and renamed
18124         it from 'Probe' to 'ExpectedError'.
18125
18126         * genericparser.cs: Removed error handling support, since it is
18127         now all done by Report class.
18128
18129         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18130         class, so parse() no longer returns an int.
18131
18132         * namespace.cs: Use Report.Error instead of GenericParser.error
18133
18134 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18135
18136         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18137         TypeContainer.AddOperator): At the front of the list put the
18138         explicit implementations, so they get resolved/defined first. 
18139
18140 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18141
18142         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18143         interface type is implemented by this TypeContainer.  Used during
18144         explicit interface implementation.
18145
18146         (Property.Define, Indexer.Define, Method.Define): Validate that
18147         the given interface in the explicit implementation is one of the
18148         base classes for the containing type.
18149
18150         Also if we are explicitly implementing an interface, but there is
18151         no match in the pending implementation table, report an error.
18152
18153         (Property.Define): Only define the property if we are
18154         not explicitly implementing a property from an interface.  Use the
18155         correct name also for those properties (the same CSC uses,
18156         although that is really not needed).
18157
18158         (Property.Emit): Do not emit attributes for explicitly implemented
18159         properties, as there is no TypeBuilder.
18160
18161         (Indexer.Emit): ditto.
18162
18163         Hiding then means that we do not really *implement* a pending
18164         implementation, which makes code fail.
18165
18166 2002-06-22  Martin Baulig  <martin@gnome.org>
18167
18168         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18169         the return value of Object.GetType().  [FIXME: we need to do this whenever
18170         we get a type back from the reflection library].
18171
18172 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18173
18174         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18175
18176 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18177
18178         * attribute.cs: Return null if we can not look up the type.
18179
18180         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18181         the interface types found.
18182
18183         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18184         interface types found.
18185
18186         * typemanager.cs (GetInterfaces): Make this routine returns alll
18187         the interfaces and work around the lame differences between
18188         System.Type and System.Reflection.Emit.TypeBuilder in the results
18189         result for GetInterfaces.
18190
18191         (ExpandInterfaces): Given an array of interface types, expand and
18192         eliminate repeated ocurrences of an interface.  This expands in
18193         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18194         be IA, IB, IC.
18195
18196 2002-06-21  Martin Baulig  <martin@gnome.org>
18197
18198         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18199         on System.Enum.
18200
18201 2002-06-21  Martin Baulig  <martin@gnome.org>
18202
18203         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18204         and called with one of the core types, return the corresponding typebuilder for
18205         that type.
18206
18207         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18208         element type.
18209
18210 2002-06-21  Martin Baulig  <martin@gnome.org>
18211
18212         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18213         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18214         (Expression.ConvertReferenceExplicit): Likewise.
18215
18216         * expression.cs (ElementAccess.DoResolve): Likewise.
18217         (ElementAccess.DoResolveLValue): Likewise.
18218
18219 2002-06-10  Martin Baulig  <martin@gnome.org>
18220
18221         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18222         add the "value" parameter to the parameter list.
18223
18224         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18225         to our caller.
18226
18227 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18228
18229         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18230         the argument to an int, uint, long or ulong, per the spec.  Also
18231         catch negative constants in array creation.
18232
18233 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18234
18235         * class.cs: do not allow the same interface to appear twice in
18236         the definition list.
18237
18238 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18239
18240         * ecore.cs: don't use ldlen with System.Array.
18241
18242 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18243
18244         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18245
18246 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18247
18248         * modifiers.cs: produce correct field attributes for protected
18249         internal. Easy fix so miguel can work on ther harder stuff:-)
18250
18251 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18252
18253         * pending.cs: New file.  Move the code from class.cs here.
18254         Support clearning the pending flag for all methods (when not doing
18255         explicit interface implementation).
18256
18257 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18258
18259         * rootcontext.cs: added a couple more types needed to bootstrap.
18260
18261 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18264         constructor in the type, instead of any constructor in the type
18265         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18266         a bug in the Mono runtime when applying the params attribute). 
18267
18268 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18269         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18270
18271 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18272
18273         * expression.cs (Unary.ResolveOperator): Use TypeManager
18274         to resolve the type.
18275
18276 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18277
18278         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18279         attached.
18280
18281         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18282         with each member too.
18283
18284         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18285         field builders too - this takes care of the enum member case.
18286
18287 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18288
18289         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18290         address-of operator on both value types and pointers.
18291
18292 2002-06-10  Martin Baulig  <martin@gnome.org>
18293
18294         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18295         PropertyBuilder to the `property_builders' list.
18296
18297         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18298         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18299         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18300         find any indexers which are inherited from an interface.
18301
18302 2002-06-09  Martin Baulig  <martin@gnome.org>
18303
18304         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18305         the same type as the constant if necessary.  There's also a test-130.cs
18306         for this.
18307
18308         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18309
18310         * typemanager.cs (TypeManager.ChangeType): Previously known as
18311         Enum.ChangeEnumType().
18312
18313 2002-06-09  Martin Baulig  <martin@gnome.org>
18314
18315         * expression.cs (Cast.TryReduce): Added support for consts.
18316
18317 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18318
18319         * class.cs (Accessor): Hold attributes information so we can pass
18320         it along.
18321
18322         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18323         Modify to pass in attributes attached to the methods.
18324
18325         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18326
18327         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18328         to handle the Accessor kind :-)
18329
18330         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18331
18332 2002-06-08  Martin Baulig  <martin@gnome.org>
18333
18334         * expression.cs (Unary.TryReduceNegative): Added support for
18335         ULongConstants.
18336
18337 2002-06-08  Martin Baulig  <martin@gnome.org>
18338
18339         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18340         name can't be found in the `defined_names' - the caller will do a
18341         MemberLookup in this case and thus find methods in System.Enum
18342         such as Enum.IsDefined().
18343
18344 2002-06-08  Martin Baulig  <martin@gnome.org>
18345
18346         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18347         Convert.ChangeType() which works with TypeBuilder created types.
18348         (Enum.LookupEnumValue, Enum.Define): Use it here.
18349
18350         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18351         `TypeBuilder.BaseType != null' check.
18352         (TypeContainer.FindMembers): Only lookup parent members if we
18353         actually have a parent.
18354         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18355         (ConstructorInitializer.Resolve): Likewise.
18356
18357         * interface.cs (Interface.FindMembers): Added
18358         `TypeBuilder.BaseType != null' check.
18359
18360         * rootcontext.cs (RootContext.ResolveCore): Added
18361         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18362         classes_second_stage.
18363
18364         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18365         debug_type and trace_type when compiling with --nostdlib.       
18366
18367 2002-06-07  Martin Baulig  <martin@gnome.org>
18368
18369         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18370         (AddField): Set it to true when adding a non-static field.
18371         (DefineType): Use `have_nonstatic_fields' to find out whether we
18372         have non-static fields, not `Fields != null'.
18373
18374 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18375
18376         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18377         dereferencing a null on the static-field code path)
18378
18379 2002-05-30  Martin Baulig  <martin@gnome.org>
18380
18381         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18382         to take command line arguments.  Use reflection to call the new
18383         custom `Initialize' function on the symbol writer and pass it the
18384         command line arguments.
18385
18386         * driver.cs (--debug-args): New command line argument to pass command
18387         line arguments to the symbol writer.
18388
18389 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18390
18391         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18392         the target type for indexers and properties.  Thanks to Joe for
18393         catching this.
18394
18395 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18396
18397         * typemanager.cs (MethodFlags): returns the method flags
18398         (Obsolete/ShouldIgnore) that control warning emission and whether
18399         the invocation should be made, or ignored. 
18400
18401         * expression.cs (Invocation.Emit): Remove previous hack, we should
18402         not do this on matching a base type, we should do this based on an attribute
18403
18404         Only emit calls to System.Diagnostics.Debug and
18405         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18406         on the command line.
18407
18408         * rootcontext.cs: Global settings for tracing and debugging.
18409
18410         * cs-tokenizer.cs (define): New utility function to track
18411         defines.   Set the global settings for TRACE and DEBUG if found.
18412
18413 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18414
18415         * interface.cs (Populate*): Pass in the TypeContainer as well as
18416         the DeclSpace as parameters so that we can create EmitContexts and
18417         then use that to apply attributes etc.
18418
18419         (PopulateMethod, PopulateEvent, PopulateProperty)
18420         (PopulateIndexer): Apply attributes everywhere.
18421
18422         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18423         etc.
18424
18425         (ApplyAttributes): Update accordingly.
18426
18427         We now apply interface attributes for all members too.
18428
18429 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18430
18431         * class.cs (Indexer.Define); Correctly check if we are explicit
18432         implementation (instead of checking the Name for a ".", we
18433         directly look up if the InterfaceType was specified).
18434
18435         Delay the creation of the PropertyBuilder.
18436
18437         Only create the PropertyBuilder if we are not an explicit
18438         interface implementation.   This means that explicit interface
18439         implementation members do not participate in regular function
18440         lookups, and hence fixes another major ambiguity problem in
18441         overload resolution (that was the visible effect).
18442
18443         (DefineMethod): Return whether we are doing an interface
18444         implementation. 
18445
18446         * typemanager.cs: Temporary hack until we get attributes in
18447         interfaces (Ravi is working on that) and we get IndexerName
18448         support in interfaces.
18449
18450         * interface.cs: Register the indexers as properties.
18451
18452         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18453         warning, I have verified that this is a bug in the .NET runtime
18454         (JavaScript suffers of the same problem).
18455
18456         * typemanager.cs (MemberLookup): When looking up members for
18457         interfaces, the parent of an interface is the implicit
18458         System.Object (so we succeed in searches of Object methods in an
18459         interface method invocation.  Example:  IEnumerable x;  x.ToString
18460         ()) 
18461
18462 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * class.cs (Event): Events should also register if they do
18465         implement the methods that an interface requires.
18466
18467         * typemanager.cs (MemberLookup); use the new GetInterfaces
18468         method. 
18469
18470         (GetInterfaces): The code used to lookup interfaces for a type is
18471         used in more than one place, factor it here. 
18472
18473         * driver.cs: Track the errors at the bottom of the file, we kept
18474         on going.
18475
18476         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18477         instance if the method we are calling is static!
18478
18479 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18480
18481         * attribute.cs (ApplyAttributes): Make this function filter out
18482         the IndexerName attribute (as that attribute in reality is never
18483         applied) and return the string constant for the IndexerName
18484         attribute. 
18485
18486         * class.cs (TypeContainer.Emit): Validate that all the indexers
18487         have the same IndexerName attribute, and if so, set the
18488         DefaultName attribute on the class. 
18489
18490         * typemanager.cs: The return value might contain other stuff (not
18491         only methods).  For instance, consider a method with an "Item"
18492         property and an Item method.
18493
18494         * class.cs: If there is a problem with the parameter types,
18495         return. 
18496
18497 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18498
18499         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18500         looks at user defined conversion after making a call to 
18501         StandardConversionExists - we need this for overload resolution.
18502
18503         * expression.cs : Update accordingly the various method calls.
18504
18505         This fixes 2 bugs filed against implicit user defined conversions 
18506
18507 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18508
18509         * statement.cs: Track the result of the assignment.
18510
18511 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18512
18513         * expression.cs (MemberAccess): Improved error reporting for
18514         inaccessible members.
18515
18516 2002-05-22  Martin Baulig  <martin@gnome.org>
18517
18518         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18519         itself with debugging support.
18520
18521 2002-05-22  Martin Baulig  <martin@gnome.org>
18522
18523         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18524         Removed, this isn't needed anymore.
18525
18526 2002-05-20  Martin Baulig  <martin@gnome.org>
18527
18528         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18529         be underlying type for an enum.
18530
18531 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18532
18533         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18534         that splits out the loading of just the core types.
18535
18536         * rootcontext.cs (ResolveCore): Split the struct resolution in
18537         two, so we can load the enumeration underlying types before any
18538         enums are used.
18539
18540         * expression.cs (Is): Bandaid until we fix properly Switch (see
18541         bug #24985 for details).
18542
18543         * typemanager.cs (ImplementsInterface): The hashtable will contain
18544         a null if there are no interfaces implemented.
18545
18546 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18547
18548         * cs-parser.jay (indexer_declarator): It is fine to have array
18549         parameters
18550
18551 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18552
18553         * typemanager.cs: (RegisterBuilder): New function used to register
18554         TypeBuilders that implement interfaces.  Since
18555         TypeBuilder.GetInterfaces (as usual) does not work with lame
18556         Reflection.Emit. 
18557         (AddUserType): register interfaces.
18558
18559         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18560         dealing with TypeBuilder.  Also, arrays are showing up as
18561         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18562         methods can not be invoked on them!
18563
18564         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18565         (ImplicitReferenceConversionExists): Split out from
18566         StandardConversionExists. 
18567
18568         * expression.cs (As): We were only implementing one of the three
18569         cases for the as operator.  We now implement them all.
18570         (Is): Implement the various other cases for Is as well.
18571
18572         * typemanager.cs (CACHE): New define used to control if we want or
18573         not the FindMembers cache.  Seems to have a negative impact on
18574         performance currently
18575
18576         (MemberLookup): Nested types have full acess to
18577         enclosing type members
18578
18579         Remove code that coped with instance/static returns for events, we
18580         now catch this in RealFindMembers.
18581
18582         (RealFindMembers): only perform static lookup if the instance
18583         lookup did not return a type or an event.  
18584
18585 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18586
18587         * assign.cs (CompoundAssign): We pass more semantic information
18588         now to Compound Assignments than we did before: now we have all
18589         the information at hand, and now we resolve the target *before* we
18590         do the expression expansion, which allows the "CacheValue" method
18591         to have the effect we intended (before, a [x] += 1 would generate
18592         two differen ArrayAccess expressions from the ElementAccess,
18593         during the resolution process).
18594
18595         (CompoundAssign.DoResolve): Resolve target and original_source here.
18596
18597 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18598
18599         * expression.cs (ArrayAccess): dropped debugging information. 
18600
18601         * typemanager.cs: Small bug fix: I was always returning i_members,
18602         instead of one of i_members or s_members (depending on which had
18603         the content).
18604
18605         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18606         method is invoked before any code generation takes place, and it
18607         is a mechanism to inform that the expression will be invoked more
18608         than once, and that the method should use temporary values to
18609         avoid having side effects
18610
18611         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18612
18613         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18614         implementation.
18615
18616         * expression.cs (Indirection, ArrayAccess): Add support for
18617         CacheTemporaries in these two bad boys. 
18618
18619         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18620         ldobj or ldind_ref.  
18621         (StoreFromPtr): Handle stobj as well.
18622
18623         * expression.cs (UnaryMutator): Share more code.
18624
18625         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18626         down: I was not tracking the Filter function as well, which
18627         was affecting the results of the cache.
18628
18629 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18630
18631         * attribute.cs: Remove the hack to handle the CharSet property on
18632         StructLayouts. 
18633
18634 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18635
18636         * attribute.cs (DoResolve): More uglyness, we now only try to
18637         resolve the attribute partially, to extract the CharSet
18638         information (only if we are a StructLayout attribute).  Otherwise 
18639
18640         (GetExtraTypeInfo): Add some code to conditionally kill in the
18641         future this.   I am more and more convinced that the .NET
18642         framework has special code to handle the attribute setting on
18643         certain elements.
18644
18645         * expression.cs (IsParamsMethodApplicable): Revert my previous
18646         foreach change here, it was wrong.
18647
18648 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18651         (pp_expr): do not abort on unknown input, just return.
18652         (eval): abort if there are pending chars.
18653
18654         * attribute.cs (Attribute.Resolve): Positional parameters are
18655         optional.  Deal with that case.
18656
18657         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18658         the Ansi/Unicode/Auto information for the type.
18659
18660         (TypeContainer.DefineType): instantiate the EmitContext here, as
18661         we will be using it during the type definition (to resolve
18662         attributes) and during the emit phase.
18663
18664         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18665         to pull type information out of the attributes
18666
18667         (Attribute.Resolve): track the constructor builder, and allow for
18668         multiple invocations (structs and classes will use this).
18669
18670         * ecore.cs (MemberLookupFinal): new version with all the
18671         parameters customizable.
18672
18673         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18674         constructors.  Return if the result value is null (as the error
18675         would have been flagged already by MemberLookupFinal)
18676
18677         Do not allow instances of abstract classes or interfaces to be
18678         created.
18679
18680         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18681         We have to compare the assembly property here when dealing with
18682         FamANDAssem and Assembly access modifiers, because we might be
18683         creating an assembly from *modules* (that means that we are not
18684         getting TypeBuilders for types defined in other modules that are
18685         part of this assembly).
18686
18687         (Method.Emit): If the method is marked abstract and has a body,
18688         emit an error. 
18689
18690         (TypeContainer.DefineMembers): If both the defined member and the
18691         parent name match are methods, then do not emit any warnings: let
18692         the Method.Define routine take care of flagging warnings.  But if
18693         there is a mismatch (method overrides something else, or method is
18694         overriwritten by something, then emit warning).
18695
18696         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18697         set to null, this means `do not check for the return type on the
18698         signature'. 
18699
18700         (Method.Define): set the return type for the method signature to
18701         null, so that we get methods with the same name and parameters and
18702         different return types.  This is used to flag warning 114 (you are
18703         hiding a method, and you probably want to use the new/override
18704         keywords instead).
18705
18706         * typemanager.cs (MemberLookup): Implemented proper access
18707         control, closing a long standing set of bug reports.  The problem
18708         was that the Framework only has two bits: Public and NonPublic,
18709         and NonPublic includes private and protected methods, but we need
18710         to enforce the FamANDAssem, FamOrAssem and Family. 
18711
18712 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18713
18714         * statement.cs (GotoCase): Return true: Ammounts to giving up
18715         knowledge on whether we return or not, and letting the other case
18716         be responsible for it.
18717
18718 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18719
18720         * driver.cs: Do not load directories for each file processed, only
18721         do it if there is a pattern.
18722
18723         * ecore.cs: Report readonly assigns here as well, as we might have
18724         been resolved only by MemberAccess.
18725
18726         (SimpleName.SimpleNameResolve): Also be useful for LValue
18727         resolution.   We need this to propagate assign to local readonly variables
18728
18729         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18730         do not want to reuse potential criteria memory.
18731
18732         * class.cs (MyEventBuilder): Set reflected_type;
18733
18734         * ecore.cs (Constantify): Added support for constifying bools.
18735
18736         (RootContext.LookupType): Added a cache for values looked up in
18737         the declaration space.
18738
18739         * typemanager.cs (FindMembers): Now is a front-end to
18740         RealFindMembers, and provides a two-level hashtable-based cache to
18741         the request.  
18742
18743         15% performance improvement: from 22.5 to 19.2 seconds.
18744
18745         * expression.cs (IsParamsMethodApplicable): use foreach.
18746         (Invocation.DoResolve): ditto.
18747         (New.DoResolve): ditto.
18748         (ArrayCreation.DoResolve): ditto.
18749
18750         * ecore.cs (FindMostEncompassingType): use foreach.
18751
18752         * delegate.cs (NewDelegate.DoResolve): Use foreach
18753
18754         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18755         (RemoveMethods): use foreach.
18756
18757         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18758         nested foreach statements instead of for, and also break out of
18759         the inner loop once a match is found.
18760
18761         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18762
18763 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18764
18765         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18766         we actually unwrap the expression to allow for extra information
18767         to be extracted. 
18768
18769         * expression.cs: Use Shr_Un on unsigned operations. 
18770
18771 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18772
18773         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18774         applicable operators was not being considered correctly. This closes
18775         the bug Miguel reported.
18776
18777 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18778
18779         * attribute.cs: check that the type derives from System.Attribute
18780         and report the correct error in that case (moved the duplicate code to
18781         its own method, too).
18782
18783 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18784
18785         * attribute.cs: lookup attribute type name as the spec says: first the
18786         bare attribute name and then name + "Attribute" (nant compiles with
18787         mcs after this fix).
18788
18789 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18790
18791         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18792         Because of the way we parse things, we should try to see if a
18793         UIntConstant can fit in an integer.
18794
18795 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18796
18797         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18798         when we are in an explicit context.
18799
18800         (ConvertReferenceExplicit): When converting from Iface type S to Class
18801         T make sure the rules are implemented as an OR.
18802
18803         * parameter.cs (ParameterType): Make it a property for now although the
18804         purpose really isn't anything immediate.
18805
18806         * expression.cs (Is*Applicable): Do better checking on the parameter type
18807         of a ref/out parameter. The ones from the system assemblies are already 
18808         marked with the correct type so we don't need to do any correction.
18809
18810         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18811         the object type is standard too so include that.
18812
18813 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18814
18815         * ecore.cs (StandardConversionExists): Augment with missing code:
18816         deal with IntConstant, LongConstants and Enumerations.
18817
18818         * assign.cs: Report the error, instead of failing silently
18819
18820         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18821         typecontainer that they are declared, because the
18822         typecontainer/namespace will have the list of using clauses that
18823         need to be applied.
18824
18825         Assembly Attributes were escaping the normal registration
18826         mechanism. 
18827
18828         (EmitCode): Apply attributes within an EmitContext that represents
18829         the container they were declared on.
18830
18831         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18832
18833 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18834
18835         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18836         Revamp completely - make much cleaner as we now operate only
18837         on a set of Types.
18838
18839         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18840         to implement the logic detailed in the spec more correctly.
18841
18842         (UserDefinedConversion): Update accordingly.
18843
18844 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18845
18846         * statement.cs: Return flow analysis information up.
18847
18848         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18849         and the default.
18850
18851         (token): Do not consume an extra character before calling
18852         decimal_digits.
18853
18854 2002-05-06  Piers Haken <piersh@friskit.com>
18855
18856         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18857
18858 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18859
18860         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18861         EmitContext during the instance constructor initializer
18862         resolution, to stop access to instance variables.
18863
18864         This is mandated by the spec, last paragraph of the `constructor
18865         initializers' section. 
18866
18867 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18868
18869         * cs-parser.jay, class.cs (Accessor): new class used to represent
18870         an accessor (get or set).  In the past we used `null' to represent
18871         a missing accessor.  But this is ambiguous because there was no
18872         way to tell in abstract indexers/properties if one of them was
18873         specified.
18874
18875         Now there is a way of addressing that.
18876
18877         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18878         instead of FindMembers.
18879
18880         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18881         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18882
18883         * attribute.cs: Treat indexers and properties as the same in terms
18884         of applying attributes
18885
18886         * ecore.cs (FindMostEncompassedType): Use statically initialized
18887         EmptyExpressions()s like we do elsewhere to avoid creating useless
18888         objects (and we take this out of the tight loop).
18889
18890         (GetConversionOperators): Move the code to extract the actual
18891         operators to a separate routine to clean things up.
18892
18893 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18894
18895         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18896         events are always registered FieldBuilders.
18897
18898         * class.cs (FieldBase): New class shared by Fields 
18899
18900         * delegate.cs: If we are a toplevel delegate, use our full name.
18901         If we are a nested delegate, then only use our tail name.
18902
18903 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18904
18905         * expression.cs (IsApplicable): Ensure that we add the "&" to
18906         ref/out types before comparing it with the type of the argument.
18907
18908         (IsParamsMethodApplicable): Ditto.
18909
18910         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18911         silly me ;-)
18912
18913         * delegate.cs : Handle the case when we have more than one applicable
18914         method. Flag an error only when we finish checking all.
18915
18916 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18917
18918         * expression.cs: Add support for boolean static initializers.
18919
18920 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18921
18922         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18923
18924         * parameter.cs (ComputeParameterTypes,
18925         ComputeAndDefineParameterTypes): Better error handling: now we
18926         clear the `types' cache if we fail during any of the type lookups.
18927         We also return the status code correctly to our caller
18928
18929         * delegate.cs: If we fail to define a delegate, abort the extra
18930         steps. 
18931
18932         * expression.cs (Binary.ResolveOperator): for
18933         operator==(object,object) and operator !=(object, object) we also
18934         have to verify that there is an implicit conversion from one to
18935         the other.
18936
18937         (ArrayAccess.DoResolve): Array Access can operate on
18938         non-variables. 
18939
18940 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18941
18942         * assign.cs (CompoundAssign): A new class used as a "flag" that
18943         the assignment actually is happening as part of a compound
18944         assignment operator.
18945
18946         During compound assignment, a few new rules exist to enable things
18947         like:
18948
18949         byte b |= 1 + 2
18950
18951         From the spec:
18952
18953         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18954         to the type of x) if y is implicitly convertible to the type of x,
18955         and the operator is a builtin operator and the return type of the
18956         operator is explicitly convertible to the type of x. 
18957
18958         * rootcontext.cs: Reset warning level to 2.  4 catches various
18959         "interesting" features in mcs, we must clean this up at some
18960         point, but currently am trying to kill other bugs ;-)
18961
18962         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18963         in container classes as well.  
18964
18965         * expression.cs (Binary.ResolveOperator): Handle string case
18966         before anything else (as operator overloading does emit an error
18967         before doing anything else).
18968
18969         This code could go away when we move to a table driven model, but
18970         i could not come up with a good plan last night.
18971
18972 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18973
18974         * typemanager.cs (CSharpName): reimplementation using regex.
18975         * class.cs: added null check for fields in Emit
18976         * rootcontext.cs: set warninglevel to 4
18977
18978 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18979
18980         * typemanager.cs (CSharpName): reimplemented with Lupus
18981         suggestion.
18982
18983 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18984
18985         * statement.cs (If): correclty implement Resolve, because we were
18986         not catching sem errors in there.  The same process is needed
18987         everywhere else. 
18988         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18989
18990
18991         (Statement.Warning_DeadCodeFound): Factorize code.
18992         (While): Report dead code here too.
18993
18994         (Statement): Added Resolve virtual method to allow
18995         for resolution split from the emit code.
18996
18997 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18998
18999         * statement.cs (EmitBoolExpression): No longer try to resolve the
19000         expression here.    
19001         (MakeBoolean): New utility function that resolve, implicitly
19002         converts to boolean and tags the expression. 
19003
19004
19005         (If, Do): Implement dead code elimination.
19006         (While): Implement loop inversion
19007
19008         (Do, While, For, If): Resolve the expression prior to calling our
19009         code generation.
19010
19011 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19012
19013         * class.cs:
19014           - added method Report28 (warning: program has more than one entry point)
19015           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19016           - modified method Method.Define, the part at the end of the method
19017
19018         * rootcontext.cs: added static public Location EntryPointLocation;
19019           
19020         * ../errors/cs0028.cs : Add test case for the above warning.              
19021
19022         * typemanager.cs:
19023           - modified method CSharpName to allow arrays of primitive type to
19024             be printed nicely (e.g. instead of System.Int32[][] it now prints
19025             int[][])
19026           - added method CSharpSignature: returns the signature of a method
19027             in string format to be used in reporting errors, warnings, etc.
19028
19029         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19030         with String.Empty.
19031
19032 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19033
19034         * delegate.cs (Define): Fix extremely silly bug where I was
19035         setting the type of the 'object' parameter of the BeginInvoke
19036         method to System.IAsyncResult instead of System.Object ;-)
19037
19038 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19039
19040         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19041         here. 
19042
19043         (Constructor.Emit): return if we fail to initialize the
19044         constructor.  Another door closed!  
19045
19046         * expression.cs (New.DoResolve): Improve error message (from -6 to
19047         1501).  Use DeclaredOnly lookup to find the exact constructor.
19048
19049         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19050         loop.  This is useful.
19051
19052         * cs-parser.jay: Adjust the default parameters so that destructors
19053         have the proper signature.
19054
19055 2002-04-26  Martin Baulig  <martin@gnome.org>
19056
19057         * driver.cs (LoadAssembly): If `assembly' contains any characters
19058         which are only valid in path names and not in assembly names
19059         (currently slash, backslash and point), use Assembly.LoadFrom ()
19060         instead of Assembly.Load () on the `assembly' (before iteration
19061         over the link_paths).
19062
19063 2002-04-26  Martin Baulig  <martin@gnome.org>
19064
19065         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19066
19067 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * class.cs (Property): use the new typemanager.MemberLookup
19070
19071         (TypeContainer.MemberLookup): Implement using the
19072         TypeManager.MemberLookup now. 
19073
19074         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19075         and return MemberInfos, so that these can be used without an
19076         EmitContext (what we had before).
19077
19078 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * expression.cs: Fix the case where the argument to params if the
19081         type of the params.  I omitted handling this before.   Fixed
19082
19083 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * driver.cs: Call BootCorlib_PopulateCoreType
19086
19087         * class.cs (Property.CheckBase): Check for properties only, not
19088         for all members. 
19089
19090         * interface.cs: Temporary hack: try/catch around the
19091         CustomAttributeBuilder, because I am getting an exception that I
19092         do not understand.
19093
19094         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19095         types whose definitions are required to be there (attributes are
19096         defined before standard types).
19097
19098         Compute definitions as we boot the various types, as they are used
19099         immediately (value_type class will need object_type, but if we do
19100         not initialize object_type, we will pass a null, which will let
19101         the runtime pick the System.Object from the existing corlib, which
19102         is not what we want).
19103
19104 2002-04-22  Patrik Torstensson <totte@labs2.com>
19105
19106         * cs-tokenizer.cs: fixed a number of trim() issues.
19107
19108 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19109
19110         * expression.cs (Argument.Type): Ensure that we return the correct
19111         type when we have out or ref parameters [in which case we 
19112         append a "&"].
19113
19114 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * class.cs (Property, Indexer): Allow extern modifier in there. 
19117
19118         * typemanager.cs (InitBaseTypes): Initializes object_type and
19119         value_type, since those will be used early on during the bootstrap
19120         process to compile corlib.
19121
19122         (InitCoreTypes): Move code from here to InitBaseTypes.
19123
19124 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19125
19126         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19127         single-dimension arrays as using the ldlen opcode.  
19128
19129         Daniel Lewis discovered this optimization.  
19130
19131         * typemanager.cs: Add signature for System.Array::get_Length
19132
19133 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19134
19135         * statement.cs: report the error when the foreach does not apply to an
19136         array nor a collection.
19137
19138 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19139
19140         * expression.cs: Add implicit conversions to the operator ~.
19141
19142         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19143
19144         * typemanager.cs: Locate the decimal constructor.
19145
19146 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19147
19148         * attribute.cs: use the new property of TypeOf.
19149         * expression.cs: added 'get' property around typearg.
19150
19151         These changes fix a build breaker reported by NickD. Is this the
19152         correct way to fix?  If not, please, revert my changes and make it
19153         work :-).
19154
19155 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19156
19157         * attribute.cs: Add support for typeof in attribute invocations.
19158         I am not sure that this is right though.
19159
19160 2002-04-14  Duncan Mak  <duncan@ximian.com>
19161
19162         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19163         Binary.Operator.Division case.
19164
19165 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19166
19167         * class.cs (DefineType): Ensure that we do a proper check on
19168         attribute types and also register it with the TypeManager.
19169
19170         (TypeContainer.Targets): The default for attribute types is
19171         AttributeTargets.All.
19172
19173         * attribute.cs (ApplyAttributes): Registering the attribute type
19174         is done elsewhere, not when we discover we have a Usage attribute.
19175
19176 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19177
19178         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19179         and get rid of is_delegate parameter.
19180
19181         * everywhere : update.
19182
19183 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19184
19185         * cs-parser.jay (compilation_unit): Revamp completely to use
19186         some new ideas that I got from Rhys' grammar to solve the problems
19187         with assembly level attributes.
19188
19189         (outer_declaration): New grammar production.
19190
19191         (attribute_sections): Add.
19192
19193         (opt_attributes): Base on attribute_sections
19194
19195         (namespace_declaration): Allow opt_attributes to tackle the case
19196         when we have assembly level attributes - we are clever in this
19197         regard now ;-)
19198
19199         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19200         attributes in the non-global context.
19201
19202         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19203         instead of SetGlobalAttributes.
19204
19205         * class.cs, rootcontext.cs : Ensure we define and generate 
19206         attribute types before anything else.
19207
19208         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19209         and flag the new error -20 for the case when the attribute type
19210         does not have valid targets specified. csc does not catch this.
19211
19212         * ../errors/errors.txt : update for error # -20
19213
19214 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19215
19216         * support.cs (InternalParameters.ParameterModifier): Do some null
19217         checking and return sane values.
19218
19219         * class.cs (Method.Define): If we are a PInvoke method, ensure
19220         that we are static and extern. Report error # 601
19221
19222         * ../errors/cs0601.cs : Add test case for the above error.
19223
19224 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19225
19226         * rootcontext.cs (attribute_types): We need to keep type of
19227         all attribute types separately and emit code for them first.
19228
19229         (RegisterAttribute) : Implement.
19230
19231         * class.cs (DefineType): Check if the current Type is a custom
19232         attribute type and register it accordingly.
19233
19234         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19235         adding the first attribute twice and rename to
19236
19237         (SetGlobalAttributes): this.
19238
19239         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19240         lookups.
19241
19242         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19243         if we are processing global arguments. Hmm, I am unsure of this.
19244
19245 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19246
19247         * expression.cs: added static array of strings to avoid calling
19248         Enum.ToString () for Operator in Binary. Significant recover of
19249         performance.
19250
19251 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19252
19253         * class.cs (FindMembers): Allow the Builders of the various
19254         members to be null.  If they are skip them.  This only happens
19255         during the PInvoke declaration.
19256
19257 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19258
19259         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19260         failure, so we do not keep going afterwards.
19261
19262         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19263         wanted to pass `false' as the `is_delegate' argument.  If this is
19264         the case, why not use delegate_type == null to mean `is_delegate =
19265         false' and anything else as is_delegate = true.
19266
19267 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19268
19269         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19270         code for the section, not the beginning of the tests.
19271
19272 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19273
19274         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19275
19276         * expression.cs (Binary): same.  Warn about errors where we have
19277         Enum/Enum in operator + as well.
19278
19279 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19280
19281         * statement.cs:
19282                 - added support for switch(bool)
19283                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19284                 - add TableSwitchEmit() to handle table-based switch statements
19285
19286 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19287
19288         * expression.cs (Invocation.OverloadResolve): Factor out code which
19289         does parameter compatibility checking with arguments so that we can 
19290         re-use the code even from Delegate.VerifyApplicability
19291
19292         (VerifyArgumentsCompat): Move above code here.
19293
19294         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19295         and instead make a call to the above method.
19296
19297 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19298
19299         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19300         We use it to keep track of classes which are attribute types.
19301
19302 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19303
19304         * delegate.cs (Delegate.Define): Correctly define the types in the
19305         presence of fixed and array parameters.
19306
19307         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19308         doing FindMembers.
19309
19310         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19311         include NonPublic after the first iteration.
19312
19313         * class.cs (Indexer.CheckBase): Only check if both parents are
19314         non-null. 
19315
19316         * cs-parser.jay (accessor_body): If empty, set to null.
19317
19318         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19319         same code path here to resolve constants names that we did have in
19320         MemberAccess.DoResolve.  There is too much code duplicated here.
19321
19322 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19323
19324         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19325
19326         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19327         to MakeUnionSet.
19328
19329         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19330         tokens, numbers and strings.
19331
19332         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19333         parenthesis.
19334
19335         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19336         asyncronous parameters and the regular parameters.  
19337
19338         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19339         specify the target directory.
19340
19341         * expression.cs: (This.DoResolve): Simplify
19342         (As.Emit): Optimize, do not generate IsInst if the expression is
19343         always of the given type.
19344
19345         (Is.DoResolve): Bug fix, we were reporting both always/never for
19346         the is expression.
19347
19348         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19349         creating too many unnecessary arrays.
19350
19351 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19354         fields instead of rolling our own initializer.   Takes care of all
19355         implicit conversions, and drops unnecessary static checks/argument.
19356
19357 2002-03-31  Dick Porter  <dick@ximian.com>
19358
19359         * driver.cs: use the GetDirectories() return values properly, and
19360         use "/" as path separator.
19361
19362 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * expression.cs (Unary): Optimize - - expr into expr.
19365         (Binary): Optimize a + (-b) into a -b.
19366
19367         * codegen.cs (CodeGen): Made all methods static.
19368
19369 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * rootcontext.cs: 
19372
19373         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19374         TypeBuilder property.
19375
19376         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19377         instead. 
19378
19379         * tree.cs: Removed the various RecordXXXX, and replaced with a
19380         single RecordDecl.  Removed all the accessor methods, and just
19381         left a single access point Type 
19382
19383         * enum.cs: Rename DefineEnum to DefineType.
19384
19385         * decl.cs: New abstract method `DefineType' used to unify the
19386         Defines for Enumerations, Interfaces, TypeContainers and
19387         Delegates.
19388
19389         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19390         LookupBaseClasses method that used to live in class.cs and
19391         interface.cs here, and renamed to FindType.
19392
19393         * delegate.cs: Implement DefineType.  Take advantage of the
19394         refactored pattern for locating the parent builder without taking
19395         the parent_builder argument (which we know does not work if we are
19396         nested, and triggering a toplevel definition).
19397
19398 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19401         accessibility of a member has changed during override and report
19402         an error if so.
19403
19404         * class.cs (Method.Define, Property.Define): Only complain on
19405         overrides if the method is private, any other accessibility is
19406         fine (and since we just checked the permission is the same, we are
19407         good to go).
19408
19409         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19410         and elif are processed always.  The other pre-processing
19411         directives are only processed if we are "taking" the path
19412
19413 2002-03-29  Martin Baulig  <martin@gnome.org>
19414
19415         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19416         current location is not Null.
19417
19418         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19419         a separate method so we can profile it.
19420
19421         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19422         `span.Seconds' are just seconds, but no minutes or hours.
19423         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19424
19425 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19426
19427         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19428         Remove the gratuitous set of Final:
19429
19430                                 // If an interface implementation, then we can set Final.
19431                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19432                                     implementing.DeclaringType.IsInterface)
19433                                         flags |= MethodAttributes.Final;
19434
19435         I do not know what I was smoking when I used that.
19436
19437
19438         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19439         step into fixing the name resolution issues for delegates and
19440         unifying the toplevel name resolution.
19441
19442 2002-03-28  Martin Baulig  <martin@gnome.org>
19443
19444         * class.cs (Method.Emit): If we have a symbol writer, call its
19445         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19446         tell it about the current method.
19447
19448         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19449         writer that we're going to emit the first byte of IL code for a new
19450         statement (a new source line).
19451         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19452         EmitContext.Mark() before emitting any code.
19453
19454         * location.cs (SymbolDocument): Return null when we're Null.
19455
19456         * statement.cs (Statement): Moved the `Location loc' variable here.
19457         (Statement.EmitBoolExpression): If we have a symbol writer, call
19458         ec.Mark() before emitting any code to tell it that we're at the
19459         beginning of a new statement.
19460         (StatementExpression): Added `Location' argument to the constructor.
19461         (Block): Added public readonly variable `StartLocation' and public
19462         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19463         (Block): Added constructor which takes a start and end location.
19464         (Block.SetEndLocation): New method. This sets the end location.
19465         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19466         local variables we create.
19467         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19468         each statement and do also mark the begin and end of the block.
19469
19470         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19471         tell it the current lexer.Location, use Location.Null for the end of the
19472         block.
19473         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19474         current block, set its end location using SetEndLocation().
19475         (statement_expression): StatementExpression constructor now takes the
19476         lexer.Location as additional argument.
19477         (for_statement, declare_local_variables): Likewise.
19478         (declare_local_variables): When creating a new implicit block, use the
19479         new Block constructor and pass it the lexer.Location.
19480
19481 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19482
19483         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19484         members also on the parent interfaces recursively.
19485
19486 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * report.cs: Use new formats, since Gonzalo finished the missing
19489         bits. 
19490
19491         * expression.cs (Binary.ResolveOperator): added missing operator|
19492         operator& and operator^ for bool/bool.
19493
19494         * cs-parser.jay: CheckDef now takes a Location argument that is
19495         used to report errors more precisly (instead of reporting the end
19496         of a definition, we try to track something which is a lot closer
19497         to the source of the problem).
19498
19499         * cs-tokenizer.cs: Track global token use, so we can properly flag
19500         the use of #define/#undef after the first token has been seen.
19501
19502         Also, rename the reportXXXX to Error_DescriptiveName
19503
19504         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19505         TypeContainer, so that Enum and Interface can use this too.
19506
19507         * class.cs (TypeContainer.LookupInterfaceOrClass,
19508         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19509         `builder' argument.  Typically this was used to pass the parent
19510         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19511         the definition).  
19512
19513         The problem is that a nested class could trigger the definition of
19514         a toplevel class, and the builder would be obviously wrong in that
19515         case. 
19516
19517         So we drop this argument, and we compute dynamically the
19518         TypeBuilder/ModuleBuilder (the correct information was available
19519         to us anyways from DeclSpace.Parent)
19520
19521         * interface.cs (Interface.DefineInterface): Drop builder
19522         parameter cleanup like class.cs
19523
19524         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19525         like class.cs
19526
19527         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19528         values. 
19529
19530         (Try.Emit): Propagate the returns value from the statement.
19531
19532         (Return.Emit): Even if we are leavning 
19533
19534         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19535
19536         * modifiers.cs: Fix the computation of MethodAttributes flags.
19537
19538 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19539
19540         * driver.cs: allow compilation of files that start with '/'.
19541         Add a default case when checking the argument of --target.
19542
19543 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19544
19545         * interface.cs: Implement the same search algorithm for types in
19546         the interface code.
19547
19548         * delegate.cs: Do not allow multiple definition.
19549
19550         * Recovered ChangeLog that got accidentally amputated
19551
19552         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19553
19554         * rootcontext.cs: Load manually enum to allow core classes to
19555         contain enumerations.
19556
19557         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19558         Update to new static methods in TypeManager.
19559
19560         * typemanager.cs (GetMethod, GetConstructor): Use our
19561         implementation of FindMembers to find the members, since during
19562         corlib compilation, the types are TypeBuilders and GetMethod and
19563         GetConstructor do not work.
19564
19565         Make all methods in TypeManager static.
19566
19567         (InitCodeHelpers): Split the functionality from
19568         the InitCodeTypes function.
19569
19570         * driver.cs: Call InitCodeHelpers after we have populated the
19571         types. 
19572
19573         * cs-parser.jay (delegate_declaration): we did not used to compute
19574         the delegate name correctly for void delegates.
19575
19576 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19577
19578         * rootcontext.cs (RootContext): Init the interface_resolve_order
19579         and type_container_resolve_order always.
19580
19581         (ResolveCore, BootstrapCorlib_ResolveClass,
19582         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19583         compiler when compiling with --nostdlib
19584
19585         * class.cs (TypeContainer.DefineType): Check that our parent is
19586         not null.  This test is most important when we are bootstraping
19587         the core types.
19588
19589         * codegen.cs: Split out the symbol writing code.
19590
19591 2002-03-25  Martin Baulig  <martin@gnome.org>
19592
19593         * driver.cs (-g): Made -g an alias for --debug.
19594
19595 2002-03-24  Martin Baulig  <martin@gnome.org>
19596
19597         * codegen.cs (SymbolWriter): New public variable. Returns the
19598         current symbol writer.
19599         (CodeGen): Added `bool want_debugging_support' argument to the
19600          constructor. If true, tell the ModuleBuild that we want debugging
19601         support and ask it for the ISymbolWriter.
19602         (Save): If we have a symbol writer, call it's Close() method after
19603         saving the assembly.
19604
19605         * driver.c (--debug): New command line argument to create a
19606         debugger information file.
19607
19608         * location.cs (SymbolDocument): New public property. Returns an
19609         ISymbolDocumentWriter object for the current source file or null
19610         if we don't have a symbol writer.
19611
19612 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19613
19614         * driver.cs (LoadAssembly): Correctly return when all the paths
19615         have been tried and not before.
19616
19617         * statement.cs (Switch.Emit): return the actual coverage for this
19618         statement (returns/not-returns)
19619
19620         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19621         switch of the statement if we are the last switch section.  That
19622         kills two problems: try/catch problems (we used to emit an empty
19623         nop at the end) and switch statements where all branches would
19624         return. 
19625
19626 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19627
19628         * driver.cs: Add default assemblies (the equivalent to the
19629         Microsoft CSC.RSP file)
19630
19631         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19632         also update tokens_seen and set it to false.
19633
19634         * driver.cs: Implement --recurse for Mike.
19635
19636         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19637         correctly splitting out the paths.
19638
19639 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19640
19641         * interface.cs (Interface.PopulateProperty): Instead of using
19642         `parent' as the declaration space for the set parameters, use
19643         `this' 
19644
19645         * support.cs (InternalParameters): InternalParameters constructor
19646         takes a DeclSpace instead of a TypeContainer.
19647
19648         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19649         types are being initialized, load the address of it before calling
19650         the function.  
19651
19652         (New): Provide a mechanism to disable the generation of local
19653         value type temporaries when the caller will be providing us with
19654         an address to store it.
19655
19656         (ArrayCreation.EmitDynamicInitializers): Use it.
19657
19658 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19659
19660         * expression.cs (Invocation.EmitArguments): Only probe for array
19661         property if there is more than one argument.  Sorry about that.
19662
19663         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19664         empty param arrays.
19665
19666         * class.cs (Method.LabelParameters): Fix incorrect code path that
19667         prevented the `ParamArrayAttribute' from being applied to the
19668         params attribute.
19669
19670 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * support.cs (ReflectionParameters): Correctly compute whether the
19673         last argument is a params array.  Fixes the problem with
19674         string.Split ('a')
19675
19676         * typemanager.cs: Make the assemblies array always be non-null
19677         (empty, but non-null)
19678
19679         * tree.cs (RecordDecl): New function that abstracts the recording
19680         of names.  This reports error 101, and provides a pointer to the
19681         previous declaration.  Fixes a crash in the compiler.
19682
19683         * cs-parser.jay (constructor_declaration): Update to new grammar,
19684         and provide a constructor_body that can be empty.
19685
19686 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19687
19688         * driver.cs: Add support for --resources.
19689
19690         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19691         Make all types for the various array helper methods be integer.
19692
19693         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19694         CheckState to ConvCast.
19695
19696         (ConvCast): Now it takes a `checked' state argument, to avoid
19697         depending on the emit context for the conversion, and just using
19698         the resolve time setting.
19699
19700         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19701         instead of Invocation.EmitArguments.  We do not emit the original
19702         arguments, instead we emit those which have been converted to
19703         unsigned int expressions.
19704
19705         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19706
19707         * codegen.cs: ditto.
19708
19709         * expression.cs (LocalVariableReference): Drop the use of the
19710         Store function that depended on the variable index.
19711
19712         * statement.cs (VariableInfo): Drop the `Idx' property from this
19713         class, as this is not taking into account the indexes for
19714         temporaries tat we generate during the execution, getting the
19715         indexes wrong.
19716
19717         * class.cs: First emit class initializers, then call the parent
19718         constructor. 
19719
19720         * expression.cs (Binary): Fix opcode emision.
19721         (UnaryMutator.EmitCode): Support checked code generation
19722
19723         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19724         matches for events for both the Static and Instance scans,
19725         pointing to the same element.   Fix that.
19726
19727 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19728
19729         * rootcontext.cs (ResolveTree): Always set the
19730         interface_resolve_order, because nested interfaces will be calling
19731         into us.
19732
19733         * class.cs (GetInterfaceOrClass): Track the same resolution
19734         process used by TypeManager.LookupType.  This fixes the nested
19735         type lookups in class declarations (separate path from
19736         LookupType). 
19737
19738         (TypeContainer.DefineType): Also define nested interfaces.
19739         (TypeContainer.RegisterOrder): New public function used to
19740         register the order in which child interfaces need to be closed.
19741
19742         Nested interfaces need to be closed after their parents have been
19743         created. 
19744
19745         * interface.cs (InterfaceAttr): Put all the logic for computing
19746         the interface attribute here. 
19747
19748         (DefineInterface): Register our interface order with the
19749         RootContext or with the TypeContainer depending on the case.
19750
19751 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19752
19753         * cs-parser.jay: rework foreach statement to work with the new
19754         changes to the policy on SimpleNames.
19755
19756         * report.cs: support Stacktrace on warnings as well.
19757
19758         * makefile: drop --unsafe and /unsafe from the compile.
19759
19760 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19761
19762         * ecore.cs (StandardConversionExists): Modify to take an Expression
19763         as the first parameter. Ensure we do null -> reference type conversion
19764         checking.
19765
19766         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19767         temporary Expression objects.
19768
19769 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19770
19771         * interface.cs: workaround bug in method overloading resolution
19772         (there is already a bugzilla bug for it).
19773
19774 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19775
19776         We could also solve this problem by having a separate path for
19777         performing type lookups, instead of DoResolve, we could have a
19778         ResolveType entry point, and only participating pieces of the
19779         production (simplename, deref, array) would implement this. 
19780
19781         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19782         signal SimpleName to only resolve type names and not attempt to
19783         resolve anything else.
19784
19785         * expression.cs (Cast): Set the flag.
19786
19787         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19788
19789         * class.cs: Only report 108 if there is no `new' modifier.
19790
19791         * cs-parser.jay: rework foreach statement to work with the new
19792         changes to the policy on SimpleNames.
19793         
19794         * report.cs: support Stacktrace on warnings as well.
19795
19796         * makefile: drop --unsafe and /unsafe from the compile.
19797
19798 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19799
19800         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19801         lookups here, instead of doing that at parse time.  This means
19802         that our grammar will not introduce `LocalVariableReferences' as
19803         expressions at this point.  That solves the problem of code like
19804         this:
19805
19806         class X {
19807            static void Main ()
19808            { int X = 1;
19809             { X x = null }}}
19810
19811         This is only half the fix.  The full fix requires parameters to
19812         also be handled in this way.
19813
19814         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19815         makes the use more obvious of the DeclSpace.  The
19816         ec.TypeContainer.TypeBuilder is now only used to pull the
19817         TypeBuilder for it.
19818
19819         My theory is that I can get rid of the TypeBuilder completely from
19820         the EmitContext, and have typecasts where it is used (from
19821         DeclSpace to where it matters).  
19822
19823         The only pending problem is that the code that implements Aliases
19824         is on TypeContainer, and probably should go in DeclSpace.
19825
19826         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19827         lookups here, instead of doing that at parse time.  This means
19828         that our grammar will not introduce `LocalVariableReferences' as
19829         expressions at this point.  That solves the problem of code like
19830         this:
19831
19832         class X {
19833            static void Main ()
19834            { int X = 1;
19835             { X x = null }}}
19836
19837         This is only half the fix.  The full fix requires parameters to
19838         also be handled in this way.
19839
19840         * class.cs (Property.DefineMethod): When implementing an interface
19841         method, set newslot, when implementing an abstract method, do not
19842         set the flag (before we tried never setting it, or always setting
19843         it, which is the difference).
19844         (Indexer.DefineMethod): same.
19845         (Method.DefineMethod): same.
19846
19847         * ecore.cs: Only set the status used flag if we get back a Field.
19848
19849         * attribute.cs: Temporary hack, so Paolo can keep working.
19850
19851 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19852
19853         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19854         the unmanaged type in the case we have a MarshalAs attribute.
19855
19856         (Resolve): Handle the case when we are parsing the special MarshalAs
19857         attribute [we need to store the unmanaged type to use later]
19858
19859         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19860         MarshalAs Attribute.
19861
19862         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19863         on parameters and accordingly set the marshalling info.
19864
19865 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19866
19867         * class.cs: Optimizing slightly by removing redundant code after
19868         we switched to the `NoTypes' return value.
19869         (Property.DefineMethod): use NoTypes here too.
19870
19871         This fixes the bug I introduced in my last batch of changes.
19872
19873 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19874
19875         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19876
19877         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19878         Enums since those are types too. 
19879
19880         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19881
19882         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19883         thanks to a call during the lookup process.
19884
19885 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19886
19887         * statement.cs (Foreach): Lots of work to accomodate a particular
19888         kind of foreach statement that I had not kept in mind.  It is
19889         possible to have foreachs on classes that provide a GetEnumerator
19890         method that return objects that implement the "pattern" for using
19891         a foreach, there is no need to support GetEnumerator
19892         specifically. 
19893
19894         This is needed to compile nant.
19895
19896         * decl.cs: Only report 114 if the member is not `Finalize' and if
19897         the warning level is at least 2.
19898
19899         * class.cs: Moved the compare function from Method to
19900         MethodSignature. 
19901
19902         (MethodSignature.InheritableMemberSignatureCompare): Add new
19903         filter function that is used to extract inheritable methods from a
19904         class. 
19905
19906         (Method.Define): Use the new `inheritable_method_signature_filter'
19907         delegate
19908
19909         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19910         command. 
19911
19912 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19915
19916         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19917
19918         * expression.cs: Pass location information to
19919         ConvertImplicitStandard. 
19920
19921         * class.cs: Added debugging code to track return values from
19922         interfaces. 
19923
19924 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * expression.cs (Is.DoResolve): If either side of the `is' is an
19927         interface, do not flag the warning.
19928
19929         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19930         for interfaces
19931
19932         * report.cs: Allow for --fatal to be used with --probe.
19933
19934         * typemanager.cs (NoTypes): Move the definition for the empty Type
19935         array here. 
19936
19937         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19938         properties. 
19939         (TypeContainer.DefineProxy): New function used to proxy to parent
19940         implementations when implementing interfaces.
19941         (TypeContainer.ParentImplements): used to lookup if our parent
19942         implements a public function that is required by an interface.
19943         (TypeContainer.VerifyPendingMethods): Hook this up.
19944
19945         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19946         `modules' and `assemblies' arraylists into arrays.  We only grow
19947         these are the very early start up of the program, so this improves
19948         the speedof LookupType (nicely measured).
19949
19950         * expression.cs (MakeByteBlob): Replaced unsafe code with
19951         BitConverter, as suggested by Paolo.
19952
19953         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19954         folding of string concatenation, but if either side is a string,
19955         and the other is not, then return null, and let the runtime use
19956         the concatenation on the string plus the object (using
19957         `Object.ToString'). 
19958
19959 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19960
19961         Constant Folding has been implemented now.
19962
19963         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19964         the error instead on types that are not supported in one's
19965         complement. 
19966
19967         * constant.cs (Constant and all children): New set of functions to
19968         perform implict and explicit conversions.
19969
19970         * ecore.cs (EnumConstant): Implement the new functions to perform
19971         conversion by proxying to the child expression.
19972
19973         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19974         own separate setting that can not be turned off from the command
19975         line using --unchecked or --checked and is only controlled using
19976         the checked/unchecked statements and expressions.  This setting is
19977         used by the constant folder to flag errors.
19978
19979         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19980         ConstantCheckState as well.   
19981
19982         During Resolve, they also have to flag the state, because the
19983         constant folder runs completely in the Resolve phase.
19984
19985         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19986         well.
19987
19988 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19989
19990         * cfold.cs: New file, this file contains the constant folder.
19991
19992         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19993         argument to track whether we are using the resulting address to
19994         load or store a value and provide better error messages. 
19995
19996         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19997         new AddressOf arguments.
19998
19999         * statement.cs (Foreach.EmitCollectionForeach): Update
20000
20001         * expression.cs (Argument.Emit): Call AddressOf with proper
20002         arguments to track usage.
20003
20004         (New.DoEmit): Call AddressOf with new arguments.
20005
20006         (Unary.Emit): Adjust AddressOf call.
20007
20008 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20009
20010         * cs-parser.jay (member_access): Change the case for pre-defined types
20011         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20012         this suggestion.
20013
20014         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20015         a method body.
20016
20017         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20018         essentially like methods and apply attributes like MethodImplOptions to them too.
20019
20020         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20021         not being null.
20022
20023         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20024         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20025         is the DeclSpace.
20026
20027         * Update code everywhere accordingly.
20028
20029         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20030
20031         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20032
20033 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20034
20035         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20036         try performing lookups against those instead of jumping straight into using
20037         the 'using' clauses.
20038
20039         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20040
20041         (LookupType): Perform lookups in implicit parents too.
20042
20043         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20044         sequence as RootContext.LookupType. 
20045
20046         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20047         the various cases of namespace lookups into this method.
20048
20049 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20052         in positional arguments)
20053
20054         * class.cs (Operator): Update the AllowedModifiers to contain
20055         extern. 
20056
20057         * cs-parser.jay: Update operator declaration to allow for the
20058         operator body to be empty.
20059
20060         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20061         values. 
20062
20063 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20064
20065         * class.cs (Method.Emit): Label parameters.
20066
20067         * driver.cs: Return 1 or 0 as the program exit code.
20068
20069 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20070
20071         * expression.cs: Special case the `null' object when trying to
20072         auto-compute the type, as anything can be explicitly converted to
20073         that. 
20074
20075         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20076         spotting this Paolo.
20077
20078         (Expression.ImplicitNumericConversion): Perform comparissions of
20079         the type using the underlying type in the case of an enumeration
20080         rather than using the enumeration type for the compare.
20081
20082         Cope with the underlying == type case, which is not possible to
20083         catch before. 
20084
20085         (Expression.ConvertNumericExplicit): Perform comparissions of
20086         the type using the underlying type in the case of an enumeration
20087         rather than using the enumeration type for the compare.
20088
20089         * driver.cs: If the user does not supply an extension, assume .exe
20090
20091         * cs-parser.jay (if_statement): Rewrote so that we can track the
20092         location for the if statement.
20093
20094         * expression.cs (Binary.ConstantFold): Only concat strings when
20095         the operation is "+", not everything ;-)
20096
20097         * statement.cs (Statement.EmitBoolExpression): Take a location
20098         argument. 
20099         (If, While, Do): Track location.
20100
20101         * expression.cs (Binary.ResolveOperator): In the object + string
20102         case, I was missing a call to ConvertImplicit
20103
20104 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20105
20106         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20107         Location arguments. Ensure we use RootContext.LookupType to do our work
20108         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20109
20110         * interface.cs (PopulateMethod): Handle the type of the parameter being
20111         null gracefully.
20112
20113         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20114         have a params method with no fixed arguments and a call is made with no
20115         arguments.
20116
20117 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20118
20119         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20120         the verbatim-string-literal
20121
20122         * support.cs (InternalParameters.ParameterModifier): handle null
20123         fixed parameters.
20124         (InternalParameters.ParameterType): ditto.
20125
20126         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20127         duplicating the name of the variable parameter.
20128         (GetParameterByName): Fix bug where we were not looking up array
20129         paramters if they were the only present (thanks Paolo!).
20130         (GetParameterInfo): We only have an empty set of types if both
20131         fixed and array are set to null.
20132         (GetParameterInfo-idx): Handle FixedParameter == null
20133
20134         * cs-parser.jay: Handle the case where there is no catch
20135         statements (missing null test).
20136
20137 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20138
20139         * driver.cs (MainDriver): Be conservative on our command line
20140         handling.
20141
20142         Catch DirectoryNotFoundException when calling GetFiles.
20143
20144         (SplitPathAndPattern): Used to split the input specification into
20145         a path and a pattern that we can feed to Directory.GetFiles.
20146
20147 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20148
20149         * statement.cs (Fixed): Implement the last case of the Fixed
20150         statement (string handling).
20151
20152         * expression.cs (StringPtr): New class used to return a char * to
20153         a string;  Used by the Fixed statement.
20154
20155         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20156
20157         * expression.cs (Binary.ResolveOperator): Remove redundant
20158         MemberLookup pn parent type.
20159         Optimize union call, we do not need a union if the types are the same.
20160         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20161         type.
20162
20163         Specialize the use of MemberLookup everywhere, instead of using
20164         the default settings. 
20165
20166         (StackAlloc): Implement stackalloc keyword.
20167
20168         * cs-parser.jay: Add rule to parse stackalloc.
20169
20170         * driver.cs: Handle /h, /help, /?
20171
20172         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20173         before we supported unsafe code.
20174
20175         * makefile: add --unsafe to the self compilation of mcs.
20176
20177 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20178
20179         * expression.cs (PointerArithmetic): New class that is used to
20180         perform pointer arithmetic.
20181         (Binary.Resolve): Handle pointer arithmetic
20182         Handle pointer comparission.
20183         (ArrayPtr): Utility expression class that is used to take the
20184         address of an array.
20185
20186         (ElementAccess): Implement array access for pointers
20187
20188         * statement.cs (Fixed): Implement fixed statement for arrays, we
20189         are missing one more case before we are done.
20190
20191         * expression.cs (Indirection): Implement EmitAssign and set the
20192         ExprClass to Variable.  This allows pointer dereferences to be
20193         treated as variables, and to have values assigned to them.
20194
20195         * ecore.cs (Expression.StoreFromPtr): New utility function to
20196         store values dereferencing.
20197
20198 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20199
20200         * expression.cs (Binary.ResolveOperator): Ensure that we are
20201         not trying to operate on a void type - this fixes the reported
20202         bug.
20203
20204         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20205         the parent implementation is sealed.
20206
20207         * ../errors/cs0239.cs : Add.
20208
20209         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20210
20211         * typemanager.cs (unverifiable_code_type): Corresponds to 
20212         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20213         which have unsafe code in them.
20214
20215         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20216         unsafe context.
20217
20218 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20219
20220         * cs-tokenizer.cs: Add support for @"litreal strings"
20221
20222         Make tokenizer accept pre-processor directives
20223         on any column (remove the old C-like limitation). 
20224
20225         * rootcontext.cs (EmitCode): Emit any global attributes.
20226         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20227
20228         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20229
20230         * cs-parser.jay: Add support for global attributes.  
20231
20232 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20233
20234         * expression.cs (Indirection): New helper class.  Unary will
20235         create Indirection classes to be able to implement the
20236         IMemoryLocation interface on it.
20237
20238 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20239
20240         * cs-parser.jay (fixed_statement): reference the right statement.
20241
20242         * statement.cs (Fixed.Emit): Finish implementing the fixed
20243         statement for the &x case.
20244
20245 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20246
20247         * class.cs (Property.Define, Method.Define): Remove newslot when
20248         `implementing'.  
20249
20250         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20251         wrong.  NewSlot should only be used if the `new' keyword is present.
20252
20253         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20254         locating our system dir.  Sorry about this.
20255
20256 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20257
20258         * driver.cs (GetSystemDir): Compute correctly the location of our
20259         system assemblies.  I was using the compiler directory instead of
20260         the library directory.
20261
20262 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20263
20264         * expression.cs (BetterFunction): Put back in what Miguel commented out
20265         since it is the correct fix. The problem is elsewhere ;-)
20266
20267         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20268         parameters of the parms method are themselves compatible or not !
20269
20270         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20271         to check that a class implements an interface before saying that an implicit
20272         conversion was allowed. Use ImplementsInterface to do the checking.
20273
20274 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * class.cs (Method.Define): Track whether we are an explicit
20277         implementation or not.  And only call DefineMethodOverride if we
20278         are an explicit implementation.
20279
20280         (Property.DefineMethod): Ditto.
20281
20282 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20283
20284         * expression.cs (BetterFunction): Catch hideous bug which was
20285          preventing us from detecting ambiguous calls due to implicit casts i.e
20286         cs0121.
20287
20288 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20289
20290         * support.cs (Pair): Remove un-needed method.  I figured why I was
20291         getting the error in cs-parser.jay, the variable in a foreach loop
20292         is readonly, and the compiler does not really treat this as a variable.
20293
20294         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20295         instead of EQUALS in grammar.  
20296
20297         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20298
20299         * expression.cs (Unary.DoResolve): Check whether the argument is
20300         managed or not.
20301
20302 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20303
20304         * support.cs: Api for Pair to set a value.  Despite the fact that
20305         the variables are public the MS C# compiler refuses to compile
20306         code that accesses the field if the variable is part of a foreach
20307         statement. 
20308
20309         * statement.cs (Fixed): Begin implementation of the fixed
20310         statement.
20311
20312         (Block.AddVariable): Return the VariableInfo on success and null
20313         on failure instead of true/false. 
20314
20315         * cs-parser.jay (foreach): Catch errors on variables already
20316         defined (we were ignoring this value before) and properly unwind
20317         the block hierarchy
20318
20319         (fixed_statement): grammar for the fixed statement.
20320
20321 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20322
20323         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20324         pointer types to be incretemented.
20325
20326         (SizeOf): Implement.
20327
20328         * cs-parser.jay (pointer_member_access): Implement
20329         expr->IDENTIFIER production.
20330
20331         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20332         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20333         on safe contexts.
20334
20335         (Unary): Implement indirection.
20336
20337         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20338         use in non-unsafe context).
20339
20340         (SimpleName.DoResolve): Check for pointers in field access on safe
20341         contexts. 
20342
20343         (Expression.LoadFromPtr): Factor the load-indirect code in this
20344         function.  This was duplicated in UnboxCast and ParameterReference
20345
20346 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * expression.cs (ComposedCast): report an error if a pointer cast
20349         is used in a safe region.
20350
20351         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20352         pointer type casts in unsafe context.
20353
20354         * codegen.cs (EmitContext): Set up IsUnsafe.
20355
20356         * cs-parser.jay (non_expression_type): Add productions for pointer
20357         casts. 
20358
20359         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20360         code.  We should not use force into static mode if the method is
20361         not virtual.  Fixes bug in MIS
20362
20363         * statement.cs (Do.Emit, While.Emit, For.Emit,
20364         Statement.EmitBoolExpression): Add support to Do and While to
20365         propagate infinite loop as `I do return' semantics.
20366
20367         Improve the For case to also test for boolean constants.
20368
20369         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20370         to the list of attributes we can add.
20371
20372         Remove `EmitContext' argument.
20373
20374         * class.cs (Method.Define): Apply parameter attributes.
20375         (Constructor.Define): Apply parameter attributes.
20376         (MethodCore.LabelParameters): Move here the core of labeling
20377         parameters. 
20378
20379         * support.cs (ReflectionParameters.ParameterModifier,
20380         InternalParameters.ParameterModifier): Use IsByRef on the type and
20381         only return the OUT bit for these parameters instead of in/out/ref
20382         flags.
20383
20384         This is because I miss-understood things.  The ParameterInfo.IsIn
20385         and IsOut represent whether the parameter has the [In] and [Out]
20386         attributes set.  
20387
20388 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20389
20390         * ecore.cs (FieldExpr.Emit): Release temporaries.
20391
20392         * assign.cs (LocalTemporary.Release): new function.
20393
20394         * codegen.cs (EmitContext.GetTemporaryStorage,
20395         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20396         temporary storage.  Now we can "put back" localbuilders when we
20397         are done with them
20398
20399 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20400
20401         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20402         need to make a copy of the variable to generate verifiable code.
20403
20404 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20405
20406         * driver.cs: Compute dynamically the system directory.
20407
20408         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20409         Slower, but more generally useful.  Used by the abstract
20410         registering implementation. 
20411
20412         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20413         the rules for the special rule on Type/instances.  First check if
20414         we have the same name, and if so, try that special static path
20415         rather than the instance path.
20416
20417 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20418
20419         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20420         for, while and if.
20421
20422         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20423         Enum, ValueType, Delegate or Array for non-corlib compiles.
20424
20425         * cs-tokenizer.cs: Catch long identifiers (645)
20426
20427         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20428         piece of code.
20429
20430         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20431         fix, we were returning too early, so we were not registering
20432         pending methods from abstract classes.
20433
20434         Do not register pending methods if the class is abstract.
20435
20436         * expression.cs (Conditional.DoResolve): Report circular implicit
20437         conversions when we neecd to compute it for conditional
20438         expressions. 
20439
20440         (Is.DoResolve): If the expression is always of the provided type,
20441         flag warning 183.  If the expression can not ever be of the
20442         provided type flag warning 184.
20443
20444         * class.cs: Catch 169 as well.
20445
20446         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20447         read. 
20448
20449 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20450
20451         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20452
20453 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20454
20455         * interface.cs: (PopulateMethod): Check for pointers being defined
20456         only if the unsafe context is active.
20457         (PopulateProperty): ditto.
20458         (PopulateIndexer): ditto.
20459
20460         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20461         specified.  If pointers are present, make sure that they are
20462         present in an unsafe context.
20463         (Constructor, Constructor.Define): ditto.
20464         (Field, Field.Define): ditto.
20465         (Property, Property.Define): ditto.
20466         (Event, Event.Define): ditto.
20467
20468         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20469         hashtable if there are classes or structs defined.
20470
20471         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20472         code, as the constant resolution moved.
20473
20474         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20475         the metadata, so we can flag error 133. 
20476
20477         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20478         pointer is being declared in an unsafe context.
20479
20480 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * modifiers.cs (Modifiers.Check): Require a Location argument.
20483         Report error 227 for Unsafe use.
20484
20485         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20486
20487         * statement.cs (For.Emit): If the test is null, then report that
20488         we do `return', as we wont reach anything afterwards.
20489
20490         (Switch.SwitchGoverningType): Track the expression that matched
20491         the conversion.
20492
20493         * driver.cs: Allow negative numbers as an error code to flag.
20494
20495         * cs-parser.jay: Handle 1551.
20496
20497         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20498
20499 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20500
20501         * cs-parser.jay: Report 1518 (type declaration can only contain
20502         class, struct, interface, enum or delegate)
20503
20504         (switch_label): Report 1523 (keywords `case' or `default' must
20505         preced code)
20506
20507         (opt_switch_sections): Report 1522 (empty switch)
20508
20509         * driver.cs: Report 1515 (response file specified multiple times)
20510         Report 1516 (Source file specified multiple times).
20511
20512         * expression.cs (Argument.Resolve): Signal 1510
20513
20514         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20515         access not allowed in static code)
20516
20517 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20518
20519         * typemanager.cs (IsPointerType): Utility method which we are going
20520         to need a lot.
20521
20522         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20523         the object type, so we take care of that.
20524
20525         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20526
20527         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20528         added to non-params parameters :-)
20529
20530         * typemanager.cs (CSharpName): Include 'void' type too. 
20531
20532         (void_ptr_type): Include in the set of core types.
20533
20534         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20535         duplicating code.
20536
20537         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20538         an unsafe context.
20539
20540         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20541         completely forgotten about it.
20542
20543 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20544
20545         * cs-parser.jay (pointer_type): Add. This begins our implementation
20546         of parsing rules for unsafe code.
20547
20548         (unsafe_statement): Implement.
20549
20550         (embedded_statement): Modify to include the above.
20551
20552         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20553
20554         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20555         if the current context is an unsafe one.
20556
20557         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20558         are handled differently, we need separate rules for them.
20559
20560         (local_variable_declaration): Update to use local_variable_pointer_type
20561         to allow variable declarations of unmanaged pointer types.
20562
20563         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20564         in unsafe contexts.
20565
20566         * ../errors/cs0214.cs : Add.
20567
20568 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20569
20570         * makefile: remove 'response' file when cleaning.
20571
20572 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * cs-parser.jay: Report 1524.
20575
20576 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20577
20578         * typemanager.cs (RegisterMethod): drop checking if we have
20579         registered this from here
20580
20581 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20582
20583         * class.cs (Method.EmitDestructor): Implement calling our base
20584         destructor. 
20585
20586         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20587         value of InFinally.
20588
20589         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20590         this routine and will wrap the call in a try/catch block.  Deal
20591         with the case.
20592
20593 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20594
20595         * ecore.cs (Expression.MemberLookup): instead of taking a
20596         parameter `same_type' that was used to tell whether we could
20597         access private members we compute our containing type from the
20598         EmitContext.
20599
20600         (FieldExpr): Added partial support for volatile fields.  This does
20601         not work for volatile fields exposed from assemblies, as I can not
20602         figure out how to extract the modreq from it.
20603
20604         Updated all the source files to use this.
20605
20606         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20607         because it is referenced by MemberLookup very often. 
20608
20609 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20610
20611         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20612         TypeBuilder.GetCustomAttributes to retrieve what we need.
20613
20614         Get rid of redundant default_member_attr_type as this is the same as
20615         default_member_type which already exists.
20616
20617         * interface.cs, attribute.cs : Update accordingly.
20618
20619 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20620
20621         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20622         work for TYpeBuilders though.  Ravi, can you please fix this?
20623
20624         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20625
20626         * expression.cs (Argument.Emit): Handle the case of ref objects
20627         being passed to ref functions;  
20628
20629         (ParameterReference.EmitLoad): Loads the content of the pointer
20630         without dereferencing.
20631
20632 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20633
20634         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20635
20636 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20637
20638         * class.cs (Indexer.DefineMethod): Incorporate the interface
20639         type in the name of the method if we are doing explicit interface
20640         implementation.
20641
20642         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20643
20644         (BetterConversion): Fix extremely trivial bug where we were referring to
20645         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20646         again !
20647
20648         * ../errors/bug16.cs : Add although we have fixed it.
20649
20650 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20651
20652         * expression.cs (BaseIndexer): Begin implementation.
20653
20654         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20655
20656         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20657         production directly to remove a shift/reduce, and implement
20658         explicit interface implementation.
20659
20660         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20661         after a floating point suffix.
20662
20663         * expression.cs (DoNumericPromotions): Improved the conversion for
20664         uint/uint.  If we have a constant, we avoid doing a typecast to a
20665         larger type.
20666
20667         * class.cs (Indexer): Implement explicit interface implementation
20668         for indexers.
20669
20670 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20671
20672         * class.cs: make the default instance constructor public and hidebysig.
20673
20674 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20675
20676         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20677         so we can call it from elsewhere.
20678
20679         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20680         we emit it internally if the class has a defined indexer; otherwise the user
20681         emits it by decorating the class definition with the DefaultMemberAttribute.
20682
20683         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20684         attribute is not used on a type which defines an indexer.
20685
20686         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20687         character when we skip whitespace.
20688
20689         * ../errors/cs0646.cs : Add.
20690
20691 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20692
20693         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20694         again. 
20695
20696         * makefile: Add practical target `mcs3.exe' which builds the third
20697         generation compiler. 
20698
20699         * expression.cs (New): Fix structures constructor calling.
20700
20701         * class.cs (Property, Method, Indexer): Emit Final flag on the
20702         method if we are an interface implementation and we are not
20703         abstract. 
20704
20705         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20706         whether this property is referencing a `base' method.
20707
20708         * expression.cs (Invocation.EmitCall): take an extra argument:
20709         is_base, this is used to determine whether the `call' or
20710         `callvirt' opcode should be used.
20711
20712
20713         * delegate.cs: update EmitCall.
20714
20715         * class.cs (Method.Define): Set NewSlot for the cases where we are
20716         not implementing an interface method.
20717
20718         (Property.Define): ditto.
20719
20720 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20721
20722         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20723         'r'.  Allows mcs to parse itself fully.
20724
20725 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20726
20727         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20728         of the number of initializers that require the InitializeArray method.
20729
20730         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20731         update the above field where necessary.
20732
20733         (MakeByteBlob): Update accordingly.
20734
20735         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20736         greater than 2.
20737
20738         (EmitDynamicInitializers): Update in accordance with the new optimization.
20739
20740         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20741         same OpCode applies.
20742
20743         * cs-parser.jay : Fix some glaring errors I introduced.
20744
20745 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20746
20747         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20748         so that we can check for name clashes there too.
20749
20750         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20751         for interface indexers.
20752
20753         * interfaces.cs (Define): Emit the default member attribute.
20754
20755         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20756         variable was being referred to while setting the value ;-)
20757
20758 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20759
20760         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20761         byte-by-byte information when we know the data is zero.
20762
20763         Make the block always a multiple of 4, because
20764         DefineInitializedData has a bug.
20765
20766         * assign.cs: Fix, we should assign from the temporary, not from
20767         the source. 
20768
20769         * expression.cs (MakeByteBlob): Fix my incorrect code.
20770
20771 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20772
20773         * typemanager.cs (EnumToUnderlying): This function is used to get
20774         the underlying type from an enumeration, because it does not
20775         always work. 
20776
20777         * constant.cs: Use the I4_S form for values between -128 and 127.
20778
20779         * statement.cs (Block.LookupLabel): Looks up a label.
20780         (Block): Drop support for labeled blocks.
20781
20782         (LabeledStatement): New kind of statement that represents a label
20783         only.
20784
20785         (Goto): Finally implement this bad boy.
20786
20787         * cs-parser.jay: Update to reflect new mechanism to implement
20788         labels.
20789
20790 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20791
20792         * codegen.cs (EmitContext.This): a codegen property that keeps the
20793         a single instance of this instead of creating many different this
20794         instances. 
20795
20796         * delegate.cs (Delegate.DoResolve): Update to use the property;
20797
20798         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20799
20800         * expression.cs (BaseAccess.DoResolve): Ditto.
20801
20802 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20803
20804         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20805         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20806
20807         (InitCoreTypes): Update accordingly.
20808
20809         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20810         so we can quickly store the state.
20811
20812         (ApplyAttributes): Set the correct implementation flags
20813         for InternalCall methods.
20814
20815 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20816
20817         * expression.cs (EmitCall): if a method is not virtual, then do
20818         not use callvirt on it.
20819
20820         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20821         user defined stuff) requires the use of stobj, which takes an
20822         address on the stack instead of an array and an index.  So emit
20823         the Ldelema operation for it.
20824
20825         (EmitStoreOpcode): Use stobj for valuetypes.
20826
20827         (UnaryMutator.EmitCode): Use the right 1 value depending on
20828         whether we are dealing with int64/uint64, float or doubles.
20829
20830         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20831         constructors that I implemented last night.
20832
20833         (Constructor.IsDefault): Fix to work properly for static
20834         constructors.
20835
20836         * cs-parser.jay (CheckDef): report method signature errors.
20837         Update error number 103 to be 132.
20838
20839         * decl.cs: New AdditionResult enumeration value: MethodExists.
20840         Although we do this check for methods later on in the semantic
20841         analysis, catching repeated default constructors is so easy that
20842         we catch these here. 
20843
20844         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20845         promotions code.
20846
20847         (ParameterReference.EmitAssign, Emit): handle
20848         bools as bytes.
20849
20850         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20851         (ArrayAccess.EmitStoreOpcode): ditto.
20852
20853         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20854
20855         * expression.cs (MakeByteBlob): Complete all the missing types
20856         (uint, short, ushort, byte, sbyte)
20857
20858         * class.cs: Only init instance field initializers on instance
20859         constructors. 
20860
20861         Rename `constructors' to instance_constructors. 
20862
20863         (TypeContainer.AddConstructor): Only add constructors to the list
20864         if it is not static.
20865
20866         Make sure that we handle default_static_constructor independently
20867         everywhere where we handle instance_constructors
20868
20869 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20870
20871         * class.cs: Do not lookup or create a base initializer for a
20872         static constructor.
20873
20874         (ConstructorInitializer.Resolve): use the proper type to lookup
20875         for constructors.
20876
20877         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20878
20879         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20880         in DeclSpace. 
20881
20882         * decl.cs: CloseType is now an virtual method, the default
20883         implementation just closes this type.
20884
20885 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20886
20887         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20888         to PreserveSig by default. Also emit HideBySig on such methods.
20889
20890         Basically, set the defaults to standard values.
20891
20892         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20893         argument, if candidate is better, it can't be worse than the best !
20894
20895         (Invocation): Re-write bits to differentiate between methods being
20896         applicable in their expanded form and their normal form - for params
20897         methods of course.
20898
20899         Get rid of use_standard everywhere as only standard conversions are allowed
20900         in overload resolution. 
20901
20902         More spec conformance.
20903
20904 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20905
20906         * driver.cs: Add --timestamp, to see where the compiler spends
20907         most of its time.
20908
20909         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20910         `this' in static code.
20911
20912         (SimpleName.DoResolve): Implement in terms of a helper function
20913         that allows static-references to be passed upstream to
20914         MemberAccess.
20915
20916         (Expression.ResolveWithSimpleName): Resolve specially simple
20917         names when called by MemberAccess to implement the special
20918         semantics. 
20919
20920         (Expression.ImplicitReferenceConversion): Handle conversions from
20921         Null to reference types before others, as Null's type is
20922         System.Object. 
20923
20924         * expression.cs (Invocation.EmitCall): Handle the special case of
20925         calling methods declared on a reference type from a ValueType
20926         (Base classes System.Object and System.Enum)
20927
20928         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20929         the left hand side is a TypeExpr, not on every enumeration. 
20930
20931         (Binary.Resolve): If types are reference types, then do a cast to
20932         object on operators != and == of both arguments.
20933
20934         * typemanager.cs (FindMembers): Extract instance and static
20935         members if requested.
20936
20937         * interface.cs (PopulateProperty): Use void_type instead of null
20938         as the return type for the setter method.
20939
20940         (PopulateIndexer): ditto.
20941
20942 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20943
20944         * support.cs (ReflectionParameters): Fix minor bug where we
20945         were examining the wrong parameter for the ParamArray attribute.
20946
20947         Cope with requests for the type of the parameter at position
20948         greater than the params parameter's. We now return the element
20949         type of the params array as that makes more sense.
20950
20951         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20952         accordingly as we no longer have to extract the element type
20953         ourselves.
20954
20955         (Invocation.OverloadResolve): Update.
20956
20957 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20958
20959         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20960         against IEnumerator, test whether the return value is a descendant
20961         of the IEnumerator interface.
20962
20963         * class.cs (Indexer.Define): Use an auxiliary method to implement
20964         the other bits of the method definition.  Begin support for
20965         explicit interface implementation.
20966
20967         (Property.DefineMethod): Use TypeManager.void_type instead of null
20968         for an empty return value.
20969
20970 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20971
20972         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20973         dealing with a FieldExpr which is composed of a FieldBuilder, in
20974         the code path we did extract the constant, but we should have
20975         obtained the underlying value to be able to cast it (otherwise we
20976         end up in an infinite loop, this is what Ravi was running into).
20977
20978         (ArrayCreation.UpdateIndices): Arrays might be empty.
20979
20980         (MemberAccess.ResolveMemberAccess): Add support for section
20981         14.5.4.1 that deals with the special case of E.I when E is a type
20982         and something else, that I can be a reference to a static member.
20983
20984         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20985         handle a particular array type to create byte blobs, it is just
20986         something we dont generate byteblobs for.
20987
20988         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20989         arguments. 
20990
20991         * location.cs (Push): remove the key from the hashtable that we
20992         are about to add.   This happens for empty files.
20993
20994         * driver.cs: Dispose files after we have parsed them.
20995
20996         (tokenize): new function that only runs the tokenizer on its
20997         input, for speed testing.
20998
20999 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21000
21001         * class.cs (Event.Define): Define the private field only if there
21002         are no accessors defined.
21003
21004         * expression.cs (ResolveMemberAccess): If there is no associated
21005         field with the event, that means we have an event defined with its
21006         own accessors and we should flag error cs0070 since transforming
21007         ourselves into a field is not valid in that case.
21008
21009         * ecore.cs (SimpleName.DoResolve): Same as above.
21010
21011         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21012         and charset to sane values.
21013
21014 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21015
21016         * assign.cs (DoResolve): Perform check on events only if they 
21017         are being accessed outside the declaring type.
21018
21019         * cs-parser.jay (event_declarations): Update rules to correctly
21020         set the type of the implicit parameter etc.
21021
21022         (add_accessor, remove_accessor): Set current local parameters.
21023
21024         * expression.cs (Binary): For delegate addition and subtraction,
21025         cast the return value from the method into the appropriate delegate
21026         type.
21027
21028 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21029
21030         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21031         of these as the workaround is unnecessary.
21032
21033         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21034         delegate data - none of that is needed at all.
21035
21036         Re-write bits to extract the instance expression and the delegate method
21037         correctly.
21038
21039         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21040         on delegates too.
21041
21042         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21043         of attaching attributes instead of duplicating code everywhere.
21044
21045         * everywhere : Update code to do attribute emission using the above method.
21046
21047 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21048
21049         * expression.cs (IsParamsMethodApplicable): if there are not
21050         parameters, return immediately.
21051
21052         * ecore.cs: The 0 literal can be implicity converted to an enum
21053         type. 
21054
21055         (SimpleName.DoResolve): First lookup the type, then lookup the
21056         members. 
21057
21058         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21059         want to get its address.  If the InstanceExpression is not
21060         addressable, store the result in a temporary variable, then get
21061         the address of it.
21062
21063         * codegen.cs: Only display 219 errors on warning level or above. 
21064
21065         * expression.cs (ArrayAccess): Make it implement the
21066         IMemoryLocation interface.
21067
21068         (Binary.DoResolve): handle the operator == (object a, object b)
21069         and operator != (object a, object b) without incurring into a
21070         BoxedCast (because 5 != o should never be performed).
21071
21072         Handle binary enumerator operators.
21073
21074         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21075         value type, otherwise use Ldelem_ref.
21076
21077         Use precomputed names;
21078
21079         (AddressOf): Implement address of
21080
21081         * cs-parser.jay (labeled_statement): Fix recursive block
21082         addition by reworking the production.
21083
21084         * expression.cs (New.DoEmit): New has a special case:
21085                 
21086                  If we are dealing with a ValueType, we have a few
21087                  situations to deal with:
21088                 
21089                     * The target of New is a ValueType variable, that is
21090                       easy, we just pass this as the variable reference
21091                 
21092                     * The target of New is being passed as an argument,
21093                       to a boxing operation or a function that takes a
21094                       ValueType.
21095                 
21096                       In this case, we need to create a temporary variable
21097                       that is the argument of New.
21098
21099
21100 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21101
21102         * rootcontext.cs (LookupType): Check that current_type is not null before
21103         going about looking at nested types.
21104
21105         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21106         not implement the IAssignMethod interface any more.
21107
21108         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21109         where we tranform them into FieldExprs if they are being resolved from within
21110         the declaring type.
21111
21112         * ecore.cs (SimpleName.DoResolve): Do the same here.
21113
21114         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21115
21116         * ../errors/bug10.cs : Add.
21117
21118         * ../errors/cs0070.cs : Add.
21119
21120         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21121
21122         * assign.cs : Get rid of EventIsLocal everywhere.
21123
21124 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21125
21126         * ecore.cs (ConvertIntLiteral): finished the implementation.
21127
21128         * statement.cs (SwitchLabel): Convert the value we are using as a
21129         key before looking up the table.
21130
21131 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * codegen.cs (EmitTopBlock): Require a Location argument now.
21134
21135         * cs-parser.jay (constructor_declarator): We need to setup
21136         current_local_parameters before we parse the
21137         opt_constructor_initializer, to allow the variables to be bound
21138         to the constructor arguments.
21139
21140         * rootcontext.cs (LookupType): First lookup nested classes in our
21141         class and our parents before we go looking outside our class.
21142
21143         * expression.cs (ConstantFold): Extract/debox the values at the
21144         beginnning. 
21145
21146         * rootcontext.cs (EmitCode): Resolve the constants first before we
21147         resolve the types.  This is not really needed, but it helps debugging.
21148
21149         * statement.cs: report location.
21150
21151         * cs-parser.jay: pass location to throw statement.
21152
21153         * driver.cs: Small bug fix.
21154
21155         * report.cs: Updated format to be 4-zero filled digits.
21156
21157 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21158
21159         * expression.cs (CheckIndices): Fix minor bug where the wrong
21160         variable was being referred to ;-)
21161
21162         (DoEmit): Do not call EmitStaticInitializers when the 
21163         underlying type is System.Object.
21164
21165 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21166
21167         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21168         and do the usual workaround for SRE.
21169
21170         * class.cs (MyEventBuilder.EventType): New member to get at the type
21171         of the event, quickly.
21172
21173         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21174
21175         * assign.cs (Assign.DoResolve): Handle the case when the target
21176         is an EventExpr and perform the necessary checks.
21177
21178         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21179         interface.
21180
21181         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21182
21183         (EventExpr): Set the type in the constructor itself since we 
21184         are meant to be born fully resolved.
21185
21186         (EventExpr.Define): Revert code I wrote earlier.
21187                 
21188         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21189         instance expression is null. The instance expression is a This in that case
21190         or a null, depending on whether it is a static method or not.
21191
21192         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21193         refers to more than one method.
21194
21195         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21196         and accordingly flag errors.
21197
21198 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21199
21200         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21201
21202 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21203
21204         * location.cs (ToString): Provide useful rutine.
21205
21206 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21207
21208         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21209         objects, return the actual integral boxed.
21210
21211         * statement.cs (SwitchLabel): define an ILLabel for each
21212         SwitchLabel. 
21213
21214         (Switch.CheckSwitch): If the value is a Literal, extract
21215         the underlying literal.
21216
21217         Also in the unused hashtable we had, add the SwitchLabel so we can
21218         quickly look this value up.
21219
21220         * constant.cs: Implement a bunch of new constants.  Rewrite
21221         Literal based on this.  Made changes everywhere to adapt to this.
21222
21223         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21224         dereferencing array only once, and also copes with enumrations.
21225
21226         bytes are two bytes wide, not one.
21227
21228         (Cast): Perform constant conversions.
21229
21230         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21231         wrappers to the literals here.
21232
21233         * expression.cs (DoNumericPromotions): long literals can converted
21234         to ulong implicity (this is taken care of elsewhere, but I was
21235         missing this spot).
21236
21237         * ecore.cs (Expression.Literalize): Make the return type Literal,
21238         to improve type checking.
21239
21240         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21241
21242 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21243
21244         * literal.cs: Revert code from ravi that checked the bounds.  The
21245         bounds are sane by the definition of the type itself. 
21246
21247         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21248         need to actually look up in our parent hierarchy for interfaces
21249         implemented. 
21250
21251         * const.cs: Use the underlying type for enumerations
21252
21253         * delegate.cs: Compute the basename for the delegate creation,
21254         that should fix the delegate test case, and restore the correct
21255         Type Lookup semantics in rootcontext
21256
21257         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21258         referencing a nested type with the Reflection API is using the "+"
21259         sign. 
21260
21261         * cs-parser.jay: Do not require EOF token at the end.
21262
21263 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21264
21265         * rootcontext.cs (LookupType): Concatenate type names with
21266         a '.' instead of a '+' The test suite passes again.
21267
21268         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21269         field of the enumeration.
21270
21271         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21272         the case when the member is an EventExpr.
21273
21274         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21275         static has an associated instance expression.
21276
21277         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21278
21279         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21280
21281         * class.cs (Event.Define): Register event and perform appropriate checks
21282         for error #111.
21283
21284         We define the Add and Remove methods even if the use provides none because
21285         in that case, we provide default implementations ourselves.
21286
21287         Define a private field of the type of the event. This is done by the CSC compiler
21288         and we should be doing it too ;-)
21289
21290         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21291         More methods we use in code we generate.
21292
21293         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21294         is important.
21295
21296         (InitCoreTypes): Update accordingly for the above.
21297
21298         * class.cs (Event.Emit): Generate code for default accessors that we provide
21299
21300         (EmitDefaultMethod): Do the job in the above.
21301
21302         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21303         appropriate place.
21304
21305 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21306
21307         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21308         builders even if we were missing one.
21309
21310         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21311         pass the Basename as our class name instead of the Name.  The
21312         basename will be correctly composed for us.
21313
21314         * parameter.cs (Paramters): Now takes a Location argument.
21315
21316         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21317         make all the code call directly LookupType in RootContext and take
21318         this chance to pass the Location information everywhere.
21319
21320         * Everywhere: pass Location information.
21321
21322 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21323
21324         * class.cs (Constructor.Define): Updated way of detecting the
21325         length of the parameters.
21326
21327         (TypeContainer.DefineType): Use basename as the type name for
21328         nested types.
21329
21330         (TypeContainer.Define): Do not recursively define types here, as
21331         definition is taken care in order by the RootContext.
21332
21333         * tree.cs: Keep track of namespaces in a per-file basis.
21334
21335         * parameter.cs (Parameter.ComputeSignature): Update to use
21336         DeclSpace. 
21337
21338         (Parameters.GetSignature): ditto.
21339
21340         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21341         instead of a TypeContainer.
21342
21343         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21344         resolve names.  Because we need to be resolve in our context, not
21345         our parents.
21346
21347         * driver.cs: Implement response files.
21348
21349         * class.cs (TypeContainer.DefineType): If we are defined, do not
21350         redefine ourselves.
21351
21352         (Event.Emit): Emit the code for add/remove handlers.
21353         (Event.Define): Save the MethodBuilders for add/remove.
21354
21355         * typemanager.cs: Use pair here too.
21356
21357         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21358         DictionaryEntry requires the first argument to be non-null.  
21359
21360         (enum_declaration): Compute full name for registering the
21361         enumeration.
21362
21363         (delegate_declaration): Instead of using
21364         formal_parameter_list, use opt_formal_parameter_list as the list
21365         can be empty.
21366
21367         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21368         (EventParsing): New property that controls whether `add' and
21369         `remove' are returned as tokens or identifiers (for events);
21370
21371 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21372
21373         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21374         use MyEventBuilder only and let it wrap the real builder for us.
21375
21376         (MyEventBuilder): Revamp constructor etc.
21377
21378         Implement all operations that we perform on EventBuilder in precisely the same
21379         way here too.
21380
21381         (FindMembers): Update to use the EventBuilder member.
21382
21383         (Event.Emit): Update accordingly.
21384
21385 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21386
21387         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21388         by calling the appropriate methods.
21389
21390         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21391         useful.
21392
21393         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21394
21395 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21396
21397         * delegate.cs (Delegate.Populate): Check that the return type
21398         and various parameters types are indeed accessible.
21399
21400         * class.cs (Constructor.Define): Same here.
21401
21402         (Field.Define): Ditto.
21403
21404         (Event.Define): Ditto.
21405
21406         (Operator.Define): Check that the underlying Method defined itself
21407         correctly - so it's MethodBuilder should not be null.
21408
21409         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21410         expression happens to be null.
21411
21412         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21413         members but as of now we don't seem to be able to do anything really useful with it.
21414
21415         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21416         not the EventBuilder.
21417
21418 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * cs-tokenizer.cs: Add support for defines.
21421         Add support for #if, #elif, #else, #endif
21422
21423         (eval_var): evaluates a variable.
21424         (eval): stubbed for evaluating functions.
21425
21426         * cs-parser.jay: Pass the defines information
21427
21428         * driver.cs: Add --define command line option.
21429
21430         * decl.cs: Move MemberCore here.
21431
21432         Make it the base class for DeclSpace.  This allows us to catch and
21433         report 108 and 109 for everything now.
21434
21435         * class.cs (TypeContainer.Define): Extract all the members
21436         before populating and emit the warning 108 (new keyword required
21437         to override) instead of having each member implement this.
21438
21439         (MemberCore.Define): New abstract method, we will be using this in
21440         the warning reporting engine in Populate.
21441
21442         (Operator.Define): Adjust to new MemberCore protocol. 
21443
21444         * const.cs (Const): This does not derive from Expression, it is a
21445         temporary object we use to create fields, it is a MemberCore. 
21446
21447         * class.cs (Method.Define): Allow the entry point to be in a
21448         specific class.
21449
21450         * driver.cs: Rewrite the argument handler to clean it up a bit.
21451
21452         * rootcontext.cs: Made it just an auxiliary namespace feature by
21453         making everything static.
21454
21455         * driver.cs: Adapt code to use RootContext type name instead of
21456         instance variable.
21457
21458         * delegate.cs: Remove RootContext argument.
21459
21460         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21461         argument. 
21462
21463         * class.cs (Event.Define): The lookup can fail.
21464
21465         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21466
21467         * expression.cs: Resolve the this instance before invoking the code.
21468
21469 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21470
21471         * cs-parser.jay: Add a production in element_access that allows
21472         the thing to become a "type" reference.  This way we can parse
21473         things like "(string [])" as a type.
21474
21475         Note that this still does not handle the more complex rules of
21476         casts. 
21477
21478
21479         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21480
21481         * ecore.cs: (CopyNewMethods): new utility function used to
21482         assemble the list of methods from running FindMembers.
21483
21484         (MemberLookup): Rework FindMembers so that 
21485
21486 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21487
21488         * class.cs (TypeContainer): Remove Delegates who fail to be
21489         defined.
21490
21491         * delegate.cs (Populate): Verify that we dont get null return
21492         values.   TODO: Check for AsAccessible.
21493
21494         * cs-parser.jay: Use basename to emit error 574 (destructor should
21495         have the same name as container class), not the full name.
21496
21497         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21498         possible representation.  
21499
21500         Also implements integer type suffixes U and L.
21501
21502 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * expression.cs (ArrayCreation.DoResolve): We need to do the
21505         argument resolution *always*.
21506
21507         * decl.cs: Make this hold the namespace.  Hold the root context as
21508         well.
21509         (LookupType): Move here.
21510
21511         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21512
21513         * location.cs (Row, Name): Fixed the code, it was always returning
21514         references to the first file.
21515
21516         * interface.cs: Register properties defined through interfaces.
21517
21518         * driver.cs: Add support for globbing on the command line
21519
21520         * class.cs (Field): Make it derive from MemberCore as well.
21521         (Event): ditto.
21522
21523 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21524
21525         * class.cs (Event::Define): Check that the type of the event is a delegate
21526         type else flag error #66.
21527
21528         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21529         same.
21530
21531         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21532         values of EntryPoint, CharSet etc etc.
21533
21534         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21535
21536         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21537         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21538         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21539         which needs this to do its work.
21540
21541         * ../errors/cs0066.cs : Add.
21542
21543 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21546         helper functions.
21547
21548         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21549         clears out the parameters field.
21550         (MemberSignatureCompare): Cleanup
21551
21552         (MemberCore): New base class used to share code between MethodCore
21553         and Property.
21554
21555         (RegisterRequiredImplementations) BindingFlags.Public requires
21556         either BindingFlags.Instace or Static.  Use instance here.
21557
21558         (Property): Refactored code to cope better with the full spec.
21559
21560         * parameter.cs (GetParameterInfo): Return an empty array instead
21561         of null on error.
21562
21563         * class.cs (Property): Abstract or extern properties have no bodies.
21564
21565         * parameter.cs (GetParameterInfo): return a zero-sized array.
21566
21567         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21568         method modifier validation to the typecontainer so we can reuse
21569         this on properties.
21570
21571         (MethodCore.ParameterTypes): return an empty sized array of types.
21572
21573         (Property.Define): Test property modifier validity.
21574
21575         Add tests for sealed/override too.
21576
21577         (Method.Emit): abstract or extern methods have no bodies.
21578
21579 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21580
21581         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21582         thing.
21583
21584         (Method::Define, ::Emit): Modify accordingly.
21585
21586         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21587
21588         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21589
21590         * makefile: Pass in /unsafe.
21591
21592 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21593
21594         * class.cs (MakeKey): Kill routine.
21595
21596         * class.cs (TypeContainer.Define): Correctly define explicit
21597         method implementations (they require the full interface name plus
21598         the method name).
21599
21600         * typemanager.cs: Deply the PtrHashtable here and stop using the
21601         lame keys.  Things work so much better.
21602
21603         This of course broke everyone who depended on `RegisterMethod' to
21604         do the `test for existance' test.  This has to be done elsewhere.
21605
21606         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21607         the object stupid Equals method (because, that like fails all over
21608         the place).  We still do not use it.
21609
21610         * class.cs (TypeContainer.SetRequiredInterface,
21611         TypeContainer.RequireMethods): Killed these two routines and moved
21612         all the functionality to RegisterRequiredImplementations.
21613
21614         (TypeContainer.RegisterRequiredImplementations): This routine now
21615         registers all the implementations required in an array for the
21616         interfaces and abstract methods.  We use an array of structures
21617         which can be computed ahead of time to reduce memory usage and we
21618         also assume that lookups are cheap as most classes will not
21619         implement too many interfaces.
21620
21621         We also avoid creating too many MethodSignatures.
21622
21623         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21624         clear the "pending" bit if we find that there are problems with
21625         the declaration.
21626
21627         (TypeContainer.VerifyPendingMethods): Update to report errors of
21628         methods that look like implementations but are not.
21629
21630         (TypeContainer.Define): Add support for explicit interface method
21631         implementation. 
21632
21633 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21634
21635         * typemanager.cs: Keep track of the parameters here instead of
21636         being a feature of the TypeContainer.
21637
21638         * class.cs: Drop the registration of parameters here, as
21639         InterfaceMethods are also interface declarations.
21640
21641         * delegate.cs: Register methods with the TypeManager not only with
21642         the TypeContainer.  This code was buggy.
21643
21644         * interface.cs: Full registation here.
21645
21646 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21647
21648         * expression.cs: Remove reducer for binary expressions, it can not
21649         be done this way.
21650
21651         * const.cs: Put here the code that used to go into constant.cs
21652
21653         * constant.cs: Put here the code for constants, this is a new base
21654         class for Literals.
21655
21656         * literal.cs: Make Literal derive from Constant.
21657
21658 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * statement.cs (Return.Emit): Report error 157 if the user
21661         attempts to return from a finally block.
21662
21663         (Return.Emit): Instead of emitting a return, jump to the end of
21664         the function.
21665
21666         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21667         LocalBuilder to store the result of the function.  ReturnLabel is
21668         the target where we jump.
21669
21670
21671 2001-12-09  Radek Doulik  <rodo@ximian.com>
21672
21673         * cs-parser.jay: remember alias in current namespace
21674
21675         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21676         namespaces
21677
21678         * class.cs (LookupAlias): lookup alias in my_namespace
21679
21680         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21681         aliases hashtable
21682         (LookupAlias): lookup alias in this and if needed in parent
21683         namespaces
21684
21685 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21686
21687         * support.cs: 
21688
21689         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21690         making things static.  I need this to avoid passing the
21691         TypeContainer when calling ParameterType.
21692
21693         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21694         that did string manipulation to compute the type and then call
21695         GetType.  Use Parameter.ParameterType instead.
21696
21697         * cs-tokenizer.cs: Consume the suffix for floating values.
21698
21699         * expression.cs (ParameterReference): figure out whether this is a
21700         reference parameter or not.  Kill an extra variable by computing
21701         the arg_idx during emission.
21702
21703         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21704         function that returns whether a parameter is an out/ref value or not.
21705
21706         (Parameter.ParameterType): The type of the parameter (base,
21707         without ref/out applied).
21708
21709         (Parameter.Resolve): Perform resolution here.
21710         (Parameter.ExternalType): The full type (with ref/out applied).
21711
21712         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21713         support for expressions on the using statement.
21714
21715 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21716
21717         * statement.cs (Using.EmitLocalVariableDecls): Split the
21718         localvariable handling of the using statement.
21719
21720         (Block.EmitMeta): Keep track of variable count across blocks.  We
21721         were reusing slots on separate branches of blocks.
21722
21723         (Try.Emit): Emit the general code block, we were not emitting it. 
21724
21725         Check the type of the declaration to be an IDisposable or
21726         something that can be implicity converted to it. 
21727
21728         Emit conversions if required.
21729
21730         * ecore.cs (EmptyExpression): New utility class.
21731         (Expression.ImplicitConversionExists): New utility function.
21732
21733 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21734
21735         * statement.cs (Using): Implement.
21736
21737         * expression.cs (LocalVariableReference): Support read only variables.
21738
21739         * statement.cs: Remove the explicit emit for the Leave opcode.
21740         (VariableInfo): Add a readonly field.
21741
21742 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21743
21744         * ecore.cs (ConvCast): new class used to encapsulate the various
21745         explicit integer conversions that works in both checked and
21746         unchecked contexts.
21747
21748         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21749         properly generate the overflow opcodes.
21750
21751 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21752
21753         * statement.cs: The correct type for the EmptyExpression is the
21754         element_type, not the variable type.  Ravi pointed this out.
21755
21756 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21757
21758         * class.cs (Method::Define): Handle PInvoke methods specially
21759         by using DefinePInvokeMethod instead of the usual one.
21760
21761         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21762         above to do the task of extracting information and defining the method.
21763
21764 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21765
21766         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21767         of the condition for string type.
21768
21769         (Emit): Move that here. 
21770
21771         (ArrayCreation::CheckIndices): Keep string literals in their expression
21772         form.
21773
21774         (EmitDynamicInitializers): Handle strings appropriately.
21775
21776 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21777
21778         * codegen.cs (EmitContext): Replace multiple variables with a
21779         single pointer to the current Switch statement.
21780
21781         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21782         EmitContext.
21783
21784 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21785
21786         * statement.cs 
21787
21788         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21789         default'.
21790
21791         (Foreach.Emit): Foreach on arrays was not setting
21792         up the loop variables (for break/continue).
21793
21794         (GotoCase): Semi-implented.
21795
21796 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21797
21798         * attribute.cs (CheckAttribute): Handle system attributes by using
21799         Attribute.GetAttributes to examine information we need.
21800
21801         (GetValidPlaces): Same here.
21802
21803         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21804
21805         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21806
21807         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21808
21809         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21810
21811         (Method::Emit): Handle the case when we are a PInvoke method.
21812
21813 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21814
21815         * expression.cs: Use ResolveWithSimpleName on compound names.
21816
21817 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21818
21819         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21820         before trying to reduce it.
21821
21822         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21823
21824         * constant.cs (LookupConstantValue): Implement.
21825
21826         (EmitConstant): Use the above in emitting the constant.
21827
21828         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21829         that are user-defined by doing a LookupConstantValue on them.
21830
21831         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21832         too, like above.
21833
21834 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21835
21836         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21837
21838         (BaseAccess.DoResolve): Implement.
21839
21840         (MemberAccess.DoResolve): Split this routine into a
21841         ResolveMemberAccess routine that can be used independently
21842
21843 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21844
21845         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21846         As that share bits of the implementation.  Is returns a boolean,
21847         while As returns the Type that is being probed.
21848
21849 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21850
21851         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21852         instead of a Literal - much easier.
21853
21854         (EnumInTransit): Remove - utterly useless :-)
21855
21856         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21857
21858         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21859
21860         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21861         chain when we have no associated expression.
21862
21863 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21864
21865         * constant.cs (Define): Use Location while reporting the errror.
21866
21867         Also emit a warning when 'new' is used and there is no inherited
21868         member to hide.
21869
21870         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21871         populated.
21872
21873         (LookupEnumValue): Implement to lookup an enum member's value and define it
21874         if necessary.
21875
21876         (Populate): Re-write accordingly to use the above routine.
21877
21878 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21879
21880         * expression.cs (This): Fix prototype for DoResolveLValue to
21881         override the base class DoResolveLValue.
21882
21883         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21884         declarations) 
21885
21886         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21887         (we need to load the address of the field here).  This fixes
21888         test-22. 
21889
21890         (FieldExpr.DoResolveLValue): Call the DoResolve
21891         function to initialize the Instance expression.
21892
21893         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21894         correctly the GetEnumerator operation on a value type.
21895
21896         * cs-parser.jay: Add more simple parsing error catches.
21897
21898         * statement.cs (Switch): Add support for string switches.
21899         Handle null specially.
21900
21901         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21902
21903 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21904
21905         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21906
21907         (declare_local_constant): New helper function.
21908
21909         * statement.cs (AddConstant): Keep a separate record of constants
21910
21911         (IsConstant): Implement to determine if a variable is a constant.
21912
21913         (GetConstantExpression): Implement.
21914
21915         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21916
21917         * statement.cs (IsVariableDefined): Re-write.
21918
21919 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21920
21921         * class.cs (TypeContainer::FindMembers): Look for constants
21922         in the case when we are looking for MemberTypes.Field
21923
21924         * expression.cs (MemberAccess::DoResolve): Check that in the
21925         case we are a FieldExpr and a Literal, we are not being accessed
21926         by an instance reference.
21927
21928         * cs-parser.jay (local_constant_declaration): Implement.
21929
21930         (declaration_statement): Implement for constant declarations.
21931
21932 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21933
21934         * statement.cs (Switch): Catch double defaults.
21935
21936         (Switch): More work on the switch() statement
21937         implementation.  It works for integral values now, need to finish
21938         string support.
21939
21940
21941 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21942
21943         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21944         integer literals into other integer literals.  To be used by
21945         switch. 
21946
21947 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21948
21949         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21950         some memory.
21951
21952         (EmitDynamicInitializers): Cope with the above since we extract data
21953         directly from ArrayData now.
21954
21955         (ExpectInitializers): Keep track of whether initializers are mandatory
21956         or not.
21957
21958         (Bounds): Make it a hashtable to prevent the same dimension being 
21959         recorded for every element in that dimension.
21960
21961         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21962         from being found.
21963
21964         Also fix bug which was causing the indices to be emitted in the reverse
21965         order.
21966
21967 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21968
21969         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21970         unfinished.  They do not work, because the underlying code is
21971         sloppy.
21972
21973 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21974
21975         * cs-parser.jay: Remove bogus fixme.
21976
21977         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21978         on Switch statement.
21979
21980 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21981
21982         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21983         the same. 
21984
21985         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21986         parameter. Apparently, any expression is allowed. 
21987
21988         (ValidateInitializers): Update accordingly.
21989
21990         (CheckIndices): Fix some tricky bugs thanks to recursion.
21991
21992         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21993         I was being completely brain-dead.
21994
21995         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21996         and re-write acordingly.
21997
21998         (DelegateInvocation): Re-write accordingly.
21999
22000         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22001
22002         (MakeByteBlob): Handle types more correctly.
22003
22004         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22005         initialization from expressions but it is incomplete because I am a complete
22006         Dodo :-|
22007
22008 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22009
22010         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22011         on If.  Basically, we have to return `true' (ie, we do return to
22012         our caller) only if both branches of the if return.
22013
22014         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22015         short-circuit operators, handle them as short circuit operators. 
22016
22017         (Cast.DoResolve): Resolve type.
22018         (Cast.Cast): Take an expression as the target type.
22019
22020         * cs-parser.jay (cast_expression): Remove old hack that only
22021         allowed a limited set of types to be handled.  Now we take a
22022         unary_expression and we resolve to a type during semantic
22023         analysis.
22024
22025         Use the grammar productions from Rhys to handle casts (this is
22026         not complete like Rhys syntax yet, we fail to handle that corner
22027         case that C# has regarding (-x), but we will get there.
22028
22029 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22030
22031         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22032         field which is an array type.
22033
22034         * cs-parser.jay (declare_local_variables): Support array initialization too.
22035
22036         * typemanager.cs (MakeKey): Implement.
22037
22038         (everywhere): Use the above appropriately.
22039
22040         * cs-parser.jay (for_statement): Update for array initialization while
22041         declaring variables.
22042
22043         * ecore.cs : The error message was correct, it's the variable's names that
22044         were misleading ;-) Make the code more readable.
22045
22046         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22047         the correct type etc.
22048
22049         (ConvertExplicit): Handle Enum types by examining the underlying type.
22050
22051 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22052
22053         * parameter.cs (GetCallingConvention): Always return
22054         CallingConventions.Standard for now.
22055
22056 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22057
22058         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22059         and `r' after calling DoNumericPromotions.
22060
22061         * ecore.cs: Fix error message (the types were in the wrong order).
22062
22063         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22064         BindingFlags.Instance as well 
22065
22066         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22067         implicit int literal conversion in an empty cast so that we
22068         propagate the right type upstream.
22069
22070         (UnboxCast): new class used to unbox value types.
22071         (Expression.ConvertExplicit): Add explicit type conversions done
22072         by unboxing.
22073
22074         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22075         the target type before applying the implicit LongLiterals to ULong
22076         literal cast.
22077
22078 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22079
22080         * cs-parser.jay (for_statement): Reworked the way For works: now
22081         we declare manually any variables that are introduced in
22082         for_initializer to solve the problem of having out-of-band code
22083         emition (that is what got for broken).
22084
22085         (declaration_statement): Perform the actual variable declaration
22086         that used to be done in local_variable_declaration here.
22087
22088         (local_variable_declaration): Do not declare anything, just pass
22089         the information on a DictionaryEntry
22090
22091 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22092
22093         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22094         re-write of the logic to now make it recursive.
22095
22096         (UpdateIndices): Re-write accordingly.
22097
22098         Store element data in a separate ArrayData list in the above methods.
22099
22100         (MakeByteBlob): Implement to dump the array data into a byte array.
22101
22102 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22103
22104         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22105         into CheckIndices.
22106
22107         * constant.cs (Define): Implement.
22108
22109         (EmitConstant): Re-write fully.
22110
22111         Pass in location info.
22112
22113         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22114         respectively.
22115
22116         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22117         DictionaryEntry since we need location info too.
22118
22119         (constant_declaration): Update accordingly.
22120
22121         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22122         code into another method : UpdateIndices.
22123
22124 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22125
22126         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22127         some type checking etc.
22128
22129 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22130
22131         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22132         bits to provide dimension info if the user skips doing that.
22133
22134         Update second constructor to store the rank correctly.
22135
22136 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22137
22138         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22139         and try to implement.
22140
22141         * ../errors/cs0150.cs : Add.
22142
22143         * ../errors/cs0178.cs : Add.
22144
22145 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22146
22147         * statement.cs: Implement foreach on multi-dimensional arrays. 
22148
22149         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22150         name of the params argument.
22151
22152         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22153         initializing the array.
22154
22155         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22156         we can use this elsewhere.
22157
22158         * statement.cs: Finish implementation of foreach for single
22159         dimension arrays.
22160
22161         * cs-parser.jay: Use an out-of-band stack to pass information
22162         around, I wonder why I need this.
22163
22164         foreach_block: Make the new foreach_block the current_block.
22165
22166         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22167         function used to return a static Parameters structure.  Used for
22168         empty parameters, as those are created very frequently.
22169
22170         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22171
22172 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22173
22174         * interface.cs : Default modifier is private, not public. The
22175         make verify test passes again.
22176
22177 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22178
22179         * support.cs (ReflectionParameters): Fix logic to determine
22180         whether the last parameter is a params one. Test 9 passes again.
22181
22182         * delegate.cs (Populate): Register the builders we define with
22183         RegisterParameterForBuilder. Test 19 passes again.
22184
22185         * cs-parser.jay (property_declaration): Reference $6 instead
22186         of $$ to get at the location.
22187
22188         (indexer_declaration): Similar stuff.
22189
22190         (attribute): Ditto.
22191
22192         * class.cs (Property): Register parameters for the Get and Set methods
22193         if they exist. Test 23 passes again.
22194
22195         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22196         call to EmitArguments as we are sure there aren't any params arguments. 
22197         Test 32 passes again.
22198
22199         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22200         IndexOutOfRangeException. 
22201
22202         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22203         Test 33 now passes again.
22204
22205 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22206
22207         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22208         broke a bunch of things.  Will have to come up with a better way
22209         of tracking locations.
22210
22211         * statement.cs: Implemented foreach for single dimension arrays.
22212
22213 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22214
22215         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22216         an error.  This removes the lookup from the critical path.
22217
22218         * cs-parser.jay: Removed use of temporary_loc, which is completely
22219         broken. 
22220
22221 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22222
22223         * support.cs (ReflectionParameters.ParameterModifier): Report
22224         whether the argument is a PARAMS argument or not.
22225
22226         * class.cs: Set the attribute `ParamArrayAttribute' on the
22227         parameter argument.
22228
22229         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22230         and cons_param_array_attribute (ConstructorInfo for
22231         ParamArrayAttribute)., 
22232
22233         * codegen.cs: Emit the return using the `Return' statement, that
22234         way we can report the error correctly for missing return values. 
22235
22236         * class.cs (Method.Emit): Clean up.
22237
22238         * expression.cs (Argument.Resolve): Take another argument: the
22239         location where this argument is used.  Notice that this is not
22240         part of the "Argument" class as to reduce the size of the
22241         structure (we know the approximate location anyways).
22242
22243         Test if the argument is a variable-reference, if not, then
22244         complain with a 206.
22245
22246         (Argument.Emit): Emit addresses of variables.
22247
22248         (Argument.FullDesc): Simplify.
22249
22250         (Invocation.DoResolve): Update for Argument.Resolve.
22251
22252         (ElementAccess.DoResolve): ditto.
22253
22254         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22255         method should be virtual, as this method is always virtual.
22256
22257         (NewDelegate.DoResolve): Update for Argument.Resolve.
22258
22259         * class.cs (ConstructorInitializer.DoResolve): ditto.
22260
22261         * attribute.cs (Attribute.Resolve): ditto.
22262
22263 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22264
22265         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22266
22267         * expression.cs (ParameterReference): Drop IStackStorage and implement
22268         IAssignMethod instead. 
22269
22270         (LocalVariableReference): ditto.
22271
22272         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22273         IAssignMethod instead. 
22274
22275 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22276
22277         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22278         enumerations that are used in heavily used structures derive from
22279         byte in a laughable and pathetic attempt to reduce memory usage.
22280         This is the kind of pre-optimzations that you should not do at
22281         home without adult supervision.
22282
22283         * expression.cs (UnaryMutator): New class, used to handle ++ and
22284         -- separatedly from the other unary operators.  Cleans up the
22285         code, and kills the ExpressionStatement dependency in Unary.
22286
22287         (Unary): Removed `method' and `Arguments' from this class, making
22288         it smaller, and moving it all to SimpleCall, so I can reuse this
22289         code in other locations and avoid creating a lot of transient data
22290         strucutres when not required.
22291
22292         * cs-parser.jay: Adjust for new changes.
22293
22294 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22295
22296         * enum.cs (Enum.Populate): If there is a failure during
22297         definition, return
22298
22299         * cs-parser.jay (opt_enum_base): we used to catch type errors
22300         here, but this is really incorrect.  The type error should be
22301         catched during semantic analysis.
22302
22303 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22304
22305         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22306         current_local_parameters as expected since I, in my stupidity, had forgotten
22307         to do this :-)
22308
22309         * attribute.cs (GetValidPlaces): Fix stupid bug.
22310
22311         * class.cs (Method::Emit): Perform check on applicability of attributes.
22312
22313         (Constructor::Emit): Ditto.
22314
22315         (Field::Emit): Ditto.
22316
22317         (Field.Location): Store location information.
22318
22319         (Property, Event, Indexer, Operator): Ditto.
22320
22321         * cs-parser.jay (field_declaration): Pass in location for each field.
22322
22323         * ../errors/cs0592.cs : Add.
22324
22325 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22326
22327         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22328
22329         (InitCoreTypes): Update accordingly.
22330
22331         (RegisterAttrType, LookupAttr): Implement.
22332
22333         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22334         info about the same.
22335
22336         (Resolve): Update to populate the above as necessary.
22337
22338         (Error592): Helper.
22339
22340         (GetValidPlaces): Helper to the above.
22341
22342         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22343
22344         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22345
22346 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22347
22348         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22349
22350         * ../errors/cs0617.cs : Add.
22351
22352 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22353
22354         * enum.cs (Emit): Rename to Populate to be more consistent with what
22355         we expect it to do and when exactly it is called.
22356
22357         * class.cs, rootcontext.cs : Update accordingly.
22358
22359         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22360         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22361
22362         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22363
22364         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22365         of a fieldinfo using the above, when dealing with a FieldBuilder.
22366
22367 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22368
22369         * ../errors/cs0031.cs : Add.
22370
22371         * ../errors/cs1008.cs : Add.
22372
22373         * ../errrors/cs0543.cs : Add.
22374
22375         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22376         enum type.
22377
22378         (FindMembers): Implement.
22379
22380         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22381         enums and delegates too.
22382
22383         (enum_types): Rename to builder_to_enum.
22384
22385         (delegate_types): Rename to builder_to_delegate.
22386
22387         * delegate.cs (FindMembers): Implement.
22388
22389 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22390
22391         * typemanager.cs (IsEnumType): Implement.
22392
22393         * enum.cs (Emit): Re-write parts to account for the underlying type
22394         better and perform checking etc.
22395
22396         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22397         of the underlying type.
22398
22399         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22400         value
22401
22402         * enum.cs (error31): Helper to report error #31.
22403
22404         * cs-parser.jay (enum_declaration): Store location of each member too.
22405
22406         * enum.cs (member_to_location): New hashtable. 
22407
22408         (AddEnumMember): Update location hashtable.
22409
22410         (Emit): Use the location of each member while reporting errors.
22411
22412 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22413
22414         * cs-parser.jay: A for_initializer if is a
22415         local_variable_declaration really ammount to have an implicit
22416         block with the variable declaration and no initializer for for.
22417
22418         * statement.cs (For.Emit): Cope with null initializers.
22419
22420         This fixes the infinite loop on for initializers.
22421
22422 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22423
22424         * enum.cs: More cleanup.
22425
22426         * ecore.cs: Remove dead code.
22427
22428         * class.cs (Property.Emit): More simplification.
22429         (Event.Emit): ditto.
22430
22431         Reworked to have less levels of indentation.
22432
22433 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22434
22435         * class.cs (Property): Emit attributes.
22436
22437         (Field): Ditto.
22438
22439         (Event): Ditto.
22440
22441         (Indexer): Ditto.
22442
22443         (Operator): Ditto.
22444
22445         * enum.cs (Emit): Ditto.
22446
22447         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22448         Enums too.
22449
22450         * class.cs (Field, Event, etc.): Move attribute generation into the
22451         Emit method everywhere.
22452
22453         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22454         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22455         as we had no way of defining nested enums !
22456
22457         * rootcontext.cs : Adjust code accordingly.
22458
22459         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22460
22461 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22462
22463         * expression.cs (EvalConstantExpression): Move into ecore.cs
22464
22465         * enum.cs (Enum): Rename some members and make them public and readonly
22466         according to our convention.
22467
22468         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22469         nothing else.
22470
22471         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22472
22473         (Enum::Emit): Write a simple version for now which doesn't try to compute
22474         expressions. I shall modify this to be more robust in just a while.
22475
22476         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22477
22478         (TypeContainer::CloseType): Create the Enum types too.
22479
22480         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22481
22482         * expression.cs (EvalConstantExpression): Get rid of completely.
22483
22484         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22485         user-defined values and other cases.
22486
22487         (IsValidEnumLiteral): Helper function.
22488
22489         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22490         out there in the case we had a literal FieldExpr.
22491
22492         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22493
22494         (Literalize): Revamp a bit to take two arguments.
22495
22496         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22497
22498 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22499
22500         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22501
22502         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22503
22504         (Resolve): Use the above to ensure we have proper initializers.
22505
22506 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22507
22508         * expression.cs (Expression::EvalConstantExpression): New method to 
22509         evaluate constant expressions.
22510
22511         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22512
22513 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22514
22515         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22516         in an array.
22517
22518         (Binary.ResolveOperator): Handle operator != (object a, object b)
22519         and operator == (object a, object b);
22520
22521         (Binary.DoNumericPromotions): Indicate whether the numeric
22522         promotion was possible.
22523
22524         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22525         Implement.  
22526
22527         Made the ArrayAccess implement interface IAssignMethod instead of
22528         IStackStore as the order in which arguments are passed reflects
22529         this.
22530
22531         * assign.cs: Instead of using expr.ExprClass to select the way of
22532         assinging, probe for the IStackStore/IAssignMethod interfaces.
22533
22534         * typemanager.cs: Load InitializeArray definition.
22535
22536         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22537         static data that can be used to initialize arrays. 
22538
22539 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * expression.cs: Handle operator== and operator!= for booleans.
22542
22543         (Conditioal.Reduce): Implement reducer for the ?: operator.
22544
22545         (Conditional.Resolve): Implement dead code elimination.
22546
22547         (Binary.Resolve): Catch string literals and return a new
22548         concatenated string.
22549
22550         (Unary.Reduce): Implement reduction of unary expressions.
22551
22552         * ecore.cs: Split out the expression core handling here.
22553
22554         (Expression.Reduce): New method used to perform constant folding
22555         and CSE.  This is needed to support constant-expressions. 
22556
22557         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22558         targets, and optimize for !x.
22559
22560 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22561
22562         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22563         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22564         set custom atttributes.
22565
22566         * literal.cs (Literal::GetValue): New abstract method to return the actual
22567         value of the literal, cast as an object.
22568
22569         (*Literal): Implement GetValue method.
22570
22571         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22572         expressions to the arraylist but objects of type Argument.
22573
22574         * class.cs (TypeContainer::Emit): Emit our attributes too.
22575
22576         (Method::Emit, Constructor::Emit): Ditto.
22577
22578         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22579         to be ignoring earlier.
22580
22581 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22582
22583         * attribute.cs (AttributeSection::Define): Implement to do the business
22584         of constructing a CustomAttributeBuilder.
22585
22586         (Attribute): New trivial class. Increases readability of code.  
22587
22588         * cs-parser.jay : Update accordingly.
22589
22590         (positional_argument_list, named_argument_list, named_argument): New rules
22591
22592         (attribute_arguments): Use the above so that we are more correct.
22593
22594 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22595
22596         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22597         to perform all checks for a method with a params parameter.
22598
22599         (Invocation::OverloadResolve): Update to use the above method and therefore
22600         cope correctly with params method invocations.
22601
22602         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22603         params too.
22604
22605         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22606         constructors in our parent too because we can't afford to miss out on 
22607         protected ones ;-)
22608
22609         * attribute.cs (AttributeSection): New name for the class Attribute
22610
22611         Other trivial changes to improve readability.
22612
22613         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22614         use the new class names.
22615
22616 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22617
22618         * class.cs (Method::Define): Complete definition for params types too
22619
22620         (Indexer::Define): Ditto.
22621
22622         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22623         Cope everywhere with a request for info about the array parameter.
22624
22625 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22626
22627         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22628
22629         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22630         local_variable_type to extract the string corresponding to the type.
22631
22632         (local_variable_type): Fixup the action to use the new helper method.
22633
22634         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22635         go.
22636
22637         * expression.cs : Clean out code which uses the above.
22638
22639 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22640
22641         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22642         and bale out if necessary by returning a false.
22643
22644         (RegisterProperty): Ditto.
22645
22646         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22647         and print out appropriate error messages.
22648
22649         * interface.cs (everywhere): Ditto.
22650
22651         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22652         location to constructor.
22653
22654         * class.cs (Property, Event, Indexer): Update accordingly.
22655
22656         * ../errors/cs111.cs : Added.
22657
22658         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22659         of a method, as laid down by the spec.
22660
22661         (Invocation::OverloadResolve): Use the above method.
22662
22663 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22664
22665         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22666         now take a TypeContainer and a Parameters object.
22667
22668         (ParameterData): Modify return type of ParameterModifier method to be 
22669         Parameter.Modifier and not a string.
22670
22671         (ReflectionParameters, InternalParameters): Update accordingly.
22672
22673         * expression.cs (Argument::GetParameterModifier): Same here.
22674
22675         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22676         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22677         symbol in it at all so maybe this is only for now.
22678
22679 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22680
22681         * support.cs (InternalParameters): Constructor now takes an extra argument 
22682         which is the actual Parameters class.
22683
22684         (ParameterDesc): Update to provide info on ref/out modifiers.
22685
22686         * class.cs (everywhere): Update call to InternalParameters to pass in
22687         the second argument too.
22688
22689         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22690         to return the modifier info [ref/out etc]
22691
22692         (InternalParameters, ReflectionParameters): Implement the above.
22693
22694         * expression.cs (Argument::ParameterModifier): Similar function to return
22695         info about the argument's modifiers.
22696
22697         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22698         too.
22699
22700         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22701         a new SetFormalParameters object which we pass to InternalParameters.
22702
22703 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22704
22705         * expression.cs (NewArray): Merge into the ArrayCreation class.
22706
22707 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22708
22709         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22710         NewUserdefinedArray into one as there wasn't much of a use in having
22711         two separate ones.
22712
22713         * expression.cs (Argument): Change field's name to ArgType from Type.
22714
22715         (Type): New readonly property which returns the proper type, taking into 
22716         account ref/out modifiers.
22717
22718         (everywhere): Adjust code accordingly for the above.
22719
22720         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22721         whether we are emitting for a ref or out parameter.
22722
22723         * expression.cs (Argument::Emit): Use the above field to set the state.
22724
22725         (LocalVariableReference::Emit): Update to honour the flag and emit the
22726         right stuff.
22727
22728         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22729
22730         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22731
22732         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22733
22734         (ReflectionParameters, InternalParameters): Implement the above method.
22735
22736         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22737         reporting errors.
22738
22739         (Invocation::FullMethodDesc): Ditto. 
22740
22741 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22742
22743         * cs-parser.jay: Add extra production for the second form of array
22744         creation. 
22745
22746         * expression.cs (ArrayCreation): Update to reflect the above
22747         change. 
22748
22749         * Small changes to prepare for Array initialization.
22750
22751 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22752
22753         * typemanager.cs (ImplementsInterface): interface might be null;
22754         Deal with this problem;
22755
22756         Also, we do store negative hits on the cache (null values), so use
22757         this instead of calling t.GetInterfaces on the type everytime.
22758
22759 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22760
22761         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22762
22763         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22764         split functionality out into different classes.
22765
22766         (New::FormArrayType): Move into NewBuiltinArray.
22767
22768         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22769         quite useless.
22770
22771         (NewBuiltinArray): New class to handle creation of built-in arrays.
22772
22773         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22774         account creation of one-dimensional arrays.
22775
22776         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22777
22778         (NewUserdefinedArray::DoResolve): Implement.
22779
22780         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22781
22782         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22783         we maintain inside the TypeManager. This is necessary to perform lookups on the
22784         module builder.
22785
22786         (LookupType): Update to perform GetType on the module builders too.     
22787
22788         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22789
22790         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22791
22792 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22793
22794         * expression.cs (New::DoResolve): Implement guts of array creation.
22795
22796         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22797
22798 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22799
22800         * expression.cs: Fix bug I introduced lsat night that broke
22801         Delegates. 
22802
22803         (Expression.Resolve): Report a 246 error (can not resolve name)
22804         if we find a SimpleName in the stream.
22805
22806         (Expression.ResolveLValue): Ditto.
22807
22808         (Expression.ResolveWithSimpleName): This function is a variant of
22809         ResolveName, this one allows SimpleNames to be returned without a
22810         warning.  The only consumer of SimpleNames is MemberAccess
22811
22812 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22813
22814         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22815         might arrive here.  I have my doubts that this is correct.
22816
22817         * statement.cs (Lock): Implement lock statement.
22818
22819         * cs-parser.jay: Small fixes to support `lock' and `using'
22820
22821         * cs-tokenizer.cs: Remove extra space
22822
22823         * driver.cs: New flag --checked, allows to turn on integer math
22824         checking. 
22825
22826         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22827         Threading.Monitor.Exit 
22828
22829 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22830
22831         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22832         Expression Class to be IndexerAccess.
22833
22834         Notice that Indexer::DoResolve sets the eclass to Value.
22835
22836 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22837
22838         * class.cs (TypeContainer::Emit): Emit code for indexers.
22839
22840         * assign.cs (IAssignMethod): New interface implemented by Indexers
22841         and Properties for handling assignment.
22842
22843         (Assign::Emit): Simplify and reuse code. 
22844
22845         * expression.cs (IndexerAccess, PropertyExpr): Implement
22846         IAssignMethod, clean up old code. 
22847
22848 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22849
22850         * typemanager.cs (ImplementsInterface): New method to determine if a type
22851         implements a given interface. Provides a nice cache too.
22852
22853         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22854         method.
22855
22856         (ConvertReferenceExplicit): Ditto.
22857
22858         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22859         various methods, with correct names etc.
22860
22861         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22862         Operator.UnaryNegation.
22863
22864         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22865         we have a unary plus or minus operator.
22866
22867         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22868         UnaryMinus.
22869
22870         * everywhere : update accordingly.
22871
22872         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22873         respectively.
22874
22875         * class.cs (Method::Define): For the case where we are implementing a method
22876         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22877         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22878
22879 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22880
22881         * interface.cs (FindMembers): Implement to work around S.R.E
22882         lameness.
22883
22884         * typemanager.cs (IsInterfaceType): Implement.
22885
22886         (FindMembers): Update to handle interface types too.
22887
22888         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22889         use IsAssignableFrom as that is not correct - it doesn't work.
22890
22891         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22892         and accordingly override EmitStatement.
22893
22894         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22895         using the correct logic :-)
22896
22897 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22898
22899         * ../errors/cs-11.cs : Add to demonstrate error -11 
22900
22901 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22902
22903         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22904         then pass this as a hint to ResolveLValue.
22905
22906         * expression.cs (FieldExpr): Add Location information
22907
22908         (FieldExpr::LValueResolve): Report assignment to readonly
22909         variable. 
22910
22911         (Expression::ExprClassFromMemberInfo): Pass location information.
22912
22913         (Expression::ResolveLValue): Add new method that resolves an
22914         LValue. 
22915
22916         (Expression::DoResolveLValue): Default invocation calls
22917         DoResolve. 
22918
22919         (Indexers): New class used to keep track of indexers in a given
22920         Type. 
22921
22922         (IStackStore): Renamed from LValue, as it did not really describe
22923         what this did.  Also ResolveLValue is gone from this interface and
22924         now is part of Expression.
22925
22926         (ElementAccess): Depending on the element access type
22927
22928         * typemanager.cs: Add `indexer_name_type' as a Core type
22929         (System.Runtime.CompilerServices.IndexerNameAttribute)
22930
22931         * statement.cs (Goto): Take a location.
22932
22933 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22934
22935         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22936         if two delegates are compatible.
22937
22938         (NewDelegate::DoResolve): Update to take care of the case when
22939         we instantiate a delegate from another delegate.
22940
22941         * typemanager.cs (FindMembers): Don't even try to look up members
22942         of Delegate types for now.
22943
22944 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22945
22946         * delegate.cs (NewDelegate): New class to take care of delegate
22947         instantiation.
22948
22949         * expression.cs (New): Split the delegate related code out into 
22950         the NewDelegate class.
22951
22952         * delegate.cs (DelegateInvocation): New class to handle delegate 
22953         invocation.
22954
22955         * expression.cs (Invocation): Split out delegate related code into
22956         the DelegateInvocation class.
22957
22958 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22959
22960         * expression.cs (New::DoResolve): Implement delegate creation fully
22961         and according to the spec.
22962
22963         (New::DoEmit): Update to handle delegates differently.
22964
22965         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22966         because of which we were printing out arguments in reverse order !
22967
22968         * delegate.cs (VerifyMethod): Implement to check if the given method
22969         matches the delegate.
22970
22971         (FullDelegateDesc): Implement.
22972
22973         (VerifyApplicability): Implement.
22974
22975         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22976         delegate invocations too.
22977
22978         (Invocation::Emit): Ditto.
22979
22980         * ../errors/cs1593.cs : Added.
22981
22982         * ../errors/cs1594.cs : Added.
22983
22984         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22985
22986 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22987
22988         * typemanager.cs (intptr_type): Core type for System.IntPtr
22989
22990         (InitCoreTypes): Update for the same.
22991
22992         (iasyncresult_type, asynccallback_type): Ditto.
22993
22994         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22995         correct.
22996
22997         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22998         too.
22999
23000         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23001         the builders for the 4 members of a delegate type :-)
23002
23003         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23004         type.
23005
23006         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23007
23008         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23009
23010 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23011
23012         * statement.cs (Break::Emit): Implement.   
23013         (Continue::Emit): Implement.
23014
23015         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23016         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23017         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23018         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23019         end loop
23020
23021         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23022         properties that track the label for the current loop (begin of the
23023         loop and end of the loop).
23024
23025 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23026
23027         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23028         use of emitting anything at all.
23029
23030         * class.cs, rootcontext.cs : Get rid of calls to the same.
23031
23032         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23033
23034         (Populate): Define the constructor correctly and set the implementation
23035         attributes.
23036
23037         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23038         have been defined.
23039
23040         (AddDelegateType): Implement.
23041
23042         (IsDelegateType): Implement helper method.
23043
23044         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23045
23046         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23047         and accordingly handle it.
23048
23049         * delegate.cs (Populate): Take TypeContainer argument.
23050         Implement bits to define the Invoke method. However, I still haven't figured out
23051         how to take care of the native int bit :-(
23052
23053         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23054         Qualify the name of the delegate, not its return type !
23055
23056         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23057         conversion.
23058
23059         (StandardConversionExists): Checking for array types turns out to be recursive.
23060
23061         (ConvertReferenceExplicit): Implement array conversion.
23062
23063         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23064
23065 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23066
23067         * cs-parser.jay (delegate_declaration): Store the fully qualified
23068         name as it is a type declaration.
23069
23070         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23071         readonly.
23072
23073         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23074         as TypeContainer::DefineType.
23075
23076         (Populate): Method in which all the definition of the various methods (Invoke)
23077         etc is done.
23078
23079         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23080         see.
23081
23082         (CloseDelegate): Finally creates the delegate.
23083
23084         * class.cs (TypeContainer::DefineType): Update to define delegates.
23085         (Populate, Emit and CloseType): Do the same thing here too.
23086
23087         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23088         delegates in all these operations.
23089
23090 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23091
23092         * expression.cs: LocalTemporary: a new expression used to
23093         reference a temporary that has been created.
23094
23095         * assign.cs: Handle PropertyAccess back here, so that we can
23096         provide the proper semantic access to properties.
23097
23098         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23099         a few more explicit conversions. 
23100
23101         * modifiers.cs: `NEW' modifier maps to HideBySig.
23102
23103         * expression.cs (PropertyExpr): Make this into an
23104         ExpressionStatement, and support the EmitStatement code path. 
23105
23106         Perform get/set error checking, clean up the interface.
23107
23108         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23109         them into toplevel access objects.
23110
23111 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23114         SRE.
23115
23116         * typemanager.cs: Keep track here of our PropertyBuilders again to
23117         work around lameness in SRE.
23118
23119 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23120
23121         * expression.cs (LValue::LValueResolve): New method in the
23122         interface, used to perform a second resolution pass for LValues. 
23123
23124         (This::DoResolve): Catch the use of this in static methods.
23125
23126         (This::LValueResolve): Implement.
23127
23128         (This::Store): Remove warning, assigning to `this' in structures
23129         is 
23130
23131         (Invocation::Emit): Deal with invocation of
23132         methods on value types.  We need to pass the address to structure
23133         methods rather than the object itself.  (The equivalent code to
23134         emit "this" for structures leaves the entire structure on the
23135         stack instead of a pointer to it). 
23136
23137         (ParameterReference::DoResolve): Compute the real index for the
23138         argument based on whether the method takes or not a `this' pointer
23139         (ie, the method is static).
23140
23141         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23142         value types returned from functions when we need to invoke a
23143         method on the sturcture.
23144
23145
23146 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23147
23148         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23149         defining the type in the Modulebuilder or Typebuilder. This is to take
23150         care of nested types which need to be defined on the TypeBuilder using
23151         DefineNestedMethod.
23152
23153         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23154         methods in RootContext, only ported to be part of TypeContainer.
23155
23156         (TypeContainer::GetInterfaceOrClass): Ditto.
23157
23158         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23159
23160         * interface.cs (Interface::DefineInterface): New method. Does exactly
23161         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23162         too.
23163
23164         (Interface::GetInterfaces): Move from RootContext here and port.
23165
23166         (Interface::GetInterfaceByName): Same here.
23167
23168         * rootcontext.cs (ResolveTree): Re-write.
23169
23170         (PopulateTypes): Re-write.
23171
23172         * class.cs (TypeContainer::Populate): Populate nested types too.
23173         (TypeContainer::Emit): Emit nested members too.
23174
23175         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23176         instead just use the name argument passed in as it is already fully
23177         qualified.
23178
23179         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23180         to TypeContainer mapping to see if a type is user-defined.
23181
23182         * class.cs (TypeContainer::CloseType): Implement. 
23183
23184         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23185         the default constructor.
23186
23187         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23188         twice.
23189
23190         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23191
23192         * interface.cs (CloseType): Create the type here.
23193
23194         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23195         the hierarchy.
23196
23197         Remove all the methods which are now in TypeContainer.
23198
23199 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23200
23201         * delegate.cs (Define): Re-write bits to define the delegate
23202         correctly.
23203
23204 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23205
23206         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23207
23208         * expression.cs (ImplicitReferenceConversion): handle null as well
23209         as a source to convert to any reference type.
23210
23211         * statement.cs (Return): Perform any implicit conversions to
23212         expected return type.  
23213
23214         Validate use of return statement.  
23215
23216         * codegen.cs (EmitContext): Pass the expected return type here.
23217
23218         * class.cs (Method, Constructor, Property): Pass expected return
23219         type to EmitContext.
23220
23221 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23222
23223         * expression.cs: Make DoResolve take an EmitContext instead of a
23224         TypeContainer.
23225
23226         Replaced `l' and `location' for `loc', for consistency.
23227
23228         (Error, Warning): Remove unneeded Tc argument.
23229
23230         * assign.cs, literal.cs, constant.cs: Update to new calling
23231         convention. 
23232
23233         * codegen.cs: EmitContext now contains a flag indicating whether
23234         code is being generated in a static method or not.
23235
23236         * cs-parser.jay: DecomposeQI, new function that replaces the old
23237         QualifiedIdentifier.  Now we always decompose the assembled
23238         strings from qualified_identifier productions into a group of
23239         memberaccesses.
23240
23241 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23242
23243         * rootcontext.cs: Deal with field-less struct types correctly now
23244         by passing the size option to Define Type.
23245
23246         * class.cs: Removed hack that created one static field. 
23247
23248 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23249
23250         * statement.cs: Moved most of the code generation here. 
23251
23252 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23253
23254         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23255         seem very right.
23256
23257         (ElementAccess): Remove useless bits for now - keep checks as the spec
23258         says.
23259
23260 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23261
23262         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23263         and start performing checks according to the spec.
23264
23265 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23266
23267         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23268         rank_specifiers instead.
23269
23270         (rank_specifiers): Change the order in which the rank specifiers are stored
23271
23272         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23273
23274         * expression.cs (ElementAccess): Implement the LValue interface too.
23275
23276 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23277
23278         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23279         except that user defined conversions are not included.
23280
23281         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23282         perform the conversion of the return type, if necessary.
23283
23284         (New::DoResolve): Check whether we are creating an array or an object
23285         and accordingly do the needful.
23286
23287         (New::Emit): Same here.
23288
23289         (New::DoResolve): Implement guts of array creation.
23290
23291         (New::FormLookupType): Helper function.
23292
23293 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23294
23295         * codegen.cs: Removed most of the code generation here, and move the
23296         corresponding code generation bits to the statement classes. 
23297
23298         Added support for try/catch/finalize and throw.
23299
23300         * cs-parser.jay: Added support for try/catch/finalize.
23301
23302         * class.cs: Catch static methods having the flags override,
23303         virtual or abstract.
23304
23305         * expression.cs (UserCast): This user cast was not really doing
23306         what it was supposed to do.  Which is to be born in fully resolved
23307         state.  Parts of the resolution were being performed at Emit time! 
23308
23309         Fixed this code.
23310
23311 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23312
23313         * expression.cs: Implicity convert the result from UserCast.
23314
23315 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23316
23317         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23318         prevented it from working correctly. 
23319
23320         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23321         merely ConvertImplicit.
23322
23323 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23324
23325         * typemanager.cs: Make the LookupTypeContainer function static,
23326         and not per-instance.  
23327
23328         * class.cs: Make static FindMembers (the one that takes a Type
23329         argument). 
23330
23331         * codegen.cs: Add EmitForeach here.
23332
23333         * cs-parser.jay: Make foreach a toplevel object instead of the
23334         inline expansion, as we need to perform semantic analysis on it. 
23335
23336 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23337
23338         * expression.cs (Expression::ImplicitUserConversion): Rename to
23339         UserDefinedConversion.
23340
23341         (Expression::UserDefinedConversion): Take an extra argument specifying 
23342         whether we look for explicit user conversions too.
23343
23344         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23345
23346         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23347
23348         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23349         with the appropriate arguments.
23350
23351         * cs-parser.jay (cast_expression): Record location too.
23352
23353         * expression.cs (Cast): Record location info.
23354
23355         (Expression::ConvertExplicit): Take location argument.
23356
23357         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23358         to determine if we are doing explicit conversions.
23359
23360         (UserCast::Emit): Update accordingly.
23361
23362         (Expression::ConvertExplicit): Report an error if everything fails.
23363
23364         * ../errors/cs0030.cs : Add.
23365
23366 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23367
23368         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23369         virtual and newslot bits. 
23370
23371         * class.cs (TypeContainer::RegisterRequiredImplementations):
23372         Record methods we need.
23373
23374         (TypeContainer::MakeKey): Helper function to make keys for
23375         MethodBases, since the Methodbase key is useless.
23376
23377         (TypeContainer::Populate): Call RegisterRequiredImplementations
23378         before defining the methods.   
23379
23380         Create a mapping for method_builders_to_methods ahead of time
23381         instead of inside a tight loop.
23382
23383         (::RequireMethods):  Accept an object as the data to set into the
23384         hashtable so we can report interface vs abstract method mismatch.
23385
23386 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23387
23388         * report.cs: Make all of it static.
23389
23390         * rootcontext.cs: Drop object_type and value_type computations, as
23391         we have those in the TypeManager anyways.
23392
23393         Drop report instance variable too, now it is a global.
23394
23395         * driver.cs: Use try/catch on command line handling.
23396
23397         Add --probe option to debug the error reporting system with a test
23398         suite. 
23399
23400         * report.cs: Add support for exiting program when a probe
23401         condition is reached.
23402
23403 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23404
23405         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23406         we do a forcible conversion regardless of type, to check if 
23407         ForceConversion returns a null.
23408
23409         (Binary::error19): Use location to report error.
23410
23411         (Unary::error23): Use location here too.
23412
23413         * ../errors/cs0019.cs : Check in.
23414
23415         * ../errors/cs0023.cs : Check in.
23416
23417         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23418         case of a non-null MethodInfo object with a length of 0 !
23419
23420         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23421         an applicable member - according to the spec :-)
23422         Also fix logic to find members in base types.
23423
23424         (Unary::ResolveOperator): Same here.
23425
23426         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23427         as I was getting thoroughly confused between this and error19 :-)
23428
23429         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23430         (::FindMostEncompassedType): Implement.
23431         (::FindMostEncompassingType): Implement.
23432         (::StandardConversionExists): Implement.
23433
23434         (UserImplicitCast): Re-vamp. We now need info about most specific
23435         source and target types so that we can do the necessary conversions.
23436
23437         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23438         mathematical union with no duplicates.
23439
23440 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23441
23442         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23443         in order from base classes to child classes, so that we can in
23444         child classes look up in our parent for method names and
23445         attributes (required for handling abstract, virtual, new, override
23446         constructs: we need to instrospect our base class, and if we dont
23447         populate the classes in order, the introspection might be
23448         incorrect.  For example, a method could query its parent before
23449         the parent has any methods and would determine that the parent has
23450         no abstract methods (while it could have had them)).
23451
23452         (RootContext::CreateType): Record the order in which we define the
23453         classes.
23454
23455 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23456
23457         * class.cs (TypeContainer::Populate): Also method definitions can
23458         fail now, keep track of this.
23459
23460         (TypeContainer::FindMembers): Implement support for
23461         DeclaredOnly/noDeclaredOnly flag.
23462
23463         (Constructor::Emit) Return the ConstructorBuilder.
23464
23465         (Method::Emit) Return the MethodBuilder. 
23466         Check for abstract or virtual methods to be public.
23467
23468         * rootcontext.cs (RootContext::CreateType): Register all the
23469         abstract methods required for the class to be complete and the
23470         interface methods that must be implemented. 
23471
23472         * cs-parser.jay: Report error 501 (method requires body if it is
23473         not marked abstract or extern).
23474
23475         * expression.cs (TypeOf::Emit): Implement.
23476
23477         * typemanager.cs: runtime_handle_type, new global type.
23478
23479         * class.cs (Property::Emit): Generate code for properties.
23480
23481 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23482
23483         * expression.cs (Unary::ResolveOperator): Find operators on base type
23484         too - we now conform exactly to the spec.
23485
23486         (Binary::ResolveOperator): Same here.
23487
23488         * class.cs (Operator::Define): Fix minor quirk in the tests.
23489
23490         * ../errors/cs0215.cs : Added.
23491
23492         * ../errors/cs0556.cs : Added.
23493
23494         * ../errors/cs0555.cs : Added.
23495
23496 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23497
23498         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23499         single integer which is really efficient
23500
23501 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23502
23503         *  expression.cs (Expression::ImplicitUserConversion): Use location
23504         even in the case when we are examining True operators.
23505  
23506         * class.cs (Operator::Define): Perform extensive checks to conform
23507         with the rules for operator overloading in the spec.
23508
23509         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23510         some of the other conversions mentioned in the spec.
23511
23512         * typemanager.cs (array_type): New static member for the System.Array built-in
23513         type.
23514
23515         (cloneable_interface): For System.ICloneable interface.
23516
23517         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23518         we start resolving the tree and populating types.
23519
23520         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23521  
23522 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23523
23524         * expression.cs (Expression::ExprClassFromMemberInfo,
23525         Expression::Literalize): Create literal expressions from
23526         FieldInfos which are literals.
23527
23528         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23529         type casts, because they were wrong.  The test suite in tests
23530         caught these ones.
23531
23532         (ImplicitNumericConversion): ushort to ulong requires a widening
23533         cast. 
23534
23535         Int32 constant to long requires widening cast as well.
23536
23537         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23538         for integers because the type on the stack is not i4.
23539
23540 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23541
23542         * expression.cs (report118): require location argument. 
23543
23544         * parameter.cs: Do not dereference potential null value.
23545
23546         * class.cs: Catch methods that lack the `new' keyword when
23547         overriding a name.  Report warnings when `new' is used without
23548         anything being there to override.
23549
23550         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23551
23552         * class.cs: Only add constructor to hashtable if it is non-null
23553         (as now constructors can fail on define).
23554
23555         (TypeManager, Class, Struct): Take location arguments.
23556
23557         Catch field instance initialization in structs as errors.
23558
23559         accepting_filter: a new filter for FindMembers that is static so
23560         that we dont create an instance per invocation.
23561
23562         (Constructor::Define): Catch errors where a struct constructor is
23563         parameterless 
23564
23565         * cs-parser.jay: Pass location information for various new
23566         constructs. 
23567
23568         * delegate.cs (Delegate): take a location argument.
23569
23570         * driver.cs: Do not call EmitCode if there were problesm in the
23571         Definition of the types, as many Builders wont be there. 
23572
23573         * decl.cs (Decl::Decl): Require a location argument.
23574
23575         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23576         into integers, and find the most appropiate integer for it.
23577
23578         * literal.cs: Implement ULongLiteral.
23579
23580         * rootcontext.cs: Provide better information about the location of
23581         failure when CreateType fails.
23582
23583 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23584
23585         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23586         as well.
23587
23588         * expression.cs (Binary::CheckShiftArguments): Add missing type
23589         computation.
23590         (Binary::ResolveOperator): Add type to the logical and and logical
23591         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23592         before.
23593
23594         (Binary::DoNumericPromotions): In the case where either argument
23595         is ulong (and most signed types combined with ulong cause an
23596         error) perform implicit integer constant conversions as well.
23597
23598 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23599
23600         * expression.cs (UserImplicitCast): Method should always be
23601         non-null. 
23602         (Invocation::BetterConversion): Simplified test for IntLiteral.
23603
23604         (Expression::ImplicitNumericConversion): Split this routine out.
23605         Put the code that performs implicit constant integer conversions
23606         here. 
23607
23608         (Expression::Resolve): Become a wrapper around DoResolve so we can
23609         check eclass and type being set after resolve.
23610
23611         (Invocation::Badness): Remove this dead function
23612
23613         (Binary::ResolveOperator): Do not compute the expensive argumnets
23614         unless we have a union for it.
23615
23616         (Probe::Emit): Is needs to do an isinst and then
23617         compare against null.
23618
23619         (::CanConvert): Added Location argument.  If the Location argument
23620         is null (Location.Null), then we do not report errors.  This is
23621         used by the `probe' mechanism of the Explicit conversion.  We do
23622         not want to generate an error for something that the user
23623         explicitly requested to be casted.  But the pipeline for an
23624         explicit cast first tests for potential implicit casts.
23625
23626         So for now, if the Location is null, it means `Probe only' to
23627         avoid adding another argument.   Might have to revise this
23628         strategy later.
23629
23630         (ClassCast): New class used to type cast objects into arbitrary
23631         classes (used in Explicit Reference Conversions).
23632
23633         Implement `as' as well.
23634
23635         Reverted all the patches from Ravi below: they were broken:
23636
23637                 * The use of `level' as a mechanism to stop recursive
23638                   invocations is wrong.  That was there just to catch the
23639                   bug with a strack trace but not as a way of addressing
23640                   the problem.
23641
23642                   To fix the problem we have to *understand* what is going
23643                   on and the interactions and come up with a plan, not
23644                   just get things going.
23645
23646                 * The use of the type conversion cache that I proposed
23647                   last night had an open topic: How does this work across
23648                   protection domains.  A user defined conversion might not
23649                   be public in the location where we are applying the
23650                   conversion, a different conversion might be selected
23651                   (ie, private A->B (better) but public B->A (worse),
23652                   inside A, A->B applies, but outside it, B->A will
23653                   apply).
23654
23655                 * On top of that (ie, even if the above is solved),
23656                   conversions in a cache need to be abstract.  Ie, `To
23657                   convert from an Int to a Short use an OpcodeCast', not
23658                   `To convert from an Int to a Short use the OpcodeCast on
23659                   the variable 5' (which is what this patch was doing).
23660
23661 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23662
23663         * expression.cs (Invocation::ConversionExists): Re-write to use
23664         the conversion cache
23665
23666         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23667         cache all conversions done, not just user-defined ones.
23668
23669         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23670         to determine if a conversion exists instead of acutually trying to 
23671         perform the conversion. It's faster too.
23672
23673         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23674         and only then attempt the implicit conversion.
23675
23676 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23677
23678         * expression.cs (ConvertImplicit): Use a cache for conversions
23679         already found. Check level of recursion and bail out if necessary.
23680
23681 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23682
23683         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23684         Export standard methods that we expect for string operations.
23685
23686         * statement.cs (Block::UsageWarning): Track usage of variables and
23687         report the errors for not used variables.
23688
23689         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23690         operator. 
23691
23692 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23693
23694         * codegen.cs: remove unnneded code 
23695
23696         * expression.cs: Removed BuiltinTypeAccess class
23697
23698         Fix the order in which implicit conversions are
23699         done.  
23700
23701         The previous fixed dropped support for boxed conversions (adding a
23702         test to the test suite now)
23703
23704         (UserImplicitCast::CanConvert): Remove test for source being null,
23705         that code is broken.  We should not feed a null to begin with, if
23706         we do, then we should track the bug where the problem originates
23707         and not try to cover it up here.
23708
23709         Return a resolved expression of type UserImplicitCast on success
23710         rather than true/false.  Ravi: this is what I was talking about,
23711         the pattern is to use a static method as a "constructor" for
23712         objects. 
23713
23714         Also, do not create arguments until the very last minute,
23715         otherwise we always create the arguments even for lookups that
23716         will never be performed. 
23717
23718         (UserImplicitCast::Resolve): Eliminate, objects of type
23719         UserImplicitCast are born in a fully resolved state. 
23720
23721         * typemanager.cs (InitCoreTypes): Init also value_type
23722         (System.ValueType). 
23723
23724         * expression.cs (Cast::Resolve): First resolve the child expression.
23725
23726         (LValue): Add new method AddressOf to be used by
23727         the `&' operator.  
23728
23729         Change the argument of Store to take an EmitContext instead of an
23730         ILGenerator, because things like FieldExpr need to be able to call
23731         their children expression to generate the instance code. 
23732
23733         (Expression::Error, Expression::Warning): Sugar functions for
23734         reporting errors.
23735
23736         (Expression::MemberLookup): Accept a TypeContainer instead of a
23737         Report as the first argument.
23738
23739         (Expression::ResolvePrimary): Killed.  I still want to improve
23740         this as currently the code is just not right.
23741
23742         (Expression::ResolveMemberAccess): Simplify, but it is still
23743         wrong. 
23744
23745         (Unary::Resolve): Catch errors in AddressOf operators.
23746
23747         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23748         index to a byte for the short-version, or the compiler will choose
23749         the wrong Emit call, which generates the wrong data.
23750
23751         (ParameterReference::Emit, ::Store): same.
23752
23753         (FieldExpr::AddressOf): Implement.
23754
23755         * typemanager.cs: TypeManager: made public variable instead of
23756         property.
23757
23758         * driver.cs: document --fatal.
23759
23760         * report.cs (ErrorMessage, WarningMessage): new names for the old
23761         Error and Warning classes.
23762
23763         * cs-parser.jay (member_access): Turn built-in access to types
23764         into a normal simplename
23765
23766 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23767
23768         * expression.cs (Invocation::BetterConversion): Fix to cope
23769         with q being null, since this was introducing a bug.
23770
23771         * expression.cs (ConvertImplicit): Do built-in conversions first.
23772
23773 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23774
23775         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23776
23777 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23778
23779         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23780         I had introduced long ago (what's new ?).
23781
23782         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23783         the work of all the checking. 
23784         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23785         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23786
23787         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23788         that is the right way. 
23789
23790         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23791         overloading resolution. Use everywhere instead of cutting and pasting code.
23792
23793         (Binary::ResolveOperator): Use MakeUnionSet.
23794
23795         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23796         we have to convert to bool types. Not complete yet.
23797
23798 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23799
23800         * typemanager.cs (TypeManager::CSharpName): support ushort.
23801
23802         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23803         to provide an expression that performsn an implicit constant int
23804         conversion (section 6.1.6).
23805         (Expression::ConvertImplicitRequired): Reworked to include
23806         implicit constant expression conversions.
23807
23808         (Expression::ConvertNumericExplicit): Finished.
23809
23810         (Invocation::Emit): If InstanceExpression is null, then it means
23811         that we perform a call on this.
23812
23813 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23814
23815         * expression.cs (Unary::Emit): Remove some dead code.
23816         (Probe): Implement Resolve and Emit for `is'.
23817         (Expression::ConvertImplicitRequired): Attempt to do constant
23818         expression conversions here.  Maybe should be moved to
23819         ConvertImplicit, but I am not sure.
23820         (Expression::ImplicitLongConstantConversionPossible,
23821         Expression::ImplicitIntConstantConversionPossible): New functions
23822         that tell whether is it possible to apply an implicit constant
23823         expression conversion.
23824
23825         (ConvertNumericExplicit): Started work on explicit numeric
23826         conversions.
23827
23828         * cs-parser.jay: Update operator constants.
23829
23830         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23831         (Parameters::GetSignature): Hook up VerifyArgs here.
23832         (Parameters::VerifyArgs): Verifies that no two arguments have the
23833         same name. 
23834
23835         * class.cs (Operator): Update the operator names to reflect the
23836         ones that the spec expects (as we are just stringizing the
23837         operator names).
23838
23839         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23840         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23841         previous usage did only work for our methods.
23842         (Expression::ConvertImplicit): Handle decimal implicit numeric
23843         conversions as well.
23844         (Expression::InternalTypeConstructor): Used to invoke constructors
23845         on internal types for default promotions.
23846
23847         (Unary::Emit): Implement special handling for the pre/post
23848         increment/decrement for overloaded operators, as they need to have
23849         the same semantics as the other operators.
23850
23851         (Binary::ResolveOperator): ditto.
23852         (Invocation::ConversionExists): ditto.
23853         (UserImplicitCast::Resolve): ditto.
23854
23855 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23856
23857         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23858         operator, return after emitting body. Regression tests pass again !
23859
23860         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23861         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23862         (Invocation::OverloadResolve): Ditto.
23863         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23864
23865         * everywhere : update calls to the above methods accordingly.
23866
23867 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23868
23869         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23870
23871         * expression.cs (ExpressionStatement): New base class used for
23872         expressions that can appear in statements, so that we can provide
23873         an alternate path to generate expression that do not leave a value
23874         on the stack.
23875
23876         (Expression::Emit, and all the derivatives): We no longer return
23877         whether a value is left on the stack or not.  Every expression
23878         after being emitted leaves a single value on the stack.
23879
23880         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23881         facilties of ExpressionStatement if possible.
23882
23883         * cs-parser.jay: Update statement_expression.
23884
23885 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23886
23887         * driver.cs: Change the wording of message
23888
23889 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23890
23891         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23892         the type of the expression to the return type of the method if
23893         we have an overloaded operator match ! The regression tests pass again !
23894         (Unary::ResolveOperator): Ditto.
23895
23896         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23897         to find "op_Implicit", not "implicit" ;-)
23898         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23899         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23900
23901         * everywhere : Correct calls to the above accordingly.
23902
23903         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23904         (ConvertImplicit): Do user-defined conversion if it exists.
23905
23906 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23907
23908         * assign.cs: track location.
23909         (Resolve): Use implicit conversions on assignment.
23910
23911         * literal.cs: Oops.  Not good, Emit of short access values should
23912         pass (Bytes) or the wrong argument will be selected.
23913
23914         * expression.cs (Unary::Emit): Emit code for -expr.
23915
23916         (Unary::ResolveOperator): Handle `Substract' for non-constants
23917         (substract from zero from the non-constants).
23918         Deal with Doubles as well. 
23919
23920         (Expression::ConvertImplicitRequired): New routine that reports an
23921         error if no implicit conversion exists. 
23922
23923         (Invocation::OverloadResolve): Store the converted implicit
23924         expressions if we make them
23925
23926 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23927
23928         * class.cs (ConstructorInitializer): Take a Location argument.
23929         (ConstructorBaseInitializer): Same here.
23930         (ConstructorThisInitializer): Same here.
23931
23932         * cs-parser.jay : Update all calls accordingly.
23933
23934         * expression.cs (Unary, Binary, New): Take location argument.
23935         Update accordingly everywhere.
23936
23937         * cs-parser.jay : Update all calls to the above to take a location
23938         argument.
23939
23940         * class.cs : Ditto.
23941
23942 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23943
23944         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23945         (Invocation::BetterConversion): Same here
23946         (Invocation::ConversionExists): Ditto.
23947
23948         (Invocation::ConversionExists): Implement.
23949
23950 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23951
23952         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23953         Also take an additional TypeContainer argument.
23954
23955         * All over : Pass in TypeContainer as argument to OverloadResolve.
23956
23957         * typemanager.cs (CSharpName): Update to check for the string type and return
23958         that too.
23959
23960         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23961         a given method.
23962
23963 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23964
23965         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23966         (Invocation::BetterFunction): Implement.
23967         (Invocation::BetterConversion): Implement.
23968         (Invocation::ConversionExists): Skeleton, no implementation yet.
23969
23970         Okay, things work fine !
23971
23972 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23973
23974         * typemanager.cs: declare and load enum_type, delegate_type and
23975         void_type. 
23976
23977         * expression.cs (Expression::Emit): Now emit returns a value that
23978         tells whether a value is left on the stack or not.  This strategy
23979         might be reveted tomorrow with a mechanism that would address
23980         multiple assignments.
23981         (Expression::report118): Utility routine to report mismatches on
23982         the ExprClass.
23983
23984         (Unary::Report23): Report impossible type/operator combination
23985         utility function.
23986
23987         (Unary::IsIncrementableNumber): Whether the type can be
23988         incremented or decremented with add.
23989         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23990         complemented. 
23991         (Unary::ResolveOperator): Implement ++, !, ~,
23992
23993         (Invocation::Emit): Deal with new Emit convetion.
23994
23995         * All Expression derivatives: Updated their Emit method to return
23996         whether they leave values on the stack or not.
23997
23998         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23999         stack for expressions that are statements. 
24000
24001 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24002
24003         * expression.cs (LValue): New interface.  Must be implemented by
24004         LValue objects.
24005         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24006         LValue interface.
24007
24008         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24009         interface for generating code, simplifies the code.
24010
24011 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24012
24013         * expression.cs (everywhere): Comment out return statements in ::Resolve
24014         methods to avoid the warnings.
24015
24016 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24017
24018         * driver.cs (parse): Report error 2001 if we can not open the
24019         source file.
24020
24021         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24022         not resolve it.
24023
24024         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24025         object. 
24026
24027         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24028         otherwise nested blocks end up with the same index.
24029
24030         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24031
24032         * expression.cs:  Instead of having FIXMEs in the Resolve
24033         functions, throw exceptions so it is obvious that we are facing a
24034         bug. 
24035
24036         * cs-parser.jay (invocation_expression): Pass Location information.
24037
24038         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24039         Use a basename for those routines because .NET does not like paths
24040         on them. 
24041
24042         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24043         already defined.
24044
24045 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24046
24047         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24048         are loading the correct data types (throws an exception if not).
24049         (TypeManager::InitCoreTypes): Use CoreLookupType
24050
24051         * expression.cs (Unary::ResolveOperator): return the child
24052         expression for expressions which are just +expr.
24053         (Unary::ResolveOperator): Return negative literals for -LITERAL
24054         expressions (otherwise they are Unary {Literal}).
24055         (Invocation::Badness): Take into account `Implicit constant
24056         expression conversions'.
24057
24058         * literal.cs (LongLiteral): Implement long literal class.
24059         (IntLiteral): export the `Value' of the intliteral. 
24060
24061 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24062
24063         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24064
24065         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24066         instead of 'Operator'
24067
24068         * expression.cs (Binary::ResolveOperator): Update accordingly.
24069         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24070         and 'Minus'
24071
24072         * cs-parser.jay (unary_expression): Update to use the new names.
24073
24074         * gen-treedump.cs (GetUnary): Same here.
24075
24076         * expression.cs (Unary::Resolve): Implement.
24077         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24078         operators are found instead of making noise ;-)
24079         (Unary::ResolveOperator): New method to do precisely the same thing which
24080         Binary::ResolveOperator does for Binary expressions.
24081         (Unary.method, .Arguments): Add.
24082         (Unary::OperName): Implement.   
24083         (Unary::ForceConversion): Copy and Paste !
24084
24085         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24086         a unary operator.
24087
24088         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24089         for the inbuilt operators. Only overloading works for now ;-)
24090
24091 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24092
24093         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24094         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24095
24096         * expression.cs (This::Emit): Implement. 
24097         (This::Resolve): Implement.
24098         (TypeOf:Resolve): Implement.
24099         (Expression::ResolveSimpleName): Add an implicit this to instance
24100         field references. 
24101         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24102         Bind instance variable to Field expressions.
24103         (FieldExpr::Instance): New field used to track the expression that
24104         represents the object instance.
24105         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24106         binding 
24107         (FieldExpr::Emit): Implement.
24108
24109         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24110         the last instruction contains a return opcode to avoid generating
24111         the last `ret' instruction (this generates correct code, and it is
24112         nice to pass the peverify output).
24113
24114         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24115         initializer for static and instance variables.
24116         (Constructor::Emit): Allow initializer to be null in the case of
24117         static constructors.  Only emit initializer for instance
24118         constructors. 
24119
24120         (TypeContainer::FindMembers): Return a null array if there are no
24121         matches.
24122
24123         Also fix the code for the MemberTypes.Method branch, as it was not
24124         scanning that for operators (or tried to access null variables before).
24125
24126         * assign.cs (Assign::Emit): Handle instance and static fields. 
24127
24128         * TODO: Updated.
24129
24130         * driver.cs: Stop compilation if there are parse errors.
24131
24132         * cs-parser.jay (constructor_declaration): Provide default base
24133         initializer for non-static constructors.
24134         (constructor_declarator): Do not provide a default base
24135         initializers if none was specified.
24136         Catch the fact that constructors should not have parameters.
24137
24138         * class.cs: Do not emit parent class initializers for static
24139         constructors, that should be flagged as an error.
24140
24141 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24142
24143         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24144         Move back code into TypeContainer::Populate.
24145
24146 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24147
24148         * class.cs (TypeContainer::AddConstructor): Fix the check to
24149         compare against Name, not Basename. 
24150         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24151
24152         * cs-parser.jay : Update accordingly.
24153
24154         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24155         for methods, don't forget to look into the operators too.
24156         (RegisterMethodBuilder): Helper method to take care of this for
24157         methods, constructors and operators.
24158         (Operator::Define): Completely revamp.
24159         (Operator.OperatorMethod, MethodName): New fields.
24160         (TypeContainer::Populate): Move the registering of builders into
24161         RegisterMethodBuilder.
24162         (Operator::Emit): Re-write.
24163
24164         * expression.cs (Binary::Emit): Comment out code path to emit method
24165         invocation stuff for the case when we have a user defined operator. I am
24166         just not able to get it right !
24167
24168 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24169
24170         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24171         argument. 
24172
24173         (Expression::MemberLookup): Provide a version that allows to
24174         specify the MemberTypes and BindingFlags. 
24175
24176         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24177         so it was not fetching variable information from outer blocks.
24178
24179         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24180         Beforefieldinit as it was buggy.
24181
24182         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24183         that Ravi put here.  
24184
24185         * class.cs (Constructor::Emit): Only emit if block is not null.
24186         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24187         deal with this by semantically definining it as if the user had
24188         done it.
24189
24190         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24191         constructors as we now "emit" them at a higher level.
24192
24193         (TypeContainer::DefineDefaultConstructor): Used to define the
24194         default constructors if none was provided.
24195
24196         (ConstructorInitializer): Add methods Resolve and Emit. 
24197
24198         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24199
24200 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24201
24202         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24203         the default constructor builder with our hashtable for methodbuilders
24204         to methodcores.
24205
24206         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24207         and argument_count is 0 in which case we have a match.
24208         (Binary::ResolveOperator): More null checking and miscellaneous coding
24209         style cleanup.
24210
24211 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24212
24213         * rootcontext.cs (IsNameSpace): Compare against null.
24214
24215         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24216
24217         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24218         and Unary::Operator.
24219
24220         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24221         accordingly.
24222
24223         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24224         we have overloaded operators.
24225         (Binary::ResolveOperator): Implement the part which does the operator overload
24226         resolution.
24227
24228         * class.cs (Operator::Emit): Implement.
24229         (TypeContainer::Emit): Emit the operators we have too.
24230
24231         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24232         the case when we have a user-defined operator.
24233
24234 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24235
24236         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24237
24238 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24239
24240         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24241         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24242         (Constructor::Emit): Implement.
24243         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24244         if we have no work to do. 
24245         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24246         Emit method.
24247
24248         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24249         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24250
24251         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24252         of parent.parent.
24253
24254 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24255
24256         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24257         in the source.
24258         (Tree::RecordNamespace): Method to do what the name says ;-)
24259         (Tree::Namespaces): Property to get at the namespaces hashtable.
24260
24261         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24262         keep track.
24263
24264         * rootcontext.cs (IsNamespace): Fixed it :-)
24265
24266 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24267
24268         * class.cs (TypeContainer::FindMembers): Add support for
24269         constructors. 
24270         (MethodCore): New class that encapsulates both the shared aspects
24271         of a Constructor and a Method.  
24272         (Method, Constructor): Factored pieces into MethodCore.
24273
24274         * driver.cs: Added --fatal which makes errors throw exceptions.
24275         Load System assembly as well as part of the standard library.
24276
24277         * report.cs: Allow throwing exceptions on errors for debugging.
24278
24279         * modifiers.cs: Do not use `parent', instead use the real type
24280         container to evaluate permission settings.
24281
24282         * class.cs: Put Ravi's patch back in.  He is right, and we will
24283         have to cope with the
24284
24285 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24286
24287         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24288         FamORAssem, not FamANDAssem.
24289
24290 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24291
24292         * driver.cs: Added --parse option that only parses its input files
24293         and terminates.
24294
24295         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24296         incorrect.  IsTopLevel is not used to tell whether an object is
24297         root_types or not (that can be achieved by testing this ==
24298         root_types).  But to see if this is a top-level *class* (not
24299         necessarly our "toplevel" container). 
24300
24301 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24302
24303         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24304         parent instead of a direct call to GetType.
24305
24306 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24307
24308         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24309         Modifiers.TypeAttr. This should just be a call to that method.
24310
24311         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24312         object so that we can determine if we are top-level or not.
24313
24314         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24315         TypeContainer too.
24316
24317         * enum.cs (Enum::Define): Ditto.
24318
24319         * modifiers.cs (FieldAttr): Re-write.
24320
24321         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24322         (TypeContainer::HaveStaticConstructor): New property to provide access
24323         to precisely that info.
24324
24325         * modifiers.cs (MethodAttr): Re-write.
24326         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24327
24328         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24329         of top-level types as claimed.
24330
24331 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24332
24333         * expression.cs (MemberLookup): Fruitless attempt to lookup
24334         constructors.  Maybe I need to emit default constructors?  That
24335         might be it (currently .NET emits this for me automatically).
24336         (Invocation::OverloadResolve): Cope with Arguments == null.
24337         (Invocation::EmitArguments): new function, shared by the new
24338         constructor and us.
24339         (Invocation::Emit): Handle static and instance methods.  Emit
24340         proper call instruction for virtual or non-virtual invocations.
24341         (New::Emit): Implement.
24342         (New::Resolve): Implement.
24343         (MemberAccess:Resolve): Implement.
24344         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24345         to track instances.
24346         (FieldExpr::Resolve): Set type.
24347
24348         * support.cs: Handle empty arguments.
24349                 
24350         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24351         SimpleLookup): Auxiliary routines to help parse a qualifier
24352         identifier.  
24353
24354         Update qualifier_identifier rule.
24355
24356         * codegen.cs: Removed debugging messages.
24357
24358         * class.cs: Make this a global thing, this acts just as a "key" to
24359         objects that we might have around.
24360
24361         (Populate): Only initialize method_builders_to_methods once.
24362
24363         * expression.cs (PropertyExpr): Initialize type from the
24364         PropertyType. 
24365
24366         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24367         Resolve pattern.  Attempt to implicitly convert value to boolean.
24368         Emit code.
24369
24370         * expression.cs: Set the type for the int32/int32 argument case.
24371         (Binary::ResolveOperator): Set the return type to boolean for
24372         comparission operators
24373
24374         * typemanager.cs: Remove debugging print code.
24375
24376         (Invocation::Resolve): resolve type.
24377
24378         * class.cs: Allocate a MemberInfo of the correct size, as the code
24379         elsewhere depends on the test to reflect the correct contents.
24380
24381         (Method::) Keep track of parameters, due to System.Reflection holes
24382
24383         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24384         mapping here.
24385
24386         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24387         of the exact size and return that.
24388
24389         (Class::LookupMethodByBuilder): New function that maps
24390         MethodBuilders to its methods.  Required to locate the information
24391         on methods because System.Reflection bit us again.
24392
24393         * support.cs: New file, contains an interface ParameterData and
24394         two implementations: ReflectionParameters and InternalParameters
24395         used to access Parameter information.  We will need to grow this
24396         as required.
24397
24398         * expression.cs (Invocation::GetParameterData): implement a cache
24399         and a wrapper around the ParameterData creation for methods. 
24400         (Invocation::OverloadResolve): Use new code.
24401
24402 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24403
24404         * class.cs (TypeContainer::EmitField): Remove and move into 
24405         (Field::Define): here and modify accordingly.
24406         (Field.FieldBuilder): New member.
24407         (TypeContainer::Populate): Update accordingly.
24408         (TypeContainer::FindMembers): Implement.
24409
24410 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24411
24412         * statement.cs: (VariableInfo::VariableType): New field to be
24413         initialized with the full type once it is resolved. 
24414
24415 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24416
24417         * parameter.cs (GetParameterInfo): Use a type cache to compute
24418         things only once, and to reuse this information
24419
24420         * expression.cs (LocalVariableReference::Emit): Implement.
24421         (OpcodeCast::Emit): fix.
24422
24423         (ParameterReference::Resolve): Implement.
24424         (ParameterReference::Emit): Implement.
24425
24426         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24427         that are expressions need to stay as Expressions.
24428
24429         * typemanager.cs (CSharpName): Returns the C# name of a type if
24430         possible. 
24431
24432         * expression.cs (Expression::ConvertImplicit): New function that
24433         implements implicit type conversions.
24434
24435         (Expression::ImplicitReferenceConversion): Implements implicit
24436         reference conversions.
24437
24438         (EmptyCast): New type for transparent casts.
24439
24440         (OpcodeCast): New type for casts of types that are performed with
24441         a sequence of bytecodes.
24442
24443         (BoxedCast): New type used for casting value types into reference
24444         types.  Emits a box opcode.
24445
24446         (Binary::DoNumericPromotions): Implements numeric promotions of
24447         and computation of the Binary::Type.
24448
24449         (Binary::EmitBranchable): Optimization.
24450
24451         (Binary::Emit): Implement code emission for expressions.
24452
24453         * typemanager.cs (TypeManager): Added two new core types: sbyte
24454         and byte.
24455
24456 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24457
24458         * class.cs (TypeContainer::FindMembers): Method which does exactly
24459         what Type.FindMembers does, only we don't have to use reflection. No
24460         implementation yet.
24461
24462         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24463         typecontainer objects as we need to get at them.
24464         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24465
24466         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24467         typecontainer object.
24468
24469         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24470         of just a Report object.
24471
24472 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24473
24474         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24475         "remove_"
24476         (TypeContainer::Populate): Now define the delegates of the type too.
24477         (TypeContainer.Delegates): Property to access the list of delegates defined
24478         in the type.
24479
24480         * delegates.cs (Delegate::Define): Implement partially.
24481
24482         * modifiers.cs (TypeAttr): Handle more flags.
24483
24484 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24485
24486         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24487         and not <=
24488         (Operator::Define): Re-write logic to get types by using the LookupType method
24489         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24490         (Indexer::Define): Ditto.
24491         (Event::Define): Ditto.
24492         (Property::Define): Ditto.
24493
24494 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24495
24496         * class.cs (TypeContainer::Populate): Now define operators too. 
24497         (TypeContainer.Operators): New property to access the list of operators
24498         in a type.
24499         (Operator.OperatorMethodBuilder): New member to hold the method builder
24500         for the operator we are defining.
24501         (Operator::Define): Implement.
24502
24503 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24504
24505         * class.cs (Event::Define): Make the prefixes of the accessor methods
24506         addOn_ and removeOn_ 
24507
24508         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24509         of the location being passed in too. Ideally, this should go later since all
24510         error reporting should be done through the Report object.
24511
24512         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24513         (Populate): Iterate thru the indexers we have and define them too.
24514         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24515         for the get and set accessors.
24516         (Indexer::Define): Implement.
24517
24518 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24519
24520         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24521         my previous implementation, did not work.
24522
24523         * typemanager.cs: Add a couple of missing types (the longs).
24524
24525         * literal.cs: Use TypeManager.bool_type instead of getting it.
24526
24527         * expression.cs (EventExpr): New kind of expressions.
24528         (Expressio::ExprClassFromMemberInfo): finish
24529
24530 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24531
24532         * assign.cs: Emit stores to static fields differently.
24533
24534 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24535
24536         * Merge in changes and adjust code to tackle conflicts. Backed out my
24537         code in Assign::Resolve ;-) 
24538
24539 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24540
24541         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24542         instead Report.Error and also pass in the location.
24543         (CSharpParser::Lexer): New readonly property to return the reference
24544         to the Tokenizer object.
24545         (declare_local_variables): Use Report.Error with location instead of plain 
24546         old error.
24547         (CheckDef): Ditto.
24548
24549         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24550         (Operator.CheckBinaryOperator): Ditto.
24551
24552         * cs-parser.jay (operator_declarator): Update accordingly.
24553
24554         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24555         (CheckBinaryOperator): Same here.
24556
24557         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24558         on the name without any prefixes of namespace names etc. This is because we
24559         already might have something already fully qualified like 
24560         'System.Console.WriteLine'
24561
24562         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24563
24564 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24565
24566         * cs-tokenizer.cs (location): Return a string which also contains
24567         the file name.
24568
24569         * expression.cs (ElementAccess): New class for expressions of the
24570         type 'element access.'
24571         (BaseAccess): New class for expressions of the type 'base access.'
24572         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24573         respectively.
24574
24575         * cs-parser.jay (element_access): Implement action.
24576         (base_access): Implement actions.
24577         (checked_expression, unchecked_expression): Implement.
24578
24579         * cs-parser.jay (local_variable_type): Correct and implement.
24580         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24581
24582         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24583
24584         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24585         name and the specifiers.
24586
24587         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24588
24589         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24590         making them all public ;-)
24591
24592         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24593         class anyways.
24594
24595 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24596
24597         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24598         PropertyExprs.
24599         (FieldExpr, PropertyExprs): New resolved expressions.
24600         (SimpleName::MemberStaticCheck): Perform static checks for access
24601         to non-static fields on static methods. Maybe this should be
24602         generalized for MemberAccesses. 
24603         (SimpleName::ResolveSimpleName): More work on simple name
24604         resolution. 
24605
24606         * cs-parser.jay (primary_expression/qualified_identifier): track
24607         the parameter index.
24608
24609         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24610         (EmitContext::EmitBoolExpression): Chain to expression generation
24611         instead of temporary hack.
24612         (::EmitStatementExpression): Put generic expression code generation.
24613
24614         * assign.cs (Assign::Emit): Implement variable assignments to
24615         local variables, parameters and fields.
24616
24617 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24618
24619         * statement.cs (Block::GetVariableInfo): New method, returns the
24620         VariableInfo for a variable name in a block.
24621         (Block::GetVariableType): Implement in terms of GetVariableInfo
24622
24623         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24624         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24625
24626 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24627
24628         * cs-parser.jay (operator_declaration): Continue on my quest : update
24629         to take attributes argument.
24630         (event_declaration): Ditto.
24631         (enum_declaration): Ditto.
24632         (indexer_declaration): Ditto.
24633
24634         * class.cs (Operator::Operator): Update constructor accordingly.
24635         (Event::Event): Ditto.
24636
24637         * delegate.cs (Delegate::Delegate): Same here.
24638
24639         * enum.cs (Enum::Enum): Same here.
24640
24641 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24642
24643         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24644
24645         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24646
24647         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24648         being passed around as an arraylist.
24649         (Attributes::AddAttribute): Method to add attribute sections.
24650
24651         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24652         (struct_declaration): Update accordingly.
24653         (constant_declaration): Update.
24654         (field_declaration): Update.
24655         (method_header): Update.
24656         (fixed_parameter): Update.
24657         (parameter_array): Ditto.
24658         (property_declaration): Ditto.
24659         (destructor_declaration): Ditto.
24660
24661         * class.cs (Struct::Struct): Update constructors accordingly.
24662         (Class::Class): Ditto.
24663         (Field::Field): Ditto.
24664         (Method::Method): Ditto.
24665         (Property::Property): Ditto.
24666         (TypeContainer::OptAttribute): update property's return type.
24667
24668         * interface.cs (Interface.opt_attributes): New member.
24669         (Interface::Interface): Update to take the extra Attributes argument.
24670
24671         * parameter.cs (Parameter::Parameter): Ditto.
24672
24673         * constant.cs (Constant::Constant): Ditto.
24674
24675         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24676         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24677         the attributes as a parameter.
24678         (InterfaceProperty): Update constructor call.
24679         (InterfaceEvent): Ditto.
24680         (InterfaceMethod): Ditto.
24681         (InterfaceIndexer): Ditto.
24682
24683         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24684         pass the attributes too.
24685         (interface_event_declaration): Ditto.
24686         (interface_property_declaration): Ditto.
24687         (interface_method_declaration): Ditto.
24688         (interface_declaration): Ditto.
24689
24690 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24691
24692         * class.cs (Method::Define): Track the "static Main" definition to
24693         create an entry point. 
24694
24695         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24696         EntryPoint if we find it. 
24697
24698         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24699         (EmitContext::ig): Make this variable public.
24700
24701         * driver.cs: Make the default output file be the first file name
24702         with the .exe extension.  
24703
24704         Detect empty compilations
24705
24706         Handle various kinds of output targets.  Handle --target and
24707         rename -t to --dumper.
24708
24709         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24710         methods inherited from Expression return now an Expression.  This
24711         will is used during the tree rewriting as we resolve them during
24712         semantic analysis.
24713
24714         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24715         the spec.  Missing entirely is the information about
24716         accessability of elements of it.
24717
24718         (Expression::ExprClassFromMemberInfo): New constructor for
24719         Expressions that creates a fully initialized Expression based on
24720         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24721         a Type.
24722
24723         (Invocation::Resolve): Begin implementing resolution of invocations.
24724
24725         * literal.cs (StringLiteral):  Implement Emit.
24726
24727 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24728
24729         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24730         member.
24731
24732 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24733
24734         * cs-parser.jay (attribute_arguments): Implement actions.
24735         (attribute): Fix bug in production. Implement action.
24736         (attribute_list): Implement.
24737         (attribute_target): Implement.
24738         (attribute_target_specifier, opt_target_specifier): Implement
24739         (CheckAttributeTarget): New method to check if the attribute target
24740         is valid.
24741         (attribute_section): Implement.
24742         (opt_attributes): Implement.
24743
24744         * attribute.cs : New file to handle attributes.
24745         (Attribute): Class to hold attribute info.
24746
24747         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24748         (attribute_section): Modify production to use 2 different rules to 
24749         achieve the same thing. 1 s/r conflict down !
24750         Clean out commented, useless, non-reducing dimension_separator rules.
24751
24752         * class.cs (TypeContainer.attributes): New member to hold list
24753         of attributes for a type.
24754         (Struct::Struct): Modify to take one more argument, the attribute list.
24755         (Class::Class): Ditto.
24756         (Field::Field): Ditto.
24757         (Method::Method): Ditto.
24758         (Property::Property): Ditto.
24759
24760         * cs-parser.jay (struct_declaration): Update constructor call to
24761         pass in the attributes too.
24762         (class_declaration): Ditto.
24763         (constant_declaration): Ditto.
24764         (field_declaration): Ditto.
24765         (method_header): Ditto.
24766         (fixed_parameter): Ditto.
24767         (parameter_array): Ditto.
24768         (property_declaration): Ditto.
24769
24770         * constant.cs (Constant::Constant): Update constructor similarly.
24771         Use System.Collections.
24772
24773         * parameter.cs (Parameter::Parameter): Update as above.
24774
24775 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24776
24777         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24778         (TypeContainer.delegates): New member to hold list of delegates.
24779
24780         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24781         this time as I seem to be on crack ;-)
24782
24783 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24784
24785         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24786         tell whether an identifier represents a namespace.
24787
24788         * expression.cs (NamespaceExpr): A namespace expression, used only
24789         temporarly during expression resolution.
24790         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24791         utility functions to resolve names on expressions.
24792
24793 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24794
24795         * codegen.cs: Add hook for StatementExpressions. 
24796
24797         * class.cs: Fix inverted test for static flag in methods.
24798
24799 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24800
24801         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24802         to make it coincide with MS' number.
24803         (Operator::CheckBinaryOperator): Ditto.
24804
24805         * ../errors/errors.txt : Remove error numbers added earlier.
24806
24807         * ../errors/cs1019.cs : Test case for error # 1019
24808
24809         * ../errros/cs1020.cs : Test case for error # 1020
24810
24811         * cs-parser.jay : Clean out commented cruft.
24812         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24813         used anywhere - non-reducing rule.
24814         (namespace_declarations): Non-reducing rule - comment out.
24815
24816         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24817         with TypeContainer::AddEnum.
24818
24819         * delegate.cs : New file for delegate handling classes.
24820         (Delegate): Class for declaring delegates.
24821
24822         * makefile : Update.
24823
24824         * cs-parser.jay (delegate_declaration): Implement.
24825
24826 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24827
24828         * class.cs (Event::Define): Implement.
24829         (Event.EventBuilder): New member.
24830
24831         * class.cs (TypeContainer::Populate): Update to define all enums and events
24832         we have.
24833         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24834         readonly fields for all these cases ?
24835
24836 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24837
24838         * class.cs (Property): Revamp to use the convention of making fields readonly.
24839         Accordingly modify code elsewhere.
24840
24841         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24842         the Define method of the Property class.
24843
24844         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24845         trivial bug.
24846         (TypeContainer::Populate): Update to define all the properties we have. Also
24847         define all enumerations.
24848
24849         * enum.cs (Define): Implement.
24850
24851 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24852
24853         * cs-parser.jay (overloadable_operator): The semantic value is an
24854         enum of the Operator class.
24855         (operator_declarator): Implement actions.
24856         (operator_declaration): Implement.
24857
24858         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24859         validity of definitions.
24860         (Operator::CheckBinaryOperator): Static method to check for binary operators
24861         (TypeContainer::AddOperator): New method to add an operator to a type.
24862
24863         * cs-parser.jay (indexer_declaration): Added line to actually call the
24864         AddIndexer method so it gets added ;-)
24865
24866         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24867         already taken care of by the MS compiler ?  
24868
24869 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24870
24871         * class.cs (Operator): New class for operator declarations.
24872         (Operator::OpType): Enum for the various operators.
24873
24874 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24875
24876         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24877         ostensibly handle this in semantic analysis.
24878
24879         * cs-parser.jay (general_catch_clause): Comment out
24880         (specific_catch_clauses, specific_catch_clause): Ditto.
24881         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24882         (catch_args, opt_catch_args): New productions.
24883         (catch_clause): Rewrite to use the new productions above
24884         (catch_clauses): Modify accordingly.
24885         (opt_catch_clauses): New production to use in try_statement
24886         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24887         and re-write the code in the actions to extract the specific and
24888         general catch clauses by being a little smart ;-)
24889
24890         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24891         Hooray, try and catch statements parse fine !
24892
24893 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24894
24895         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24896         string from the hashtable of variables.
24897
24898         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24899         I end up making that mistake ;-)
24900         (catch_clauses): Fixed gross error which made Key and Value of the 
24901         DictionaryEntry the same : $1 !!
24902
24903 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24904
24905         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24906
24907         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24908         when the add and remove accessors are specified. 
24909
24910 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24911
24912         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24913         information about indexer_declarator.
24914         (indexer_declarator): Implement actions.
24915         (parsing_indexer): New local boolean used to keep track of whether
24916         we are parsing indexers or properties. This is necessary because 
24917         implicit_parameters come into picture even for the get accessor in the 
24918         case of an indexer.
24919         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24920
24921         * class.cs (Indexer): New class for indexer declarations.
24922         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24923         (TypeContainer::indexers): New member to hold list of indexers for the
24924         type.
24925
24926 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24927
24928         * cs-parser.jay (add_accessor_declaration): Implement action.
24929         (remove_accessor_declaration): Implement action.
24930         (event_accessors_declaration): Implement
24931         (variable_declarators): swap statements for first rule - trivial.
24932
24933         * class.cs (Event): New class to hold information about event
24934         declarations.
24935         (TypeContainer::AddEvent): New method to add an event to a type
24936         (TypeContainer::events): New member to hold list of events.
24937
24938         * cs-parser.jay (event_declaration): Implement actions.
24939
24940 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24941
24942         * cs-parser.jay (dim_separators): Implement. Make it a string
24943         concatenating all the commas together, just as they appear.
24944         (opt_dim_separators): Modify accordingly
24945         (rank_specifiers): Update accordingly. Basically do the same
24946         thing - instead, collect the brackets here.
24947         (opt_rank_sepcifiers): Modify accordingly.
24948         (array_type): Modify to actually return the complete type string
24949         instead of ignoring the rank_specifiers.
24950         (expression_list): Implement to collect the expressions
24951         (variable_initializer): Implement. We make it a list of expressions
24952         essentially so that we can handle the array_initializer case neatly too.
24953         (variable_initializer_list): Implement.
24954         (array_initializer): Make it a list of variable_initializers
24955         (opt_array_initializer): Modify accordingly.
24956
24957         * expression.cs (New::NType): Add enumeration to help us
24958         keep track of whether we have an object/delegate creation
24959         or an array creation.
24960         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24961         members to hold data about array creation.
24962         (New:New): Modify to update NewType
24963         (New:New): New Overloaded contructor for the array creation
24964         case.
24965
24966         * cs-parser.jay (array_creation_expression): Implement to call
24967         the overloaded New constructor.
24968
24969 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24970
24971         * class.cs (TypeContainer::Constructors): Return member
24972         constructors instead of returning null.
24973
24974 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24975
24976         * typemanager.cs (InitCoreTypes): Initialize the various core
24977         types after we have populated the type manager with the user
24978         defined types (this distinction will be important later while
24979         compiling corlib.dll)
24980
24981         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24982         on Expression Classification.  Now all expressions have a method
24983         `Resolve' and a method `Emit'.
24984
24985         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24986         generation from working.     Also add some temporary debugging
24987         code. 
24988
24989 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24990
24991         * codegen.cs: Lots of code generation pieces.  This is only the
24992         beginning, will continue tomorrow with more touches of polish.  We
24993         handle the fundamentals of if, while, do, for, return.  Others are
24994         trickier and I need to start working on invocations soon.
24995
24996         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24997         s.InitStatement. 
24998
24999         * codegen.cs (EmitContext): New struct, used during code
25000         emission to keep a context.   Most of the code generation will be
25001         here. 
25002
25003         * cs-parser.jay: Add embedded blocks to the list of statements of
25004         this block.  So code generation proceeds in a top down fashion.
25005
25006 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25007
25008         * statement.cs: Add support for multiple child blocks.
25009
25010 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25011
25012         * codegen.cs (EmitCode): New function, will emit the code for a
25013         Block of code given a TypeContainer and its ILGenerator. 
25014
25015         * statement.cs (Block): Standard public readonly optimization.
25016         (Block::Block constructors): Link children. 
25017         (Block::Child): Child Linker.
25018         (Block::EmitVariables): Emits IL variable declarations.
25019
25020         * class.cs: Drop support for MethodGroups here, delay until
25021         Semantic Analysis.
25022         (Method::): Applied the same simplification that I did before, and
25023         move from Properties to public readonly fields.
25024         (Method::ParameterTypes): Returns the parameter types for the
25025         function, and implements a cache that will be useful later when I
25026         do error checking and the semantic analysis on the methods is
25027         performed.
25028         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25029         and made a method, optional argument tells whether this is a class
25030         or a structure to apply the `has-this' bit.
25031         (Method::GetCallingConvention): Implement, returns the calling
25032         convention. 
25033         (Method::Define): Defines the type, a second pass is performed
25034         later to populate the methods.
25035
25036         (Constructor::ParameterTypes): implement a cache similar to the
25037         one on Method::ParameterTypes, useful later when we do semantic
25038         analysis. 
25039
25040         (TypeContainer::EmitMethod):  New method.  Emits methods.
25041
25042         * expression.cs: Removed MethodGroup class from here.
25043
25044         * parameter.cs (Parameters::GetCallingConvention): new method.
25045
25046 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25047
25048         * class.cs (TypeContainer::Populate): Drop RootContext from the
25049         argument. 
25050
25051         (Constructor::CallingConvention): Returns the calling convention.
25052         (Constructor::ParameterTypes): Returns the constructor parameter
25053         types. 
25054
25055         (TypeContainer::AddConstructor): Keep track of default constructor
25056         and the default static constructor.
25057
25058         (Constructor::) Another class that starts using `public readonly'
25059         instead of properties. 
25060
25061         (Constructor::IsDefault): Whether this is a default constructor. 
25062
25063         (Field::) use readonly public fields instead of properties also.
25064
25065         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25066         track of static constructors;  If none is used, turn on
25067         BeforeFieldInit in the TypeAttributes. 
25068
25069         * cs-parser.jay (opt_argument_list): now the return can be null
25070         for the cases where there are no arguments. 
25071
25072         (constructor_declarator): If there is no implicit `base' or
25073         `this', then invoke the default parent constructor. 
25074
25075         * modifiers.cs (MethodAttr): New static function maps a set of
25076         modifiers flags into a MethodAttributes enum
25077         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25078         MethodAttr, TypeAttr to represent the various mappings where the
25079         modifiers are used.
25080         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25081
25082 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25083
25084         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25085         method arguments.
25086
25087         * interface.cs (PopulateIndexer): Implemented the code generator
25088         for interface indexers.
25089
25090 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25091
25092         * interface.cs (InterfaceMemberBase): Now we track the new status
25093         here.  
25094
25095         (PopulateProperty): Implement property population.  Woohoo!  Got
25096         Methods and Properties going today. 
25097
25098         Removed all the properties for interfaces, and replaced them with
25099         `public readonly' fields. 
25100
25101 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25102
25103         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25104         initialize their hashtables/arraylists only when they are needed
25105         instead of doing this always.
25106
25107         * parameter.cs: Handle refs and out parameters.
25108
25109         * cs-parser.jay: Use an ArrayList to construct the arguments
25110         instead of the ParameterCollection, and then cast that to a
25111         Parameter[] array.
25112
25113         * parameter.cs: Drop the use of ParameterCollection and use
25114         instead arrays of Parameters.
25115
25116         (GetParameterInfo): Use the Type, not the Name when resolving
25117         types. 
25118
25119 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25120
25121         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25122         and instead use public readonly fields.
25123
25124         * class.cs: Put back walking code for type containers.
25125
25126 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25127
25128         * class.cs (MakeConstant): Code to define constants.
25129
25130         * rootcontext.cs (LookupType): New function.  Used to locate types 
25131
25132
25133 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25134
25135         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25136         this System.Reflection code is.  Kudos to Microsoft
25137
25138         * typemanager.cs: Implement a type cache and avoid loading all
25139         types at boot time.  Wrap in LookupType the internals.  This made
25140         the compiler so much faster.  Wow.  I rule!
25141
25142         * driver.cs: Make sure we always load mscorlib first (for
25143         debugging purposes, nothing really important).
25144
25145         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25146         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25147
25148         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25149         on namespaces that have been imported using the `using' keyword.
25150
25151         * class.cs (TypeContainer::TypeAttr): Virtualize.
25152         (Class::TypeAttr): Return attributes suitable for this bad boy.
25153         (Struct::TypeAttr): ditto.
25154         Handle nested classes.
25155         (TypeContainer::) Remove all the type visiting code, it is now
25156         replaced with the rootcontext.cs code
25157
25158         * rootcontext.cs (GetClassBases): Added support for structs. 
25159
25160 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25161
25162         * interface.cs, statement.cs, class.cs, parameter.cs,
25163         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25164         Drop use of TypeRefs, and use strings instead.
25165
25166 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25167
25168         * rootcontext.cs: 
25169
25170         * class.cs (Struct::Struct): set the SEALED flags after
25171         checking the modifiers.
25172         (TypeContainer::TypeAttr): new property, returns the
25173         TypeAttributes for a class.  
25174
25175         * cs-parser.jay (type_list): Oops, list production was creating a
25176         new list of base types.
25177
25178         * rootcontext.cs (StdLib): New property.
25179         (GetInterfaceTypeByName): returns an interface by type name, and
25180         encapsulates error handling here.
25181         (GetInterfaces): simplified.
25182         (ResolveTree): Encapsulated all the tree resolution here.
25183         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25184         types. 
25185
25186         * driver.cs: Add support for --nostdlib, to avoid loading the
25187         default assemblies.
25188         (Main): Do not put tree resolution here. 
25189
25190         * rootcontext.cs: Beginning of the class resolution.
25191
25192 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25193
25194         * rootcontext.cs: Provide better error reporting. 
25195
25196         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25197
25198         * rootcontext.cs (CreateInterface): Handle the case where there
25199         are no parent interfaces.
25200
25201         (CloseTypes): Routine to flush types at the end.
25202         (CreateInterface): Track types.
25203         (GetInterfaces): Returns an array of Types from the list of
25204         defined interfaces.
25205
25206         * typemanager.c (AddUserType): Mechanism to track user types (puts
25207         the type on the global type hash, and allows us to close it at the
25208         end). 
25209
25210 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25211
25212         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25213         RecordInterface instead.
25214
25215         * cs-parser.jay: Updated to reflect changes above.
25216
25217         * decl.cs (Definition): Keep track of the TypeBuilder type that
25218         represents this type here.  Not sure we will use it in the long
25219         run, but wont hurt for now.
25220
25221         * driver.cs: Smaller changes to accomodate the new code.
25222
25223         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25224         when done. 
25225
25226         * rootcontext.cs (CreateInterface):  New method, used to create
25227         the System.TypeBuilder type for interfaces.
25228         (ResolveInterfaces): new entry point to resolve the interface
25229         hierarchy. 
25230         (CodeGen): Property, used to keep track of the code generator.
25231
25232 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25233
25234         * cs-parser.jay: Add a second production for delegate_declaration
25235         with `VOID'.
25236
25237         (enum_body): Put an opt_comma here instead of putting it on
25238         enum_body or enum_member_declarations so we can handle trailing
25239         commas on enumeration members.  Gets rid of a shift/reduce.
25240
25241         (type_list): Need a COMMA in the middle.
25242
25243         (indexer_declaration): Tell tokenizer to recognize get/set
25244
25245         * Remove old targets.
25246
25247         * Re-add the parser target.
25248
25249 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25250
25251         * cs-parser.jay: Add precendence rules for a number of operators
25252         ot reduce the number of shift/reduce conflicts in the grammar.
25253
25254 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25255
25256         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25257         and put it here.
25258
25259         Get rid of old crufty code.
25260
25261         * rootcontext.cs: Use this to keep track of the parsed
25262         representation and the defined types available to the program. 
25263
25264         * gen-treedump.cs: adjust for new convention.
25265
25266         * type.cs: Split out the type manager, and the assembly builder
25267         from here. 
25268
25269         * typemanager.cs: the type manager will live here now.
25270
25271         * cil-codegen.cs: And the code generator here. 
25272
25273 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25274
25275         * makefile: Fixed up for easy making.
25276
25277 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25278
25279         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25280         the 
25281
25282         (unary_expression): Expand pre_increment_expression and
25283         post_decrement_expression to reduce a shift/reduce.
25284
25285 2001-07-11  Simon Cozens
25286
25287         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25288
25289         Improve allow_keyword_as_indent name.
25290
25291 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25292
25293         * Adjustments for Beta2. 
25294
25295 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25296
25297         * decl.cs: Added `Define' abstract method.
25298         (InTransit): new property, used to catch recursive definitions. 
25299
25300         * interface.cs: Implement `Define'. 
25301
25302         * modifiers.cs: Map Modifiers.constants to
25303         System.Reflection.TypeAttribute flags.
25304
25305         * class.cs: Keep track of types and user-defined types.
25306         (BuilderInit): New method for creating an assembly
25307         (ResolveType): New function to launch the resolution process, only
25308         used by interfaces for now.
25309
25310         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25311         that are inserted into the name space. 
25312
25313 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25314
25315         * ARGH.  I have screwed up my tree so many times due to the use of
25316         rsync rather than using CVS.  Going to fix this at once. 
25317
25318         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25319         load types.
25320
25321 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25322
25323         * Experiment successful: Use System.Type rather that our own
25324         version of Type.  
25325
25326 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25327
25328         * cs-parser.jay: Removed nsAliases from here.
25329
25330         Use new namespaces, handle `using XXX;' 
25331
25332         * namespace.cs: Reimplemented namespace handling, use a recursive
25333         definition of the class.  Now we can keep track of using clauses
25334         and catch invalid using clauses.
25335
25336 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25337
25338         * gen-treedump.cs: Adapted for all the renaming.
25339
25340         * expression.cs (Expression): this class now has a Type property
25341         which returns an expression Type.
25342
25343         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25344         `Type', as this has a different meaning now in the base
25345
25346 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25347
25348         * interface.cs, class.cs: Removed from all the sources the
25349         references to signature computation, as we can not do method
25350         signature computation during the parsing time, as we are not
25351         trying to solve at that point distinguishing:
25352
25353         class X {
25354                 void a (Blah x) {}
25355                 void a (NS.Blah x) {}
25356         }
25357
25358         Which depending on the context might be valid or not, as we do not
25359         know if Blah is the same thing as NS.Blah at that point.
25360
25361         * Redid everything so the code uses TypeRefs now instead of
25362         Types.  TypeRefs are just temporary type placeholders, that need
25363         to be resolved.  They initially have a pointer to a string and the
25364         current scope in which they are used.  This is used later by the
25365         compiler to resolve the reference to an actual Type. 
25366
25367         * DeclSpace is no longer a CIR.Type, and neither are
25368         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25369         are all DeclSpaces, but no Types. 
25370
25371         * type.cs (TypeRefManager): This implements the TypeRef manager,
25372         which keeps track of all the types that need to be resolved after
25373         the parsing has finished. 
25374
25375 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25376
25377         * ARGH.  We are going to have to store `foreach' as a class rather
25378         than resolving it, as we need to verify error 1579 after name
25379         resolution.   *OR* we could keep a flag that says `This request to
25380         IEnumerator comes from a foreach statement' which we can then use
25381         to generate the error.
25382
25383 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25384
25385         * class.cs (TypeContainer.AddMethod): we now add methods to the
25386         MethodGroup instead of the method hashtable.  
25387
25388         * expression.cs: Add MethodGroup abstraction, which gets us one
25389         step closer to the specification in the way we handle method
25390         declarations.  
25391
25392         * cs-parser.jay (primary_expression): qualified_identifier now
25393         tried to match up an identifier to a local variable reference or
25394         to a parameter reference.
25395
25396         current_local_parameters is now a parser global variable that
25397         points to the current parameters for the block, used during name
25398         lookup.
25399
25400         (property_declaration): Now creates an implicit `value' argument to
25401         the set accessor.
25402
25403 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25404
25405         * parameter.cs: Do not use `param' arguments as part of the
25406         signature, per the spec.
25407
25408 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25409
25410         * decl.cs: Base class for classes, structs and interfaces.  This
25411         is the "Declaration Space" 
25412
25413         * cs-parser.jay: Use CheckDef for checking declaration errors
25414         instead of having one on each function.
25415
25416         * class.cs: Factor out some code for handling error handling in
25417         accordance to the "Declarations" section in the "Basic Concepts"
25418         chapter in the ECMA C# spec.
25419
25420         * interface.cs: Make all interface member classes derive from
25421         InterfaceMemberBase.
25422
25423 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25424
25425         * Many things: all interfaces are parsed and generated in
25426         gen-treedump.  Support for member variables, constructors,
25427         destructors, properties, constants is there.
25428
25429         Beginning of the IL backend, but very little done, just there for
25430         testing purposes. 
25431
25432 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25433
25434         * cs-parser.jay: Fix labeled statement.
25435
25436         * cs-tokenizer.cs (escape): Escape " and ' always.
25437         ref_line, ref_name: keep track of the line/filename as instructed
25438         by #line by the compiler.
25439         Parse #line.
25440
25441 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25442
25443         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25444         to match the values in System.CodeDOM.
25445
25446         Divid renamed to Divide.
25447
25448         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25449         statements. 
25450         (Statements.set): remove.
25451
25452         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25453         statements. 
25454
25455         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25456         falseStatements always have valid values. 
25457
25458         * cs-parser.jay: Use System.CodeDOM now.
25459