2006-04-08 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2
3         A fix for #76744.
4         ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5         only not visible.
6
7 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8
9         A fix for #77916.
10         expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
11         array.
12
13 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
14
15         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
16         attribute is present and Guid not.
17         (Interface.ApplyAttributeBuilder): Ditto.
18
19         * attribute.cs: Add error message.
20
21 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
22
23         A fix for #78020.
24
25         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
26         sources (it's composite) so hold them in extra array as they are used in
27         Emit phase only. It worked in the previous versions by mistake.
28         (Attribute.Emit): Emit attribute for more owners when exist.
29
30         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
31         it has now different behaviour.
32
33 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
34
35         * constant.cs (Constant.IsDefaultInitializer): New method.
36
37         * class.cs: Updated.
38
39         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
40         re-initialize default values. It saves KBs almost for every assembly.
41         Thanks Zoltan for the idea.
42         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
43         (ArrayCreation.DoResolve): Resolve only once.
44         (ArrayCreation.Emit): Emit static initializer only when it is faster.
45         (ArrayCreation.GetAttributableValue): Cope with optimized values.
46
47 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
48
49         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
50         From #77961.
51
52 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
53
54         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
55         in an embedded statement too.
56
57 2006-04-01  Raja R Harinath  <rharinath@novell.com>
58
59         Fix #77929
60         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
61         testing.
62
63         Fix #77958
64         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
65
66         Fix #77962
67         * report.cs (SymbolRelatedToPreviousError): Drop generic type
68         arguments before checking whether a type is reflected or not.
69
70         Fix #77954
71         * expression.cs (Invocation.IsApplicable): Ensure a generic method
72         definition doesn't take part in overload resolution.
73         (Invocation.IsParamsMethodApplicable): Likewise.
74         (Invocation.OverloadResolve): When replacing a reflected override
75         method with its base definition, ensure that type arguments are
76         applied.
77
78 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
79
80         A fix for #77966.
81
82         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
83         was not specified.
84
85         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
86
87 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
88
89         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
90         phase.
91
92         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
93         LocalTemporary change.
94
95         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
96         TypeContainer.
97         (ClassOrStruct.DefineFieldInitializers): Implemented static field
98         initializers optimization.
99         (ClassOrStruct.TypeAttr): Moved from modifiers.
100         (Constructor.CheckBase): Don't crash when static ctor has parameters.
101         (FieldBase.ResolveInitializer): Resolves initializer.
102         (FieldBase.HasDefaultInitializer): New property.
103
104         * cs-parser.jay: Removed message.
105
106         * expression.cs (CompilerGeneratedThis): New specialization.
107
108         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
109
110 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
111
112         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
113
114 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
115
116         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
117         be now EnumConstants only.
118
119 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
120
121         * attribute.cs, driver.cs: Reset more caches.
122
123 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
124
125         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
126
127 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
128
129         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
130         for easier reuse. Updated all overrides.
131         (IntegralConstant): New base class for all integral constants.
132         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
133         of the constant range, report custom error.
134         (UIntConstant.Reduce): Fixed uint conversion.
135
136         * ecore.cs, literal.cs: Reduce updates.
137
138 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
139
140         A fix for #75813.
141
142         * class.cs (Constructor.Define): Removed extra if for default ctors.
143         A patch from Atsushi Enomoto.
144
145 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
146
147         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
148         GetAttributableValue.
149
150         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
151         when required.
152
153         * convert.cs (ImplicitConversionRequired): Error message moved to
154         DoubleLiteral.
155
156         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
157         automatic implicit conversion of an output value.
158         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
159
160         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
161         conversion.
162         (TypeOf.GetAttributableValue): Add extra handling for object type.
163
164         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
165         special error message.
166
167 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
168
169         * class.cs (Constructor.Emit): Don't crash when struct ctor is
170         InternalCall.
171         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
172         compatible with MS runtime.
173
174 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
175
176         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
177         attribute arguments here.
178
179         * class.cs (Indexer.Define): The check was moved to attribute class.
180
181 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
182
183         * expression.cs (StringConcat.Append): Reverted back to no warning state.
184
185 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
186
187         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
188
189         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
190         the blocks too.
191
192 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
193
194         * doc-bootstrap.cs : fix build.
195
196 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
197
198         * expression.cs (StringConcat.Append): Issue a warning when empty string
199         is going to append.
200
201 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
202
203         * assign.cs (CompoundAssign.ResolveSource): Removed.
204
205         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
206         clean up.
207
208         * class.cs (TypeContainer.FindMethods): Removed.
209         (TypeContainer.CheckMemberUsage): Made static.
210
211         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
212
213         * constant.cs (CheckRange): Removed unused type argument.
214         (CheckUnsigned): Removed unused type argument.
215
216         * cs-parser.jay: Updated after MemberAccess clean up.
217         Uses Length for empty string test.
218
219         * cs-tokenizer.cs: Uses Length for empty string test.
220         (IsCastToken): Made static.
221         (is_hex): Made static.
222         (real_type_suffix): Made static.
223
224         * decl.cs (SetupCache): Made static.
225         (OnGenerateDocComment): Removed unused ds argument.
226
227         * delegate.cs (VerifyDelegate): Removed unused argument.
228
229         * doc.cs: Uses Length for empty string test.
230
231         * driver.cs: Uses Length for empty string test.
232
233         * enum.cs (IsValidEnumType): Made static
234
235         * expression.cs (EnumLiftUp): Removed unused argument.
236         (ResolveMethodGroup): Ditto.
237         (BetterConversion): Ditto.
238         (GetVarargsTypes): Ditto.
239         (UpdateIndices): Ditto.
240         (ValidateInitializers): Ditto.
241         (MemberAccess.ctor): Ditto.
242         (GetIndexersForType): Ditto.
243
244         * flowanalysis.cs: (MergeFinally): Removed unused argument.
245
246         * iterators.cs: Updated after MemberAccess clean up.
247
248         * location.cs: Uses Length for empty string test.
249
250         * namespace.cs: Uses Length for empty string test.
251
252          * report.cs (CheckWarningCode): Made static.
253
254         * statement.cs (LabeledStatement): Removed unused argument.
255
256         * typemanager.cs (FilterNone): Removed.
257
258 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
259
260         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
261         obsolete.
262
263         * class.cs: Updated.
264
265 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
266
267         * cs-parser.jay.cs: __arglist is not allowed for delegates.
268
269 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
270
271         A fix for #77816.
272
273         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
274         host container.
275         (AnonymousMethod.ImplicitStandardConversionExists): New method.
276         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
277         Add more error reporting; Fixed issue with params.
278
279         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
280
281         * cs-parser.jay: AnonymousMethod requires host container.
282
283         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
284
285 2006-03-18  Raja R Harinath  <harinath@gmail.com>
286
287         * class.cs: Change 'TypeContainer ds' constructor argument to
288         'DeclSpace parent'.  Some classes were missed below due to
289         different naming convention.
290
291         * class.cs (MemberCore.Parent): Delete.  This makes the
292         ParentContainer changes below enforceable by the compiler.
293
294         Treat pointers to enclosing declaration space as 'DeclSpace', not
295         'TypeContainer'.
296         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
297         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
298
299         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
300         of TypeContainer.
301         (Block.AddThisVariable): Likewise.
302         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
303         (AbstractPropertyEventMethod.Emit): Likewise.
304         (AbstractPropertyEventMethod.EmitMethod): Likewise.
305         (GetMethod.Define, SetMethod.Define): Likewise.
306         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
307         (DelegateMethod.EmitMethod): Likewise.
308
309         Fix regression test-partial-13.cs.
310         Rationalize use of PartialContainer.  Ensure that the partial
311         class semantics can be tied to type-correctness, i.e., any
312         violation will cause a compile error.
313         * class.cs, const.cs: Access all fields that belong to class
314         TypeContainer via ParentContainer.  Arguments of EmitContexts and
315         Resolve()-like functions still use 'Parent'.
316
317         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
318         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
319         (PropertyMethod.CheckModifiers): Remove unused argument.
320         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
321         DeclSpace.
322
323 2006-03-28  Raja R Harinath  <rharinath@novell.com>
324
325         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
326
327 2006-03-17  Raja R Harinath  <harinath@gmail.com>
328
329         Make semantics of PartialContainer simpler.
330         * decl.cs (DeclSpace.IsPartial): Remove.
331         * class.cs (TypeContainer.IsPartial): Likewise.
332         (TypeContainer..ctor): Set PartialContainer to point to self.
333         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
334         (TypeContainer.FindNestedType): Likewise.
335         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
336
337 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
338
339         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
340
341 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
342
343         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
344         classes.
345
346 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
347
348         * class.cs (Operator.Define): An error for base conversion was not
349         reported correctly.
350
351 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
352
353         A fix for #77593, #77574.
354
355         * class.cs (MethodCore.CheckBase): Another if for operator.
356
357 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
358
359         A fix for #77822.
360
361         * expression.cs (VerifyArgumentsCompat): Reverted to double error
362         reporting, it's more tricky than I thought.
363
364 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
365
366         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
367         were not resolved
368
369         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
370         (DelegateCreation.ImplicitStandardConversionExists): New method for just
371         conversion test.
372         
373         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
374         not needed.
375
376 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
377
378         A fix for #77353.
379
380         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
381         (Event.Define): ditto
382         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
383
384         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
385         Removed redundant code and set NewSlot for Invoke method too.
386
387         * parameter.cs (Parameters.ctor): Add custom, type ctor.
388         (Parameters.MergeGenerated): New method. Use this method when you merge
389         compiler generated argument with user arguments.
390
391 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
392
393         * attribute.cs (ResolveAsTypeTerminal): Removed.
394
395         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
396         specialization for predefined types; 30% speed up.
397         Finally placed obsolete check to right place.
398         (Expression.ResolveType): Removed.
399
400         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
401         Updated after ResolveType was removed.
402
403         * expression.cs (Cast.ctor): Check void cast.
404         (Binary.ResolveAsTypeTerminal): Is never type.
405         (Conditional.ResolveAsTypeTerminal): Is never type.
406
407         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
408
409 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
410
411         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
412
413 2006-03-23  Martin Baulig  <martin@ximian.com>
414
415         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
416         type check if either of the types is an open generic type.
417
418 2006-03-23  Martin Baulig  <martin@ximian.com>
419
420         * convert.cs
421         (Convert.ExplicitTypeParameterConversion): New method; implement
422         explicit type parameter conversions.
423
424 2006-03-23  Martin Baulig  <martin@ximian.com>
425
426         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
427         blindly allow all conversions if we do not have any constraints.
428
429 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
430
431         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
432         these two separated members to simplify the code.
433         (Attribute.Resolve): Refactored to use new fields and methods.
434         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
435         implemented obsolete attribute checking.
436         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
437         implemented obsolete checking again. It look line never ending quest ;-)
438         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
439
440         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
441
442         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
443
444         *class.cs (Property.Define): Add RegisterProperty call.
445
446         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
447         argument groups (only 2).
448
449         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
450         encoding expression to arguments.
451         (Expression.ExprClassToResolveFlags): Just turned to property.
452
453         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
454         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
455         optimized as well as implemented support for zero-length attributes.
456
457         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
458         Add caching of PropertyInfo's.
459
460 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
461
462         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
463         error multiple times.
464
465 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
466
467         New partial class implementation.
468         A fix for #77027, #77029, #77403
469
470         * attribute.cs (Attributable): Made attributes protected.
471
472         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
473         the replacements of ClassPart and PartialContainer.
474         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
475         (TypeContainer.AddInterface): Ditto.
476         (TypeContainer.AddPartial): The main method for partial classes. It checks
477         for errors and merges ModFlags and attributes. At the end class is added to
478         partial_parts list.
479         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
480         required here.
481         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
482         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
483         from the rest of partial classes.
484         (TypeContainer.GetClassBases): Simplified.
485         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
486         DefineType.
487         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
488         (TypeContainer.HasExplicitLayout): Uses Flags now.
489         (PartialContainer): Removed.
490         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
491         (StaticClass): Was merged with Class.
492         (Class.GetClassBases): class and static class bases are verified here.
493         (Class.TypeAttr): Added static attributes when class is static.
494         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
495         (MemberBase): In some cases we need to call parent container for partial
496         class. It should be eliminated but it's not easy now.
497
498         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
499
500         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
501         partial classed to accumulate class comments.
502         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
503
504         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
505
506         * driver.cs (MainDriver): Tree.GetDecl was removed.
507
508         * modifiers.cs (Modifiers): Add partial modifier.
509
510         * tree.cs (Tree.decl): Removed.
511         (RootTypes): Started to use this class more often for root types
512         specializations.
513
514 2006-03-23  Raja R Harinath  <rharinath@novell.com>
515
516         * generic.cs (TypeParameter.UpdateConstraints): Update
517         'constraints' if null.
518
519 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
520
521         A fix for #77615
522
523         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
524         external interface does not have an attribute.
525
526 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
527
528         Another prerequisites for new partial classs implementation.
529         
530         * attribute.cs (Attribute.Equal): Implemented.
531         (Attribute.Emit): Changed as attributes can be applied more than twice.
532         (Attributes.Emit): Check for duplicate attributes here.
533
534         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
535         as a parameter, clean-up.
536
537 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
538
539         A fix for #77485
540
541         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
542         contains obsolete attribute check which can in some cases look for base
543         type of current class which is not initialized yet.
544         (TypeContainer.BaseType): Replacement of ptype.
545
546         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
547
548 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
549
550         First of prerequisites for new partial classs implemention.
551         
552         * attribute.cs (Attributable): Extended by ResolveContext;
553         Attributes finally have correct context for resolving in all cases.
554         (AttachTo): Attribute owner is assigned here.
555
556         * codegen.cs (IResolveContext): Introduce new interface to hold
557         all information needed in resolving phase.
558         (EmitContext): Implements IResolveContext; more clean-up needed here.
559         
560         * decl.cs (MemberCore): Implemented IResolveContext.
561
562         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
563         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
564         parameter.cs, statement.cs, tree.cs, typemanager.cs:
565         Refactored to use new IResolveContext instead of EmitContext; cleanup
566
567 2006-03-22  Raja R Harinath  <rharinath@novell.com>
568
569         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
570         mcs to keep code differences small.
571         * attribute.cs (Attribute.GetParameterDefaultValue): New.
572         * typemanager.cs (parameter_default_value_attribute_type): New.
573         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
574         CS1908 check.
575
576 2006-03-22  Martin Baulig  <martin@ximian.com>
577
578         * generic.cs
579         (Nullable.NullableLiteral): Derive from `NullLiteral'.
580
581         * convert.cs
582         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
583         instead of the normal `NullLiteral'.
584
585 2006-03-21  Martin Baulig  <martin@ximian.com>
586
587         Fix #77583.
588         * generic.cs (TypeManager.InferType): If `pt' is a generic
589         parameter, don't check whether `pt == at'.
590
591 2006-03-20  Raja R Harinath  <rharinath@novell.com>
592
593         Fix #77852
594         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
595         (TypeParameter.Resolve): Update to change.
596         (ConstraintChecker.CheckConstraints): Resolve type-argument
597         constraints before use.
598
599 2006-03-16  Martin Baulig  <martin@ximian.com>
600
601         * generic.cs
602         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
603         and don't have any instance constructors, also lookup in the base class.
604         (TypeManager.IsNullableValueType): New public method.
605
606         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
607         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
608         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
609
610         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
611         instead of just TypeManager.IsNullableType() to determine whether
612         a lifted operator exists.
613         (UnaryMutator.DoResolve): Likewise.
614         (Conditional.DoResolve): Likewise.
615         (Binary.DoResolve): A lifted operator only exists if both operands
616         are valuetypes and at least one of them is a nullable type.
617
618 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
619
620         * iterator.cs : yield break is allowed in try statement which has
621           catch clauses. Fixed bug #77767.
622
623 2006-03-12  Martin Baulig  <martin@ximian.com>
624
625         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
626         private IsSignatureEqual() to compare types; see the comment in
627         that method; fixes #77674.
628
629 2006-03-10  Raja R Harinath  <rharinath@novell.com>
630
631         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
632         (Expression.ResolveAsTypeTerminal): Likewise.
633         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
634         * expression.cs, generic.cs, iterators.cs: Likewise.
635         * parameter.cs, statement.cs, typemanager.cs: Likewise.
636
637 2006-03-09  Martin Baulig  <martin@ximian.com>
638
639         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
640         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
641
642 2006-03-09  Martin Baulig  <martin@ximian.com>
643
644         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
645         `prepared' flag is set.
646
647         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
648         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
649         issues; see gtest-254.cs.
650
651 2006-03-07  Martin Baulig  <martin@ximian.com>
652
653         * generic.cs (TypeManager.InferType): Allow infering
654         `IEnumerable<T>' with an array of T; see gtest-251.cs.
655
656 2006-03-06  Martin Baulig  <martin@ximian.com>
657
658         * generic.cs
659         (TypeManager.InferType): Fix gtest-250.cs.
660
661         * typemanager.cs
662         (TypeManager.IsSubclassOf): Also check the base class.
663
664         * expression.cs
665         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
666         fixes gtest-249.cs.
667
668 2006-03-01  Raja R Harinath  <rharinath@novell.com>
669
670         Fix #77679.
671         * expression.cs (ParameterReference.DoResolveBase): Change return
672         type to bool.
673         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
674         Update.
675
676         Fix #77628.
677         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
678
679         Fix #77642.
680         * typemanager.cs (GetFullNameSignature): Don't nullref on
681         protected accessors.
682
683 2006-02-16  Martin Baulig  <martin@ximian.com>
684
685         * generic.cs
686         (TypeManager.GetGenericFieldDefinition): New public method; use it
687         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
688
689 2006-02-14  Martin Baulig  <martin@ximian.com>
690
691         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
692
693 2006-02-14  Martin Baulig  <martin@ximian.com>
694
695         * generic.cs
696         (TypeManager.DropGenericMethodArguments): New public method; don't
697         use GetGenericMethodDefinition() on something which is not a
698         generic method.
699
700 2006-02-14  Martin Baulig  <martin@ximian.com>
701
702         * generic.cs
703         (ConstraintChecker.CheckConstraints): If a type parameter has the
704         `struct' constraint, the type must be a non-nullable valuetype.
705
706 2006-02-10  Martin Baulig  <martin@ximian.com>
707
708         * typemanager.cs
709         (TypeManager.IsOverride): Make this work for instantiated methods
710         in a generic class; fixes #77509.
711         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
712         rather than calling it directly; fixes #77488.  
713
714 2006-02-08  Martin Baulig  <martin@ximian.com>
715
716         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
717         reporting into CheckConstraint() so we can use the correctly
718         instantiated type.
719
720 2006-02-08  Martin Baulig  <martin@ximian.com>
721
722         * expression.cs (BaseAccess): Add support for generic methods.
723
724         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
725         the new MethodGroupExpr.
726
727 2006-02-07  Martin Baulig  <martin@ximian.com>
728
729         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
730         also reference types; fixes #77483.
731
732 2006-02-07  Martin Baulig  <martin@ximian.com>
733
734         * generic.cs
735         (TypeManager.IsGenericMethod): We now return whether something is
736         an instantiated generic method (and not a generic method def).
737         (TypeManager.IsGenericMethodDefinition): New public method.
738
739         * typemanager.cs
740         (TypeManager.CSharpSignature): Only include type arguments for
741         "real" generic methods, not for any instantiated method.
742         (TypeManager.GetMethodName): Likewise, but also allow generic
743         method definitions here.
744
745 2006-02-06  Miguel de Icaza  <miguel@novell.com>
746
747         * codegen.cs (EmitScopeInitFromBlock): check here the
748         capture_context, there is no need to make two calls to the
749         EmitContext. 
750
751         * anonymous.cs: Add some debugging messages that might help me
752         track other instances of this problem in the future (the
753         regression of test 467).
754
755         * cs-parser.jay: track the variable block, as we need to initalize
756         any captured variables declared in this block for the "catch"
757         portion of the "Try" statement.
758
759         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
760         scope initialization for captured variables. 
761
762         Also, move the emit for the variables after the block location has
763         been marked.
764
765 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
766
767        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
768         
769 2006-02-06  Martin Baulig  <martin@ximian.com>
770
771         * class.cs (TypeContainer.DefineType): If we're a struct, pass
772         `TypeManager.value_type' as parent type to
773         ModuleBuilder.DefineType().  Fixes #77358.      
774
775 2006-02-02  Miguel de Icaza  <miguel@novell.com>
776
777         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
778         commit yesterday, the initialization for the roots is necessary.
779         What is not necessary is the scope activation.
780
781 2006-02-02  Raja R Harinath  <rharinath@novell.com>
782
783         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
784         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
785         CS0206 checks.
786         (Argument.Resolve): Remove CS0206 checks.
787
788 2006-02-01  Miguel de Icaza  <miguel@novell.com>
789
790         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
791         scopes for all the roots, the scopes will now be emitted when the
792         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
793
794         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
795         code.  This reduces a lot of existing cruft.
796         
797         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
798         that the ScopeInfo is generated as we enter the scope, not at the
799         time of use, which is what we used to do before.
800
801         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
802         every time a Block is about to be emitted if we have a
803         CaptureContext. 
804
805 2006-02-01  Raja R Harinath  <rharinath@novell.com>
806
807         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
808         attribute for mscorlib too.
809
810         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
811         (Reset): Update.
812         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
813
814         * typemanager.cs (cons_param_array_attribute): Make private.
815         (Reset): Set it to null.
816         (InitCoreHelpers): Don't initialize it.
817         (ConsParamArrayAttribute): New.  Initialize it as needed.
818         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
819
820 2006-01-31  Miguel de Icaza  <miguel@novell.com>
821
822         * expression.cs: There might be errors reported during the
823         selection of applicable methods.  If there are errors, do not
824         continue execution as it will lead the compiler to crash.
825
826 2006-01-30  Miguel de Icaza  <miguel@novell.com>
827
828         * expression.cs: Member access is not allowed on anonymous
829         methods.  Fixes #77402.
830
831 2006-01-30  Raja R Harinath  <rharinath@novell.com>
832
833         Fix #77401
834         * cs-parser.jay (VariableDeclaration): Don't set
835         current_array_type to null.
836         (field_declaration, event_declaration, declaration_statement):
837         Set it to null here.
838
839 2006-01-29  Raja R Harinath  <harinath@gmail.com>
840
841         Fix part of #77397
842         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
843
844 2006-01-28  Raja R Harinath  <harinath@gmail.com>
845
846         * typemanager.cs (GenericParameterPosition): New.
847         * doc.cs: Use it.
848
849 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
850
851         * doc.cs : To process "include" elements, first we should create
852           another list than XmlNodeList, because it could result in node
853           removal, which could result in that the XmlNodeList gives up
854           yielding next node.
855
856 2006-01-25  Miguel de Icaza  <miguel@novell.com>
857
858         * expression.cs: Introduce an error report that we were not
859         catching before.   Gonzalo ran into it.
860
861 2006-01-23  Miguel de Icaza  <miguel@novell.com>
862
863         A fix for bug: #76957
864         
865         * iterators.cs (MoveNextMethod.CreateMethodHost): call
866         ComputeMethodHost before creating the method, this is a new
867         requirement. 
868
869         * anonymous.cs (AnonymousContainer): Now we track all the scopes
870         that this method references (RegisterScope).  The actual scope
871         where the method is hosted is computed with the ComputeMethodHost
872         before we create the method.
873
874         Moved the Deepest routine here.
875
876         (AnonymousContainer.ComputeMethodHost): New routine used to
877         compute the proper ScopeInfo that will host the anonymous method.
878
879         (ScopeInfo): Deal with multiple roots.  The problem was that we
880         did not have a unique root where all ScopeInfos could be hanged
881         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
882         of roots.  
883
884         Remove AdjustMethodScope which is now computed at the end.  Remove
885         LinkScope which did a partial link, instead link all ScopeInfos
886         before code generation from the new "LinkScopes" routine. 
887
888         Simplify all the Add* routines as they no longer need to maintain
889         the tree, they just need to record that they are using variables
890         from a ScopeInfo.
891
892         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
893         routines to produce the forest of ScopeInfo trees.
894
895         * class.cs (TypeContainer.AppendMethod): This is just like
896         AddMethod, but ensures that an interface implementation method
897         (IEnumerable.XXX) is not inserted at the beginning of the queue of
898         methods, but at the end.
899
900         We use this functionality to ensure that the generated MoveNext
901         method in the iterator class is resolved/emitted before the
902         enumerator methods created.   
903
904         This is required because the MoveNext method computes the right
905         ScopeInfo for the method.  And the other methods will eventually
906         need to resolve and fetch information computed from the anonymous
907         method. 
908
909         
910 2006-01-23  Raja R Harinath  <rharinath@novell.com>
911
912         Improve implementation of section 14.4.2.2 (Better function member).
913         * expression.cs (Invocation.MoreSpecific): Compare all type
914         arguments before deciding if one type is more specific than
915         another.  Handle array types too.  Return the more specific type.
916         (Invocation.BetterFunction): Add more tie-breaking rules from
917         section 14.4.2.2.  Perform "more specific" check after
918         other tie-breaking rules.  Compare all parameter types before
919         choosing the "more specific" method.
920
921 2006-01-21  Raja R Harinath  <harinath@gmail.com>
922             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
923
924         Fix rest of #76995.
925         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
926         the 'aliases' hash.
927         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
928         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
929
930 2006-01-18  Martin Baulig  <martin@ximian.com>
931
932         * class.cs (TypeContainer.AddToMemberContainer): Use
933         `symbol.MemberName.MethodName' instead of just `symbol.Name';
934         fixes #77124.
935
936 2006-01-18  Martin Baulig  <martin@ximian.com>
937
938         Fix #76417: a generic class may now have methods which may unify
939         for some type parameter substitutions.
940
941         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
942         for methods which may unify anymore.
943
944         * expression.cs (Invocation.MoreSpecific): New private static
945         method; checks whether one method is more specific than another
946         according to 14.4.2.2 of the spec.
947         (Invocation.BetterFunction): Implement the tie-breaking rules from
948         14.4.2.2 of the spec: if two methods unify for some type parameter
949         substitution, we need to pick the more specific one.
950
951 2006-01-18  Raja R Harinath  <rharinath@novell.com>
952
953         Fix #76656, cs0231-2.cs.
954         * cs-parser.jay (formal_parameter_list): Make error case catch
955         more issues.
956         (parenthesized_expression_0): Add CS1026 check.
957         (invocation_expression): Remove unused { $$ = lexer.Location }.
958
959 2006-01-17  Raja R Harinath  <rharinath@novell.com>
960
961         Fix #76824.
962         * cs-parser.jay (statement_expression): Don't list out the
963         individual statement-expressions.  Convert syntax error into
964         CS0201 check.
965
966 2006-01-16  Raja R Harinath  <rharinath@novell.com>
967
968         Fix #76874.
969         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
970         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
971         CheckIntermediateModification.
972         (FieldExpr.DoResolve): Add new two-argument version that
973         allows us to resolve the InstanceExpression as an lvalue.
974         The one-argument variant is now just a wrapper.
975         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
976         Resolve the lhs as an lvalue if the it has a value type.
977         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
978         from Assign.DoResolve.
979         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
980         resolved as an lvalue.
981         (PropertyExpr.DoResolve): Update.
982         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
983         has a value type.  Move CS1612 check here from
984         CheckIntermediateModification.
985         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
986         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
987         'right_side' of a ResolveLValue on an 'out' argument.
988         (EmptyExpression.LValueMemberAccess): New.  Used as the
989         'right_side' of a propagated ResolveLValue on a value type.
990         (LocalVariableReference.DoResolveBase): Recognize
991         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
992         Add CS1654 check.
993         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
994         EmptyExpression.Null.
995
996 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
997
998         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
999           Type.IsGenericParameter(). Fixed bug #77183.
1000         * doc.cs : it is now identical to doc.cs in mcs.
1001
1002 2006-01-16  Martin Baulig  <martin@ximian.com>
1003
1004         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1005
1006 2006-01-16  Martin Baulig  <martin@ximian.com>
1007
1008         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1009         ctors; fixes #77250.
1010
1011 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1012
1013         This fixes the problem where we used ldfld instead of ldflda to
1014         load the "THIS" pointer on captured parameters, when THIS is a
1015         value type.  See bug #77205.
1016         
1017         * iterators.cs (CapturedThisReference.Emit): Pass false to
1018         EmitThis (we do not need the address).
1019
1020         * codegen.cs (EmitThis): it needs to know whether we need the
1021         address of `this' or not.  This is used by value types.  
1022
1023         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1024         every other call passes false.
1025
1026 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1027
1028         Fix #77221.
1029         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1030         GetOverride.
1031         * expression.cs (Invocation.OverloadResolve): Update.
1032         (Invocation.DoResolve): Avoid double resolution of invocation.
1033
1034 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1035
1036         Fix #77180.
1037         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1038         unary negation of floating point types as 0-expr; negation cannot
1039         overflow in floating point types.
1040
1041         Fix #77204.
1042         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1043         on operands of 'void' type.
1044
1045         Fix #77200.
1046         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1047         and ExclusiveOr for boolean constants too.
1048
1049 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1050
1051         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1052
1053 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1054
1055         * cs-tokenizer.cs (Position): New class used to save and restore
1056         the position state in the tokenizer.  Before this patch the save
1057         and restore was not complete enough so the line and columns would
1058         start to drift and the debugger and stack traces will get the
1059         wrong data.
1060
1061 2006-01-10  Martin Baulig  <martin@ximian.com>
1062
1063         * generic.cs
1064         (TypeParameter.InflateConstraints): New public method.
1065
1066         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1067         constraints; fixes #77042.
1068
1069 2006-01-10  Martin Baulig  <martin@ximian.com>
1070
1071         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1072         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1073         #77061. 
1074
1075 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1076
1077         Fix #75636.
1078         * expression.cs (Invocation.OverloadResolve): Replace reflected
1079         override methods with their base virtual methods, rather than
1080         skipping over them.
1081         * typemanager.cs (TypeManager.GetOverride): New.
1082
1083 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1084
1085         * driver.cs: Report the case of no source files and no -out:
1086         argument provided.
1087
1088 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1089
1090         Fix #77035.
1091         * expression.cs (ComposedCast.GetSignatureForError): Define.
1092
1093 2006-01-05  Jb Evain  <jbevain@gmail.com>
1094
1095         * class.cs (Property.Define, Indexer.Define): do not tag the
1096         properties as SpecialName | RTSpecialName.
1097
1098 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1099
1100         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1101         doing a low-level comparission of parameter types.  It was lacking
1102         a check for __argslist. 
1103
1104 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1105
1106         * expression.cs (ParameterReference.DoResolveBase): Allow
1107         reference parameters if they are local to this block. 
1108
1109         This allows the ref and out parameters of a delegate to be used in
1110         an anonymous method, for example:
1111
1112         delegate void set (out int x);
1113
1114         set s = delegate (out int x){
1115                 x = 0;
1116         };
1117
1118         This is used by functionality introduced late in the C# language.
1119         
1120         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1121         method that take ref and out parameters. 
1122
1123         Fixes #77119 which was a late change in the spec.
1124
1125 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1126
1127         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1128         parent if its the same scope.  Fixes #77060.
1129
1130 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1131
1132         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1133
1134 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1135
1136         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1137         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1138         that doesn't contain the full public key. This is a update of the
1139         friend assemblies in .Net 2.0 release.
1140         
1141 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1142
1143         Fix #76995
1144
1145         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1146         ListDictionary, to contain the ExternAliasEntry entries (in
1147         addition to the NamespaceEntry.aliases hashtable). This field is
1148         shared between the original entry and its doppelganger (bodyless 
1149         copy of it).
1150         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1151         extern_aliases field.
1152         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1153         lookup in extern_aliases.
1154
1155 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1156
1157         Fix #77006.
1158         * class.cs (TypeContainer.Mark_HasEquals): New.
1159         (TypeContainer.Mark_HasGetHashCode): New.
1160         (ClassPart): Override them.
1161         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1162
1163         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1164         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1165         DeclSpace.
1166
1167         Fix #77008.
1168         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1169         'parent' argument to the base constructor.
1170
1171         Remove all mention of TypeContainer from decl.cs.
1172         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1173         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1174         (DeclSpace.DeclSpace): Likewise.
1175         (DeclSpace.DefineMembers): Remove unused argument.
1176         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1177         debugging check -- we don't care if the debug code throws an
1178         InvalidCastException instead of an InternalErrorException.
1179         * class.cs (TypeContainer.DefineMembers): Update to changes.
1180         (TypeContainer.DoDefineMembers): Likewise.
1181         (TypeContainer.GetMethods): Likewise.
1182         (PropertyMember.Define): Likewise.
1183         (MemberBase.Parent): New property that forwards to
1184         MemberCore.Parent, but ensures that we get a TypeContainer.
1185         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1186         (RootContext.PopulateTypes): Likewise.  Remove special case code
1187         for !RootContext.StdLib: DefineMembers is idempotent.
1188
1189 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1190
1191         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1192
1193 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1194
1195         * doc.cs : The search for referenced namespace was insufficient to
1196           get global one as it used to do. Fixed bug #76965.
1197
1198 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1199
1200         * doc.cs : check name in cref in the last phase that whether it is
1201           namespace or not.
1202
1203 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1204
1205         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1206           Mono.C5.
1207
1208 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1209
1210         * doc.cs : so it turned out that we cannot skip override check for 
1211           interface members. Fixed bug #76954.
1212
1213 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1214
1215         * cs-tokenizer.cs : fixed bug #75984:
1216           - #warning and #error should not be handled when the source line
1217             is disabled.
1218           - #line is not checked strictly when the source line is disabled.
1219           - #define and #undef is on the other hand checked strictly at any
1220             state.
1221
1222 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1223
1224         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1225           CS1027 report.
1226
1227 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1228
1229         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1230
1231         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1232         nested types.
1233
1234 2005-12-14  Martin Baulig  <martin@ximian.com>
1235
1236         * typemanager.cs (TypeManager.GetFullName): Make this public;
1237         `Type.Fullname' now never returns null.
1238
1239         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1240         explicit interface implementations; we're now using the same
1241         naming convention than csc does.
1242
1243 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1244
1245         * convert.cs (ExplicitConversionCore): Check the return value from
1246         ExplicitConversionCore which can return null on failure.  Fixes #76914
1247
1248 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1249
1250         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1251         instead of IsGenericInstance.
1252         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1253         code that's now covered by the more general test.
1254         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1255
1256         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1257         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1258         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1259         * generic.cs, report.cs, typemanager.cs: Likewise.
1260
1261 2005-12-08  Martin Baulig  <martin@ximian.com>
1262
1263         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1264
1265         * typemanager.cs (TypeManager.CSharpSignature): Include type
1266         arguments in the signature of a generic method.
1267
1268 2005-12-07  Martin Baulig  <martin@ximian.com>
1269
1270         Add support for custom attributes on type parameters.
1271
1272         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1273
1274         * generic.cs (TypeParameterName): New public class; we use this
1275         instead of a `string' to store the name of a type parameter, so we
1276         can also have `Attributes'.
1277         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1278         array instead of a `string[]' array.
1279         (TypeParameter.ctor): We now also take an `Attributes' argument.
1280         (TypeParameter.EmitAttributes): New public method; emit our
1281         `OptAttributes' here.
1282         (GenericMethod.EmitAttributes): New public method; emit the custom
1283         attributes on all our type parameters.
1284
1285         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1286         our type parameters.
1287         (MethodData.Define): If we're a generic method, call
1288         EmitAttributes() on it.
1289
1290 2005-12-07  Martin Baulig  <martin@ximian.com>
1291
1292         * generic.cs
1293         (ConstraintChecker): New public abstract class; move the
1294         constraint checking here from `ConstructedType' and also do
1295         constraint checking for generic methods here.
1296
1297         * expression.cs (Invocation.OverloadResolve): Use
1298         ConstraintChecker.CheckConstraints() if we resolved to a generic
1299         method.  Fix #76806.
1300
1301 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1302
1303         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1304
1305         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1306         event initializers.
1307         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1308         (FieldBase.Initializer): Initializer is now optional.
1309         (EventField.Define): Only event field can have initializer.
1310
1311         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1312
1313         * const.cs (Const): Reuse initializer.
1314
1315         * cs-parser.jay: Updated after FieldBase changes.
1316         Added current_array_type to simplify array initializers.
1317
1318         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1319
1320         * expression.cs, iterators.cs: Updated.
1321
1322         * namespace.cs (NamespaceEntry): Made UsingFound private.
1323
1324 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1325
1326         * parameterCollection.cs: Obsolete, removed.
1327         * parser.cs: Obsolete, removed.
1328
1329 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1330
1331         Fix #76849.
1332         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1333
1334         * enum.cs (Enum.Define): Set obsolete context here.
1335
1336 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1337
1338         * doc.cs :
1339           - FindDocumentedMember() now expects 1) paramList as null
1340             when "we don't have to check the number of parameters" and
1341             2) Type.EmptyTypes when "there is no arguments".
1342           - Introduced FoundMember struct to hold the exact type which was
1343             used to find the documented member (the above change broke
1344             test-xml-044; it might be better just to use DeclaringType than
1345             what MS does, like this change does, but it depends on usage.)
1346
1347 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1348
1349         * doc.cs : documented member might be from DeclaringType for nested
1350           types. Fixed bug #76782.
1351
1352 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1353
1354         * anonymous.cs: Have the param code handle leaving copies on the
1355         stack etc. Allows anonymous params to take part in the assignment
1356         code (++, +=, etc). Fixes bug #76550
1357
1358         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1359         it down to the anon code.
1360
1361         * iterators.cs: Use dummy var here
1362
1363         * codegen.cs: Handle new vars
1364
1365 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1366
1367         Fix #76849.
1368         * class.cs (MethodData.Define): Set proper Obsolete context.
1369
1370         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1371         obsolete context.
1372         (FieldExpr.DoResolve): Ditto.
1373
1374 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1375
1376         Fix #76849.
1377         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1378         parent is not obsolete.
1379
1380 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1381
1382         * doc.cs : (FindDocumentedMember) find parameterless members first
1383           and get CS0419 in the early stage. Fixed first case of bug #76727.
1384
1385 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1386
1387         Fix #76859.
1388         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1389         no error was reported.
1390
1391         *expression.cs (Binary.DoResolve): left can be null.
1392
1393 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1394
1395         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1396         abstract method and all overrides.
1397         * support.cs (ParameterData.GenericConstraints): Delete.
1398         (ReflectionParameters.type_params): Delete.
1399         (ReflectionParameters.ReflectionParameters): Make private.
1400         (ReflectionParameters.GetConstaints): New factory method.
1401         * generic.cs (TypeParameterDefineType): Use it.
1402         (TypeManager.GetTypeParameterConstraints): Likewise.
1403
1404 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1405
1406         Fix #76783.
1407         * class.cs (MethodData.Emit): Parameters should be labeled first.
1408
1409 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1410
1411         Fix #76761.
1412         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1413
1414 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1415
1416         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1417
1418         * class.cs (MethodCore): Parameter clean up.
1419         (IMethodData): Added ParameterInfo.
1420         (MethodData): Parameter clean up.
1421         (Indexer.Define): Parameter clean up.
1422
1423         * anonymous.cs,
1424         * codegen.cs,
1425         * cs-parser.jay,
1426         * decl.cs,
1427         * doc.cs,
1428         * ecore.cs,
1429         * flowanalysis.cs,
1430         * iterators.cs,
1431         * pending.cs,
1432         * statement.cs,
1433         * typemanager.cs: Parameter clean up.
1434
1435         * delegate.cs (Define): Get rid of duplicated code.
1436
1437         * expression.cs (ParameterReference): Removed useless parameters
1438         and simplified.
1439         (Invocation): Ditto.
1440
1441         * parameter.cs (ParamsParameter): New class, params specialization.
1442         (ArglistParameter): Attemp to separate arglist.
1443         (Parameter): Refactored to be reusable and faster.
1444         (Parameter.Modifier): Made understandable.
1445         (Parameters): Changed to be used as a class for `this' assembly
1446         parameters. Refactored to use new specialized classes.
1447
1448         * support.cs (ParameterData): Added Types property.
1449         (InternalParameters): Deleted.
1450
1451 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1452
1453         * doc.cs : the previous patch does not actually fix the bug.
1454           PropertyInfo override check is now implemented and really fixed it.
1455         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1456
1457 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1458
1459         * doc.cs : apply "override filter" also to properties.
1460           Fixed bug #76730.
1461
1462 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1463
1464         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1465           no need to check overrides. For classes, omit those results from 
1466           interfaces since they must exist in the class. Fixed bug #76726.
1467
1468 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1469
1470         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1471           with different parameters. Fixed the second problem in #76685.
1472
1473 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1474
1475         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1476           get expected 'protected' access in CheckValidFamilyAccess()).
1477           Fixed bug #76692.
1478
1479 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1480
1481         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1482           Fixed bug #76705.  CS1569 was incorrectly commented out.
1483
1484 2005-11-23  Martin Baulig  <martin@ximian.com>
1485
1486         * generic.cs (Constraints.Define): Removed.
1487         (TypeParameter.DefineConstraints): Removed.
1488         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1489         on the GenericTypeParameterBuilder here.
1490
1491 2005-11-23  Martin Baulig  <martin@ximian.com>
1492
1493         * typemanager.cs (TypeManager.GetProperty): Make this public.
1494
1495         * generic.cs (Nullable.NullableInfo.ctor): Use
1496         TypeManager.GetProperty() rather than using reflection directly.
1497
1498 2005-11-17  Martin Baulig  <martin@ximian.com>
1499
1500         * expression.cs (Indexers.GetIndexersForType): Added support for
1501         generic parameters; fixes #76587.
1502
1503 2005-11-17  Martin Baulig  <martin@ximian.com>
1504
1505         * anonymous.cs
1506         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1507         inherit the scope from our parent.  Fixes #76653.
1508
1509 2005-11-15  Martin Baulig  <martin@ximian.com>
1510
1511         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1512         instead of `ScopeTypeBuilder' to refer to the "current" type.
1513         (AnonymousMethod.CreateScopeType): Correctly create the helper
1514         class if we're inside a generic type definition.
1515
1516 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1517
1518         * doc.cs : use Invocation.IsOverride() to do real override check.
1519         * expression.cs : made Invocation.IsOverride() internal.
1520
1521 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1522
1523         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1524           TypeBuilder.FindMembers() and filter overriden base members out.
1525           Fixed bug #76990.
1526
1527 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1528
1529         * doc.cs : ref/out parameters are represented as '@' (instead of
1530           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1531
1532 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1533
1534         * doc.cs : when there was no '.' in cref to methods in doc comment,
1535           then parameters were missing in the output. Fixed bug #76691.
1536
1537 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1538
1539         * driver.cs : don't output docs when there is an error.
1540           Fixed bug #76693.
1541
1542 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1543
1544         * doc.cs :
1545           Now it should detect indexers. Fixed primary concern in bug #76685.
1546           Fixed CS0419 message to not show the identical member signature in
1547           the message.
1548
1549 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1550
1551         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1552           instead of Type.FindMembers() since it does not handle events.
1553           Fixed bug #71604.
1554
1555 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1556
1557         * codegen.cs: Fixed typo (speficied -> specified).
1558
1559 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1560
1561         Fix #76369.
1562         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1563
1564 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1565
1566         * attribute.cs: Changed error message.
1567
1568         * cs-tokenizer.cs: One more check.
1569
1570 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1571
1572         * statement.cs (Block.Resolve): Ignore empty statement.
1573
1574 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1575
1576         * report.cs: Made error/warning methods more strict to avoid
1577         their misuse.
1578
1579         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1580         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1581         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1582         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1583
1584 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1585
1586         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1587         Use the more explicit AssemblyName.FullName instead of 
1588         AssemblyName.Name to report errors.
1589         
1590 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1591
1592         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1593         with mcs.
1594
1595 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1596
1597         * class.cs,
1598         * convert.cs,
1599         * cs-parser.jay,
1600         * decl.cs,
1601         * enum.cs,
1602         * expression.cs,
1603         * generic.cs,
1604         * pending.cs,
1605         * report.cs: Fixed error reporting and typos.
1606
1607         * generic.cs (TypeParameter.GetSignatureForError): New method.
1608         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1609
1610         * typemanager.cs (GetFullName): Refactored.
1611
1612 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1613
1614         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1615         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1616
1617         * class.cs (TypeContainer.IsComImport): New property.
1618         (Constructor.Define): Create proper ctor for ComImport types.
1619
1620         * expression.cs (New.CheckComImport): Fixed.
1621
1622 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1623
1624         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1625         that a parameter has been captured does not mean that we do not
1626         have to do the rest of the processing.  This fixes the second part
1627         of #76592.  If there was another anonymous method capturing
1628         values in the past, the Scope would never be set for the second
1629         method that captured the same parameter.
1630
1631         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1632         properly manipulate the stack.   Second part of fix for #76592.
1633
1634         * expression.cs (New): Add support for invoking "new" on
1635         interfaces that have been flagged with the ComImport attribute and
1636         the CoClass.  Fixes #76637 
1637
1638         * statement.cs (Try.DoEmit): When a variable is captured, do not
1639         try to emit the vi.LocalBuilder variable as it has been captured.
1640         Create a temporary variable and store the results on the
1641         FieldBuilder.  Fixes #76642
1642
1643 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1644
1645         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1646
1647         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1648
1649         * expression.cs (Binary.DoResolve): Added && optimalization.
1650     
1651         * typemanager.cs (AddUserType): Removed useless argument.
1652
1653 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1654
1655         * statement.cs (Block.variables): Uses ListDictionary.
1656
1657 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1658
1659         Fix #75969.
1660         * class.cs (PartialContainer.EmitType): Customized to emit
1661         security attributes.
1662         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1663         for partial classes.
1664
1665 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1666
1667         Fix #76599.
1668         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1669         access has to be fixed.
1670         
1671         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1672
1673 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1674
1675         Fix #76590.
1676         * ecore.cs (NullCast.Reduce): Implemented.
1677
1678         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1679         constant type.
1680         
1681         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1682         properly.
1683         (Foreach.Resolve): Catch null properly.
1684
1685 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1686  
1687         * cs-tokenizer.cs: Warning text fix.
1688
1689         * driver.cs: AllWarningNumbers exposed on public interface.
1690
1691         * report.cs (): Reviewed warning numbers.
1692         (IsValidWarning): Use binary search.
1693
1694 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1695  
1696         * driver.cs: Implemeted resource visibility.
1697         (Resources): New class for code sharing between /res: and
1698         /linkres:
1699  
1700 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1701
1702         decl.cs (CurrentTypeParameters): Fixed to be public.
1703
1704 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1705
1706         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1707
1708 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1709
1710         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1711
1712 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1713
1714         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1715
1716 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1717
1718         Add friend assembly access support.
1719         * typemanager.cs: assembly_internals_vis_attrs
1720         cache for friend assembly access. 
1721         (TypeManager.IsFriendAssembly): New method for
1722         checking friend assembly access.
1723         (TypeManager.Error_FriendAccessNameNotMatching): New
1724         helper method.
1725         (TypeManager.CompareKeyTokens): Likewise.
1726         (TypeManager.Filter): Handle friend accessible
1727         members.
1728
1729         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1730         friend accessible types.
1731
1732         * ecore.cs (Expression.IsAccessorAccessible): Handle
1733         friend accessible properties.
1734
1735         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1736         accessible types.
1737         
1738 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1739
1740         Fix #76568.
1741         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1742         folding.
1743         
1744         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1745         contants only.
1746         
1747         * ecore.cs (NullCast): Child is contant only.
1748         
1749         * literal.cs (NullLiteral.Reduce): null can be converted to any
1750         reference type.
1751
1752 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1753
1754         * driver.cs: Use Encoding.Default as default code page instead
1755           of ISO-28591.
1756
1757 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1758
1759         Fix #76085.
1760         * expression.cs (Invocation.Error_InvalidArguments): Handle
1761         __arglist parameters.
1762         (Invocation.VerifyArgumentsCompat): Likewise.
1763         * support.cs (ReflectionParameters.GetSignatureForError): Print
1764         __arglist parameters.
1765         (InternalParamters.GetSignatureForError): Likewise.
1766         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1767
1768 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1769
1770         * attribute.cs (GetPropertyValue): Made public.
1771
1772         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1773         Resolve.
1774         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1775         attribute.
1776         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1777         is not defined.
1778         
1779         * driver.cs: Reflect method name change.
1780         
1781         * statement.cs (Try.Resolve): Warn when try has both general
1782         exception handlers.
1783         
1784         * typemanager.cs: runtime_compatibility_attr_type new predefined
1785         type.
1786
1787 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1788
1789         Fix #76419.
1790         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1791         treat it as an empty parameter list.
1792
1793 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1794
1795         Fix #76271.     
1796         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1797         ResolveAsTypeStep silent.
1798         * statement.cs (Block.AddConstant): Mark block as used.
1799         (Block.ResolveMeta): Avoid piling on error messages
1800         if a constant initializer resolution fails.
1801
1802 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1803
1804         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1805         Remove.
1806         (NamespaceEntry.VerifyAllUsing): New.
1807         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1808         behaviour.  Delegates actual resolution of alias to ...
1809         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1810         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1811         Update.
1812         * driver.cs (Driver.MainDriver): Update.
1813         
1814         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1815         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1816         property.
1817         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1818         Remove.
1819         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1820         RootNamespace.DefineNamespacesForAll.
1821
1822 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1823
1824         * typemanager.cs (assemblies, external_aliases, modules)
1825         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1826         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1827         overhead.  Move resposibility ...
1828         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1829         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1830
1831 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1832
1833         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1834         cached_namespaces.  Improve usage.
1835         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1836         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1837         Move from GlobalRootNamespace and simplify.
1838         (RootNamespace.Global): Make instance variable.
1839         (RootNamespace.RootNamespace): Add "alias name" parameter.
1840         (GlobalRootNamespace): Simplify drastically.
1841         (Namespace.Lookup): Don't use GetNamespace.
1842         * typemanager.cs (GetRootNamespace): Rename from
1843         ComputeNamespaceForAlias.
1844         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1845
1846 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1847
1848         * anonymous.cs (AnonymousContainer): Don't crash when container
1849         doesn't exist.
1850
1851 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1852
1853         * expression.cs (Binary.DoResolve): Warn when comparing same
1854         values.
1855
1856 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1857
1858         Fix #76486.
1859         * expression.cs (Binary.DoResolve): It looks like there are no
1860         convetsion rules in enum context.
1861
1862 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1863
1864         Add support for extern alias qualifiers.
1865         * typemanager.cs: Move some LookupTypeReflection code
1866         to namespace.cs, to have cleaner code. Added some methods
1867         to help us keep track of the extern aliased references.
1868         * driver.cs: Add suport for extern alias assemblies on command
1869         line and check for their warnings/errors. Also keep track of the
1870         extern aliased assemblies.
1871         * namespace.cs: Move the global functionality of Namespace
1872         to GlobalRootNamespace/RootNamespace. Now the global namespace
1873         is GlobalRootNamespace.Globa. Also the code moved from 
1874         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1875         Finally added LocalAliasEntry (AliasEntry before) and
1876         ExternAliasEntry, to handle alias statements.
1877         * cs-parser.jay: Add support in the grammar for extern alias
1878         statement.
1879         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1880         Update callings to Namespace (now in GlobalRootNamespace).
1881
1882 2005-10-25  Martin Baulig  <martin@ximian.com>
1883
1884         * convert.cs (ImplicitTypeParameterConversion): Make base
1885         interfaces actually work; fixes #76557.
1886
1887 2005-10-25  Martin Baulig  <martin@ximian.com>
1888
1889         * generic.cs
1890         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1891         all the type parameters; fixes #76551.
1892
1893 2005-10-25  Martin Baulig  <martin@ximian.com>
1894
1895         Fix #76472.
1896
1897         * generic.cs
1898         (GenericMethod.ctor): Added `Expression return_type' and
1899         `Parameters parameters' arguments.
1900         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1901         parameter and return types to check their constraints if they're
1902         generic types.
1903
1904         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1905         boolean field.
1906
1907         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1908         constraints of a generic type if `ec.ResolvingGenericMethod'.
1909
1910         * class.cs (MethodCore.DoDefineParameters): Set
1911         `ec.ResolvingGenericMethod' if we're a generic method.
1912         (MemberBase.MemberType): Likewise.
1913
1914 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1915
1916         * typemanager.cs (TypeManager): Added 
1917         TypeManager.internals_visible_attr_type to cache
1918         S.R.CompilerServices.InternalsVisibleToAttribute.
1919
1920         * codegen.cs (AssemblyClass): Added checks for 
1921         InternalsVisibleToAttribute in new method 
1922         CheckInternalsVisibleAttribute () and also cache the
1923         AssemblyName in AssemblyClass.Name.
1924         
1925 2005-10-24  Martin Baulig  <martin@ximian.com>
1926
1927         * typemanager.cs
1928         (TypeManager.ExpandInterfaces): Added overloaded version which
1929         just takes a `Type[]' array.
1930
1931         * generic.cs
1932         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1933         just use the interfaces which were explicitly specified and not
1934         the interfaces they inherit.  Fixes #76482.
1935         (TypeParameter.FindMembers): Expand the interfaces here.
1936
1937 2005-10-21  Martin Baulig  <martin@ximian.com>
1938
1939         * generic.cs
1940         (Constraints.Resolve): Also resolve the actual types here.
1941         (Constraints.ResolveTypes): Just check the constraints here.
1942         Fixes #76363; see gtest-218.cs.
1943
1944 2005-10-21  Martin Baulig  <martin@ximian.com>
1945
1946         * convert.cs
1947         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1948         instead of a `BoxedCast'; fixes gtest-217.cs.
1949
1950 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1951
1952         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1953           1) "new()" is specified as generic parameter constraint and 2) the
1954           type is TypeBuilder and 3) the type is abstract even if it has a
1955           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1956
1957 2005-10-20  Martin Baulig  <martin@ximian.com>
1958
1959         * generic.cs
1960         (GenericConstraints.TypeParameter): New public property.
1961         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1962         (TypeParameter.DeclSpace): New public property.
1963         (TypeParameter.DefineType): Inflate the constraints if our
1964         `DeclSpace' is an `Iterator'.   
1965
1966 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1967
1968         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1969           GenericMethod argument to compare methods' generic type arguments.
1970           Fixed bug #76382.
1971
1972 2005-10-19  Martin Baulig  <martin@ximian.com>
1973
1974         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1975         not ResolveType() when resolving the base type, so we're not
1976         checking the constraints here.
1977         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1978         if we have any.
1979
1980 2005-10-19  Martin Baulig  <martin@ximian.com>
1981
1982         * generic.cs (ConstructedType.CheckConstraints): Committing
1983         untested fix for #76441.
1984
1985 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1986
1987         Fix #76371.
1988         * class.cs (TypeContainer.DefineType): Move updating of
1989         topological sort earlier in the code.
1990         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1991
1992 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1993
1994         Fix #76273.
1995         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1996         
1997         * constant.cs (Constant.TryReduce): Moved from Cast class.
1998         (Reduce): Made little bit more OO and fixed missing conversions.
1999         
2000         * ecore.cs (Reduce): Implemented.
2001         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2002         
2003         * literal.cs (Reduce): Implemented.
2004         
2005         * class.cs: Reverted Miguel's wrong commit.
2006
2007 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2008
2009         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2010
2011 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2012
2013         * cs-parser.jay, expression.cs : CS0214 was missing error location
2014           for constants. Fixed bug #76404.
2015
2016 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2017
2018         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2019         InstanceExpression.
2020         (PropertyExpr.EmitCall): Likewise.
2021         * expression.cs (Invocation.EmitArguments): Handle case where
2022         arguments == null.
2023         (Invocation.EmitCall): Avoid allocating temporary variable if
2024         there are no arguments.
2025
2026 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2027
2028         Fix #76370.
2029         * convert.cs (ExplicitConversionCore): Fixed object->enum
2030         conversion.
2031
2032 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2033
2034         Fix #76323.
2035         * convert.cs (ImplicitConversionStandard): Move conversion of
2036         void* to arbitrary pointer types ...
2037         (ExplicitConversionStandard): .. here.
2038         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2039         error to always print typenames.
2040
2041 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2042
2043         * convert.cs (GetConversionOperator): Rename from
2044         GetConversionOperators.  Move operator selection code from ...
2045         (UserDefinedConversion): ... here.
2046
2047 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2048
2049         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2050         conversion.
2051
2052 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2053
2054         * assign.cs (Assign.DoResolve): Error method changed.
2055
2056         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2057         
2058         * const.cs (ResolveValue): Reset in_transit immediately.
2059         
2060         * constant.cs: Error method changed.
2061         
2062         * convert.cs: Removed useless location parameter.
2063         (ExplicitNumericConversion): Don't do double enum check.
2064         (ExplicitConversionCore): Renamed from ExplicitConversion.
2065         (ExplicitUnsafe): Extracted from ExplicitConversion.
2066         (ExplicitConversion): Uses for error reporting.
2067         
2068         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2069         error messages.
2070         (ResolveBoolean): Uses common error method.
2071         (CastToDecimal): Get rid of ec.
2072         (CastFromDecimal): Optimized.
2073         (ConvCast): Get rid of ec.
2074         
2075         * enum.cs (ResolveValue): Reset in_transit immediately.
2076         (Emit): Return after first error.
2077         
2078         * expression.cs: Convert changes.
2079         
2080         * literal.cs: Error method changed.
2081         
2082         * statement.cs: Error method changed.
2083
2084 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2085
2086         Fix gtest-131.cs and gtest-211.cs.
2087         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2088         Only emit code for a label if it is used.  Unreachable code can
2089         violate ECMA evaluation stack invariants.
2090
2091 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2092
2093         * anonymous.cs: Implemented ExprClassName.
2094         
2095         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2096         delegate.
2097         
2098         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2099         check.
2100         
2101         * class.cs (StaticClass.DefineContainerMembers): Report protected
2102         members as error.
2103         
2104         * codegen.cs: if(ed) PRODUCTION.
2105         
2106         * convert.cs (Error_CannotImplicitConversion): Better error
2107         distinction.
2108         
2109         * cs-parser.jay: More error checks.
2110         
2111         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2112         
2113         * driver.cs (CSCParseOption): Enabled wrong option check.
2114         
2115         * ecore.cs (Expression.ExprClassName): Turned to property.
2116         (MemberExpr.CheckIntermediateModification): For checking boxed
2117         value types     modification.
2118         
2119         * statement.cs (Fixed.Resolve): Expression type must be
2120         convertible to fixed type.
2121         (CollectionForeach.GetEnumeratorFilter,TryType):
2122         Small refactoring for easier error checking.
2123
2124 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2125
2126         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2127         attributes.
2128         
2129         * class.cs (GeneratedBaseInitializer): New class for customization
2130         compiler generated initializers.
2131         (MemberBase.DoDefine): Check Obsolete attribute here.
2132         (FieldMember.DoDefine): Ditto.
2133         
2134         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2135         constants.
2136         
2137         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2138         (MemberCore.GetObsoleteAttribute): Removed argument.
2139         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2140         (MemberCore.CheckObsoleteType): New helper.
2141         
2142         * delegate.cs,
2143         * enum.cs,
2144         * statement.cs: Updates after MemberCore changes.
2145         
2146         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2147         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2148         
2149         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2150         obsolete attribute for compiler construct.
2151         (As.DoResolve): Cache result.
2152         
2153         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2154
2155 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2156
2157         * expression.cs (Probe): instead of having a "Type probe_type"
2158         keep the extra information as a TypeExpr probe_type_expr since the
2159         "As" operator needs to perform some type checks.
2160
2161         * (As.DoResolve): If the type is a type parameter, ensure that it
2162         is constrained by a class.
2163
2164 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2165
2166         * statement.cs (Lock): Use the TemporaryVariable class instead of
2167         manually using local variables as those do not work when variables
2168         are captured.
2169
2170         * ecore.cs: Moved the TemporaryVariable class from being a nested
2171         class inside Foreach to be a public class that can be employed in
2172         other places. 
2173
2174 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2175
2176         * cs-parser.jay: interface_accessors replaced by
2177         accessor_declarations.
2178
2179         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2180         location.
2181         
2182         * statement.cs (GotoCase.Resolve): Convert null constant to
2183         null case.
2184         (SwitchLabel.ResolveAndReduce): Ditto.
2185         (SwitchLabel.NullStringCase): Custom null stamp.
2186         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2187         
2188         typemanager.cs (CSharpSignature): Don't skip first argument
2189         for full names.
2190
2191 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2192
2193         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2194         expression.cs, iterators.cs, literal.cs: Store constants and
2195         literals location.
2196         
2197         * class.cs (MemberBase.ShortName): Pass location.
2198         
2199         * cs-parser.jay: Some location fixes.
2200         
2201         * ecore.cs (Expression.Location): Made virtual.
2202
2203 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2204
2205         Fix #72930.
2206         * const.cs (Const.ResolveValue): Check for assigning non-null
2207         value to reference type.
2208
2209 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2210
2211         Fix #76133.
2212         * expression.cs (This.VerifyFixed): In a value type T, the type of
2213         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2214         value type R, 'this' is treated as a value parameter.
2215
2216 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2217
2218         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2219         if the underlying types are the same, otherwise we need to produce
2220         code that will do the proper cast.
2221
2222         This was exposed by Marek's constant rewrite which produced
2223         invalid code for the call site:
2224
2225         enum X : long { a }
2226         void Method (X v) {}
2227
2228         Method ((X) 5)
2229
2230         This fixes test-49.cs
2231
2232 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2233
2234         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2235           Type/Object should be allowed as well. Fixed bug #75968.
2236
2237 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2238
2239         * expression.cs : (Binary.DoResolve): when one is enum constant and
2240           another is constant 0, then return enum one *as enum type*.
2241           Fixed bug 74846.
2242
2243 2005-10-04  Martin Baulig  <martin@ximian.com>
2244
2245         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2246         `SetMemberIsUsed()' work for generics, too.
2247
2248 2005-10-04  Martin Baulig  <martin@ximian.com>
2249
2250         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2251         for corlib.  Fixes #75691.
2252
2253 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2254
2255         Fix #76255.
2256         * driver.cs: Fix compilation files with full root path.
2257
2258 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2259
2260         * report.cs (SymbolRelatedToPreviousError): Format the output so
2261         it does not use an open parenthesis that is never closed. 
2262
2263         * driver.cs: Follow coding guidelines
2264
2265 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2266
2267         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2268
2269         * location.cs (InEmacs): in this mode, do not report column
2270         location as it confuses Emacs.
2271
2272 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2273
2274         * support.cs (SeekableStreamReader.Position): Don't error out when
2275         the requested position is just beyond the end of the current
2276         buffered data.
2277
2278 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2279
2280         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2281         try to keep in sync with the byte count of the underlying Stream.
2282         However, this limits us to a window size of 2048 characters: i.e.,
2283         the maximum lookahead of our lexer/parser can be 2048 characters.
2284
2285 2005-09-22  Martin Baulig  <martin@ximian.com>
2286
2287         * driver.cs: Removed a debugging FIXME.
2288
2289 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2290
2291         * cs-parser.jay (type_arguments): Add CS1644 check.
2292         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2293
2294 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2295
2296         * Makefile (PROGRAM): Make profile specific.
2297         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2298         the current directory.
2299
2300         Fix test-455.cs.
2301         * expression.cs (Invocation.EmitCall): Remove optimization on
2302         this_call since it doesn't handle 'this' being a value type.
2303
2304 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2305
2306         * driver.cs: Ensure file handles are closed after parsing
2307
2308 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2309
2310         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2311         if the underlying types are the same, otherwise we need to produce
2312         code that will do the proper cast.
2313
2314         This was exposed by Marek's constant rewrite which produced
2315         invalid code for the call site:
2316
2317         enum X : long { a }
2318         void Method (X v) {}
2319
2320         Method ((X) 5)
2321
2322         This fixes test-49.cs
2323
2324 2005-09-05  Martin Baulig  <martin@ximian.com>
2325
2326         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2327         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2328
2329         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2330
2331 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2332
2333         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2334           to be a pointer type due to the spec 25.2, so check if declaring
2335           type is generic type definition. Fixed bug #75772.
2336
2337 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2338
2339         Fixed bug #75957.
2340         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2341           both types are not defined by methods.
2342         * expression.cs : (Invocation.IsApplicable): it should work when
2343           the argument type is equal to the parameter type, not only when
2344           ImplicitConversionExists() returns true.
2345
2346 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2347
2348         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2349         internal.
2350
2351         Fix #75941.
2352         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2353         flow-branching for LocalVariableReferences in case we were invoked
2354         from a MemberAccess.
2355         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2356         Carved out of ...
2357         (LocalVariableReference.DoResolveBase): ... this.
2358         (MemberAccess.Resolve): Do the check that was disabled during
2359         SimpleNameResolve.
2360
2361 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2362
2363         * class.cs :
2364           (PartialContainer.Create): check abstract/sealed/static strictly
2365           but abstract/sealed can exist only at one side. Fixed bug #75883.
2366
2367 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2368
2369         Fix #75945.
2370         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2371         specified, don't default to UnmanagedType.I4.
2372
2373 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2374
2375         * expression.cs : conditional operator should check possibly
2376           incorrect assign expression. Fixed bug #75946.
2377
2378 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2379
2380         Fix #75934.
2381         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2382         (ScopeInfo.EmitScopeType): Use it to construct field names from
2383         names of captured locals.
2384
2385         Fix #75929.
2386         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2387         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2388         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2389         (ExplicitConversion): Remove enum cases already handled by
2390         implicit conversion.  Move implicit conversion check to the beginning.
2391         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2392         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2393         Don't treat System.Enum as a struct.
2394
2395 2005-08-30  Jb Evain  <jbevain@gmail.com>
2396
2397         * attribute.cs: handles as expression in parameters.
2398
2399 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2400
2401         Fix #75802.
2402         * class.cs (TypeContainer.VerifyClsName): Don't use a
2403         PartialContainer when verifying CLS compliance.
2404         (AbstractPropertyEventMethod): Set Parent here, ...
2405         (PropertyMethod): ... not here.
2406
2407 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2408
2409         * attribute.cs : escaped attribute name should not be allowed to be
2410           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2411
2412 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2413
2414         Fix #75927.
2415         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2416         when converting a long constant to unsigned long.
2417         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2418         detect where IsApplicable and VerifyArgumentsCompat disagree.
2419
2420 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2421         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2422
2423         Fix #75848.
2424         * class.cs (TypeContainer.CanElideInitializer): New helper.
2425         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2426         can safely emitting the initializer of a field.
2427
2428 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2429
2430         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2431           allowed inside a switch (without loop). Fixed bug #75433.
2432
2433 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2434
2435         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2436         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2437
2438 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2439
2440         * driver.cs : kinda reverting the default encoding changes (not exact 
2441           revert since I noticed that "codepage:reset" might not work fine).
2442
2443 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2444
2445         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2446           Location. Now getter and setter store location correctly.
2447           (errors/cs0111-12.cs now reports the expected location.)
2448
2449 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2450
2451         * driver.cs : Use default encoding on the environment.
2452           Removed (now that) extra parameter for SeekableStreamReader.
2453         * support.cs : (SeekableStreamReader) third .ctor() argument for
2454           StreamReader is not required (always true). preamble size could
2455           be acquired in simpler and safe way.
2456
2457 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2458
2459         * cs-parser.jay: report CS0642 at warning level 3
2460           and report CS0642 for an if else statement also
2461           fixes bug #74745. Patch by John Luke (and a bit
2462           modified by me).
2463           Removed extra CS0642 warning check for "while",
2464           "for" and "fixed".
2465         * statement.cs: In Block.Resolve(), CS0642 check
2466           is reimplemented to check a sequence of an empty
2467           statement and a block.
2468
2469           Both fix bug #66777.
2470
2471 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2472
2473         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2474         detection until I fix it.
2475         
2476         * cs-tokenizer.cs: Changed error message.
2477         
2478         * cs-parser.jay: Fixed 2 error locations.
2479         
2480         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2481         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2482         properties.
2483         
2484         * enum.cs (GetSignatureForError): Fixed.
2485         
2486         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2487         method detection.
2488         
2489         * class.cs,
2490         * typemanager.cs (RegisterProperty): Removed.
2491         
2492         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2493
2494 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2495
2496         Fix #75874.
2497         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2498         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2499
2500 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2501
2502         * expression.cs : tiny fix is required for not warning positive ulong.
2503           See test-441.cs.
2504
2505 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2506
2507         * expression.cs : add CS0652 check for constant and integral
2508           expression. Fixed bug #53974.
2509
2510 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2511
2512         * expression.cs : in DoNumericPromotions(), check if there is implicit
2513           conversion overload for string (to check CS0034). Fixed bug #52492.
2514
2515 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2516
2517         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2518
2519 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2520
2521         * ecore.cs : report location when it is *not* Null.
2522
2523 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2524
2525         * codegen.cs,
2526           ecore.cs,
2527           flowanalysis.cs,
2528           expression.cs:
2529           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2530           correctly. Fixed bug #75721.
2531
2532 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2533
2534         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2535         loop that performs 'min (pos, char_count)'.
2536
2537         Fix #75862.
2538         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2539         converted value in Operator.OnesComplement.
2540
2541 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2542
2543         * anonymous.cs: If the anon method is pulled into a helper class,
2544         it needs to be `internal' not `private'. Fixes runtime behavior on
2545         msft. bug #75704
2546
2547 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2548
2549         Fix #75803
2550         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2551         is a partial class.
2552
2553 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2554
2555         The big constants rewrite
2556         Fix #75746, #75685 and more
2557         As a side effect saved 1MB for MWF ;-)
2558         
2559         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2560         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2561         enum based for corlib compilation.
2562         
2563         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2564         subtractions.
2565         
2566         * class.cs (FixedField.Define): Use ResolveAsConstant.
2567         
2568         * const.cs (IConstant): Interface constants and enums.
2569         (Const.ResolveValue): New method for constant resolvning.
2570         (ExternalConstant): Constants from imported assemblies.
2571         
2572         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2573         conversion; like enums.
2574         (Constant.ToType): Converts this constant to different type.
2575         (Constant.Increment): Adds 1.
2576         
2577         * convert.cs (ImplicitConversionRequired): Simplified.
2578         
2579         * cs-parser.jay: Create EnumMember directly.
2580         
2581         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2582         
2583         * doc.cs (GenerateEnumDocComment): Removed.
2584         
2585         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2586         (ConvertIntLiteral): Removed.
2587         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2588         
2589         * enum.cs (EnumMember): Implement IConstant.
2590         (Enum.IsValidEnumConstant): Removed.
2591         (Enum.GetNextDefaultValue): Removed.
2592         (Enum.FindMembers): Updated.
2593         (Enum.GenerateDocComment): Iterate enum members.
2594         
2595         * expression.cs (Cast.TryReduce): Handle enums correctly.
2596         (New.Constantify): Made public.
2597         (MemberAccess.DoResolve): Removed contant specific if(s).
2598         
2599         * literal.cs (NullLiteral): Implement new abstract methods.
2600         
2601         * statement.cs (GotoCase.Resolve): Use new constant methods.
2602         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2603         
2604         * typemanager.cs (LookupEnum): Removed.
2605         (IsEnumType): Fixed to work with corlib.
2606         (RegisterConstant): Removed.
2607         (LookupConstant): Removed.
2608         (GetConstant): Changed to work with IConstant.
2609
2610 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2611
2612         * location.cs : Fixed overflown (>255) column number.
2613
2614 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2615
2616         First cut of the qualified-alias-member feature.
2617         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2618         token.
2619         * cs-parser.jay (DOUBLE_COLON): New token.
2620         (namespace_or_type_name): Add rule for recognizing
2621         qualified-alias-members.
2622         (primary_expression): Likewise.
2623         (element_access): Allow QualifiedAliasMember as a possible
2624         type-bearing expression.
2625         (local_variable_type, local_variable_pointer_type): Likewise.
2626         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2627         aliases in the current and enclosing namespace declarations.
2628         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2629         * decl.cs (MemberName.is_double_colon): New.
2630         (MemberName.MemberName): Add new constructor for alias-member.
2631         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2632         * expression.cs (QualifiedAliasMember): New expression type.
2633
2634 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2635
2636         * location.cs : it borked when no argument was specified.
2637
2638 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2639
2640         * location.cs : tiny ToString() format fix.
2641
2642 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2643
2644         * statement.cs : oops, it was missing.
2645
2646 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2647
2648         A set of fixes for precise line/column location.
2649
2650         * location.cs :
2651           "token" field now holds a file/line "delta", a line number offset 
2652           from the segment, and a column number. See also:
2653           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2654           December/009508.html
2655           Removed static IsNull. Use instance IsNull property instead.
2656         * cs-tokenizer.cs :
2657           For some tokens it stores Location. For Identifier it stores
2658           LocatedToken which is a pair of string name and location.
2659           Column numbers are adjusted only at getChar().
2660         * report.cs :
2661           Use Location.ToString() for reporting (it now contains column).
2662         * cs-parser.jay :
2663           Largely modified to use LocatedToken instead of
2664           string (IDENTIFIER), and to acquire Location from some tokens.
2665         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2666           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2667           codegen.cs :
2668           Now MemberName holds Location. DeclSpace.ctor() receives Location
2669           as a parameter. Removed extra parameters to all derived classes.
2670           Replaced Location.IsNull() with instance property.
2671         * assign.cs, expression.cs :
2672           Added .ctor() overload that omits Location.
2673         * attribute.cs :
2674           Added "nameEscaped" flag that indicates the identifier was escaped
2675           in the source file. This fixes bug #57047.
2676
2677 2005-09-02  Martin Baulig  <martin@ximian.com>
2678
2679         * class.cs: Make CS3005 a warning, not an error.
2680
2681 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2682
2683         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2684         New method, looking for lo-case imported cls type.
2685
2686         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2687         here.
2688
2689         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2690
2691         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2692
2693         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2694         all_imported_types.
2695         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2696
2697         Optimized to save 3.5 MB for SWF compilation.
2698
2699 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2700
2701         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2702         (PartialContainer.Create): Moved logic AddToContainer.
2703         (PartialContainer.MarkForDuplicationCheck): Shares name.
2704         
2705         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2706         place.
2707         
2708         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2709         initialization.
2710         (Namespace.GetSignatureForError): New method.
2711         
2712         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2713         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2714
2715 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2716
2717         Fix #75669.
2718         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2719         member lookup rather than qualifier_type, since qualifier_type can
2720         be null.
2721
2722 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2723
2724         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2725         enum member.
2726
2727 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2728
2729         * statement.cs: Copy the local exception into the exception
2730         captured local.  Fixes 75674
2731
2732 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2733
2734         Fix #75658.
2735         * expression.cs (Invocation.OverloadResolve): Don't report error
2736         CS1501 if error CS1502 has been reported.
2737         (New.DoResolve): Delegate CS1501 reporting to
2738         Invocation.OverloadResolve.
2739
2740         Fix #75656.
2741         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2742         invariant-meaning-in-block property in an enclosing block if
2743         necessary.
2744
2745 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2746
2747         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2748         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2749         (Switch.CheckSwitch): Just save 50kb for SWF.
2750
2751 2005-07-27  Martin Baulig  <martin@ximian.com>
2752
2753         * anonymous.cs (CaptureContext.AddField): Added
2754         `AnonymousContainer am' argument; compute its toplevel scope if
2755         it's not already computed.  Fixes #75649.
2756
2757 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2758
2759         Fix #75628.
2760         * class.cs (Constructor.Emit): Reset block to null if the block
2761         resolve fails.
2762
2763 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2764
2765         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2766
2767 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2768
2769         * class.cs (MethodData.Define): Check whether accessor implementing
2770         interface is public.
2771
2772         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2773
2774 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2775
2776         Fix #57245
2777         * namespace.cs (LookupType): Moved same type check to...
2778         
2779         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2780         with the same name.
2781
2782 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2783
2784         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2785         already found a typebuilder.
2786         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2787         MemberNames, not strings.
2788
2789         * const.cs (Error_ExpressionMustBeConst): 
2790         Rename from Error_EpressionMustBeConst.
2791         * const.cs, class.cs, statement.cd: Update.
2792
2793 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2794
2795         Fix #65573
2796
2797         * const.cs (Const.LookupConstantValue): Report missing contant expression
2798         everytime.
2799         (Error_EpressionMustBeConstant): Only one error method.
2800
2801         * class.cs, statement.c: Updated.
2802
2803 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2804
2805         * statement.cs (Block.Flags): Add back HasVarargs.
2806         (Block.flags): Make protected.
2807         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2808
2809         * typemanager.cs (types, typecontainers, user_types): Remove.
2810         (UserTypes, TypeContainers): Likewise.
2811         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2812         (CleanUp, Reset): Update.
2813         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2814         (GetNestedType): Use Type.GetNestedType.
2815         (CoreLookupType): Take two arguments, the namespace and the
2816         basename of the type.  Update to use the Namespace.Lookup
2817         mechanism.
2818         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2819         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2820         string concatenation and substring matches.
2821         * class.cs, enum.cs, delegate.cs: Update to changes.
2822
2823 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2824
2825         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2826         Expression and made virtual.
2827
2828         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2829         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2830
2831         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2832
2833         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2834         error message.
2835
2836         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2837         change.
2838
2839 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2840
2841         Fix #57707
2842         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2843         AssemblyCultureAttribute is not used on executable.
2844
2845         * rootcontext.cs,
2846         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2847
2848 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2849
2850         Fix #60638.
2851         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2852         New.  Reports CS0252/CS0253.
2853         Mostly taken from preliminary patch by Duncak Mak.
2854         (Binary.DoResolveOperator): Store results of operator lookup.
2855         Use them to detect if we need to warn about unintended reference
2856         comparisons.
2857
2858 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2859
2860         Fix #72969.
2861         * namespace.cs (Namespace.Lookup): Add back location parameter.
2862         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2863         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2864
2865         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2866         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2867         (Namespace.LookupType): ... this.
2868         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2869         of namespaces.
2870         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2871         purported to handle pointers.
2872         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2873         CoreLookupType.
2874
2875 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2876
2877         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2878         type as namespace.
2879
2880 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2881
2882         * namespace.cs (Namespace.Lookup): Drop location parameter.
2883         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2884         (NamespaceEntry.Lookup): ... this.
2885         (NamespaceEntry.Error_AmbiguousTypeReference):
2886         Move here from DeclSpace.
2887         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2888         names ...
2889         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2890         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2891         Move to NamespaceEntry.
2892         * delegate.cs, expression.cs: Update to changes.
2893
2894 2005-08-31  Martin Baulig  <martin@ximian.com>
2895
2896         Committing a patch from Atsushi Enomoto for #75850.
2897
2898         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2899         Prefer a generic enumerator over a non-generic one.
2900
2901 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2902
2903         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2904         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2905
2906 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2907
2908         * driver.cs : reverting default encoding change as well as mcs.
2909
2910 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2911
2912         * driver.cs, support.cs : merged r48826.
2913           Marek Safer wrote:
2914           > could you integrate your mcs changes to gmcs otherwise
2915           > gmcs cannot compile some files.
2916
2917 2005-08-20  Martin Baulig  <martin@ximian.com>
2918
2919         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2920         scope if we don't already have it.
2921
2922         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2923         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2924         fixes #75867.
2925
2926 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2927
2928         * statement.cs: Copy the local exception into the exception
2929         captured local.  Fixes 75674
2930
2931 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2932
2933         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2934         type as namespace.
2935
2936 2005-08-12  Martin Baulig  <martin@ximian.com>
2937
2938         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2939         for nested types here to avoid hitting the cache too early.
2940
2941 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2942
2943         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2944         an error. 
2945
2946 2005-08-03  Martin Baulig  <martin@ximian.com>
2947
2948         Make iterators in generic methods work; see gtest-191.cs.
2949
2950         * generic.cs
2951         (Constraints.Resolve): Protect against being called twice.
2952
2953         * class.cs
2954         (TypeContainer.GetClassBases): Make this `protected virtual'.
2955
2956         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2957         (Iterator.GetClassBases): Override this and compute the base
2958         classes here.
2959         (Iterator.DefineNestedTypes): If we're a generic method, all our
2960         method type parameters become class type parameters on the proxy
2961         class.
2962
2963         * statement.cs
2964         (ToplevelBlock.Parameters): Make this a property, not a field.
2965         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2966
2967 2005-08-03  Martin Baulig  <martin@ximian.com>
2968
2969         * typemanager.cs (TypeManager.IsSubclassOf): Use
2970         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2971         (TypeManager.GetFullName_recursed): Improved.
2972
2973 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2974
2975         Fix #75417
2976         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2977         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2978         invocation_type == mi.DeclaringType, since the first one also checks
2979         other condition used by generic instances.
2980         
2981 2005-07-27  Martin Baulig  <martin@ximian.com>
2982
2983         * anonymous.cs (CaptureContext.AddField): Added
2984         `AnonymousContainer am' argument; compute its toplevel scope if
2985         it's not already computed.  Fixes #75649.
2986
2987 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2988
2989         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2990         CheckAttributeType and refactored.
2991         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2992         ResolveAsTypeTerminal error handling.
2993         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2994         handling.
2995         (GetSignatureForError): Print errors in same way.
2996
2997         * class.cs,
2998         * codegen.cs: Reflect attribute GetSignatureForError change.
2999
3000         * ecore.cs,
3001         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3002
3003         * namespace.cs (UsingEntry): Refactored to make fields private.
3004
3005         * assign.cs,
3006         statement.cs: Error_UnexpectedKind has extra parameter.
3007
3008 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3009
3010         * ecore.cs (IAlias): Remove.
3011         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3012         that implement the interface.
3013         * namespace.cs (Namespace): Likewise.
3014         (Namespace.declspaces): Renamed from 'defined_names'.
3015         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3016         DeclSpace instead of an IAlias.
3017         * tree.cs (Tree.AddDecl): Update.
3018
3019 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3020
3021         * statement.cs (Block.Flags); Remove HasVarargs.
3022         (Block.HasVarargs): Move to ToplevelBlock.
3023         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3024         (Block.Variables): Make protected.  Initialize variable hashtable
3025         if necessary.
3026         (Block.AddVariable): Update.
3027         (Block.Resolve): Update to changes.
3028         (ToplevelBlock.HasVarargs): New boolean.
3029         (ToplevelBlock.ThisVariable): Move here from Block.
3030         (ToplevelBlock.AddThisVariable): Likewise.
3031         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3032         * expression.cs (This.ResolveBase): Update to changes.
3033         (ArglistAccess.DoResolve): Likewise.
3034
3035 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3036
3037         Fix #75321
3038         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3039
3040         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3041         not used and not used & assigned.
3042         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3043
3044 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3045
3046         Fix #75053
3047         * expression.cs (Is.DoResolve): null is never provided type.
3048
3049 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3050
3051         Fix #52496
3052         * cs-parser.jay: Less strict event error rule to catch more errors.
3053
3054 2005-07-11  Martin Baulig  <martin@ximian.com>
3055
3056         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3057         for the constructor constraint: we do not only have to check
3058         whether the class has a public constructor, but also ensure that
3059         it's parameterless.  Fixes #75492.
3060
3061 2005-07-11  Martin Baulig  <martin@ximian.com>
3062
3063         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3064         between type parameters if they either have the reference type
3065         constraint or the class constraint.
3066
3067 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3068
3069         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3070
3071 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3072
3073         Fix #74975
3074         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3075         (ExtractSecurityPermissionSet): Cope with self referencing security
3076         attributes properly.
3077
3078         * driver.cs (SetOutputFile): Made public property OutputFile.
3079
3080 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3081
3082         Fix #75486.
3083         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3084         has_nonstatic_fields.  Make into a FieldBase pointer.
3085         (TypeContainer.AddField): Add CS0282 check.
3086         (TypeContainer.EmitType): Update.
3087
3088 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3089
3090         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3091         compare if they start with __.
3092
3093 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3094
3095         * statement.cs (Switch.SwitchGoverningType): Only look at
3096         UserCasts that don't need implicit standard conversions to one of
3097         the allowed switch types (Fixes test-322.cs).
3098         (LocalInfo.Resolve): Re-enable sanity-test.
3099
3100 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3101
3102         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3103         
3104         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3105         
3106         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3107
3108 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3109
3110         Fix #75472.
3111         * ecore.cs (SimpleName.GetSignatureForError): Add.
3112         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3113         (MemberAccess.GetSignatureForError): Add.
3114
3115 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3116  
3117         The big error and warning messages review.
3118         
3119         * anonymous.cs,
3120         * assign.cs,
3121         * attribute.cs,
3122         * class.cs,
3123         * codegen.cs,
3124         * convert.cs,
3125         * cs-parser.jay,
3126         * cs-tokenizer.cs,
3127         * decl.cs,
3128         * delegate.cs,
3129         * doc.cs,
3130         * driver.cs,
3131         * ecore.cs,
3132         * enum.cs,
3133         * expression.cs,
3134         * flowanalysis.cs,
3135         * iterators.cs,
3136         * literal.cs,
3137         * location.cs,
3138         * modifiers.cs,
3139         * namespace.cs,
3140         * parameter.cs,
3141         * pending.cs,
3142         * report.cs,
3143         * rootcontext.cs,
3144         * statement.cs,
3145         * support.cs,
3146         * tree.cs,
3147         * typemanager.cs: Updated.
3148         
3149         * class.cs: (MethodCore.SetYields): Moved here to share.
3150         (PropertyMethod.Define): Moved iterator setup here.
3151         
3152         * iterators.cs: Add orig_method to have full access to parent
3153         container.
3154
3155 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3156
3157         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3158         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3159         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3160         variable of struct type.
3161         * expression.cs (Unary.ResolveOperator): Update to change.
3162         (Indirection.VerifyFixed): Likewise.
3163         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3164         (ParameterReference.VerifyFixed): Value parameters are fixed.
3165         (This.VerifyFixed): Treat 'this' as a value parameter.
3166         * statement.cs (LocalInfo.IsFixed): Remove.
3167
3168 2005-07-01  Martin Baulig  <martin@ximian.com>
3169
3170         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3171         `ec.EmitThis ()' to get the correct scope.
3172
3173 2005-07-01  Martin Baulig  <martin@ximian.com>
3174
3175         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3176         instance is a ParameterReference; fixes #75299.
3177
3178 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3179
3180         Fix #75412.
3181         * expression.cs (Indexers.map): Remove.
3182         (Indexers.Append): Filter out inaccessible setters and getters.
3183         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3184
3185         Fix #75283.
3186         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3187         Refactored from ...
3188         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3189         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3190         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3191         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3192
3193 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3194
3195         Fix #75322
3196         * class.cs (FieldBase.GetInitializerExpression): One more field
3197         for backup.
3198
3199 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3200
3201         * pending.cs: Do not define a proxy if the base method is virtual,
3202         it will be picked up by the runtime (bug 75270).
3203
3204 2005-07-08  Martin Baulig  <martin@ximian.com>
3205
3206         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3207         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3208
3209 2005-07-07  Martin Baulig  <martin@ximian.com>
3210
3211         * generic.cs (ConstructedType.CheckConstraint): Use
3212         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3213         called recursively; fixes #75329.
3214
3215 2005-07-06  Martin Baulig  <martin@ximian.com>
3216
3217         * generic.cs (TypeManager.InferTypeArguments): Added support for
3218         anonymous methods; fixes #75461.
3219
3220 2005-07-01  Martin Baulig  <martin@ximian.com>
3221
3222         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3223         `ec.EmitThis ()' to get the correct scope.
3224
3225 2005-07-01  Martin Baulig  <martin@ximian.com>
3226
3227         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3228         instance is `This'; fixes #75299.
3229
3230 2005-06-30  Martin Baulig  <martin@ximian.com>
3231
3232         * class.cs (Indexer): Implement IIteratorContainer; added support
3233         for iterators in indexers.
3234
3235         * codegen.cs
3236         (EmitContext.CurrentIterator): Make this a property, not a field.
3237
3238         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3239
3240 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3241
3242         * pending.cs: Do not define a proxy if the base method is virtual,
3243         it will be picked up by the runtime (bug 75270).
3244
3245 2005-06-28  Martin Baulig  <martin@ximian.com>
3246
3247         * cs-parser.jay (interface_method_declaration): Avoid a
3248         reduce/reduce conflict by moving some of the code into a separate
3249         `interface_method_declaration_body' rule; fixes #75368.
3250
3251 2005-06-28  Martin Baulig  <martin@ximian.com>
3252
3253         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3254         array check after the check for TypeBuilder's.
3255
3256 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3257
3258         * convert.cs (FindMostEncompassedType): Add two trivial special
3259         cases (number_of_types == 0 || number_of_types == 1).
3260         (FindMostEncompasingType): Likewise.
3261
3262 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3263
3264         Some cleanups preparing for the fix of #75283.
3265         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3266         error testing.
3267         (EventExpr.InstanceResolve): Likewise.
3268         (EventExpr.DoResolve): Remove redundant checks.
3269
3270 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3271
3272         * class.cs: Small fix.
3273
3274 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3275
3276         Fix #75160.
3277         * class.cs (GetPartialBases): Fix return value check of
3278         part.GetClassBases.
3279
3280 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3281
3282         Ensure that partial classes are registered in their enclosing
3283         namespace.  Initial part of fix of #75160.
3284         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3285         Register declspace with namespace here, not in
3286         DeclSpace.RecordDecl.
3287         * cs-parser.jay: Pass namespace to RecordDecl.
3288         * class.cs (PartialContainer.Create): Likewise.
3289         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3290         called.
3291         * decl.cs (Declspace.RecordDecl): Remove.
3292         * namespace.cs (NamespaceEntry.DefineName): Remove.
3293
3294 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3295
3296         * rootcontext.cs: Reset TargetExt as well.
3297
3298 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3299
3300         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3301         -langversion:ISO-1.
3302
3303 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3304
3305         Fix #75080, cs0119.cs.
3306         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3307         of ...
3308         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3309         allowing ExprClass.Type and ExprClass.Namespace for
3310         ResolveFlags.VariableOrValue.
3311         (Expression.Resolve) [1-argument variant]: Change default resolve
3312         flags based on language version.
3313         (Expression.Error_UnexpectedKind): Use a simple string array
3314         rather than an ArrayList.
3315         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3316         not ExprClass.Type.
3317         (TypeOfVoid.DoResolve): Likewise.
3318         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3319         flags argument -- it always has the same value.
3320
3321 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3322
3323         Fix #75081.
3324         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3325         Use it in the error message.
3326         * assign.cs, expression.cs, statement.cs: Update.
3327
3328 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3329
3330         Fix #75088.
3331         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3332         the "almostMatchedMember" case too.
3333         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3334         that failed the accessibility checks to 'almost_match'.
3335
3336 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3337
3338         * attribute.cs: Use internal MethodBuilder methods to set
3339         ExactSpelling and SetLastError on PInvoke methods, instead
3340         of passing them via charset.  Fixes #75060.
3341
3342 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3343
3344         * parameter.cs (Parameter): Remove TODO comment.
3345         (Parameter.DefineParameter): Remove Location parameter.
3346         (Parameters.LabelParameters): Likewise.
3347         * class.cs (Constructor.Emit): Update to change.
3348         (MethodData.Emit): Likewise.
3349         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3350         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3351
3352 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3353
3354         * parameter.cs,
3355           Removed Parameters.Location and added Parameter.Location instead.
3356           Removed Location parameter from Emit() and GetSignature().
3357         * anonymous.cs,
3358           class.cs,
3359           cs-parser.jay,
3360           delegate.cs,
3361           iterators.cs,
3362           statement.cs :
3363           Modified all related calls.
3364
3365 2005-06-21  Martin Baulig  <martin@ximian.com>
3366
3367         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3368         left-hand side is not a nullable type; fixes #75328.
3369
3370 2005-06-21  Martin Baulig  <martin@ximian.com>
3371
3372         * typemanager.cs
3373         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3374         (TypeManager.GetFullNameSignature): Likewise.
3375
3376         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3377         `source.FullName' and `target.FullName' to check whether there are
3378         two conflicting definitions.
3379
3380 2005-06-21  Martin Baulig  <martin@ximian.com>
3381
3382         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3383         a BoxedCast - also for reference types - to be compatible with csc.
3384
3385 2005-06-21  Martin Baulig  <martin@ximian.com>
3386
3387         * expression.cs (MemberAccess.DoResolve): Add support for nested
3388         types in a generic instance; fixes #75320.
3389
3390 2005-06-20  Martin Baulig  <martin@ximian.com>
3391
3392         * generic.cs (TypeManager.InferType): Also walk the class
3393         hierarchy for generic instances; fixes #75261.
3394
3395 2005-06-17  Martin Baulig  <martin@ximian.com>
3396
3397         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3398         to make things work for corlib.
3399
3400 2005-06-15  Martin Baulig  <martin@ximian.com>
3401
3402         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3403         obsolete `SecurityAction' values.
3404
3405 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3406
3407         * rootcontext.cs: Reset TargetExt as well.
3408         
3409 2005-06-09  Martin Baulig  <martin@ximian.com>
3410
3411         * delegate.cs (Delegate.VerifyMethod): Added
3412         `MethodGroupExpr old_mg' argument; inherit its
3413         `HasTypeParameters'; fix #75085.
3414
3415 2005-06-09  Martin Baulig  <martin@ximian.com>
3416
3417         * expression.cs (Invocation.OverloadResolve): Correctly handle
3418         generic methods for the SetMemberIsUsed(); fix #75064.
3419
3420 2005-06-09  Martin Baulig  <martin@ximian.com>
3421
3422         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3423         fixes #75062.
3424
3425 2005-06-08  Martin Baulig  <martin@ximian.com>
3426
3427         * cs-parser.jay (nullable_type_or_conditional): If we put the
3428         nullable back and our `type' is a `ComposedCast', remove the
3429         nullable from it.  Fixes #75156.
3430
3431         * expression.cs (ComposedCast.RemoveNullable): New public method.
3432
3433 2005-06-08  Martin Baulig  <martin@ximian.com>
3434
3435         The big Iterators rewrite :-)
3436
3437         * iterators.cs: Rewrite this to use the anonymous methods framework.
3438
3439         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3440         before the TypeContainers; see 2test-21.cs.
3441
3442         * class.cs
3443         (TypeContainer.DefineType): Don't create a new EmitContext if we
3444         already have one (this only happens if we're an Iterator).
3445         (TypeContainer.Define): Also call Define() on all our iterators.
3446         (Method.CreateEmitContext): Added support for iterators.
3447
3448         * anonymous.cs
3449         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3450         (AnonymousContainer.CreateMethodHost): Moved here from
3451         AnonymousMethod and made abstract.
3452         (AnonymousContainer.CreateScopeType): New abstract method.
3453         (AnonymousContainer.IsIterator): New public property.
3454         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3455         get the ScopeTypeBuilder rather than manually defining it here. 
3456         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3457         iterators here.
3458
3459         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3460         before RootContext.DefineTypes().
3461
3462         * codegen.cs (EmitContext.RemapToProxy): Removed.
3463         (EmitContext.CurrentAnonymousMethod): Changed type from
3464         AnonymousMethod -> AnonymousContainer.
3465         (EmitContext.ResolveTopBlock): Protect from being called twice.
3466         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3467         (EmitContext.EmitThis): Removed the iterators hacks; use the
3468         anonymous methods framework for that.
3469
3470         * statement.cs
3471         (ToplevelBlock.Container): Make this a property, not a field.
3472         (ToplevelBlock.ReParent): New public method; move the
3473         ToplevelBlock into a new container.
3474         (Foreach.TemporaryVariable): Simplify.
3475
3476 2005-06-05  Martin Baulig  <martin@ximian.com>
3477
3478         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3479         (Block.AddTemporaryVariable): New public method; creates a new
3480         `LocalInfo' for a temporary variable.
3481         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3482         variables here.
3483         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3484         non-iterator variables.
3485
3486 2005-06-05  Martin Baulig  <martin@ximian.com>
3487
3488         * statement.cs (Foreach.TemporaryVariable): Create the
3489         LocalBuilder in the Emit phase and not in Resolve since in some
3490         situations, we don't have an ILGenerator during Resolve; see
3491         2test-19.cs for an example.
3492
3493 2005-06-04  Martin Baulig  <martin@ximian.com>
3494
3495         The big Foreach rewrite - Part II.
3496
3497         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3498         with `PropertyInfo ienumerator_getcurrent'.
3499
3500         * codegen.cs (VariableStorage): Removed.
3501
3502         * statement.cs
3503         (Foreach): Derive from Statement, not ExceptionStatement.
3504         (Foreach.CollectionForeach): New nested class.  Moved all the code
3505         dealing with collection foreach here.
3506         (Foreach.ForeachHelperMethods): Removed.
3507         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3508
3509 2005-05-23  Martin Baulig  <martin@ximian.com>
3510
3511         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3512         don't need to.  Fix #75014.
3513
3514 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3515
3516         Improve user-defined conversion handling.
3517         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3518         applicable operators.
3519         (AddConversionOperators): New.  Helper for GetConversionOperators.
3520         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3521         there is only one most encompassed/encompassing type.
3522         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3523         "applicable operator" handling.
3524         (UserConversion): Move cache here from GetConversionOperators.
3525         Directly cache the chosen operator, rather than the whole
3526         MethodGroup.
3527         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3528         case.  Allow conversion of decimal to sbyte and byte too.
3529         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3530         New static methods.  Used to avoid allocating EmptyExpressions in
3531         convert.cs.
3532
3533 2005-05-24  Duncan Mak  <duncan@novell.com>
3534
3535         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3536         another class, used in Convert.ExplicitNumericConversion.
3537         (CastToDecimal): New class, similar to above, but casts to
3538         System.Decimal, used in Convert.ImplicitNumericConversion and also
3539         in explicit convesion from double/float to decimal.
3540
3541         * convert.cs (ImplicitNumericConversion): Handle implicit
3542         conversions to System.Decimal.
3543         (ExplicitNumericConversion): handle explicit conversions to
3544         System.Decimal.
3545
3546         This fixes #68711.
3547         
3548 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3549
3550         * typemanager.cs: Do not throw an exception in the TypeBuilder
3551         case, we take care of it on the TypeCode.
3552
3553 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3554         
3555         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3556         is back.
3557         
3558         * cs-parser.jay: Catch more lexical errors.
3559         
3560         * report.cs: Add one more Error method.
3561         
3562         * rootcontext.cs,
3563         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3564
3565 2005-05-20  Martin Baulig  <martin@ximian.com>
3566
3567         * class.cs (TypeContainer.CircularDepException): Removed.
3568         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3569         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3570         (CS0146) and interface (CS0529) dependencies here.
3571
3572 2005-05-20  Martin Baulig  <martin@ximian.com>
3573
3574         * expression.cs (New.DoResolve): Move the CS0712 check above the
3575         CS0144 check; otherwise it can never be reached.
3576
3577 2005-05-20  Martin Baulig  <martin@ximian.com>
3578
3579         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3580
3581 2005-05-20  Martin Baulig  <martin@ximian.com>
3582
3583         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3584
3585         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3586
3587 2005-05-19  Martin Baulig  <martin@ximian.com>
3588
3589         * delegate.cs
3590         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3591         to disable error reporting.
3592
3593         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3594         here since we don't want to report an error; see the new test-336.cs.
3595
3596 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3597
3598         * statement.cs (ToplevelBlock.GetParameterReference)
3599         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3600         Move here from class Block.
3601         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3602         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3603
3604 2005-05-18  Martin Baulig  <martin@ximian.com>
3605
3606         Fix #74978.
3607
3608         * flowanalysis.cs
3609         (FlowBranching.Reachability): Add non-static public And() and Or()
3610         methods.
3611         (FlowBranchingSwitch): New class; do the `break_origins' thing
3612         like in FlowBranchingLoop.
3613         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3614         reachability, not just locals and parameters.
3615         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3616         switch; MergeBreakOrigins() now takes care of that.
3617
3618 2005-05-18  Martin Baulig  <martin@ximian.com>
3619
3620         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3621         a loop and may leave it, reset the barrier; fixes #74974.
3622
3623 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3624
3625         Fix test-382.cs.  Emit values of decimal constants.
3626         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3627         Carved out of ...
3628         (TypeContainer.AddField): ... this.
3629         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3630         with initializers to include 'Const's.
3631         (ClassPart.RegisterFieldForInitialization): Forward to
3632         PartialContainer.
3633         * const.cs (Const.Const): Pass initializer to base class.
3634         (Const.Define): In case of decimal constants, register them for
3635         initialization in a static constructor.
3636
3637 2005-05-14  Martin Baulig  <martin@ximian.com>
3638
3639         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3640         do not call ResolveUnreachable() on unreachable statements in
3641         here, see the comment in the source code.
3642
3643 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3644
3645         Fix #74934.
3646         * expression.cs (BinaryResolveOperator): If one of the operands of
3647         an equality comparison is 'null' and the other is a pointer type,
3648         convert the null to a NullPointer.
3649         * convert.cs (ImplicitReferenceConversion): If the expression is a
3650         NullLiteral and the target type is a pointer type, return a
3651         NullPointer instead.
3652         (ImplicitConversionStandard): Likewise.
3653
3654 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3655         
3656         * cs-parser.jay: Set readonly context based on special constructs.
3657         
3658         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3659         readonly variable error handling.
3660         
3661         * rootcontext.cs (EmitCode): Don't verify members when error
3662         occurred.
3663         
3664         * statement.cs (LocalInfo): Add reaodnly context information.
3665         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3666
3667 2005-05-17  Martin Baulig  <martin@ximian.com>
3668
3669         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3670         #70970. 
3671
3672 2005-05-13  Martin Baulig  <martin@ximian.com>
3673
3674         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3675         handle unreachable blocks.
3676
3677 2005-05-13  Martin Baulig  <martin@ximian.com>
3678
3679         * class.cs
3680         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3681         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3682         #74905. 
3683
3684 2005-05-13  Martin Baulig  <martin@ximian.com>
3685
3686         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3687         instance variable, not a local.  Fix #74873.
3688         (Block.ResolveUnreachable): Set it to true here.
3689
3690 2005-05-12  Martin Baulig  <martin@ximian.com>
3691
3692         * cs-parser.jay (property_declaration): Pass the `current_class',
3693         not the `current_container' to Property's .ctor.  Fixes #74912.
3694
3695 2005-05-11  Martin Baulig  <martin@ximian.com>
3696
3697         * typemanager.cs (Closure): Copy this from MCS and merge all the
3698         GMCS-specific changes into it.
3699
3700 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3701
3702         Fix #74920.
3703         * typemanager.cs (unmanaged_enclosing_types): New.
3704         (IsUnmanagedType): Avoid infloops by using
3705         'unmanaged_enclosing_types' to talk with recursive invocations.
3706
3707 2005-05-11  Duncan Mak  <duncan@novell.com>
3708
3709         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3710         continuing to process for 'arg'.
3711         (handle_preprocessing_directive): Check the argument of the #endif
3712         directive and report error CS1025 if there are any trailing
3713         characters.
3714
3715         According to the C# spec, having even whitespace after the #endif
3716         directive is illegal; however, because we call arg.TrimEnd ()
3717         beforehand, we have the same behavior as csc, allowing whitespace
3718         after the directive.
3719
3720         Fixes #74892.
3721
3722 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3723
3724         Fix #74863.
3725         
3726         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3727         (Constructor.GetObsoleteAttribute): Implemented correctly.
3728
3729 2005-05-10  Martin Baulig  <martin@ximian.com>
3730
3731         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3732         resolve the type; fixes #74864.
3733         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3734         in DoResolve(); fixes #74862.
3735
3736 2005-05-10  Martin Baulig  <martin@ximian.com>
3737
3738         * support.cs (ReflectionParameters.ParameterModifier): Use
3739         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3740         and `ParameterAttributes.In'.  Fixes #74884.
3741
3742 2005-05-10  Martin Baulig  <martin@ximian.com>
3743
3744         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3745         the cache if we're just looking for `MemberTypes.NestedType' in a
3746         generic instance.
3747
3748         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3749         constraints if we're still resolving the type tree.
3750         (Expression.MemberLookup): If we're resolving the type tree, only
3751         look for `MemberTypes.NestedType' since we're only interested in
3752         getting types.
3753
3754         * class.cs (TypeContainer.DefineType): Don't resolve the type
3755         parameters here; do this later in ResolveType() after the type
3756         tree has been resolved.
3757         (TypeContainer.ResolveType): New public method; this is called
3758         after the type tree is resolved and before the types are being
3759         populated.  We resolve the generic constraints here.
3760         (TypeContainer.DoDefineMember): Check the constraints on our base
3761         class and interfaces.
3762
3763         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3764         set the `ResolvingTypeTree' flag on the EmitContext.
3765
3766         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3767
3768 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3769
3770         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3771         
3772         * expression.cs (Argument.GetParameterModifier): Turned to property.
3773         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3774         
3775         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3776         its C# equivalent.
3777         
3778 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3779
3780         Fix #74852.
3781         * decl.cs (MemberCache.AddMethods): Register override methods,
3782         rather than non-override methods.
3783         * typemanager.cs (RegisterOverride): New.
3784         (IsOverride): Update.
3785
3786 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3787
3788         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3789
3790 2005-05-06  Martin Baulig  <martin@ximian.com>
3791
3792         * attribute.cs
3793         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3794         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3795
3796 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3797
3798         Fix #73105.
3799         
3800         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3801         recursive declaration.
3802         
3803         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3804         
3805 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3806
3807         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3808         
3809         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3810
3811 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3812
3813         Fix #74797.
3814         * decl.cs (DeclSpace.FamilyAccessible): 
3815         Use TypeManager.IsNestedFamilyAccessible.
3816
3817         Fix reopened #64812.
3818         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3819         internal'.
3820
3821 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3822             Abin Thomas  <projectmonokochi@rediffmail.com>
3823             Anoob V E  <projectmonokochi@rediffmail.com>
3824             Harilal P R  <projectmonokochi@rediffmail.com>
3825
3826         Fix #64812.
3827         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3828         allow access to all static members.
3829
3830 2005-05-04  Martin Baulig  <martin@ximian.com>
3831
3832         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3833
3834 2005-05-04  Martin Baulig  <martin@ximian.com>
3835
3836         Fix #74655.
3837
3838         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3839         section at the end; make things work if `default' is not the last
3840         section.        
3841
3842 2005-05-04  Martin Baulig  <martin@ximian.com>
3843
3844         Fix #70400.
3845
3846         * statement.cs (Switch): Replaced the `got_default' field with a
3847         `default_section' one.
3848         (Switch.CheckSwitch): Set `default_section' here.
3849         (Switch.Resolve): If we're a constant switch and the constant is
3850         not found, use the default section.
3851
3852 2005-05-03  Martin Baulig  <martin@ximian.com>
3853
3854         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3855
3856         * statement.cs (Foreach.ArrayForeach): New nested class.
3857         (Foreach.TemporaryVariable): New nested class.
3858         (Foreach.EmitArrayForeach): Removed; this is now in the new
3859         ArrayForeach class.
3860
3861 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3862
3863         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3864         more conservative.
3865         (VerifyPendingMethods): Revert change below.
3866
3867         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3868         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3869         that used to trigger warning -28.  Remove warning -28.
3870         * expression.cs (Invocation.OverloadResolve): Use
3871         TypeManager.IsOverride to distinguish override methods.
3872
3873         Fix #74773.
3874         * pending.cs (VerifyPendingMethods): If a base type implements the
3875         requested interface, don't bother checking individual methods of
3876         the base type.  As a side-effect, this prevents the creation of
3877         unnecessary proxies.
3878
3879 2005-05-02  Martin Baulig  <martin@ximian.com>
3880
3881         Fix #70182.
3882
3883         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3884         Also `And' the locals if the old vector is null.
3885         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3886         null; in this case we basically reset all the variables.        
3887
3888 2005-05-02  Martin Baulig  <martin@ximian.com>
3889
3890         Fix #74529.
3891
3892         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3893         Added `FlowBranching branching' argument; always `and' the
3894         variables instead of `or'ing them unless we're an infinite loop.
3895
3896         * statement.cs (While.Resolve): Create a new sibling unless we're
3897         infinite.       
3898
3899 2005-05-02  Martin Baulig  <martin@ximian.com>
3900
3901         Fix #70140.
3902
3903         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3904         arguments; use it instead of creating a new TopLevelBlock.
3905         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3906         our ConstructorInitializer.
3907
3908         * statement.cs
3909         (TopLevelBlock.TopLevelBranching): New public property.
3910         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3911         and create our `TopLevelBranching'.
3912
3913         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3914         anonymous method host, use `block.TopLevelBranching' rather than
3915         creating a new branching.
3916
3917 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3918
3919         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3920         a ScopeInfo, if any of the current children is a child of the new
3921         entry, move those children there.
3922
3923 2005-04-30  Martin Baulig  <martin@ximian.com>
3924
3925         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3926         at the beginning of a SwitchSection.  Fix #73335.
3927
3928 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3929
3930         Fix #74378
3931         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3932         
3933         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3934         (FieldExpr.DoResolve): Obsolete members are ignored for field
3935         initializers.
3936         
3937 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3938
3939         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3940         of arrays detection.
3941
3942         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3943         verification.
3944         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3945
3946         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3947         arrays report.
3948
3949 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3950
3951         * cs-parser.jay: Use the prefered version of -unsafe in error
3952         message.
3953
3954 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3955
3956         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3957         circumstances.
3958
3959 2005-04-20  John Luke  <john.luke@gmail.com>
3960
3961         * driver.cs: fix typo in error message, --outout to --output
3962
3963 2005-04-30  Martin Baulig  <martin@ximian.com>
3964
3965         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3966         handle the .NET 2.x security attributes.
3967
3968 2005-04-30  Martin Baulig  <martin@ximian.com>
3969
3970         * typemanager.cs
3971         (TypeManager.ExpandInterfaces): Don't add things twice.
3972
3973         * class.cs
3974         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3975
3976 2005-04-29  Martin Baulig  <martin@ximian.com>
3977
3978         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3979
3980         * anonymous.cs: Added support for anonymous generic methods.
3981
3982 2005-04-29  Martin Baulig  <martin@ximian.com>
3983
3984         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3985         generic instances.
3986
3987 2005-04-29  Martin Baulig  <martin@ximian.com>
3988
3989         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3990
3991         * expression.cs (New.DoResolve): Fix the CS0304 check.
3992
3993 2005-04-29  Martin Baulig  <martin@ximian.com>
3994
3995         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3996         naming schema.
3997
3998         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3999         explicit interface implementation, compare the interface types.
4000         (MethodData.Define): Use the new naming scheme from the latest
4001         .NET 2.x beta2.
4002         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4003
4004         * decl.cs (MemberName.GetMemberName): Removed.
4005         (MemberName.MethodName, FullName): New properties.
4006
4007 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4008
4009         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4010
4011 2005-04-22  Martin Baulig  <martin@ximian.com>
4012
4013         * generic.cs (GenericMethod): Create the EmitContext in the
4014         `Define()'; in `Define(MethodBuilder)', create the type parameters
4015         before calling `Define()'.  Fixes #73933.
4016
4017 2005-04-22  Martin Baulig  <martin@ximian.com>
4018
4019         * generic.cs
4020         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4021         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4022
4023         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4024         ConstructedType, check its constraints.
4025
4026 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4027
4028         * codegen.cs (InRefOutArgumentResolving): New field.
4029         
4030         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4031         fields outside contructor.
4032         
4033         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4034         
4035 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4036
4037         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4038         parameter code was not completed ever, so it was not as up-to-date
4039         as local variables.  Must finish it.
4040
4041         The bug fix was to compare the Toplevel of the block, not the
4042         current block.  Thanks for Ben for pointing this out. 
4043
4044 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4045
4046         * decl.cs (AddMethods): Use the declaring type of the problem
4047         method to determine if we want to squash a warning.
4048
4049 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4050
4051         * attribute.cs: Removed debug output.
4052
4053         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4054         
4055         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4056         Report.Stderr.
4057         
4058 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4059
4060         Fix #74481.
4061         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4062         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4063         all null comparisons against reference types.
4064
4065 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4066
4067         Fix# 74565
4068         * class.cs (TypeContainer.CircularDepException) New nested
4069         exception class.
4070         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4071         (TypeContainer.DefineType): Removed error, reset InTransit before
4072         exit.
4073         (Class.DefineType): Throw exception when is in Transit.
4074         Catch exception and report error.
4075         (Struct.DefineType): Throw exception when is in Transit.
4076         Catch exception and report error.
4077         (Interface.DefineType): Throw exception when is in Transit.
4078         Catch exception and report error.
4079
4080         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4081         handle nested exception handlers.
4082
4083         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4084         a catch.
4085
4086         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4087         InFinally and InCatch storage.
4088
4089         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4090         (Catch.Resolve): Set and Restore ec.InCatch.
4091         (Try.Resolve): Set and Restore ec.InFinally.
4092         (Try.HasCatch): True when try has catch.
4093
4094 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4095
4096         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4097           for the same event member, so exclude such cases from warning 419.
4098           Fixed bug #74633.
4099
4100 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4101
4102         * expression.cs (Binary.ResolveOperator): Apply patch from John
4103         Luke to fix bug 59864: operators &, | and ^ on enumerations
4104         require that the same enum type on both sides.
4105
4106         * driver.cs: Add warnings to old flag usage, this is to assist
4107         people who produce Makefiles and hope that the Makefiles will be
4108         used on Windows.
4109
4110         * class.cs (TypeContainer.EmitType): Moved the definition of the
4111         special $PRIVATE$ field from the resolve phase to the Emit phase.
4112         During resolve we do not know if we are a struct with
4113         HasExplicitLayout, we know this only after the attributes for the
4114         type are emitted.
4115
4116         Set the FieldOffset to zero on the dummy field that we create for
4117         the class.   Fixes 74590.
4118
4119 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4120
4121         Fix #73834.
4122         * ecore.cs (PropertyExpr.resolved): New.
4123         (DoResolve): Use it to handle a case of double resolution here.
4124         Handle a case of identical-name-and-type-name.
4125         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4126         resolution by storing the results of expression resolution back
4127         into the "probes" array.
4128
4129 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4130
4131         Fix cs0208-7.cs and cs0208-8.cs.
4132         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4133         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4134         error reporting to point out the reason a struct is not unmanaged.
4135
4136 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4137
4138         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4139           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4140
4141 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4142
4143         Fix #74528.
4144         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4145         IdenticalNameAndTypeName here.
4146         (EventExpr.InstanceResolve): Likewise.
4147
4148 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4149
4150         C# 2.0 DefaultCharSetAttribute implementation
4151         
4152         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4153         which allows us to set GlobalNamespace for every resolve.
4154         (Attribute.ResolveArguments): Cut from Resolve.
4155         (Attribute.GetCharSetValue): Returns CharSet named argument.
4156         (Attribute.DefinePInvokeMethod): Gets default charset from
4157         module settings.
4158         (GlobalAttribute.ResolveAsTypeStep): Override.
4159         (GlobalAttribute.ResolveArguments): Override.
4160         
4161         * class.cs (TypeAttr): Is protected.
4162         
4163         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4164         (ModuleClass.DefaultCharSetType): New memeber.
4165         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4166         
4167         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4168         charset from module.
4169         
4170         * delegate.cs (TypeAttr): Override.
4171         (Delegate.DefineType): Use this TypeAttr.
4172         
4173         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4174         at very early stage (before types are defined) to resolve model
4175         module attributes. It will probably not work with corlib but it
4176         should be ok.
4177         
4178         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4179         charset from module.
4180         
4181         * typemanager.cs (default_charset_type): New type.
4182
4183 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4184
4185         * decl.cs (MemberCache.AddMethods): Don't warn if
4186         System.Object.Finalize has buggy MethodAttributes.
4187
4188         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4189         removed below.
4190
4191 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4192
4193         * doc.cs : detect ambiguous reference to overloaded members.
4194           Fixed bug #71603. MS 1.1 csc does not detect it.
4195
4196 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4197
4198         * doc.cs : delegates must not be referenced with parameters.
4199           Fixed bug #71605.
4200
4201 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4202
4203         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4204
4205 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4206
4207         * driver.cs (MainDriver): Stop processing if the CLS stage found
4208         errors. 
4209
4210         (CompilerCallableEntryPoint.InvokeCompiler): Always
4211         reset after execution;   Take a TextWriter argument for the
4212         output.
4213
4214         * report.cs: Use the error stream instead of hardcoding stderr. 
4215
4216 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4217
4218         * class.cs: Reduce code paths to test, too small of an
4219         optimization to make it worth the extra testing.  Always perform
4220         it. 
4221
4222 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4223
4224         Fix #74510.
4225         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4226         operators that had errors reported on them.
4227
4228 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4229
4230         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4231         argument types.
4232         (Attribute.Resolve): Add named argument type checking.
4233         
4234         * class.cs (FixedField.Define): Use IsPrimitiveType
4235         
4236         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4237         
4238         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4239         unsafe parameter types.
4240         
4241         * statement.cs (Using.ResolveExpression): Add better error description.
4242         
4243         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4244         
4245 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4246
4247         Fix #74484.
4248         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4249         AttributeUsageAttribute in the emitcontext of the attribute class,
4250         not in the emitcontext of the attributable entity it was attached to.
4251         * cs-parser.jay: Use 'current_class', not 'current_container',
4252         when creating a GlobalAttribute.
4253
4254 2005-04-08  Alp Toker  <alp@atoker.com>
4255
4256         * pending.cs: The fix to #58413 failed to compile methods implementing
4257         interfaces with/without params modifiers and vice versa, even though
4258         params modifiers aren't part of the signature. Make the modifier check
4259         less strict as in csc.
4260
4261 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4262             Anoob V E  <projectmonokochi@rediffmail.com>
4263             Harilal P R  <projectmonokochi@rediffmail.com>
4264
4265         Fix #58413.
4266         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4267         modifiers of pending methods.
4268         (PendingImplementation.PendingImplementation): Initialize it.
4269         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4270         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4271         with ParameterData.  Add check for modifiers.
4272         * class.cs (MethodData.Define): Update to changes.
4273
4274 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4275
4276         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4277
4278 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4279
4280         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4281         property.
4282         
4283         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4284         
4285         * rootcontext.cs,
4286         * typemanager.cs: Registered RequiredAttributeAttribute.
4287         
4288 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4289
4290         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4291         Warning CS0169 is back at level 3.
4292         (IMethodData.SetMemberIsUsed): New method.
4293         
4294         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4295         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4296         
4297         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4298
4299         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4300         contants.
4301         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4302         is used.
4303         
4304         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4305         is used.
4306         
4307         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4308         to avoid the problems with nested types.
4309
4310 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4311             Anoob V.E  <projectmonokochi@rediffmail.com>
4312             Harilal P.R  <projectmonokochi@rediffmail.com>
4313             Raja R Harinath  <rharinath@novell.com>
4314
4315         Fix #73820.
4316         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4317         attribute.
4318         * typemanager (GetConstructor): Make public.
4319
4320 2005-04-05  John Luke  <john.luke@gmail.com>
4321             Raja R Harinath  <rharinath@novell.com>
4322
4323         Fix #62232.
4324         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4325         struct too.  Return false quicker in a few cases.
4326         (VerifyUnManaged): Use it.
4327
4328 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4329
4330         Fix #74041.
4331         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4332         not 'unreachable_seen'.
4333
4334 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4335
4336         * attribute.cs (Attribute.GetValue): Removed unused.
4337         
4338         * codegen.cs (CodeGen.TrimExt): Removed unused.
4339         
4340         * cs-parser.jay (output): Removed unused.
4341         
4342         * cs-tokenizer.cs (hex_digits): Removed unused.
4343         
4344         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4345         
4346         * expression.cs (Indirection.LoadExprValue): Removed unused.
4347         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4348         
4349         * iterators.cs (Iterator.param_types): Removed unused.
4350         
4351         * statement.cs (Goto.block): Removed unused.
4352         (ToplevelBlock.did): Removed unused.
4353         (Switch.ResolveConstantSwitch): Removed unused.
4354
4355 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4356
4357         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4358         resetting thingy.
4359
4360 2005-04-19  Martin Baulig  <martin@ximian.com>
4361
4362         Merged r42462 from MCS and made it work for GMCS.
4363
4364         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4365
4366         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4367
4368 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4369
4370         Fix #74232 and cs0208-3.cs.
4371         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4372         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4373         unmanaged type.  Don't use FieldBuilders when 't' is a
4374         TypeBuilder.  Use ModFlags and MemberType fields.
4375         * class.cs (MemberBase.member_type): Rename from MemberType.
4376         (MemberBase.MemberType): New property.  Determines member_type on
4377         demand.
4378         (MemberBase.DoDefine): Don't initialize MemberType here.
4379         (FieldMember.Define): Likewise.
4380
4381 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4382
4383         Fix #74241
4384         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4385         Attributes are emitted there.
4386         
4387 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4388
4389         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4390         keyword in 'partial enum' too.
4391         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4392         is not allowed).
4393         Report from Kamil Skalski <nazgul@omega.pl>.
4394
4395         Fix #74309.
4396         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4397         have partial containers too.
4398
4399         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4400         in block' checks to Block.CheckInvariantMeaningInBlock.
4401         * statement.cs (Block.GetKnownVariableInfo): Make private.
4402         (Block.IsVariableUsedInChildBlock): Remove.
4403         (Block.IsVariableUsedInBlock): Likewise.
4404         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4405         conflicting declaration.
4406         (Block.AddVariable): Make error messages less long-winded and more
4407         specific.  Show location of conflicting declaration.
4408         * parameter.cs (Parameters.Location): New readonly property.
4409
4410 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4411
4412         Clean up semantics of invoking ResolveMemberAccess.
4413         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4414         can have an instance, ensure that we pass in a non-TypeExpression
4415         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4416         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4417         argument.  Update to changes and simplify.
4418         (FieldExpr.Emitinstance): Remove CS0120 check.
4419         (PropertyExpr.EmitInstance): Likewise.
4420         * expression.cs (Argument.Resolve): Likewise.
4421         (Invocation.DoResolve): Update to changes in semantics of
4422         InstanceExpression.
4423
4424 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4425
4426         Fix #74241
4427         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4428         customization.
4429         
4430         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4431
4432 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4433
4434         Fix difference in behaviour with commandline invocation.
4435         * driver.cs (Driver.Reset): New.
4436         (CompilerCallableEntryPoint): Call it.
4437
4438         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4439         variable" warnings if the boolean expression failed to resolve.
4440
4441 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4442
4443         * attribute.cs: Fix the union of several permissions when some of them
4444         are unrestricted (so the result isn't an unrestricted permission set).
4445         Fix #74036.
4446
4447 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4448
4449         * ecore.cs (MemberExpr): New class.  Convert from interface
4450         IMemberExpr.
4451         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4452         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4453         error checks.
4454         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4455         (MethodGroupExpr.IsExplicitImpl): Remove.
4456         (Expression.GetFieldFromEvent): Remove.
4457         (SimpleName.MemberStaticCheck): Remove.
4458         (SimpleName.DoSimpleNameResolve): Update to changes.
4459         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4460         (MemberAccess.IdenticalNameAndTypeName): Remove.
4461         (MemberAccess.error176): Move to MemberExpr.
4462         (MemberAccess.DoResolve): Update to changes.
4463         (BaseAccess.DoResolve): Likewise.
4464
4465 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4466
4467         C# 2.0 Conditional attribute class implementation
4468         
4469         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4470         Analyzes class whether it has attribute which has ConditionalAttribute
4471         and its condition is not defined.
4472         
4473         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4474         (Class.IsExcluded): New method. Search for at least one defined
4475         condition in ConditionalAttribute of attribute class.
4476
4477 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4478
4479         * ecore.cs (PropertyExpr): Derive from Expression, not
4480         ExpressionStatement.
4481         (PropertyExpr.EmitStatement): Remove.
4482
4483 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4484
4485         Fix #74060.
4486         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4487         internal field "value__" of an enum be private.  The examples for
4488         "value__" that I found on MSDN all used FieldAttributes.Private.
4489
4490         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4491         Don't mention IL method attribute names.
4492
4493         Fix #47991.  Remove a TODO.
4494         * statement.cs (Block.Toplevel): Make into a field.
4495         (Block.Parameters): Move into ToplevelBlock.
4496         (Block.known_variables): Rename from child_variable_names.
4497         (Block.Block): Remove variants that take Parameters.  Initialize
4498         'Toplevel' with the immediately surrounding toplevel block.
4499         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4500         LocalInfo parameter.
4501         (Block.GetKnownVariableInfo): New.
4502         (Block.IsVariableNameUsedInChildBlock): Update.
4503         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4504         the block, even though it may not be in scope.
4505         (Block.AddVariable): Remove Parameters parameter.  Use
4506         Toplevel.Parameters instead.
4507         (Block.AddConstant): Remove Parameters parameter.
4508         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4509         (Block.IsParamaterReference): Likewise.
4510         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4511         (ToplevelBlock.Parameters): New.  Moved from Block.
4512         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4513         initialize Parameters to a non-null value.
4514         * cs-parser.jay: Update to changes.
4515         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4516         simple names that mean different things in the same block.  Use
4517         Block.IsVariableNameUsedInBlock.
4518
4519 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4520
4521         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4522
4523 2005-03-26  Raja R Harinath  <harinath@acm.org>
4524
4525         Fix #73038.
4526         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4527         fails to resolve, ensure that the LHS is still resolved as an
4528         lvalue.
4529
4530 2005-03-25  Raja R Harinath  <harinath@acm.org>
4531
4532         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4533         ec.ContainerType.
4534         (Enum.current_ec): Remove.
4535         (Enum.LookupEnumValue): Remove EmitContext argument.
4536         Just uses the one created during DefineType.
4537         (Enum.FindMembers): Update.
4538         * expression.cs (MemberAccess.DoResolve): Update.
4539
4540 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4541
4542         * assign.cs (Assign.DoResolve): Check for CS1717 when
4543         source and target are same (uses Equals).
4544
4545         * expression.cs (LocalVariableReference, ParameterReference,
4546         This): Implemented Equals, GetHashCode.
4547
4548         * statement.cs (Block.GetParameterReference): Removed useless
4549         local variable.
4550
4551 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4552
4553         Fix cs0128.cs
4554         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4555         blocks before deciding whether the error is cs0136 or cs0128.
4556
4557         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4558         (using_alias_directive, using_namespace_directive): Pass
4559         MemberName, not an expression to Namespace.UsingAlias and
4560         Namespace.Using.
4561         (MakeName): Use the MemberName of the namespace.
4562         * namespace.cs (Namespace.MemberName): New.
4563         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4564         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4565         Likewise.
4566         * decl.cs (MemberName.Name): Make readonly.
4567         (MemberName.FromDotted): New "constructor".
4568         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4569         (MemberCore.Name): Compute from MemberName on demand.
4570         (MemberCore.SetMemberName): Provide a way to change the
4571         MemberName.
4572         (MemberCore.AddToContainer): Don't take a fullname parameter.
4573         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4574         fully qualified name of the container to the member name.
4575         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4576         only if the type is a member of the root container.
4577         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4578         MemberName.Left rather than searching for an embedded ".".
4579         (PartialContainer.CreatePart): Update to changes in RootContext.
4580         (MemberBase.ShortName): Turn into a property.  Use
4581         MemberCore.SetMemberName.
4582         (MemberBase.ExplicitInterfaceName): Remove.
4583         (MemberBase.UpdateMemberName): Remove.
4584         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4585         (PropertyBase.SetMemberName): New override.
4586         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4587         (Tree.GetDecl): New.
4588         (Tree.AllDecls): Rename from Decls.
4589         * attribute.cs, enum.cs, report.cs: Update to changes.
4590         * driver.cs (MainDriver): Use MemberName.FromDotted on
4591         RootContext.MainClass.
4592
4593 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4594
4595         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4596         checks.
4597
4598         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4599
4600 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4601
4602         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4603         property accessor modifiers.
4604
4605         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4606         fixed buffer attribute (CS1716).
4607         (PropertyMethod.HasCustomAccessModifier): When property accessor
4608         has custom modifier.
4609
4610         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4611         modifiers.
4612         (PropertyExpr.DoResolveLValue): Add CS0272.
4613
4614 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4615
4616         * convert.cs: When converting to a pointer, use the proper Conv.U
4617         or Conv.I depending on the source data type.
4618
4619         * cs-tokenizer.cs: Make the size for large decimal constants,
4620         fixes #72957.
4621
4622 2005-03-17  Martin Baulig  <martin@ximian.com>
4623
4624         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4625         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4626
4627 2005-03-17  Martin Baulig  <martin@ximian.com>
4628
4629         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4630         to bool so we can return an error condition.
4631         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4632         returned an error.
4633
4634 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4635
4636         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4637         attributes.
4638
4639 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4640
4641         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4642         Refactor to avoid traversing the list of assemblies, and to avoid
4643         string concatenation.
4644         * typemanager.cs (guid_attr_type): Remove.
4645         (negative_hits, pointers, references): Remove hashes.
4646         (type_hash): New.
4647         (GetConstructedType): New.  Uses type_hash to handle constructed
4648         types (arrays, references, pointers).
4649         (GetReferenceType, GetPointerType): Use it.
4650         (GetNestedType): New.  Uses type_hash to handle nested types of
4651         reflected types.
4652         (LookupType, LookupTypeDirect): Remove.
4653         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4654         'types' hash and LookupTypeReflection directly.
4655         (params_string, params_object): Use GetConstructedType.
4656         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4657         top-level types.
4658         (Namespace.Lookup): Use cached_types.
4659         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4660         provided by old TypeManager.LookupType.
4661         * rootcontext.cs (MakeFQN): Remove.
4662         * decl.cs (DeclSpace.MakeFQN): Likewise.
4663         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4664         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4665         TypeManager.GetConstructedType.
4666         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4667
4668 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4669
4670         * cs-parser.jay: Fix build.
4671
4672 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4673
4674         * class.cs (TypeContainer.CircularDepException) New nested
4675         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4676
4677         * cs-parser.jay: Reports CS1527 for any namespace element.
4678
4679         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4680         Added CS0407.
4681
4682         * expression.cs (ParameterReference.IsAssigned): Changed error to
4683         CS0269.
4684         (Error_WrongNumArguments): Moved CS0245 detection here.
4685
4686         * statement.cs (Return.Resolve): Add CS1622 report.
4687
4688 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4689
4690         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4691
4692 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4693
4694         * attribute.cs expression.cs: Get rid of some allocations.
4695
4696 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4697
4698         * doc.cs : just eliminate the latest change.
4699
4700 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4701
4702         * doc.cs : commented out the latest change. It breaks xml-030.cs
4703
4704 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4705
4706         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4707           fail. So invoke CreateType() in FindDocumentedType().
4708
4709 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4710
4711         * cs-tokenizer.cs : added IsKeyword().
4712         * doc.cs : Detect keyword incorrectly used as identifier.
4713           Allow identifiers prefixed by @.
4714
4715 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4716
4717         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4718         It caused exception in namespace resolving (again!).
4719         
4720         * class.cs (Class.ctor): Removed exit.
4721         (PropertyMethod.ctor): ditto.
4722         
4723         * codegen.cs (Codegen.Reset): Reset static data.
4724         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4725         
4726         * cs-tokenizer.cs (Cleanup): Removed.
4727         
4728         * driver.cs (GetSystemDir): Rewrote to one line command.
4729         It caused problem with unloaded dynamic modules.
4730         (UnixParseOption): Removed Exit.
4731         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4732         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4733         Now can be mcs used as library.
4734         
4735         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4736         empty location.
4737         
4738         * location.cs (Reset): Reset static data.
4739         
4740         * namespace.cs (Reset): Reset static data.
4741         
4742         * report.cs (Report.Reset): Reset static data.
4743         
4744         * rootcontext.cs (RootContext.Reset): Reset static data.
4745         
4746         * tree.cs (RootTypes.ctor): Use Location.Null
4747         
4748         * typemanager.cs (TypeManager.Reset): Reset static data.
4749         (CoreLookupType): Removed Exit.
4750         (TypeHandle.Reset): Reset static data.
4751         
4752 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4753
4754         Fix #73516.
4755         * typemanager.cs (ComputeNamespaces): Import namespaces from
4756         referenced modules too.
4757
4758 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4759
4760         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4761         than '.'.
4762
4763 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4764
4765         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4766         enclosing DeclSpace.  This ensures that a name-lookup populates
4767         more caches and there are fewer 'TypeExpression's.  Carve out
4768         nested type lookup into ...
4769         (LookupNestedTypeInHierarchy): ... this.
4770
4771 2005-04-15  Martin Baulig  <martin@ximian.com>
4772
4773         Merged r41590 from MCS and make it work in the generics land.
4774
4775         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4776         `check' argument.
4777
4778         * class.cs (PartialContainer.UpdateConstraints): Removed.
4779         (PartialContainer.CheckConstraints): Removed.
4780         (PartialContainer.SetParameterInfo): Store the constraints here.
4781         (PartialContainer.DefineTypeParameters): New public method;
4782         resolve the type parameter's constraints here.  Note that the
4783         PartialContainer doesn't have an EmitContext anymore, so we must
4784         do this in the ClassPart.
4785
4786 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4787
4788         Clean up a few partial-class semantics.  
4789         Fixes test-357.cs and cs1618-2.cs.
4790         * cs-parser.jay (struct_declaration): Use 'current_class' as
4791         parent of newly-created struct.  Remove call to Register ().
4792         Use 'pop_current_class' to complete handing the current struct.
4793         (interface_declaration): Likewise.
4794         (class_declaration): Likewise.
4795         (enum_declaration): Use 'current_class' as parent of newly created
4796         enum.
4797         (delegate_declaration): Likewise.
4798         (pop_current_class): New function.  This is used to handle closing
4799         up the 'current_class' and 'current_container', and pointing them
4800         to the enclosing class/container.
4801         (CSharpParser): Initialize 'current_class' too.
4802         * decl.cs (MemberCore): Add check for invariant: a partial
4803         container is not a parsed entity, and thus does not enclose any
4804         parsed members.
4805         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4806         (DeclSpace.BaseTypeExpr): Use it.
4807         (DeclSpace.LookupType): Add check for invariant.
4808         * class.cs (TypeContainer): Add check for invariant: a nested
4809         class should have the same NamespaceEntry as its enclosing class.
4810         (TypeContainer.EmitFieldInitializers): Make virtual.
4811         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4812         MemberCore.
4813         (TypeContainer.Register): Remove.
4814         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4815         null.  Use TypeResolveEmitContext for resolving base types and
4816         interfaces.  Move initialization of Parts.TypeBuilder here from
4817         ...
4818         (TypeContainer.DefineNestedTypes): ... here.
4819         (PartialContainer): Take a Namespace not a NamespaceEntry.
4820         (PartialContainer.Create): Don't use Register.  Call the
4821         appropriate Add... function directly.
4822         (ClassPart): Take both the PartialContainer and the enclosing
4823         class as constructor arguments.
4824         (ClassPart.EmitFieldInitializers): Override.
4825         (ClassPart.PartFindNestedTypes): Remove.
4826         (FieldBase.GetInitializerExpression): Resolve the initializer
4827         expression in the emit context of the enclosing class.
4828         * tree.cs (RootTypes): Remove Register ().
4829         
4830 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4831
4832         * cs-parser.jay: Removed CS0134.
4833         
4834         * driver.cs: Removed CS1901.
4835         
4836         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4837         for predefined types.
4838
4839 2005-03-07  Duncan Mak  <duncan@novell.com>
4840
4841         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4842         well. Fixes bug #73454.
4843
4844 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4845
4846         * cs-tokenizer.cs (xtoken): Add CS1035.
4847         
4848         * class.cs (MethodData.Define): Add CS0683.
4849         (FieldMember.ctor): Add CS0681.
4850
4851 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4852
4853         * ecore.cs (SimpleName.DoResolve): Rename from
4854         SimpleName.DoResolveAllowStatic.
4855         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4856         Pass 'intermediate' flag to MemberStaticCheck.
4857         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4858         of "intermediate" lookups via MemberAccess.
4859         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4860         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4861
4862 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4863
4864         Fix #73394.
4865         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4866         slipped in because of variable names that are identical to a
4867         builtin type's BCL equivalent ('string String;', 'int Int32;').
4868         (PropertyExpr.EmitInstance): Likewise.
4869
4870 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4871
4872         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4873         
4874         * report.cs (warning_ignore_table): Made public.
4875
4876 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4877
4878         Fix #73282.
4879         * class.cs (MethodData.Emit): Pass 'container' to
4880         container.GetObsoleteAttribute instead of 'container.Parent'.
4881
4882 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4883
4884         * cs-parser.jay: Add 1534 error test.
4885
4886         * iterators.cs (Yield.CheckContext): Add error 1629.
4887         (Iterator.ctor): Save unsafe modifier.
4888         (MoveNextMethod.DoEmit): Restore unsafe context.
4889
4890         * namespace.cs (UsingAlias): Better error message.
4891
4892 2005-03-03  Dan Winship  <danw@novell.com>
4893
4894         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4895         the warning message [#73219]
4896
4897 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4898
4899         Fix compile with MCS 1.0.0.0.
4900         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4901         w_restore to not depend on string constant folding.
4902
4903 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4904
4905         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4906         CS0246 check to users who passed 'silent = false'.
4907         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4908         check.
4909         (SimpleName.SimpleNameResolve): Update.
4910         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4911         (MemberAccess.IdenticalNameAndTypeName): Update.
4912         * doc.cs (FindDocumentedTypeNonArray): Update.
4913
4914 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4915
4916         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4917         * parameters.cs (ComputeAndDefineParameters): Remove.
4918         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4919         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4920         Use GetParameterInfo.
4921
4922 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4923
4924         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4925
4926 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4927
4928         Unify DeclSpace.LookupType and DeclSpace.FindType.
4929         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4930         is in charge of defining nested types on demand.
4931         (DeclSpace.LookupType): Use it when the current_type is a
4932         TypeBuilder.  Use LookupTypeDirect for reflected types.
4933         (DeclSpace.FindType): Remove.
4934         (DeclSpace.LookupInterfaceOrClass): Likewise.
4935         (DeclSpace.DefineTypeAndParents): Likewise.
4936         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4937         DeclSpace.LookupType.
4938         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4939         * typemanager.cs (LookupType): Simplify.
4940         (AddUserType): Remove type from negative_hits.
4941         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4942         * class.cs (TypeContainer.FindMembers): Move handling of nested
4943         types ...
4944         (TypeContainer.FindMembers_NestedTypes): ... here.
4945         (TypeContainer.FindNestedType): Implement override.
4946         (ClassPart.FindNestedType): Delegate to PartialContainer.
4947         (ClassPart.PartFindNestedType): Looks up the nested types of the
4948         part alone.
4949
4950 2005-04-14  Martin Baulig  <martin@ximian.com>
4951
4952         * generic.cs (ConstructedType): Moved all the type lookup and
4953         nested class logic into SimpleName.
4954         (ConstructedType.ResolveConstructedType): Our underlying type is
4955         already fully resolved; all the type lookup stuff is in
4956         SimpleName.
4957
4958         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4959         constructed types here instead of in ConstructedType.
4960
4961         * decl.cs (MemberName.GetTypeExpression): Always create a
4962         SimpleName, not a ConstructedType.
4963         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4964
4965 2005-03-02  Martin Baulig  <martin@ximian.com>
4966
4967         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4968         static constructor in static classes.
4969
4970 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4971
4972         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4973         sizeParamIndex is not specified.
4974
4975 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4976
4977         Fix #73117
4978         * report.cs (WarningMessage.IsEnabled): Missing null check.
4979
4980 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4981
4982         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4983         in the fields and not in the properties.
4984
4985 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4986
4987         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4988         fields as well.
4989
4990 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4991
4992         * attribute.cs: Small refactoring (improved robustness).
4993         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4994         (ValidateGuid): Removed.
4995         (Resolve): Removed referenced to above mentioned.
4996         (GetAttributeUsage): Made private and changed to work without
4997         class assistance.
4998         (GetIndexerAttributeValue): Don't crash.
4999         (GetConditionalAttributeValue): Ditto.
5000         (GetClsCompliantAttributeValue): Ditto.
5001         (ExtractSecurityPermissionSet): All attributes exceptions are
5002         error 648.
5003         (GetPropertyValue): New helper.
5004         (GetMethodImplOptions): New method.
5005         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5006         some missing properties.
5007         
5008         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5009         (Method.ApplyAttributeBuilder): Updated.
5010         
5011         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5012         exception.
5013
5014 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5015
5016         Fix #73052.
5017         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5018         non-simple types (array, pointer, reference).
5019
5020 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5021
5022         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5023
5024         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5025         for operators.
5026         (Method.CheckBase): Catch wrong destructor here.
5027         (MethodData.Define): Add errors 550, 668.
5028
5029         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5030
5031         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5032
5033         * pending.cs (VerifyPendingMethods): Add error 551.
5034
5035         * typemanager.cs (CSharpName): Next error report helper.
5036
5037 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5040         attributes. Removed useless attribute double check.
5041         It saves almost 2MBs for corlib.
5042
5043 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5044
5045         Fix #72924.
5046         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5047         called twice in case of error.
5048
5049 2005-02-23  Chris Toshok  <toshok@ximian.com>
5050
5051         Fix compiler portions of #72827.
5052         * statement.cs (Block.Emit): call Begin/EndScope on the
5053         EmitContext instead of the ILGenerator.
5054
5055         * codegen.cs (EmitContext.BeginScope): new method, call
5056         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5057         we have one.)
5058         (EmitContext.BeginScope): same, but EndScope and CloseScope
5059
5060         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5061         offset and call the superclass's OpenScope(int) with it.
5062         (SymbolWriter.CloseScope): get the current il
5063         offset and call superclass's CloseScope(int) with it.
5064
5065 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5066
5067         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5068         CS1677 for out and ref as well.
5069
5070         * class.cs (Method.Define): Add error CS1599 detection.
5071         
5072         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5073         
5074         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5075         
5076         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5077         
5078         * support.cs.cs (ModifierDesc): New helper method.
5079
5080 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5081             Abin Thomas  <projectmonokochi@rediffmail.com>
5082             Anoob V E  <projectmonokochi@rediffmail.com>
5083             Harilal P R  <projectmonokochi@rediffmail.com>
5084
5085         Fix #57851, #72718.
5086         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5087         MemberLookup (used for error reporting) actually returns a result.
5088         Fix error report number (122, not 112).
5089
5090 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5091             Anoob V E  <projectmonokochi@rediffmail.com>
5092             Harilal P R  <projectmonokochi@rediffmail.com>
5093
5094         Fix #71134.
5095         * pending.cs (PendingImplementation.GetAbstractMethods):
5096         Find NonPublic members too.
5097
5098 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5099
5100         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5101         Fixed error 217.
5102         
5103         * class.cs (MethodCore.CheckMethodAgainstBase):
5104         Add error 239 report.
5105
5106 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5107
5108         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5109         
5110         * class.cs (Operator.Define): Add error 217 report.
5111         
5112 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5113
5114         Fix #68955.
5115         * expression.cs (Invocation.IsApplicable): Make public.
5116         (Invocation.IsParamsMethodApplicable): Likewise.
5117         * delegate.cs (Delegate.VerifyApplicability): Don't use
5118         Invocation.VerifyArgumentCompat for parameter applicability
5119         testing.  Use Invocation.IsApplicable and
5120         Invocation.IsParamsMethodApplicable.
5121
5122 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5123
5124         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5125         
5126         * class.cs (Operator.Define): Add error 217 report.
5127         
5128 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5129
5130         * namespace.cs (UsingEntry.Resolve): Undo change below.
5131
5132 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5133
5134         Fix #72756.
5135         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5136         disable the error message when the extended MemberLookup also
5137         fails.
5138         (Expression.MemberLookupFinal): Update.
5139         (SimpleName.DoSimpleNameResolve): Update.
5140         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5141         Don't use MemberLookupFinal.
5142         (New.DoResolve): Update.
5143         (BaseAccess.CommonResolve): Update.
5144
5145 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5146
5147         Fix #72732.
5148         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5149         occured previously, don't resolve again.
5150
5151 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5152
5153         Fix #69949
5154         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5155         argument. Call ResolveAttributeUsage for unresolved.
5156         when types doesn't match ctor arguments.
5157         
5158         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5159         for nested attribute classes.
5160         (Class.attribute_usage): Removed.
5161         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5162         for attribute class.
5163         
5164         * ecore.cs (IsAttribute): Removed.
5165         
5166         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5167         
5168         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5169         now normal types.
5170         (attribute_types): Removed.
5171         (EmitCode): Global attributes are emited as the latest.
5172
5173 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5174
5175         * class.cs (EmitFieldInitializers): Don't emit field initializer
5176         for default values when optimilization is on.
5177         
5178         * constant.cs (Constant.IsDefaultValue): New property.
5179         
5180         * driver.cs: Add /optimize handling.
5181         
5182         * constant.cs,
5183         * ecore.cs,
5184         * literal.cs: Implement new IsDefaultValue property.
5185         
5186         * rootcontext.cs (Optimize): New field, holds /optimize option.
5187
5188 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5189
5190         Fix crasher in re-opened #72347.
5191         * namespace.cs (Namespace.Lookup): Return null if
5192         DeclSpace.DefineType returns null.
5193
5194         Fix #72678.
5195         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5196
5197 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5198
5199         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5200         now returns null if it cannot resolve to an lvalue.
5201         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5202         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5203         returned null.  Remove check for SimpleName.
5204         (EventExpr.DoResolveLValue): New.
5205         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5206         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5207         error from ...
5208         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5209         avoid CS0131 error.
5210         (Unary.ResolveOperator): Move CS0211 check ...
5211         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5212         CS0131 error.
5213         (Unary.DoResolveLValue): Simplify.
5214         (AddressOf.DoResolveLValue): New.
5215         (ArrayAccess.DoResolveLValue): New.
5216
5217 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5218
5219         * attribute.cs (Attribute.Resolve): Add arguments casting for
5220         when types doesn't match ctor arguments.
5221
5222 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5223
5224         Fix parts of #63202.
5225         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5226         lookup of operator in base type.  Ensure that all checks happen
5227         when the operator resolves to an "op_..." method.
5228
5229 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5230
5231         Fix #71992.
5232         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5233         'ignore_cs0104' parameter.  Pass it to ...
5234         (NamespaceEntry.Lookup): ... this.
5235         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5236         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5237         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5238         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5239         Update.  Request that cs0104 errors be ignored.
5240         (ComposedCast.ResolveAsTypeStep): Update.
5241
5242 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5243
5244         Fix #59209.
5245         * expression.cs (Invocation.BetterFunction): Remove support for
5246         comparing virtual functions and their overrides.
5247         (Invocation.IsOverride): New.
5248         (Invocation.OverloadResolve): Don't consider 'override' functions
5249         during candidate selection.  Store them in a lookaside list.
5250         If the selected method is a 'virtual' function, use the list to
5251         find any overrides that are closer to the LHS type.
5252
5253 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5254
5255         * expression.cs (New.DoResolve): Add complex core type reduction.
5256         (New.Constantify): Converts complex core type syntax like 'new int ()'
5257         to simple constant.
5258         
5259 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5260
5261         * decl.cs (EntryType.EntryType): New constructor to create an
5262         updated copy of a cache entry.
5263         (MemberCache.AddMethods): Use it.
5264         (MemberCache.ClearDeclaredOnly): Remove.
5265         (MemberCache.MemberCache): Update.
5266
5267 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5268
5269         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5270         variable.  This one is represents the actual low-level declaration
5271         of the method, as opposed to the semantic level `IsStatic'.   
5272
5273         An anonymous method which is hosted into a static method might be
5274         actually an instance method.  IsStatic would reflect the
5275         container, while MethodIsStatic represents the actual code
5276         generated.
5277
5278         * expression.cs (ParameterReference): Use the new MethodIsStatic
5279         instead of IsStatic.
5280
5281         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5282         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5283         set on the current EmitContext. 
5284
5285         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5286         resolve our casted expression as an LValue.  This triggers the
5287         proper LValue processing that is later required by Assign.
5288
5289         This fixes 72347.
5290
5291         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5292
5293 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5294
5295         C# 2.0 Fixed buffer implementation
5296
5297         * anonymous.cs: Update after RegisterHelperClass renaming.
5298
5299         * attribute.cs (AttributeTester.fixed_buffer_cache):
5300         Cache of external fixed buffers.
5301         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5302         implementation if field is fixed buffer else null.
5303
5304         * class.cs
5305         (TypeContainer.AddField): Accept FieldMember instead of Field.
5306         (FieldBase.IsFieldClsCompliant): Extracted code from
5307         VerifyClsCompliance descendant customization.
5308         (FixedField): New class handles fixed buffer fields.
5309         (FixedFieldExternal): Keeps information about imported fixed
5310         buffer.
5311         (IFixedField): Make access to internal or external fixed buffer
5312         same.
5313
5314         * cs-parser.jay: Add fixed buffer parsing.
5315
5316         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5317         buffer.
5318
5319         * expression.cs (Indirection): Extended implementation to accept
5320         fixed buffer field.
5321         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5322         (ElementAccess.MakePointerAccess): Get type as parameter.
5323         (DoResolve): Add fixed buffer field expression conversion.
5324         (DoResolveLValue): Ditto.
5325         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5326         (ArrayPtr): Derives from FixedBufferPtr.
5327         (ArrayPtr.Emit): Add extra emit for array elements.
5328
5329         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5330
5331         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5332         for compiler generated types.
5333         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5334
5335         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5336         and consume less memory.
5337         (Fixed.Resolve): Add fixed buffer case.
5338
5339         * typemanager.cs (compiler_generated_attr_ctor,
5340         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5341         (HasElementType): Add our own implementation to work on every
5342         runtime.
5343
5344 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5345
5346         * anonymous.cs (CaptureContext): Track whether `this' has been
5347         referenced.   
5348
5349         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5350         only captured `this' if it was implicitly done (instance
5351         methods/variables were used). 
5352
5353         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5354         `this' must be captured.
5355
5356 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5357  
5358         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5359         is null it means that there has been no need to capture anything,
5360         so we just create a sibling.
5361
5362         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5363
5364         Just a partial fix.  The other half is fairly elusive.
5365         
5366 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5367
5368         Fix #52586, cs0121-4.cs.
5369         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5370         and return a hashtable.
5371         (MemberCache.ClearDeclaredOnly): New.
5372         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5373         the method_hash of a base type too.
5374         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5375         type methods.  Overwrite entries with the same MethodHandle so
5376         that the ReflectedType is correct.  The process leaves in base
5377         virtual functions and their overrides as distinct entries.
5378         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5379         matters since it was boxed in a ArrayList before.
5380         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5381         modifier.
5382         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5383         case of a virtual function and its override (choose the overload
5384         as better).
5385         (Invocation.OverloadResolve): Avoid 'override' members during
5386         'applicable_type' calculation.
5387
5388 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5389
5390         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5391         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5392         GetTypeHandle.  It is possible for a reflected type to derive from
5393         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5394         System.Array during mscorlib compilation).
5395         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5396         contain a method_hash, don't create one either.  Don't create a
5397         deep copy of the base cache's method_hash.
5398         (MemberCache.SetupCache): Rename back from DeepCopy.
5399         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5400         already initialized.  If we see an override function, add its
5401         underlying base virtual function to the member_hash too.
5402
5403 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5404
5405         Combine two near-redundant caches.
5406         * typemanager.cs (method_params): Rename from method_internal_params.
5407         (TypeManager.GetParameterData): New.  Replace
5408         Invocation.GetParameterData.
5409         (TypeManager.LookupParametersByBuilder): Remove.
5410         * expression.cs (Invocation.method_parameter_cache): Remove.
5411         (Invocation.GetParameterData): Remove.
5412         Update to changes.
5413         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5414         Update to changes.
5415
5416 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5417
5418         Fix #72015.
5419         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5420         TypeManager.multicast_delegate_type is null, resolve it by looking
5421         up "System.MulticastDelegate".
5422         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5423
5424 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5425             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5426             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5427
5428         Fix cs0164.cs.
5429         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5430         (LabeledStatement.AddReference): New.  Set 'referenced'.
5431         (Goto.Resolve): Use it.
5432
5433 2005-02-05  John Luke  <john.luke@gmail.com>
5434
5435         * driver.cs: remove duplicate -doc line in Usage ()
5436
5437 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5438
5439         * location.cs (Location.AddFile): Fix CS2002 error report.
5440
5441 2005-02-02  Martin Baulig  <martin@ximian.com>
5442
5443         * delegate.cs (Delegate.DefineType): Report an internal error if
5444         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5445         details.        
5446
5447 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5448
5449         Fix a crasher in a variant of #31984.
5450         * const.cs (Constant.CheckBase): New override that defers the
5451         new-or-override check in case the base type hasn't been populated
5452         yet.
5453         (Constant.Define): Ensure the new-or-override check is performed.
5454
5455 2005-02-01  Duncan Mak  <duncan@ximian.com>
5456
5457         * const.cs (LookupConstantValue): Check that `ce' is not null
5458         before calling GetValue ().
5459
5460 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5461
5462         Fix test-334.cs (#69519).
5463         * cs-parser.jay (using_alias_directive): Pass in an expression to
5464         NamespaceEntry.UsingAlias.
5465         (using_namespace_directive): Pass in an expression to
5466         NamespaceEntry.Using.
5467         (namespace_name): Don't flatten to a string.
5468         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5469         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5470         ResolveAsTypeStep.
5471         (NamespaceEntry.UsingEntry): Likewise.
5472         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5473         changes.
5474         (NamespaceEntry.LookupForUsing): Remove.
5475         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5476         names.
5477         (NamespaceEntry.Lookup): Remove support for dotted names.
5478
5479 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5480
5481         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5482         split into two.
5483         (NamespaceEntry.ImplicitParent): Compute on demand.
5484         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5485         parallels the current.
5486         (NamespaceEntry.LookupForUsing): Use it.
5487         (NamespaceEntry.Lookup): If the current namespace-entry is
5488         implicit, don't search aliases and using tables.
5489
5490 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5491
5492         Fix #31984.
5493         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5494         BaseCache here.
5495         (TypeContainer.BaseCache): Compute on demand.
5496         (TypeContainer.FindMembers): Define constants and types if they're
5497         not already created.
5498         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5499         check.
5500         * const.cs (Constant.Define): Make idempotent.
5501
5502 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5503
5504         * pending.cs: Produce better code (no nops produced by using Ldarg
5505         + value).
5506         
5507         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5508         i - 1' it should be arg + 1.
5509
5510         Fixes bug #71819.
5511
5512 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5513
5514         * attribute.cs (Attribute.CheckAttributeType): Make private
5515         non-virtual.
5516         (Attribute.ResolveType): Make virtual.
5517         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5518         handling of RootContext.Tree.Types.
5519
5520 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5521
5522         Update attribute-handling to use the SimpleName/MemberAccess
5523         mechanisms.
5524         * cs-parser.jay (attribute): Pass in an expression to the
5525         constructors of Attribute and GlobalAttribute.
5526         * attribute.cs (Attribute): Take an expression for the name.
5527         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5528         passed in attribute name expression.
5529         (Attribute.CheckAttributeType): Use it.
5530         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5531         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5532         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5533         argument to prevent error messages if the lookup fails.
5534
5535 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5536
5537         * expression.cs (Indirection): Implemented IVariable interface
5538         to support indirection in AddressOf operator.
5539         (PointerArithmetic.Emit): Add optimalization for case where
5540         result can be precomputed.
5541
5542 2005-01-26  Martin Baulig  <martin@ximian.com>
5543
5544         * class.cs (TypeContainer.AttributeTargets): Return the correct
5545         AttributeTargets depending on our `Kind' instead of throwing an
5546         exception; fixes #71632.
5547
5548 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5549
5550         Fix #71257
5551         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5552         constant members.
5553
5554 2005-03-17  Martin Baulig  <martin@ximian.com>
5555
5556         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5557         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5558
5559 2005-03-17  Martin Baulig  <martin@ximian.com>
5560
5561         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5562         to bool so we can return an error condition.
5563         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5564         returned an error.
5565
5566 2005-03-17  Martin Baulig  <martin@ximian.com>
5567
5568         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5569
5570         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5571         converting from an array-type of T to `IEnumerable<T>'.
5572
5573 2005-03-16  Martin Baulig  <martin@ximian.com>
5574
5575         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5576         (Nullable.LiftedUnaryMutator): New public class.
5577
5578         * expression.cs (UnaryMutator.DoResolve): Added support for
5579         Nullable Types.
5580
5581 2005-03-14  Martin Baulig  <martin@ximian.com>
5582
5583         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5584
5585 2005-03-14  Martin Baulig  <martin@ximian.com>
5586
5587         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5588         the comparision operators `<', `>', `<=' and `>='.
5589
5590 2005-03-13  Martin Baulig  <martin@ximian.com>
5591
5592         * generic.cs
5593         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5594         avoid confusion with the `NullLiteral'.
5595         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5596
5597 2005-03-13  Martin Baulig  <martin@ximian.com>
5598
5599         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5600         comparing arbitrary types with the null literal.
5601
5602 2005-03-13  Martin Baulig  <martin@ximian.com>
5603
5604         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5605         boolean operators '&&', '||', '&' and '|'.
5606         (Nullable.OperatorTrueOrFalse): New public class.
5607
5608         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5609         instead of a `StaticCallExpr'; added support for nullables.
5610
5611 2005-03-10  Martin Baulig  <martin@ximian.com>
5612
5613         * expression.cs
5614         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5615         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5616
5617 2005-03-07  Martin Baulig  <martin@ximian.com>
5618
5619         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5620         it work if `expr' is not an IMemoryLocation.
5621         (Nullable.Lifted): Implement IMemoryLocation.
5622         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5623         target type.
5624
5625 2005-03-05  Martin Baulig  <martin@ximian.com>
5626
5627         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5628         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5629         (Nullable): Added support for lifted unary and binary operators.
5630
5631         * expression.cs (Unary.DoResolve): Added support for nullable types.
5632         (Binary.DoResolve): Likewise.
5633         (Conditional.DoResolve): Likewise.
5634
5635 2005-03-02  Martin Baulig  <martin@ximian.com>
5636
5637         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5638
5639         * class.cs (ClassPart.SetParameterInfo): Override this.
5640         (PartialContainer.SetParameterInfo): Override this.
5641         (TypeContainer.CheckConstraints): New protected method.
5642         (PartialContainer.CheckConstraints): Override this and check
5643         whether the same contraints were specified in all parts of a
5644         partial generic type definition.
5645         (PartialContainer.UpdateConstraints): New public method.
5646
5647         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5648
5649 2005-03-02  Martin Baulig  <martin@ximian.com>
5650
5651         Committing a patch from Carlos Alberto Cortez to fix #72887.
5652
5653         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5654         casts from `T []' to `int []'.
5655
5656 2005-03-02  Martin Baulig  <martin@ximian.com>
5657
5658         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5659
5660         * expression.cs (Binary.ResolveOperator): When resolving a
5661         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5662         `=='.  Fixes #71866.  See gen-127.cs.
5663
5664 2005-03-02  Martin Baulig  <martin@ximian.com>
5665
5666         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5667         static constructor in static classes.
5668
5669 2005-03-02  Martin Baulig  <martin@ximian.com>
5670
5671         * generic.cs
5672         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5673         (Nullable.LiftedConversion): Added support for user-defined
5674         conversions.
5675
5676         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5677
5678         * cs-parser.jay: Use ComposedCast everywhere instead of
5679         NullableType, so we don't need to check for NullableType
5680         everywhere.
5681         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5682         case where we'll be resolved into a `parenthesized_expression_0'
5683         afterwards.
5684
5685         * convert.cs
5686         (Convert.UserDefinedConversion): Added nullable conversions.
5687
5688 2005-02-28  Martin Baulig  <martin@ximian.com>
5689
5690         * generic.cs (TypeManager.IsNullableType): New static method.
5691         (Nullable): New abstract class.
5692         (Nullable.NullLiteral): New public class.
5693         (Nullable.LiftedConversion): New public class.
5694
5695         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5696         `builtin_types opt_nullable'.
5697
5698         * convert.cs
5699         (Convert.ImplicitConversionStandard): Added nullable conversions.
5700         (Convert.ExplicitConversionStandard): Likewise.
5701         (Convert.ExplicitConversion): Likewise.
5702
5703 2005-02-26  Martin Baulig  <martin@ximian.com>
5704
5705         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5706         begin with a "?", for instance "?[]".  Don't do a type lookup if
5707         `dim' is empty.
5708
5709 2005-02-25  Martin Baulig  <martin@ximian.com>
5710
5711         The first part of Nullable Types :-)
5712
5713         * generic.cs (NullableType): New public class.
5714         (NullCoalescingOperator): New public class.
5715         (TypeArguments.Resolve): Add a CS0306 check.
5716
5717         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5718         (opt_nullable): New rule.
5719         (type): Added `opt_nullable' to `namespace_or_type_name',
5720         `builtin_types' and `pointer_type'.
5721         (array_type): Added `opt_nullable'.
5722         (opt_rank_specifier_or_nullable): New rule; this is the
5723         combination of `opt_rank_specifier' and `opt_nullable'.
5724         (opt_error): New rule; catch errors here.
5725         (nullable_type_or_conditional): New rule; we use this to check for
5726         nullable and still detect the conditional operator.
5727         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5728         instead `opt_rank_specifier'.
5729
5730         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5731         for nullables.
5732
5733 2005-02-24  Martin Baulig  <martin@ximian.com>
5734
5735         * README, README.Changes: Removed; they're old and obsolete.
5736
5737 2005-02-22  Martin Baulig  <martin@ximian.com>
5738
5739         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5740         returned an error, set `constraints' to null to avoid a crash
5741         later on.
5742         (TypeParameter.ResolveType): Likewise.
5743
5744 2005-02-22  Martin Baulig  <martin@ximian.com>
5745
5746         * generic.cs
5747         (Constraints.ResolveTypes): Protect against being called twice.
5748         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5749         (TypeParameter.ResolveType): New public method; calls
5750         constraints.ResolveTypes().
5751         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5752         into the new ResolveType().
5753         (GenericMethod.Define): Call ResolveType() on all our
5754         TypeParameter's.        
5755
5756 2005-02-21  Martin Baulig  <martin@ximian.com>
5757
5758         * generic.cs
5759         (TypeManager.generic_nullable_type): New static public field.
5760         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5761
5762         * rootcontext.cs
5763         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5764
5765 2005-02-15  Martin Baulig  <martin@ximian.com>
5766
5767         * generic.cs (ConstructedType.Constraints): Correctly check
5768         constraints if the argument type is a type parameter; fixes
5769         #72326. 
5770
5771 2005-02-02  Martin Baulig  <martin@ximian.com>
5772
5773         * delegate.cs (Delegate.DefineType): Report an internal error if
5774         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5775         details.        
5776
5777 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5778
5779         * pending.cs: Produce better code (no nops produced by using Ldarg
5780         + value).
5781         
5782         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5783         i - 1' it should be arg + 1.
5784
5785         Fixes bug #71819.
5786         
5787 2005-01-26  Martin Baulig  <martin@ximian.com>
5788
5789         * cs-parser.jay (indexer_declarator): Don't report an error if we
5790         have type parameters since we can be an explicit interface
5791         implementation; fixes #71449.
5792
5793 2005-01-26  Martin Baulig  <martin@ximian.com>
5794
5795         * class.cs (TypeContainer.AttributeTargets): Return the correct
5796         AttributeTargets depending on our `Kind' instead of throwing an
5797         exception; fixes #71632.
5798
5799 2005-01-26  Martin Baulig  <martin@ximian.com>
5800
5801         * delegate.cs (Delegate.DefineType): Correctly define our type
5802         parameters.  Fixes #71483.
5803
5804 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5805
5806         Fix #71602.
5807         * expression.cs (MemberAccess.DoResolve): Don't complain with
5808         cs0572 when the LHS of a member access has identical name and type
5809         name.
5810
5811 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5812
5813         Fix #71651, #71675
5814         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5815         CreatePermission.
5816         Create custom PermissionSet only for PermissionSetAttribute.
5817
5818 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5819
5820         Fix #71649
5821         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5822         delegates in static class.
5823
5824 2005-01-24  Martin Baulig  <martin@ximian.com>
5825
5826         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5827         merging an implicit block, just use its reachability.
5828
5829         * statement.cs (Block.Resolve): Make the unreachable code check
5830         work wrt. implicit blocks; see test-337 from #63842.
5831
5832 2005-01-21  Alp Toker  <alp@atoker.com>
5833  
5834         * cs-parser.jay: destructor_declaration's container is PartialContainer
5835         not Class when partial types are used, so use Kind prop instead of
5836         'is'.
5837         
5838 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5839
5840         * cs-parser.jay: Improve error reporting when an interface
5841         declares new types.
5842
5843 2005-01-20  Dick Porter  <dick@ximian.com>
5844
5845         * support.cs: SeekableStreamReader fix from Sandor Dobos
5846         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5847         chars are read.  Fixes bug 70369.
5848
5849 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5850
5851         * cs-parser.jay (catch_clause): Simplify current_block handling
5852         somewhat.
5853
5854 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5855
5856         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5857         code with ImplicitStandardConversion to handle the implicit
5858         conversion of method groups into valid delegate invocations. 
5859
5860         The problem is that in parameter handling we were using this code
5861         path.  Fixes bug #64698
5862
5863 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5864
5865         * cs-parser.jay: Fix several infelicities.
5866         - Avoid assigning to the parser value stack.  Code like 
5867           '$3 = null' is unclean.  Synthesize a value for the code block
5868           instead. 
5869         - Avoid using oob_stack for storing location information.  Use ...
5870         (_mark_): ... this.  New (empty) rule.  Saves the current location
5871         in $$.
5872         (foreach_statement): Avoid using oob_stack for current_block
5873         handling.  Use technique used in for_statement and
5874         using_statement.  Synthesize a value for the code block to store
5875         additional intermediate information.
5876
5877 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5878
5879         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5880         of a different type is only allowed to private fields of a
5881         containing type, not on fields of a base class.
5882
5883         See test-174.cs and error cs0122-9.cs
5884
5885 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5886
5887         Fix test-335.cs (bug #58126).
5888         * cs-parser.jay (argument): Split out non-expression parts of the
5889         rule into 'non_simple_argument'.
5890         (invocation_expression): Support parenthesized invocations with
5891         multiple arguments, and with single non-simple arguments.
5892
5893 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5894
5895         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5896         places.
5897
5898 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5899
5900         Fix cs0038-1.cs, cs1640-6.cs.
5901         * ecore.cs (Expression.Resolve): Remove special-case for
5902         SimpleName in error-handling.
5903         (Expression.almostMatchedMembers): Relax access permission to
5904         protected.
5905         (Expression.MemberLookupFailed): Handle duplicates in
5906         almostMatchedMembers list.
5907         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5908         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5909         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5910         overload if the passed in MemberInfo is a MethodBase.
5911
5912 2005-01-25  Martin Baulig  <martin@ximian.com>
5913
5914         * doc.cs
5915         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5916
5917 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5918
5919         Fix #70749
5920         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5921         for non-CAS & merge permission sets properly.
5922
5923 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5924
5925         Improve standard-compliance of simple name and member access 
5926         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5927         * ecore.cs (FullNamedExpression): New abstract base class 
5928         for Namespaces and TypeExpressions.
5929         (ResolveFlags.SimpleName): Remove.
5930         (SimpleName): Remove support for dotted names.
5931         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5932         DeclSpace.FindType and DeclSpace.LookupType.
5933         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5934         (Expression.ExprClassName): Make member function.
5935         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5936         a namespace.  Remove creation of dotted "SimpleName"s.
5937         (MemberAccess.DoResolve): Likewise.
5938         * decl.cs (DeclSpace.Cache): Make private.
5939         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5940         (DeclSpace.FindType): Update.
5941         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5942         FullNamedExpression.
5943         * namespace.cs (Namespace): Derive from FullNamedExpression
5944         so that it can be part of expression resolution.
5945         (Namespace.Lookup): Return an FullNamedExpression.
5946         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5947         namespace.
5948         * rootcontext.cs (NamespaceLookup): Remove.
5949         (LookupType): Move to DeclSpace.
5950         * attribute.cs (CheckAttributeType): Update.
5951         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5952         (FindDocumentedTypeNonArray): Likewise.
5953
5954 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5955
5956         Fix cs0509.cs, cs1632.cs.
5957         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5958         is the same as IsInterface.
5959         (TypeContainer.GetClassBases): Likewise.
5960         * statement.cs (LabeledStatement.ig): New field.
5961         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5962         label.
5963         (LabeledStatement.DoEmit): Check that the label was created with
5964         the same ILGenerator.
5965
5966 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5967
5968         Fix #71058
5969         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5970         accessors to its properties.
5971
5972         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5973         from accessors to property.
5974         
5975 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5976
5977         Fix #70722
5978         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5979         only for overrides.
5980         
5981 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5982
5983         * attribute.cs: Check for null and empty strings.  
5984
5985         I have lost another battle to Paolo.
5986
5987 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5988
5989         Fix #70942
5990         * class.cs (PropertyMethod): Set Parent field in ctors.
5991         (SetMethod.InternalParameters): Add unsafe switch hack.
5992         Override MarkForDuplicationCheck where it is appropriate.
5993
5994         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5995         It says whether container allows members with the same name.
5996         Base default is no.
5997         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5998         Removed is_method parameter.
5999
6000 2005-01-06  Duncan Mak  <duncan@ximian.com>
6001
6002         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6003         because the previous change led to incorrect reporting of CS1032
6004         ("Cannot define/undefine preprocessor symbols after first token in
6005         file"). Instead of using `tokens_seen' as the only flag that
6006         triggers CS1040, introduce `comments_seen'. This new flag is used
6007         to signify having seen comments on the current line, so it is
6008         unset after a newline.
6009
6010 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6011
6012         * doc.cs : When searching for a type, find nested type too.
6013           This fixes bug #71040.
6014
6015 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6016
6017         * doc.cs :
6018           - Warn missing member comment on those classes which also does not
6019             have doc comments. Fixed bug #71041.
6020           - Don't warn missing doc comment on default constructor.
6021             Fixed bug #71042.
6022
6023 2005-01-06  Duncan Mak  <duncan@ximian.com>
6024
6025         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6026         comments, set `tokens_seen' to true. This allows us to detect
6027         misplaced preprocessor directives (i.e. not at the beginning of
6028         the a line, nor after whitespaces). In that case, report error
6029         CS1040. This fixes bug #56460.
6030
6031         * cs-parser.jay (interface_member_declaration): Add checks for
6032         IsExplicitImpl, and report CS0541 error if an interface member is
6033         defined as an explicit interface declaration.
6034
6035 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6036
6037         Fix #70817
6038         * class.cs (PropertyMethod): Set Parent field in ctors.
6039         (SetMethod.InternalParameters): Add unsafe switch hack.
6040         
6041         * decl.cs (MemberCore.Parent): Cannot be readonly.
6042
6043 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6044
6045         * decl.cs (DeclSpace.ResolveType): Remove.
6046         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6047         Merge in code from ...
6048         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6049         * class.cs, enum.cs: Update to changes.
6050
6051 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6052
6053         * anonymous.cs: Ensure that we init the scope of our parent if it
6054         has not been initialized yet.
6055
6056 2004-12-30  Duncan Mak  <duncan@ximian.com>
6057
6058         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6059         if field.FieldBuilder is null. Fixes #70758.
6060
6061         * convert.cs: Fixed some typos and updated some of the comments.
6062         (ImplicitStandardConversionExists):
6063         (TryImplicitIntConversion): If `target_type' is an interface and
6064         the type of `ic' implements this interface, return true or a new
6065         BoxedCast instead of null. This fixes #70468.
6066
6067 2004-12-29  Duncan Mak  <duncan@ximian.com>
6068
6069         * expression.cs (Argument.Emit): Check that Expr is
6070         IMemoryLocation before casting to it, and report CS1510 otherwise.
6071
6072         This fixes #70402.
6073
6074 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6075
6076         * statement.cs (Block.ThisVariable): remove the recursion here, to
6077         make the --profile more sane.
6078
6079 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6080
6081         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6082         assembly, by JB Evain.
6083
6084 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6085
6086         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6087           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6088         "parent" refers to enclosing type/class.  "base" refers to superclass.
6089
6090 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6091
6092         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6093         Ensure that we only have GlobalAttributes.
6094         * attribute.cs (Attribute.Emit): Make non-virtual.
6095         (GlobalAttribute.Emit): Remove.
6096         (Attribute.Resolve): Make virtual.
6097         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6098         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6099         the argument. Don't create one.
6100         (Attribute.GetObsoleteAttribute): Likewise.
6101         (Attribute.GetClsCompliantAttributeValue): Likewise.
6102         * class.cs, decl.cs: Update to changes.
6103
6104 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6105
6106         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6107         
6108         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6109         
6110         * statement.cs (Foreach.Resolve): Add error 186 report.
6111
6112 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6113
6114         * expression.cs (Conditional.DoResolve): Add warning 429.
6115         
6116         * statement.cs (If.Resolve): Add warning 665.
6117
6118 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6119
6120         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6121         except when in the parser, and in GlobalAttribute.
6122         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6123         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6124         RootContext.Tree.Types.NamespaceEntry once work is done.
6125         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6126         and resets RootContext.Tree.Types.NamespaceEntry.
6127
6128 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * cs-parser.jay: Don't create a block for every variable.
6131
6132 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6133
6134         * location.cs: Provide extra information.
6135
6136         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6137         variables from the captured environment, it is the ldarg_0.
6138
6139 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6140
6141         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6142         find a conclusion.
6143         
6144         * class.cs: Changed warning level for 169 to avoid developer
6145         displeasure from warning flooding. It will be changed back when they
6146         fix most of current BCL warnings.
6147         
6148         * RootContext.cs: Pushed default WarningLevel to 3.
6149         
6150         * statement.cs: Removed unused variable.
6151
6152 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6153
6154         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6155         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6156         Add error 502 report.
6157         (StaticClass.DefineType): Add error 441 report.
6158         (Class.AllowedModifiersProp): New virtual property as temporary
6159         extension to AllowedModifiers.
6160         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6161         to share implementation with StaticClass and don't call virtual
6162         methods from ctor.
6163         
6164         * driver.cs (MainDriver): Add error 1558 test.
6165
6166         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6167         report. Moved error 36 test here.
6168
6169         * statement.cs (Throw.Resolve): Add error 724 report.
6170
6171         * typemanager.cs: Add out_attribute_type core type.
6172         
6173 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6174
6175         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6176         3018 report.
6177         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6178
6179         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6180         3017 report.
6181         
6182         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6183
6184         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6185         Add error 3023 report.
6186         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6187
6188         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6189         implementation.
6190
6191 2004-12-12  John Luke  <john.luke@gmail.com>
6192
6193         * driver.cs (AddArgs): take -- into account when
6194         adding arguments, fixes bug 65710 
6195
6196 2004-12-12  Martin Baulig  <martin@ximian.com>
6197
6198         * expression.cs (Unary.TryReduceNegative): Added support for
6199         SByteConstant and ByteConstant.
6200         (Unary.Reduce): Check error values from TryReduceNegative().
6201
6202 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6203
6204         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6205         and report exception as error 182.
6206
6207 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6208
6209         * driver.cs (Main): Fix message when there are warnings.
6210
6211 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6212
6213         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6214
6215 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6216
6217         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6218         Reduced number of warnings.
6219         
6220         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6221
6222 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6223
6224         * driver.cs: Removed message.
6225
6226         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6227
6228 2004-12-08    <vargaz@freemail.hu>
6229
6230         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6231
6232 2004-12-08  Martin Baulig  <martin@ximian.com>
6233
6234         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6235         instead of a CS3002 for properties and indexer.
6236
6237 2004-12-08  Martin Baulig  <martin@ximian.com>
6238
6239         * decl.cs (MemberName.ToString): Make this work again.
6240
6241 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6242
6243         * attribute.cs (Resolve): Add error 591 detection.
6244
6245         * class.cs (FieldMember.Define): Add error 1547 detection.
6246         (Indexer.Define): Add error 620 detection.
6247         (Operator.Define): Add error 590 detection.
6248
6249         * ecore.cs: Missing argument for error 79.
6250
6251         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6252         detection.
6253
6254 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6255
6256         Fix #70106
6257         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6258         only.
6259
6260 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6261
6262         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6263           Some operator comments were suppressed.
6264         * doc.cs : Implicit/explicit operator name in doc comments are like
6265           "op_Explicit(type)~returnType", so added suffix handling.
6266
6267 2005-01-21  Alp Toker  <alp@atoker.com>
6268
6269         * cs-parser.jay: destructor_declaration's container is PartialContainer
6270         not Class when partial types are used, so use Kind prop instead of 'is'.
6271
6272 2004-12-12  Martin Baulig  <martin@ximian.com>
6273
6274         * expression.cs (Unary.TryReduceNegative): Added support for
6275         SByteConstant and ByteConstant.
6276         (Unary.Reduce): Check error values from TryReduceNegative().
6277
6278 2004-12-11  Martin Baulig  <martin@ximian.com>
6279
6280         * support.cs (ReflectionParameters.ParameterName): If we have a
6281         `gpd', call `ParameterName' on it.
6282
6283         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6284
6285         * pending.cs (PendingImplementation.DefineProxy): Call
6286         DefineParameter() for all of the MethodBuilder's arguments.
6287
6288 2004-12-09  Martin Baulig  <martin@ximian.com>
6289
6290         * doc.cs (DocUtil): Make this a static class.
6291
6292 2004-12-09  Martin Baulig  <martin@ximian.com>
6293
6294         * expression.cs (Invocation.InferType): Moved the type inference
6295         implementation into TypeManager.
6296
6297         * generics.cs (TypeManager): Moved the type inference
6298         implementation here.
6299
6300 2004-12-09  Martin Baulig  <martin@ximian.com>
6301
6302         * typemanager.cs (TypeManager): Make this a partial class.
6303
6304         * generics.cs
6305         (TypeManager): Move the generics part of `TypeManager' here.
6306
6307 2004-12-08  Martin Baulig  <martin@ximian.com>
6308
6309         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6310         instead of a CS3002 for properties and indexer.  Added CS3024
6311         check for generic interfaces.
6312
6313         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6314         instances are not CLS-compliant.
6315
6316 2004-12-08  Martin Baulig  <martin@ximian.com>
6317
6318         * cs-parser.jay
6319         (void_pointer_expression): New rule for `void*', `void**' etc.
6320         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6321
6322 2004-12-08  Martin Baulig  <martin@ximian.com>
6323
6324         * expression.cs (Invocation.InferType): Removed the hack for
6325         MethodCore.MayUnify().  
6326
6327         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6328         this actually work.
6329
6330         * class.cs (MethodCore.MayUnify): Use
6331         TypeManager.MayBecomeEqualGenericTypes().       
6332
6333 2004-12-08  Martin Baulig  <martin@ximian.com>
6334
6335         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6336         parameter, box it.  Fixes #69233.
6337
6338 2004-12-08  Martin Baulig  <martin@ximian.com>
6339
6340         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6341         have the ctor constraint.  Fixes #68326.
6342
6343 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6344
6345         * cs-parser.jay : interface comment was not consumed because of
6346           extra opt_semicolon before doc handling.
6347
6348 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6349
6350         Fix test-327.cs, test-328.cs, and put in early infrastructure
6351         for eventually fixing #52697.
6352         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6353         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6354         from other methods.
6355         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6356         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6357         (VerifyUsing, error246): Update.
6358         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6359         'NamespaceEntry.LookupNamespaceOrType'.
6360
6361 2004-12-07  Martin Baulig  <martin@ximian.com>
6362
6363         * driver.cs: Call it "BETA SOFTWARE" :-)
6364
6365 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6366
6367         Fix crash on cs0657-17.cs.
6368         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6369         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6370         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6371         the case where the NamespaceEntry gets overwritten.
6372
6373 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6374
6375         Fixed #69195, #56821
6376         * ecore.cs (ResolveBoolean): Tiny refactoring.
6377
6378         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6379         of right expression resolving when left is false constant and
6380         operator is LogicalAnd OR true constant and operator is LogicalOr.
6381
6382         * statement.cs (ResolveUnreachable): Always reports warning.
6383
6384 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6385
6386         * class.cs: Distinguish between 1721 and 1722 (just a little help
6387         for the programmer).
6388
6389 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6390
6391         * delegate.cs: Only allow this on new versions of the language. 
6392
6393 2004-12-02  Duncan Mak  <duncan@ximian.com>
6394
6395         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6396         Expression class.
6397         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6398         here as a static method. Take an additional bool out parameter
6399         `must_do_cs1540_check' for signaling to InstanceResolve.
6400         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6401         member field from PropertyExpr class and made it an argument of
6402         the method instead.
6403         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6404         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6405         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6406         and `remove_accessor' as well as InstanceResolve: report CS0122
6407         where applicable.
6408
6409         Fixes #70129.
6410
6411 2004-12-07  Martin Baulig  <martin@ximian.com>
6412
6413         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6414         and CS0692 where appropriate.
6415
6416 2004-12-06  Martin Baulig  <martin@ximian.com>
6417
6418         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6419         IsDuplicateImplementation() and improved it.
6420
6421         * expression.cs (Invocation.InferTypeArguments): Added
6422         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6423         and removed the "ref" modifier from `infered_types'.
6424
6425         * decl.cs (MemberName.ToString): Removed the exception.
6426
6427 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6428
6429         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6430           comments are allowed.
6431
6432 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6433
6434         * delegate.cs: Add checks for subtypes in paramaters and return values
6435         in VerifyMethod () to add support for Covariance/Contravariance
6436         in delegates.
6437         
6438 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6439
6440         * report.cs: Remove extra closing parenthesis.
6441
6442         * convert.cs (Error_CannotImplicitConversion): If the name of the
6443         types are the same, provide some extra information.
6444
6445 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6446
6447         Fix bug #70102
6448         * attribute.cs (Resolve): Improved implementation of params
6449         attribute arguments.
6450
6451         * support.cs (ParameterData): Add HasParams to be faster.
6452
6453 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6454
6455         all things are for /doc support:
6456
6457         * doc.cs: new file that supports XML documentation generation.
6458         * mcs.exe.sources: added doc.cs.
6459         * driver.cs:
6460           Handle /doc command line option.
6461           Report error 2006 instead of 5 for missing file name for /doc.
6462           Generate XML documentation when required, after type resolution.
6463         * cs-tokenizer.cs:
6464           Added support for picking up documentation (/// and /** ... */),
6465           including a new XmlCommentState enumeration.
6466         * cs-parser.jay:
6467           Added lines to fill Documentation element for field, constant,
6468           property, indexer, method, constructor, destructor, operator, event
6469           and class, struct, interface, delegate, enum.
6470           Added lines to warn incorrect comment.
6471         * rootcontext.cs :
6472           Added Documentation field (passed only when /doc was specified).
6473         * decl.cs:
6474           Added DocComment, DocCommentHeader, GenerateDocComment() and
6475           OnGenerateDocComment() and some supporting private members for
6476           /doc feature to MemberCore.
6477         * class.cs:
6478           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6479         * delegate.cs:
6480           Added overriden DocCommentHeader.
6481         * enum.cs:
6482           Added overriden DocCommentHeader and GenerateDocComment().
6483
6484 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6485
6486         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6487         unwrapping the enumeration values, chain to
6488         DoConstantNumericPromotions again, so we can promote things to the
6489         fundamental types (takes care of enums that are bytes, sbytes).
6490
6491         Fixes bug #62054.
6492
6493 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6494
6495         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6496         Fix long-standing bug in type-lookup.  Use FindType instead of
6497         LookupType when ec.ResolvingTypeTree.
6498         (Attribute.ResolveType, Attribute.Resolve)
6499         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6500         Update to changes.
6501         (Attributes.Search): Remove internal version.  Update.
6502         (Attributes.SearchMulti): Update.
6503         (Attributes.GetClsCompliantAttribute): Remove.
6504         (Attributes.GetIndexerNameAttribute): Remove.
6505         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6506         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6507         * class.cs (Indexer.Define): Likewise.
6508
6509 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6510
6511         Fix bug #68790
6512         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6513         MarshallByReference members access.
6514
6515         * expression.cs: Use CheckMarshallByRefAccess;
6516         Better error CS0197 message.
6517
6518         * report.cs: Print whole related error message.
6519
6520 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6521
6522         * class (GetClassBases): Better error 60 report.
6523         (EventProperty): Disabled warning 67 detection.
6524
6525 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6526
6527         Fix bug #60324
6528         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6529
6530         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6531         precise values.
6532
6533 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6534
6535         Fix bug #49488
6536         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6537
6538         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6539
6540 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6541
6542         * attribute.cs (Attribute.Resolve): Refine error reporting and
6543         report a cs0117 if the identifier does not exist, to distinguish
6544         from 0617 which is a miss-use of the actual identifier.
6545
6546         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6547         between cs0070 and cs0079.
6548
6549         * class.cs (MemberBase.DoDefine): When reporting a wrong
6550         accessibility level, we use MethodCore to compare instead of
6551         Method (this was a regression in some refactoring effort).
6552
6553         So now we correctly report cs0056 again.
6554
6555         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6556         testing the target_type (which was known to be object_type) and
6557         not the source type (which is anonymous_method).
6558
6559         Fixed reporting of error cs1660.
6560
6561         * expression.cs (UserCast.Source): Expose the underlying cast.
6562
6563         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6564         allowed types to find a match to int32 first (most common).
6565
6566         In addition, it ignores any ImplicitUserConversions that did an
6567         internal implicit conversion (as the switch statement allows only
6568         one integral conversion to exist).
6569
6570         * class.cs (PartialContainer.Create): rename `name' to
6571         `member_name' for clarity.  Then replace the string calls with a
6572         call to MemberName.GetPartialName, as now using
6573         MemberName.ToString is an error (this is due to the side effects
6574         it had, that were fixed in the past).
6575
6576         This will restore the error reporting on a number of partial class
6577         errors that were missusing this (and getting an exception as a
6578         results, which is now just a plain textual warning, because
6579         yyparse debug output would crash otherwise).
6580
6581 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6582
6583         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6584
6585 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6586
6587         * rootcontext.cs (LookupType): Make sure to cache lookups that
6588         don't give us a negative result. This saves about 5% of corlib
6589         compilation time.
6590
6591 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6592
6593         * report.cs (AbstractMessage.Print): messages are sent to stderr
6594
6595         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6596         non-interface in the list of interfaces (at this point, either
6597         parent was properly set, or a base class is being listed in the
6598         interfaces section).
6599
6600         This flags error 1722, and resolves the crash from bug 69259.
6601
6602 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6603
6604         * statement.cs (Using.EmitExpressionFinally): make this work right
6605         for valuetypes. Fixes 69926.
6606
6607 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6608
6609         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6610         converted to an enum" here, before we try to change the underlying
6611         type.  This code exists, but it is a different code path than the
6612         one used while encoding constants.
6613
6614         (ImplicitReferenceConversionExists): In addition, resynchronized
6615         the code here, so it matches the same code in
6616         ImplicitReferenceConversionExists for the `from any class-type S
6617         to any interface-type T'.       
6618
6619 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6620
6621         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6622
6623 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6624
6625         * cs-parser.jay: Use verbosity accordingly. 
6626
6627 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6628
6629         * expression.cs (Unary.ResolveOperator): Do not report warning;
6630         AddressOf reads from variable.
6631         
6632         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6633
6634 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6635
6636         Fix bug #69462
6637
6638         * attribute.cs (Attributable): Removed CheckTargets.
6639         (Attributes.Emit): Explicit attribute targets are tested here.
6640
6641         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6642         not enabled for interfaces.
6643
6644         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6645         (GetAssemblyName): Ouch next bug there.
6646
6647 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6648
6649         * expression.cs: Error 275 added.
6650         
6651 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6652
6653         Fix bug #69177 (Implemented decimal constant support)
6654
6655         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6656         (BinaryFold): Add DecimalConstant.
6657
6658         * const.cs (Define): Decimal constant 
6659         (is not constant.
6660         (ChangeType): Add decimal type handling.
6661         (LookupConstantValue): Don't set value for decimal type but
6662         emit DecimalConstantAttribute. Needed for constant optimization.
6663
6664         * constant.cs (ToDecimal): New method.
6665         (ConvertToDecimal): New method.
6666         (IntConstant): Implemented ConvertToDecimal.
6667         (DecimalConstant.Emit): Emit optimized version for decimals in
6668         int range.
6669
6670         * expression.cs (ResolveOperator): Changed order of constant
6671         reduction to work correctly with native types which have
6672         overloaded operators.
6673         (ResolveMemberAccess): Extract constant value from attribute
6674         for decimal type.
6675
6676         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6677
6678         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6679         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6680         (ChangeType): Decimal is special.
6681         (TypeToCoreType): Add decimal type.
6682
6683 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6684
6685         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6686         decimal types.
6687
6688 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6689
6690         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6691         test cs1667-5.cs.
6692
6693 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6694
6695         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6696
6697         * pending.cs (PendingImplementation): Grab only interfaces.
6698
6699 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6700
6701         * statement.cs (ForeachHelperMethods): Add location member and
6702         error 202 detection.
6703
6704 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6705
6706         * expression.cs (DoResolveBase): Fixed wrong warning for out
6707         variables.
6708
6709 2004-12-04  Martin Baulig  <martin@ximian.com>
6710
6711         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6712         to check whether the conversion is ok.
6713
6714         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6715         `Type.EmptyTypes' if we're not a generic TypeContainer.
6716
6717 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6718
6719         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6720         old bug: when converting from the null literal to a pointer,
6721         return an EmptyCast, not the NullLiteral.
6722
6723         This fixes #69921, the recent null_type changes probably made this
6724         bug more prominent.
6725
6726 2004-12-03  Martin Baulig  <martin@ximian.com>
6727
6728         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6729         method as our child, call AnonymousMethod.Compatible() on it.
6730
6731 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6732
6733         * class.cs (FieldBase): Use an unused bit field from the field to
6734         encode the `has_offset' property from the FieldMember.  This saves
6735         a couple of Ks on bootstrap compilation.
6736
6737         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6738         method as our child, return the AnonymousMethod resolved
6739         expression.
6740
6741         * expression.cs (New.DoResolve): Allow return values from
6742         NewDelegate to also include AnonymousMethods.
6743
6744         Fixes #70150.
6745
6746 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6747
6748         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6749         cs1648 report.
6750         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6751         System.Runtime.InteropServices._Exception, since it's a base
6752         interface of the core type System.Exception in the net_2_0 profile.
6753
6754 2004-11-27  Martin Baulig  <martin@ximian.com>
6755
6756         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6757
6758 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6759
6760         * Makefile: Convert to use executable.make.
6761         * gmcs.exe.sources: New.
6762
6763 2004-11-25  Martin Baulig  <martin@ximian.com>
6764
6765         * expression.cs (Invocation.InferType): Added support for byref types.
6766
6767 2004-11-25  Martin Baulig  <martin@ximian.com>
6768
6769         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6770         in TypeManager.TypeToCoreType().
6771
6772 2004-11-25  Martin Baulig  <martin@ximian.com>
6773
6774         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6775         "Dispose" method from the `current_type'.
6776         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6777         DoDefineMembers() instead of using the MethodBuilder; this is
6778         required for generic iterators.
6779
6780         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6781
6782 2004-11-24  Martin Baulig  <martin@ximian.com>
6783
6784         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6785
6786 2004-11-20  Martin Baulig  <martin@ximian.com>
6787
6788         * expression.cs (Invocation.InferType): Correctly infer generic
6789         instances; see gen-103.cs.
6790         (Invocation.InferTypeArguments): If a generic method doesn't have
6791         any unbound type parameters, we don't need to infer anything.
6792
6793 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6794
6795         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6796
6797 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6798
6799         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6800         (TypeHandle.GetMemberCache): New.
6801         (TypeHandle.TypeHandle): Update.
6802         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6803         (TypeManager.LookupParentInterfacesCache):
6804         Rename from LookupInterfaceCache.  Optimize slightly.
6805         (TypeManager.MemberLookup_FindMembers): Update.
6806         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6807         multi-type variant.
6808         (AddCacheContents): Rename from AddHashtable.
6809         * class.cs (TypeContainer.parent_container): Remove.
6810         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6811         (TypeContainer.DoDefineMembers): Don't initialize it.
6812         Update to name changes.
6813         
6814 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6815
6816         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6817         that factors the code to check access modifiers on override.  
6818
6819         (PropertyBase): Use the code here.
6820
6821         Patch from Lluis S'anchez, fixes bug #69361.
6822
6823 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6824
6825         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6826         routine that is used to report the use of a captured variable
6827         whose address has been taken.
6828
6829         There are two checks: one when variables are being captured and
6830         the other check is when the address of a variable is taken. 
6831         
6832         (because an anonymous methods might be resolved before *or* after
6833         the address has been taken) and 
6834
6835         * expression.cs (Conditional.DoResolve): Remove the special
6836         casing that Martin added to trueExpr and falseExpr being both
6837         NullLiteral.  We get the right behavior now just by introducing
6838         the null_type into the compiler. 
6839
6840         * convert.cs (ExplicitConversion): Change the code to use
6841         null_type instead of testing `expr is NullLiteral'.
6842         (ImplicitConversionStandard): use null_type too.
6843         (ImplicitReferenceConversionExists): use null_type too.
6844         (ImplicitReferenceConversion): use null_type too.
6845
6846         * literal.cs: The type of `NullLiteral' is now null_type instead
6847         of object_type. 
6848         (Resolve): Set the type here.
6849
6850         * typemanager.cs: Introduce null_type.
6851
6852 2004-11-18  Martin Baulig  <martin@ximian.com>
6853
6854         * rootcontext.cs
6855         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6856
6857 2004-11-18  Martin Baulig  <martin@ximian.com>
6858
6859         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6860
6861 2004-11-18  Martin Baulig  <martin@ximian.com>
6862
6863         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6864         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6865         call ResolveConstructedType() on it to resolve it without checking
6866         constraints.
6867         (Constraints.ResolveTypes): Check them here.
6868         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6869         but don't check constraints.
6870         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6871         check constraints here.
6872         (ConstructedType.ResolveConstructedType): New public method.  This
6873         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6874         resolve ourselves without checking constraints.
6875
6876         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6877
6878 2004-11-18  Martin Baulig  <martin@ximian.com>
6879
6880         * decl.cs
6881         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6882
6883         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6884
6885 2004-11-18  Martin Baulig  <martin@ximian.com>
6886
6887         * ecore.cs (TypeExpr.ResolveType): Removed.
6888         (Expression.ResolveAsTypeTerminal): We always return a fully
6889         resolved `TypeExpr', so we can just access its `Type'.
6890
6891         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6892
6893 2004-11-17  Martin Baulig  <martin@ximian.com>
6894
6895         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6896         sure we don't return any unresolved TypeExpr's.
6897         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6898         a `TypeExpr'.
6899         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6900
6901         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6902         unresolved `ConstructedType's.
6903
6904 2004-11-17  Martin Baulig  <martin@ximian.com>
6905
6906         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6907
6908 2004-11-17  Martin Baulig  <martin@ximian.com>
6909
6910         * ecore.cs
6911         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6912
6913         * decl.cs (DeclSpace.ResolveType): Removed.
6914         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6915
6916 2004-11-17  Martin Baulig  <martin@ximian.com>
6917
6918         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6919         direction, like FindMembers() does.  Fixes #69546, testcase is in
6920         test-315.cs.    
6921
6922 2004-11-16  Martin Baulig  <martin@ximian.com>
6923
6924         This is based on a patch from Marek Safar, see bug #69082.
6925         Fixes bugs #63705 and #67130.
6926
6927         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6928         method; create a MemberCache for an interface type and cache the
6929         result.
6930
6931         * decl.cs (IMemberContainer.ParentContainer): Removed.
6932         (IMemberContainer.ParentCache): New property.
6933         (MemberCache.SetupCacheForInterface): Removed.
6934         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6935         to create a cache for an interface's "parent".
6936
6937         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6938         interfaces too.
6939
6940 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6941
6942         * statement.cs: Avoid adding bools to a hashtable.
6943
6944 2004-11-15  Martin Baulig  <martin@ximian.com>
6945
6946         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6947
6948 2004-11-11  Martin Baulig  <martin@ximian.com>
6949
6950         * typemanager.cs (TypeManager.GetMethodName): New method.
6951
6952         * class.cs (MethodData.Define): Include the generic arity in the
6953         name of an explicit interface; also add it to the method name.
6954
6955         * pending.cs (PendingImplementation.InterfaceMethod): The method
6956         name now includes the generic arity.
6957
6958 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6959
6960         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6961         calling an unsafe method from a safe location.
6962
6963 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6964
6965         Fix #69167
6966         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6967
6968 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6969
6970         * namespace.cs (VerifyUsing): use GetPartialName instead of
6971         ToString. 
6972
6973 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6974
6975         * statement.cs (Return.Resolve): Fix regression in typo: if
6976         `in_exc', we have to request a NeedReturnLabel, this was a typo
6977         introduced in the anonymous method check-in.  Fixes #69131.
6978
6979         * Indexers were using the ShortName when defining themselves,
6980         causing a regression in the compiler bootstrap when applying the
6981         patch from 2004-11-02 (first part), now they use their full name
6982         and the bug is gone.
6983
6984 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6985
6986         * driver.cs: Strip the path from the names of embedded resources. Fixes
6987         #68519.
6988
6989 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6990
6991         Fix error message regression: cs0104-2.cs.
6992         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6993         (AliasEntry.Resolve): Update.
6994         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6995         'silent' flag.
6996         (RootContext.LookupType): Update.
6997
6998 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6999
7000         * cs-parser.jay: Add support for handling accessor modifiers
7001         * class: Add support port accessor modifiers and error checking,
7002         define PropertyMethod.Define as virtual (not abstract anymore)
7003         * ecore.cs: Add checking for proeprties access with access modifiers
7004         * iterators.cs: Modify Accessor constructor call based in the modified
7005         constructor
7006 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7007
7008         * expression.cs (StringConcat): Handle being called twice,
7009         as when we have a concat in a field init with more than two
7010         ctors in the class
7011
7012 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7013
7014         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7015         special case explicit implementations, we should always produce
7016         the .property or .event declaration.
7017         
7018         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7019         since it will not return correct data if people use this
7020         unresolved in the presence of using statements (see test-313).
7021
7022         * class.cs (MethodData.Define): If we are an explicit interface
7023         implementation, set the method name to the full name of the
7024         interface plus the name of the method.  
7025
7026         Notice that using the method.MethodName.GetFullName() does not
7027         work, as it will only contain the name as declared on the source
7028         file (it can be a shorthand in the presence of using statements)
7029         and not the fully qualifed type name, for example:
7030
7031         using System;
7032
7033         class D : ICloneable {
7034                 object ICloneable.Clone ()  {
7035                 }
7036         }
7037
7038         Would produce a method called `ICloneable.Clone' instead of
7039         `System.ICloneable.Clone'.
7040
7041         * namespace.cs (Alias.Resolve): Use GetPartialName.
7042         
7043 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7044
7045         * cs-parser.jay: Add error 1055 report.
7046
7047 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7048
7049         * assign.cs (Assign.DoResolve): Only do the transform of
7050         assignment into a New if the types are compatible, if not, fall
7051         through and let the implicit code deal with the errors and with
7052         the necessary conversions. 
7053
7054 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7055
7056         * cs-parser.jay: Add error 1031 report.
7057
7058         * cs-tokenizer.cs: Add location for error 1038.
7059
7060 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7061
7062         * cs-parser.jay: Add error 1016 report.
7063
7064 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7065
7066         * cs-parser.jay: Add errors 1575,1611 report.
7067
7068 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7069
7070         * cs-parser.jay: Add error 1001 report.
7071
7072 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7073
7074         Fix #68850
7075         * attribute.cs (GetMarshal): Add method argument for
7076         caller identification.
7077
7078         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7079         agument for GetMarshal and RuntimeMissingSupport.
7080
7081 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7082
7083         * attribute.cs (ExtractSecurityPermissionSet): Removed
7084         TypeManager.code_access_permission_type.
7085
7086         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7087
7088 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7089
7090         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7091         for obsolete use of a variable here.   Fixes regression on errors
7092         cs0619-25 and cs0619-26.
7093
7094 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7095
7096         Fix #62358, implemented security attribute encoding.
7097
7098         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7099         Tests permitted SecurityAction for assembly or other types.
7100         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7101         data from SecurityPermissionAttribute to PermisionSet class.
7102
7103         * class.cs (ApplyAttributeBuilder): Added special handling
7104         for System.Security.Permissions.SecurityAttribute based types.
7105
7106         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7107         special handling for System.Security.Permissions.SecurityAttribute
7108         based types.
7109
7110         * enum.cs (ApplyAttributeBuilder): Added special handling
7111         for System.Security.Permissions.SecurityAttribute based types.
7112
7113         * parameter.cs (ApplyAttributeBuilder): Added special handling
7114         for System.Security.Permissions.SecurityAttribute based types.
7115
7116         * rootcontext.cs: Next 2 core types.
7117
7118         * typemanager.cs (TypeManager.security_permission_attr_type):
7119         Built in type for the SecurityPermission Attribute.
7120         (code_access_permission_type): Build in type.
7121
7122 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7123
7124         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7125         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7126         all of this information into
7127         EmitContext.EmitCapturedVariableInstance.
7128         
7129         * codegen.cs (EmitCapturedVariableInstance): move here the
7130         funcionality of emitting an ldarg.0 in the presence of a
7131         remapping.   This centralizes the instance emit code.
7132
7133         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7134         then emit a load of this: it means that we have reached the
7135         topmost ScopeInfo: the one that contains the pointer to the
7136         instance of the class hosting the anonymous method.
7137
7138         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7139         captures to the topmost CaptureContext.
7140
7141 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7142
7143         * expression.cs (LocalVariableReference): Move the knowledge about
7144         the iterators into codegen's EmitCapturedVariableInstance.
7145
7146 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7147
7148         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7149         all code paths return a value from an anonymous method (it is the
7150         same as the 161 error, but for anonymous methods).
7151
7152 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7153
7154         The introduction of anonymous methods in the compiler changed
7155         various ways of doing things in the compiler.  The most
7156         significant one is the hard split between the resolution phase
7157         and the emission phases of the compiler.
7158
7159         For instance, routines that referenced local variables no
7160         longer can safely create temporary variables during the
7161         resolution phase: they must do so from the emission phase,
7162         since the variable might have been "captured", hence access to
7163         it can not be done with the local-variable operations from the runtime.
7164         
7165         * statement.cs 
7166
7167         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7168         is a toplevel block.
7169
7170         (ToplevelBlock): A new kind of Block, these are the blocks that
7171         are created by the parser for all toplevel method bodies.  These
7172         include methods, accessors and anonymous methods.
7173
7174         These contain some extra information not found in regular blocks:
7175         A pointer to an optional CaptureContext (for tracking captured
7176         local variables and parameters).  A pointer to the parent
7177         ToplevelBlock.
7178         
7179         (Return.Resolve): Catch missmatches when returning a value from an
7180         anonymous method (error 1662).
7181         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7182         phase.
7183
7184         (Break.Resolve): ditto.
7185
7186         (SwitchLabel): instead of defining the labels during the
7187         resolution phase, we now turned the public ILLabel and ILLabelCode
7188         labels into methods called GetILLabelCode() and GetILLabel() that
7189         only define the label during the Emit phase.
7190
7191         (GotoCase): Track the SwitchLabel instead of the computed label
7192         (its contained therein).  Emit the code by using
7193         SwitchLabel.GetILLabelCode ().
7194
7195         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7196         whether the Local has been captured or not.
7197
7198         (LocalInfo.IsCaptured): New property, used to tell whether the
7199         local has been captured.
7200         
7201         * anonymous.cs: Vastly updated to contain the anonymous method
7202         support.
7203
7204         The main classes here are: CaptureContext which tracks any
7205         captured information for a toplevel block and ScopeInfo used to
7206         track the activation frames for various local variables.   
7207
7208         Each toplevel block has an optional capture context associated
7209         with it.  When a method contains an anonymous method both the
7210         toplevel method and the anonymous method will create a capture
7211         context.   When variables or parameters are captured, they are
7212         recorded on the CaptureContext that owns them, for example:
7213
7214         void Demo () {
7215              int a;
7216              MyDelegate d = delegate {
7217                  a = 1;
7218              }
7219         }
7220
7221         Here `a' will be recorded as captured on the toplevel
7222         CapturedContext, the inner captured context will not have anything
7223         (it will only have data if local variables or parameters from it
7224         are captured in a nested anonymous method.
7225
7226         The ScopeInfo is used to track the activation frames for local
7227         variables, for example:
7228
7229         for (int i = 0; i < 10; i++)
7230                 for (int j = 0; j < 10; j++){
7231                    MyDelegate d = delegate {
7232                         call (i, j);
7233                    }
7234                 }
7235
7236         At runtime this captures a single captured variable `i', but it
7237         captures 10 different versions of the variable `j'.  The variable
7238         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7239         recorded on a child.  
7240
7241         The toplevel ScopeInfo will also track information like the `this'
7242         pointer if instance variables were referenced (this is necessary
7243         as the anonymous method lives inside a nested class in the host
7244         type of the method). 
7245
7246         (AnonymousMethod): Expanded to track the Toplevel, implement
7247         `AnonymousMethod.Compatible' to tell whether an anonymous method
7248         can be converted to a target delegate type. 
7249
7250         The routine now also produces the anonymous method content
7251
7252         (AnonymousDelegate): A helper class that derives from
7253         DelegateCreation, this is used to generate the code necessary to
7254         produce the delegate for the anonymous method that was created. 
7255
7256         * assign.cs: API adjustments for new changes in
7257         Convert.ImplicitStandardConversionExists.
7258
7259         * class.cs: Adjustments to cope with the fact that now toplevel
7260         blocks are of type `ToplevelBlock'. 
7261
7262         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7263         insteda of standard blocks.
7264
7265         Flag errors if params arguments are passed to anonymous methods.
7266
7267         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7268         `CurrentAnonymousMethod' which points to the current Anonymous
7269         Method.  The variable points to the AnonymousMethod class that
7270         holds the code being compiled.  It is set in the new EmitContext
7271         created for the anonymous method.
7272
7273         (EmitContext.Phase): Introduce a variable and an enumeration to
7274         assist in enforcing some rules about when and where we are allowed
7275         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7276         only one that enfonces this right now).
7277
7278         (EmitContext.HaveCaptureInfo): new helper method that returns
7279         whether we have a CapturedContext initialized.
7280
7281         (EmitContext.CaptureVariable): New method used to register that a
7282         LocalInfo must be flagged for capturing. 
7283
7284         (EmitContext.CapturedParameter): New method used to register that a
7285         parameters must be flagged for capturing. 
7286         
7287         (EmitContext.CapturedField): New method used to register that a
7288         field must be flagged for capturing. 
7289
7290         (EmitContext.HaveCapturedVariables,
7291         EmitContext.HaveCapturedFields): Return whether there are captured
7292         variables or fields. 
7293
7294         (EmitContext.EmitMethodHostInstance): This is used to emit the
7295         instance for the anonymous method.  The instance might be null
7296         (static methods), this (for anonymous methods that capture nothing
7297         and happen to live side-by-side with the current method body) or a
7298         more complicated expression if the method has a CaptureContext.
7299
7300         (EmitContext.EmitTopBlock): Routine that drives the emission of
7301         code: it will first resolve the top block, then emit any metadata
7302         and then emit the code.  The split is done so that we can extract
7303         any anonymous methods and flag any captured variables/parameters.
7304         
7305         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7306         during this phase, the ILGenerator should not be used as labels
7307         and local variables declared here might not be accessible to any
7308         code that is part of an anonymous method.  
7309
7310         Exceptions to this include the temporary variables that are
7311         created by some statements internally for holding temporary
7312         variables. 
7313         
7314         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7315         metadata for a cb
7316
7317         (EmitContext.TemporaryReturn): This method is typically called
7318         from the Emit phase, and its the only place where we allow the
7319         ReturnLabel to be defined other than the EmitMeta.  The reason is
7320         that otherwise we would have to duplicate a lot of logic in the
7321         Resolve phases of various methods that today is on the Emit
7322         phase. 
7323
7324         (EmitContext.NeedReturnLabel): This no longer creates the label,
7325         as the ILGenerator is not valid during the resolve phase.
7326
7327         (EmitContext.EmitThis): Extended the knowledge in this class to
7328         work in anonymous methods in addition to iterators. 
7329
7330         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7331         code is necessary on the stack to access the instance to a local
7332         variable (the variable will be accessed as a field).
7333
7334         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7335         EmitContext.EmitAddressOfParameter): Routines to support
7336         parameters (not completed at this point). 
7337         
7338         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7339         will also remove the parameters.
7340
7341         * convert.cs (Convert): Define a `ConstantEC' which points to a
7342         null.  This is just to prefity some code that uses
7343         ImplicitStandardConversion code and do not have an EmitContext
7344         handy.
7345
7346         The idea is to flag explicitly that at that point in time, it is
7347         known that the conversion will not trigger the delegate checking
7348         code in implicit conversions (which requires a valid
7349         EmitContext). 
7350
7351         Everywhere: pass new EmitContext parameter since
7352         ImplicitStandardConversionExists now requires it to check for
7353         anonymous method conversions. 
7354
7355         (Convert.ImplicitStandardConversionExists): If the type of an
7356         expression is the anonymous_method_type, and the type is a
7357         delegate, we invoke the AnonymousMethod.Compatible method to check
7358         whether an implicit conversion is possible. 
7359
7360         (Convert.ImplicitConversionStandard): Only do implicit method
7361         group conversions if the language level is not ISO_1.
7362
7363         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7364         MethodInfo for the Invoke method.  used by Delegate and
7365         AnonymousDelegate.
7366
7367         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7368         method conversions if the target type is a delegate.
7369
7370         Removed extra debugging nops.
7371
7372         (LocalVariableReference): Turn the `local_info' into a public
7373         field. 
7374
7375         Add `prepared' field, the same hack used for FieldExprs to cope
7376         with composed assignments, as Local variables do not necessarily
7377         operate purely on the stack as they used to: they can be captured
7378         fields. 
7379
7380         Add `temp' for a temporary result, like fields.
7381
7382         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7383
7384         It now copes with Local variables that are captured and emits the
7385         proper instance variable to load it from a field in the captured
7386         case. 
7387
7388         (ParameterReference.DoResolveBase): During the resolve phase,
7389         capture parameters if we are in an anonymous method.
7390
7391         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7392         anonymous method, use the EmitContext helper routines to emit the
7393         parameter reference.
7394
7395         * iterators.cs: Set RemapToProxy to true/false during the
7396         EmitDispose class.
7397
7398         * parameters.cs (GetParameterByName): New helper method. 
7399
7400         * typemanager.cs (anonymous_method_type) a new type that
7401         represents an anonyous method.  This is always an internal type,
7402         used as a fencepost to test against the anonymous-methodness of an
7403         expression. 
7404         
7405 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7406
7407         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7408         561 report.
7409         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7410
7411 2004-11-10  Martin Baulig  <martin@ximian.com>
7412
7413         * expression.cs (Invocation.BetterFunction): If two methods have
7414         equal parameter types, but only one of them is generic, the
7415         non-generic one wins.
7416         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7417         instance; just use `Type.IsValueType' to determine whether
7418         something is a struct or not.
7419         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7420         so we can be called multiple times.
7421
7422 2004-11-10  Martin Baulig  <martin@ximian.com>
7423
7424         * generic.cs (TypeParameter.DefineConstraints): New public method.
7425         (TypeParameter.CheckAccessLevel): Override this and return true.
7426         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7427         override ResolveType() anymore.
7428         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7429
7430 2004-11-10  Martin Baulig  <martin@ximian.com>
7431
7432         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7433         call DeclSpace.ResolveNestedType() on it.
7434
7435 2004-11-10  Martin Baulig  <martin@ximian.com>
7436
7437         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7438         non-null, call ParameterModifier() on it.
7439
7440 2004-11-10  Martin Baulig  <martin@ximian.com>
7441
7442         * iterators.cs
7443         (Iterators): Added `current_type' and `this_type' fields.
7444         (Iterators.DefineIterator): Create a new EmitContext and store it
7445         in `ec'; compute `this_type'.
7446
7447 2004-11-10  Martin Baulig  <martin@ximian.com>
7448
7449         * typemanager.cs
7450         (TypeManager.IsPrivateAccessible): New public method.
7451         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7452
7453 2004-11-10  Martin Baulig  <martin@ximian.com>
7454
7455         * class.cs (TypeContainer.DefineType): Call
7456         TypeBuilder.DefineGenericParameters() before resolving the type
7457         parameters.
7458         (MethodData.parent_method): New protected field.
7459         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7460         (MethodData.Define): Compute `parent_method'.
7461
7462         * decl.cs
7463         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7464         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7465         (DeclSpace.ec): New protected field; store the EmitContext here.
7466         (DeclSpace.EmitContext): New public property.
7467         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7468         (DeclSpace.ResolveNestedType): New public method.
7469         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7470         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7471         (DeclSpace.FamilyAccessible): Likewise.
7472         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7473         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7474         EmitContext.
7475
7476         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7477         field.
7478
7479         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7480         (Enum.Emit): Don't create a new EmitContext.
7481
7482 2004-10-18  Martin Baulig  <martin@ximian.com>
7483
7484         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7485         `Type' directly, but call ResolveType() on it.
7486         (Catch.Resolve): Likewise.
7487         (Foreach.Resolve): Likewise.
7488
7489 2004-10-18  Martin Baulig  <martin@ximian.com>
7490
7491         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7492         `Type' directly, but call ResolveType() on it.
7493         (Probe.DoResolve): Likewise.
7494         (ArrayCreation.LookupType): Likewise.
7495         (TypeOf.DoResolve): Likewise.
7496         (SizeOf.DoResolve): Likewise.
7497
7498 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7499
7500         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7501         the ResolveType.
7502
7503 2004-10-17  John Luke  <john.luke@gmail.com>
7504
7505         * class.cs (Operator.GetSignatureForError): use CSharpName
7506
7507         * parameter.cs (Parameter.GetSignatureForError): Returns
7508         correct name even if was not defined.
7509
7510 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7511
7512         Fix #65816.
7513         * class.cs (TypeContainer.EmitContext): New property.
7514         (DefineNestedTypes): Create an emitcontext for each part.
7515         (MethodCore.DoDefineParameters): Use container's emitcontext.
7516         Pass type array to InternalParameters.
7517         (MemberBase.DoDefine): Use container's emitcontext.
7518         (FieldMember.Define): Likewise.
7519         (Event.Define): Likewise.
7520         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7521         Pass type array to InternalParameters.
7522         (SetIndexerMethod.GetParameterInfo): Likewise.
7523         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7524         * delegate.cs (Define): Pass emitcontext to
7525         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7526         array to InternalParameters.
7527         * expression.cs (ParameterReference.DoResolveBase): Pass
7528         emitcontext to GetParameterInfo.
7529         (ComposedCast.DoResolveAsTypeStep): Remove check on
7530         ec.ResolvingTypeTree.
7531         * parameter.cs (Parameter.Resolve): Change argument to
7532         EmitContext.  Use ResolveAsTypeTerminal.
7533         (Parameter.GetSignature): Change argument to EmitContext.
7534         (Parameters.ComputeSignature): Likewise.
7535         (Parameters.ComputeParameterTypes): Likewise.
7536         (Parameters.GetParameterInfo): Likewise.
7537         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7538         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7539         * support.cs (InternalParameters..ctor): Remove variant that takes
7540         a DeclSpace.
7541         * typemanager.cs (system_intptr_expr): New.
7542         (InitExpressionTypes): Initialize it.
7543
7544 2004-10-12  Chris Toshok  <toshok@ximian.com>
7545
7546         * cs-parser.jay: fix location for try_statement and catch_clause.
7547
7548 2004-10-18  Martin Baulig  <martin@ximian.com>
7549
7550         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7551         `Type' directly, but call ResolveType() on it.
7552         (MemberBase.DoDefine): Likewise.
7553
7554         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7555         `Type' directly, but call ResolveType() on it.
7556         (ComposedCast.DoResolveAsTypeStep): Likewise.
7557
7558         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7559         `Type' directly, but call ResolveType() on it.
7560
7561 2004-10-17  John Luke  <john.luke@gmail.com>
7562
7563         * class.cs (Operator.GetSignatureForError): use CSharpName
7564
7565         * parameter.cs (Parameter.GetSignatureForError): Returns
7566         correct name even if was not defined.
7567
7568 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7569
7570         Fix #65816.
7571         * class.cs (TypeContainer.EmitContext): New property.
7572         (DefineNestedTypes): Create an emitcontext for each part.
7573         (MethodCore.DoDefineParameters): Use container's emitcontext.
7574         Pass type array to InternalParameters.
7575         (MemberBase.DoDefine): Use container's emitcontext.
7576         (FieldMember.Define): Likewise.
7577         (Event.Define): Likewise.
7578         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7579         Pass type array to InternalParameters.
7580         (SetIndexerMethod.GetParameterInfo): Likewise.
7581         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7582         * delegate.cs (Define): Pass emitcontext to
7583         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7584         array to InternalParameters.
7585         * expression.cs (ParameterReference.DoResolveBase): Pass
7586         emitcontext to GetParameterInfo.
7587         (ComposedCast.DoResolveAsTypeStep): Remove check on
7588         ec.ResolvingTypeTree.
7589         * parameter.cs (Parameter.Resolve): Change argument to
7590         EmitContext.  Use ResolveAsTypeTerminal.
7591         (Parameter.GetSignature): Change argument to EmitContext.
7592         (Parameters.ComputeSignature): Likewise.
7593         (Parameters.ComputeParameterTypes): Likewise.
7594         (Parameters.GetParameterInfo): Likewise.
7595         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7596         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7597         * support.cs (InternalParameters..ctor): Remove variant that takes
7598         a DeclSpace.
7599         * typemanager.cs (system_intptr_expr): New.
7600         (InitExpressionTypes): Initialize it.
7601
7602 2004-10-12  Chris Toshok  <toshok@ximian.com>
7603
7604         * cs-parser.jay: fix location for try_statement and catch_clause.
7605
7606 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7607
7608         More DeclSpace.ResolveType avoidance.
7609         * decl.cs (MemberCore.InUnsafe): New property.
7610         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7611         with newly created EmitContext.
7612         (FieldMember.Define): Likewise.
7613         * delegate.cs (Delegate.Define): Likewise.
7614         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7615         only if normal name-lookup fails.
7616         (TypeExpr.DoResolve): Enable error-checking.
7617         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7618         (SizeOf.DoResolve): Likewise.
7619         (ComposedCast.DoResolveAsTypeStep): Likewise.
7620         (StackAlloc.DoResolve): Likewise.
7621         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7622         (Block.Unsafe): New property.
7623         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7624         (Unsafe): Set 'unsafe' flag of contained block.
7625         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7626         (Fixed.Resolve): Likewise.
7627         (Catch.Resolve): Likewise.
7628         (Using.ResolveLocalVariableDecls): Likewise.
7629         (Foreach.Resolve): Likewise.
7630
7631 2004-10-05  John Luke <john.luke@gmail.com>
7632
7633         * cs-parser.jay: add location to error CS0175
7634
7635 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7636
7637         * ecore.cs (Expression.Constantity): Add support for turning null
7638         into a constant.
7639
7640         * const.cs (Const.Define): Allow constants to be reference types
7641         as long as the value is Null.
7642
7643 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7644
7645         * namespace.cs (NamespaceEntry.Using): No matter which warning
7646         level is set, check if this namespace name has already been added.
7647
7648 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7649
7650         * expression.cs: reftype [!=]= null should always use br[true,false].
7651         # 67410
7652
7653 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7654
7655         Fix #67108
7656         * attribute.cs: Enum conversion moved to 
7657         GetAttributeArgumentExpression to be applied to the all
7658         expressions.
7659
7660 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7661
7662         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7663         * class.c (TypeContainer.DefineType): Flag error if
7664         base types aren't accessible due to access permissions.
7665         * decl.cs (DeclSpace.ResolveType): Move logic to
7666         Expression.ResolveAsTypeTerminal.
7667         (DeclSpace.ResolveTypeExpr): Thin layer over
7668         Expression.ResolveAsTypeTerminal.
7669         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7670         Refactor code into NestedAccess.  Use it.
7671         (DeclSpace.NestedAccess): New.
7672         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7673         argument to silence errors.  Check access permissions.
7674         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7675         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7676         (Cast.DoResolve): Likewise.
7677         (New.DoResolve): Likewise.
7678         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7679         (TypeOf.DoResolve): Likewise.
7680
7681         * expression.cs (Invocation.BetterConversion): Return the Type of
7682         the better conversion.  Implement section 14.4.2.3 more faithfully.
7683         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7684         section 14.4.2.2 explicit.
7685         (Invocation.OverloadResolve): Update.
7686         (Invocation): Remove is_base field.
7687         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7688         (Invocation.Emit): Likewise.
7689
7690 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7691
7692         * cs-parser.jay: Reverted 642 warning fix.
7693
7694 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7695
7696         Fix bug #66615
7697         * decl.cs (FindMemberWithSameName): Indexer can have more than
7698         1 argument.
7699
7700 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7701
7702         * expression.cs (LocalVariableReference.DoResolveLValue):
7703         Do not report warning 219 for out values.
7704         (EmptyExpression.Null): New member to avoid extra allocations.
7705
7706 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7707
7708         * cs-parser.jay: Fix wrong warning 642 report.
7709
7710         * cs-tokenizer.cs (CheckNextToken): New helper;
7711         Inspect next character if is same as expected.
7712
7713 2004-09-23  Martin Baulig  <martin@ximian.com>
7714
7715         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7716         (Convert.ImplicitReferenceConversionExists): Likewise.
7717
7718 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7719
7720         * Makefile (DISTFILES): Comment out a few missing files.
7721
7722 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7723
7724         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7725         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7726         (gmcs.exe): Invoke bootstrap-libs.
7727         (clean-local): Clean the net_2_0_bootstrap profile too.
7728         (PROGRAM_INSTALL_DIR): New.
7729         (install-local): Use it.
7730
7731 2004-10-13  Martin Baulig  <martin@ximian.com>
7732
7733         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7734         (TypeParameter.DefineType): If we're a method type parameter and
7735         that method is overriding something, "inflate" its constraints.
7736
7737 2004-10-12  Martin Baulig  <martin@ximian.com>
7738
7739         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7740         and have type arguments, create and resolve a ConstructedType.
7741
7742 2004-10-12  Martin Baulig  <martin@ximian.com>
7743
7744         * decl.cs (MemberCache.FindMemberToOverride): Use
7745         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7746         to compare the invocationType.
7747
7748         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7749         When comparing two type parameters, only do the signature-only
7750         comparision for method type parameters.
7751
7752 2004-10-11  Martin Baulig  <martin@ximian.com>
7753
7754         * report.cs: Don't make --fatal abort on warnings, we have
7755         -warnaserror for that.
7756
7757 2004-10-11  Martin Baulig  <martin@ximian.com>
7758
7759         * typemanager.cs
7760         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7761         (TypeManager.IsEqual): Call ourself recursively instead of using
7762         Type.IsEqual(). 
7763
7764 2004-10-11  Martin Baulig  <martin@ximian.com>
7765
7766         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7767         on our own type parameters, not on the ones we inherit from a containing
7768         class.
7769
7770         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7771         the comparision.
7772
7773         * generic.cs (TypeParameter.Define): We may only be called once.
7774
7775         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7776         instead of TypeManager.IsEqual().
7777
7778 2004-09-28  Martin Baulig  <martin@ximian.com>
7779
7780         * generic.cs
7781         (GenericConstraints.EffectiveBaseClass): New public property.
7782         (TypeParameter.GenericConstraints): New public property.
7783         (ConstructedType.CheckConstraints): Improved.
7784
7785         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7786         (Convert.TypeParameterConversion): New private method; use this in
7787         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7788         for all conversions related to type parameters.
7789
7790 2004-09-24  Martin Baulig  <martin@ximian.com>
7791
7792         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7793         type parameter conversions for type parameters which are known to
7794         be reference types.
7795
7796 2004-09-24  Martin Baulig  <martin@ximian.com>
7797
7798         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7799         `IsValueType' properties.
7800
7801         * support.cs (ReflectionConstraints): Use
7802         Type.GetGenericParameterConstraints() instead of the old hack.
7803
7804 2004-09-24  Martin Baulig  <martin@ximian.com>
7805
7806         * generic.cs (GenericConstraints): Moved here and made it an
7807         abstract class.
7808
7809         * support.cs (GenericConstraints): Moved to generic.cs.
7810
7811 2004-09-24  Martin Baulig  <martin@ximian.com>
7812
7813         * support.cs
7814         (ReflectionConstraints): Un-nested this class and made it public.
7815
7816         * typemanager.cs
7817         (TypeManager.GetTypeParameterConstraints): New public method.
7818         (TypeManager.HasConstructorConstraint): Use the attributes.
7819
7820 2004-09-24  Martin Baulig  <martin@ximian.com>
7821
7822         * support.cs (GenericConstraints): Replaced `HasConstructor',
7823         `IsReferenceType' and `IsValueType' with `Attributes'.
7824         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7825         method and made the .ctor public.
7826
7827         * generic.cs (Constraints.Attributes): New public property.
7828         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7829         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7830         `IsValueType' -> `HasValueTypeConstraint'.
7831
7832 2004-09-23  Martin Baulig  <martin@ximian.com>
7833
7834         * generic.cs (Constraints): Reflect latest runtime changes.
7835
7836 2004-09-23  Martin Baulig  <martin@ximian.com>
7837
7838         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7839         (Convert.ImplicitReferenceConversionExists): Likewise.
7840
7841 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7842
7843         * class.cs (Operator.Define): Add error 448 and 559 report.
7844         
7845 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7846
7847         * class.cs (MemberBase.IsTypePermitted): New protected
7848         method for checking error CS0610.
7849
7850 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7851
7852         * class.cs (TypeContainer.HasExplicitLayout): New property
7853         Returns whether container has StructLayout attribute set Explicit.
7854         (FieldMember): New abstract class for consts and fields.
7855         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7856         (Field): Reuse FieldMember.
7857
7858         * const.cs (Const): Reuse FieldMember.
7859
7860         * rootcontext.cs: EmitConstants call moved to class.
7861
7862 2004-09-22  Martin Baulig  <martin@ximian.com>
7863
7864         Marek and me just fixed one of our oldest bugs: #28562 :-)
7865
7866         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7867
7868         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7869         we're an EnumConstant, just return that.
7870         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7871         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7872         to get the value which'll actually be written into the attribute.
7873         However, we have to use GetValue() to access the attribute's value
7874         in the compiler.        
7875
7876 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7877
7878         * constant.cs (Constant.IsNegative): New abstract property
7879         IsNegative.
7880
7881         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7882         (StackAlloc.DoResolve): Reused IsNegative.
7883
7884 2004-09-22  Martin Baulig  <martin@ximian.com>
7885
7886         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7887         public method; like LookupTypeContainer, but also works for
7888         generic instances.
7889
7890         * report.cs (Report.SymbolRelatedToPreviousError): Use
7891         TypeManager.LookupGenericTypeContainer().       
7892
7893 2004-09-22  Martin Baulig  <martin@ximian.com>
7894
7895         Thanks to Peter Sestoft for this bug report.
7896
7897         * expression.cs (Conditional): If both the `trueExpr' and the
7898         `falseExpr' is a NullLiteral, return a NullLiteral.
7899
7900 2004-09-22  Martin Baulig  <martin@ximian.com>
7901
7902         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7903         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7904         for the "get_Current" call.
7905
7906 2004-09-21  Martin Baulig  <martin@ximian.com>
7907
7908         * convert.cs (Convert.ImplicitReferenceConversion): When
7909         converting to an interface type, first check whether we're
7910         converting from a reference type.
7911
7912 2004-09-14  Martin Baulig  <martin@ximian.com>
7913
7914         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7915
7916 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7917
7918         Fixed bug #61902
7919         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7920         called and is obsolete then this member suppress message
7921         when call is inside next [Obsolete] method or type.
7922
7923         * expression.cs: Use TestObsoleteMethodUsage member.
7924
7925 2004-09-14  Martin Baulig  <martin@ximian.com>
7926
7927         * genericparser.cs: Removed.
7928
7929 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7930
7931         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7932
7933 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7934
7935         * attribute.cs (Attribute.Resolve): Add error 653 report.
7936
7937         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7938         report.
7939         (Method.ApplyAttributeBuilder): Add error 685 report.
7940         (Operator.Define): Add error 564 report.
7941
7942         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7943
7944         * expression.cs (Invocation.DoResolve): Add error
7945         245 and 250 report.
7946
7947         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7948         error 674 report.
7949
7950 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7951
7952         * class.cs (ConstructorInitializer.Resolve):
7953         Wrong error number (515->516).
7954
7955 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7956
7957         * class.cs (Indexer.Define): Add error 631 report.
7958
7959 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7960
7961         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7962
7963 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7964
7965         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7966
7967 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7968
7969         * cs-parser.jay: Added error CS0241 report.
7970
7971 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7972
7973         * cs-parser.jay (fixed_statement): Introduce a scope for the
7974         declaration in the 'fixed' statement.
7975
7976 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7977
7978         * cs-parser.jay: Added CS0230 error report.
7979
7980 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7981
7982         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7983
7984 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7985
7986         * expression.cs (Argument.Resolve): Added error CS0192 and
7987         CS0199 report.
7988
7989 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7990
7991         C# 2.0 #pragma warning feature
7992
7993         * cs-tokenizer.cs (PreProcessPragma): New method; 
7994         Handles #pragma directive.
7995
7996         * report.cs (WarningRegions): New class; Support
7997         class for #pragma warning directive. It tests whether
7998         warning is enabled for a given line.
7999
8000 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * const.cs: Add more descriptive error report, tahnks to
8003         Sebastien. 
8004
8005 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8006
8007         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8008
8009 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8010
8011         * expression.cs: Apply patch from Ben: Remove dead code from
8012         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8013         as that code just threw an exception anwyays.
8014
8015         * const.cs: Remove the call to the turnintoconstant, for details
8016         see bug: #63144
8017         
8018         * literal.cs: The type of the null-literal is the null type;  So
8019         we use a placeholder type (literal.cs:System.Null, defined here)
8020         for it.
8021
8022         * expression.cs (Conditional.DoResolve): Remove some old code that
8023         is no longer needed, conversions have been fixed.
8024
8025         (ArrayCreationExpression.DoResolve): Return false if we fail to
8026         resolve the inner expression.
8027
8028 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8029
8030         Fix test-290.cs.
8031         * cs-parser.jay (delegate_declaration): Record a delegate
8032         declaration as a type declaration.
8033         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8034
8035 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8036
8037         * parameter.cs: Do not crash if the type can not be resolved. 
8038
8039         * expression.cs: Report errors with unsafe pointers, fixes #64896
8040
8041 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8042
8043         * expression.cs: Pointer arith always needs to do a conv.i
8044         if the operand is a long. fix 65320
8045
8046 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8047
8048         Fixed cs0619-37.cs, cs0619-38.cs
8049
8050         * enum.cs (GetObsoleteAttribute): Removed.
8051
8052         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8053         on Enum member is double staged. The first is tested member
8054         and then enum.
8055
8056 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8057
8058         Fixed #56986, #63631, #65231
8059
8060         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8061         adds member to name container.
8062         (TypeContainer.AddToTypeContainer): New method, adds type to
8063         name container.
8064         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8065         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8066         AddOperator): Simplified by reusing AddToMemberContainer.
8067         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8068         instead of field.
8069         (Method.CheckForDuplications): Fixed implementation to test all
8070         possibilities.
8071         (MemberBase): Detection whether member is explicit interface
8072         implementation is now in constructor.
8073         (MemberBase.UpdateMemberName): Handles IndexerName.
8074         (Accessor): Changed to keep also location information.
8075         (AbstractPropertyEventMethod): Is derived from MemberCore.
8076         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8077         will be emited or not.
8078         (PropertyBase.AreAccessorsDuplicateImplementation):
8079         Tests whether accessors are not in collision with some method.
8080         (Operator): Is derived from MethodCore to simplify common
8081         operations.
8082
8083         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8084         must be performed.
8085         (DeclSpace.AddToContainer): Adds the member to defined_names
8086         table. It tests for duplications and enclosing name conflicts.
8087
8088         * enum.cs (EnumMember): Clean up to reuse the base structures
8089
8090 2004-09-03  Martin Baulig  <martin@ximian.com>
8091
8092         Merged latest changes into gmcs.  Please keep this comment in
8093         here, it makes it easier for me to see what changed in MCS since
8094         the last time I merged.
8095
8096 2004-09-03  Martin Baulig  <martin@ximian.com>
8097
8098         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8099         into TypeContainer, to make partial classes work again.
8100
8101 2004-09-03  Martin Baulig  <martin@ximian.com>
8102
8103         * rootcontext.cs (RootContext.V2): Removed.
8104
8105 2004-03-23  Martin Baulig  <martin@ximian.com>
8106
8107         * expression.cs (Invocation.OverloadResolve): Added `bool
8108         may_fail' argument and use it instead of the Location.IsNull() hack.
8109
8110 2004-09-09  Martin Baulig  <martin@ximian.com>
8111
8112         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8113
8114 2004-09-09  Martin Baulig  <martin@ximian.com>
8115
8116         * generic.cs (TypeParameter.DefineType): Added support for
8117         explicit interface methods.
8118
8119 2004-09-09  Martin Baulig  <martin@ximian.com>
8120
8121         * README.Changes: New document.  Started to list important changes
8122         between MCS and GMCS here.
8123
8124 2004-09-08  Martin Baulig  <martin@ximian.com>
8125
8126         * class.cs
8127         (TypeContainer.CheckRecursiveDefinition): New protected method.
8128         (TypeContainer.DefineType): Move the CS0146 check into
8129         CheckRecursiveDefinition().     
8130
8131 2004-09-06  Martin Baulig  <martin@ximian.com>
8132
8133         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8134         types for the constructor constraint.
8135
8136 2004-09-03  Martin Baulig  <martin@ximian.com>
8137
8138         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8139         into TypeContainer, to make partial classes work again.
8140
8141 2004-09-03  Martin Baulig  <martin@ximian.com>
8142
8143         * rootcontext.cs (RootContext.V2): Removed.
8144
8145 2004-03-23  Martin Baulig  <martin@ximian.com>
8146
8147         * expression.cs (Invocation.OverloadResolve): Added `bool
8148         may_fail' argument and use it instead of the Location.IsNull() hack.
8149
8150 2004-09-03  Martin Baulig  <martin@ximian.com>
8151
8152         Merged latest changes into gmcs.  Please keep this comment in
8153         here, it makes it easier for me to see what changed in MCS since
8154         the last time I merged.
8155
8156 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8157
8158         Fix #61128.
8159         * expression.cs (BetterConversion): Don't allow either conversion 
8160         to be null.  Remove redundant implicit conversion test when 'q ==
8161         null' -- when this function is invoked, we already know that the
8162         implicit conversion exists.
8163         (BetterFunction): Assume that 'best' is non-null.  Remove
8164         redundant reimplementation of IsApplicable when 'best' is null.
8165         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8166         number of arguments.
8167         (IsAncestralType): Extract from OverloadResolve.
8168         (OverloadResolve): Make robust to the MethodGroupExpr being
8169         unsorted.  Implement all the logic of Section 14.5.5.1, and
8170         support overloading of methods from multiple applicable types.
8171         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8172
8173         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8174         (RealError, Warning): Append type of report to related symbol.
8175
8176 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8177
8178         * enum.cs: Fixed CLS-Compliance checks for enum members.
8179         Error tests cs3008-8.cs, cs3014-8.cs
8180
8181 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8182
8183         Fixed bug #62342, #63102
8184         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8185         like ImplementMethod.
8186
8187 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8188
8189         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8190         Fixed bug #65170.
8191
8192 2004-09-02  Martin Baulig  <martin@ximian.com>
8193
8194         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8195         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8196         on the MethodBase.
8197
8198 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8199
8200         C# 2.0 Static classes implemented
8201
8202         * class.cs (TypeContainer): instance_constructors,
8203         initialized_fields, initialized_static_fields,
8204         default_constructor, base_inteface_types are protected to be
8205         accessible from StaticClass.
8206         (TypeContainer.DefineDefaultConstructor): New virtual method
8207         for custom default constructor generating
8208         (StaticClass): New class to handle "Static classes" feature.
8209
8210         * cs-parser.jay: Handle static keyword on class like instance
8211         of StaticClass.
8212
8213         * driver.cs: Added "/langversion" command line switch with two
8214         options (iso-1, default).
8215
8216 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8217
8218         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8219
8220 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8221
8222         * delegate.cs: Style.
8223
8224 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8225
8226         * delegate.cs: Add seperate instance expr field for miguel.
8227
8228 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8229
8230         * PointerArithmetic (Resolve): make sure we are not doing
8231         pointer arith on void*. Also, make sure we are resolved
8232         by not setting eclass until resolve.
8233
8234         All callers: Make sure that PointerArithmetic gets resolved.
8235
8236 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8237
8238         * ArrayCreation (LookupType): If the type does not resolve 
8239         to an array, give an error.
8240
8241 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8242
8243         * statement.cs (Try.Resolve): Fixed bug #64222
8244
8245 2004-08-27  Martin Baulig  <martin@ximian.com>
8246
8247         * class.cs
8248         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8249         crash here.     
8250
8251 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8252
8253         * ecore.cs (Constantify): Get underlying type via
8254         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8255         Windows in special cases.
8256
8257 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8258
8259         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8260         for obtaining also private methods.
8261         (GetRemoveMethod): Used GetRemoveMethod (true)
8262         for obtaining also private methods.
8263
8264 2004-09-02  Martin Baulig  <martin@ximian.com>
8265
8266         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8267         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8268         on the MethodBase.
8269
8270 2004-08-27  Martin Baulig  <martin@ximian.com>
8271
8272         * class.cs
8273         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8274         crash here.     
8275
8276 2004-08-25  Martin Baulig  <martin@ximian.com>
8277
8278         * support.cs (ReflectionParameters..ctor): If this is a generic
8279         method, retrieve and store its type parameters.
8280         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8281         (ReflectionParameters.GenericConstraints): The argument specifies
8282         the type parameter, not the method parameter.
8283         (InternalParameters.GenericConstraints): Likewise.
8284
8285         * generic.cs (TypeParameter.DefineType): Correctly handle
8286         constraints wrt. generic methods in interfaces and their
8287         implementations.        
8288
8289 2004-08-24  Martin Baulig  <martin@ximian.com>
8290
8291         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8292         (Constraints.IsSubclassOf): New internal method.
8293
8294         * typemanager.cs (TypeManager.FindMembers): Added special support
8295         for GenericTypeParameterBuilder's.      
8296         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8297         type parameters.
8298
8299 2004-08-24  Martin Baulig  <martin@ximian.com>
8300
8301         * typemanager.cs
8302         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8303         this for accessibility checks.
8304         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8305         IsNestedFamilyAccessible.
8306         (TypeManager.IsSubclassOf): New method, do what the name actually
8307         says.   
8308
8309 2004-08-24  Martin Baulig  <martin@ximian.com>
8310
8311         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8312         as a SimpleName, include the generic arity.
8313
8314 2004-08-24  Martin Baulig  <martin@ximian.com>
8315
8316         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8317         MethodAttributes.HideBySig for operators.
8318
8319 2004-08-23  Martin Baulig  <martin@ximian.com>
8320
8321         Back to the old error reporting system :-)
8322
8323         * report.cs (Message): Removed.
8324         (Report.MessageData, ErrorData, WarningData): Removed.
8325         (Report.Error, Warning): Back to the old system.
8326
8327 2004-08-23  Martin Baulig  <martin@ximian.com>
8328
8329         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8330
8331         * class.cs (TypeContainer.ParentContainer): New public virtual
8332         method; replaces the explicit interface implementation.
8333         (ClassPart.ParentContainer): Override.
8334
8335 2004-08-23  Martin Baulig  <martin@ximian.com>
8336
8337         * statement.cs (Switch): Added support for constant switches; see
8338         #59428 or test-285.cs.
8339
8340 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8341
8342         Fixed bug #62740.
8343         * statement.cs (GetEnumeratorFilter): Removed useless
8344         logic because C# specs is strict. GetEnumerator must be
8345         public.
8346
8347 2004-08-22  Martin Baulig  <martin@ximian.com>
8348
8349         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8350         a switch and may break, reset the barrier.  Fixes #59867.
8351
8352 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8353
8354         CLS-Compliance speed up (~5% for corlib)
8355
8356         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8357         New method. Tests container for CLS-Compliant names
8358
8359         * class.cs (TypeContainer.VerifyClsName): New method.
8360         Checks whether container name is CLS Compliant.
8361         (Constructor): Implements IMethodData.
8362
8363         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8364         low-case table for CLS Compliance test.
8365         (MemberCache.VerifyClsParameterConflict): New method.
8366         Checks method parameters for CS3006 error.
8367
8368         * enum.cs (EnumMember): Is derived from MemberCore.
8369         (Enum.VerifyClsName): Optimized for better performance.
8370
8371 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8372
8373         * report.cs: Renamed Error_T to Error and changed all
8374         references.
8375
8376 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8377
8378         * class.cs (TypeContainer.IndexerArrayList): New inner class
8379         container for indexers.
8380         (TypeContainer.DefaultIndexerName): New constant for default
8381         indexer name. Replaced all "Item" with this constant.
8382         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8383
8384         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8385         DefaultMemberAttribute constructor.
8386
8387 2004-08-05  Martin Baulig  <martin@ximian.com>
8388
8389         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8390         Fix bug #59429.
8391
8392 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8393
8394         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8395         multi platforms problem.
8396
8397         * compiler.csproj: Included shared files.
8398
8399 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8400
8401         Fix bug 60333, 55971 in the more general way
8402         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8403         Added arg_type argument for constant conversion.
8404         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8405
8406 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8407
8408         Fix bug #59760
8409         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8410         OperatorArrayList, MethodCoreArrayList for typecontainer
8411         containers. Changed class member types to these new types.
8412         (MethodArrayList.DefineMembers): Added test for CS0659.
8413
8414 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8415
8416         * cfold.cs: Synchronize the folding with the code in expression.cs
8417         Binary.DoNumericPromotions for uint operands.
8418
8419         * attribute.cs: Revert patch from Raja, it introduced a regression
8420         while building Blam-1.2.1 (hard to isolate a test case).
8421
8422 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8423
8424         Fix for #55382
8425         * class.cs:
8426         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8427         name collision.
8428         (MethodCore.parent_method): New member. The method we're overriding
8429         if this is an override method.
8430         (MethodCore.CheckBase): Moved from Method class and made common.
8431         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8432         private.
8433         (MethodCore.CheckForDuplications): New abstract method. For custom
8434         member duplication search in a container
8435         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8436         method and its return type.
8437         (Event.conflict_symbol): New member. Symbol with same name in the
8438         parent class.
8439
8440         * decl.cs:
8441         (MemberCache.FindMemberWithSameName): New method. The method
8442         is looking for conflict with inherited symbols.
8443
8444 2004-08-04  Martin Baulig  <martin@ximian.com>
8445
8446         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8447
8448         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8449
8450 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8451
8452         * report.cs (Message): New enum for better error, warning reference in
8453         the code.
8454         (MessageData): New inner abstract class. It generally handles printing of
8455         error and warning messages.
8456         Removed unused Error, Warning, Message methods.
8457
8458 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8459
8460         Fix for cs0592-8.cs test
8461         * attribute.cs
8462         (Attributable.ValidAttributeTargets): Made public.
8463         (Attribute.ExplicitTarget): New member for explicit target value.
8464         (Attribute.CheckTargets): Now we translate explicit attribute
8465         target to Target here.
8466
8467 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8468
8469         * ecore.cs (MethodGroupExpr): new IsBase property.
8470
8471         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8472
8473         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8474         rather than an instance expr.
8475
8476         (DelegateCreation.Emit): Use the method group rather than
8477         the instance expression. Also, if you have base.Foo as the
8478         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8479
8480         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8481
8482         (NewDelegate.DoResolve): Only check for the existance of Invoke
8483         if the method is going to be needed. Use MethodGroupExpr.
8484
8485         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8486
8487         * expression.cs: For pointer arith., make sure to use
8488         the size of the type, not the size of the pointer to
8489         the type.
8490
8491 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8492
8493         Fix for #60722
8494         * class.cs (Class): Added error CS0502 test.
8495
8496 2004-08-03  John Luke  <jluke@cfl.rr.com>
8497             Raja R Harinath  <rharinath@novell.com>
8498
8499         Fix for #60997.
8500         * attribute.cs (Attribute.complained_before): New flag.
8501         (Attribute.ResolveType, Attribute.Resolve),
8502         (Attribute.DefinePInvokeMethod): Set it.
8503         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8504         
8505 2004-08-03  Martin Baulig  <martin@ximian.com>
8506
8507         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8508         use a user-defined operator; we still need to do numeric
8509         promotions in case one argument is a builtin type and the other
8510         one has an implicit conversion to that type.  Fixes #62322.
8511
8512 2004-08-18  Martin Baulig  <martin@ximian.com>
8513
8514         * class.cs (Method.Define): Use the correct method name when
8515         creating the MethodBuilder for a generic method.
8516
8517 2004-08-17  Martin Baulig  <martin@ximian.com>
8518
8519         * generic.cs (Constraints): Support type parameter constraints.
8520
8521 2004-08-16  Martin Baulig  <martin@ximian.com>
8522
8523         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8524         (Token.GENERIC_DIMENSION): New token; this is returned if we
8525         encounter an unbound generic type in a typeof() expression.
8526
8527         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8528         this token is only generated while parsing a typeof() expression.
8529         (typeof_expression): Removed the old unbound_type hack.
8530
8531         * generic.cs (TypeArguments.IsUnbound): New public property.
8532
8533         * decl.cs (MemberName): Added support for unbound types.
8534
8535 2004-08-14  Martin Baulig  <martin@ximian.com>
8536
8537         * typemanager.cs
8538         (TypeManager.IsEqualGenericInstance): New static method.
8539         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8540         just used to check accessibility, so follow the rules of 26.1.6.        
8541
8542         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8543         ConstructedType instead of a TypeExpression if we have type arguments.
8544
8545         * cs-parser.jay (typeof_expression): Support unbound generic types.
8546
8547         * ecore.cs (UnboundTypeExpression): New public class.
8548
8549 2004-08-12  Martin Baulig  <martin@ximian.com>
8550
8551         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8552         TypeManager.IsEqual() rather than `=='.
8553
8554         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8555         generic instances as well.
8556
8557 2004-08-12  Martin Baulig  <martin@ximian.com>
8558
8559         * expression.cs (Invocation.InferType): We can only infer method
8560         type parameters.  Fixes #62647.
8561
8562 2004-08-11  Martin Baulig  <martin@ximian.com>
8563
8564         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8565         before resolving the base classes.
8566
8567 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8568
8569         * Makefile: install .mdb file too.
8570
8571 2004-08-05  Martin Baulig  <martin@ximian.com>
8572
8573         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8574         initializer, the current type is just the TypeBuilder, not the
8575         instantiated generic type.
8576         (FieldExpr.IsFieldInitializer): New public property.
8577
8578 2004-08-04  Martin Baulig  <martin@ximian.com>
8579
8580         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8581
8582         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8583
8584 2004-08-03  Martin Baulig  <martin@ximian.com>
8585
8586         * class.cs (MethodData.Define): If we're an explicit
8587         implementation, remove the generic arity from the type name.
8588
8589 2004-08-03  Martin Baulig  <martin@ximian.com>
8590
8591         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8592         use a user-defined operator; we still need to do numeric
8593         promotions in case one argument is a builtin type and the other
8594         one has an implicit conversion to that type.  Fixes #62322.
8595
8596 2004-08-02  Martin Baulig  <martin@ximian.com>
8597
8598         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8599         `TypeExpr[]' array.
8600         (TypeContainer.GetClassBases): Return the unexpanded list of
8601         interfaces; we expand them later.
8602         (TypeContainer.DefineType): After creating the TypeBuilder, call
8603         TypeManager.ExpandInterfaces() to get an expanded and resolved
8604         list of interfaces.
8605
8606         * ecore.cs (TypeExpr.GetInterfaces): Removed
8607
8608         * generics.cs (Constraints.InterfaceConstraints): Remove.
8609         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8610         register the interface constraints.
8611
8612         * typemanager.cs
8613         (TypeManager.AddUserType): Removed the `ifaces' argument.
8614         (TypeManager.AddTypeParameter): Likewise.
8615         (TypeManager.AddUserInterface): Removed, was unused.
8616         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8617         `TypeExpr[]' array for the interfaces.
8618         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8619         has been defined, returns a list of the resolved interfaces types.
8620         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8621         (TypeManager.GetExplicitInterfaces): Likewise.  
8622
8623 2004-08-02  Martin Baulig  <martin@ximian.com>
8624
8625         * expression.cs (Invocation.EmitCall): If we're invoking a method
8626         on a type parameter, use the new `Constrained' prefix opcode.
8627
8628 2004-08-02  Martin Baulig  <martin@ximian.com>
8629
8630         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8631         (LocalInfo.IsThis): New public property.
8632         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8633
8634 2004-08-01  Martin Baulig  <martin@ximian.com>
8635
8636         * class.cs (TypeContainer.GetClassBases): Don't set the default
8637         here since we may get called from GetPartialBases().
8638         (TypeContainer.DefineType): If GetClassBases() didn't return a
8639         parent, use the default one.
8640
8641 2004-07-30  Martin Baulig  <martin@ximian.com>
8642
8643         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8644
8645         * class.cs (SourceMethod): New public class, derive from the
8646         symbol writer's ISourceMethod.
8647         (Method): Use the new symbol writer API.
8648
8649         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8650         as argument and use the new symbol writer.
8651
8652         * location.cs
8653         (SourceFile): Implement the symbol writer's ISourceFile.
8654         (Location.SymbolDocument): Removed.
8655         (Location.SourceFile): New public property.
8656
8657         * symbolwriter.cs: Use the new symbol writer API.
8658
8659 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8660
8661         * Makefile (install-local): Remove.  Functionality moved to
8662         executable.make.
8663
8664 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8665
8666         * Makefile: Install mcs.exe.config file together with mcs.exe.
8667         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8668         correct runtime version.
8669         
8670 2004-07-25  Martin Baulig  <martin@ximian.com>
8671
8672         * class.cs
8673         (TypeContainer.RegisterOrder): Removed, this was unused.
8674         (TypeContainer, interface_order): Removed.
8675         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8676         TypeContainer as argument since we can also be called with a
8677         `PartialContainer' for a partial class/struct/interface.
8678         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8679         of checking whether we're an `Interface' - we could be a
8680         `PartialContainer'.
8681         (PartialContainer.Register): Override; call
8682         AddClass()/AddStruct()/AddInterface() on our parent.
8683
8684         * cs-parser.jay (interface_member_declaration): Add things to the
8685         `current_container', not the `current_class'.
8686
8687         * rootcontext.cs (RegisterOrder): The overloaded version which
8688         takes an `Interface' was unused, removed.
8689
8690         * typemanager.cs (TypeManager.LookupInterface): Return a
8691         `TypeContainer', not an `Interface'.
8692         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8693         contain a `PartialContainer' for an interface, so check it's
8694         `Kind' to figure out what it is.
8695
8696 2004-07-25  Martin Baulig  <martin@ximian.com>
8697
8698         * class.cs (Class.DefaultTypeAttributes): New public constant.
8699         (Struct.DefaultTypeAttributes): Likewise.
8700         (Interface.DefaultTypeAttributes): Likewise.
8701         (PartialContainer.TypeAttr): Override this and add the
8702         DefaultTypeAttributes.
8703
8704 2004-07-25  Martin Baulig  <martin@ximian.com>
8705
8706         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8707         we can just use the `Parent' field instead.
8708
8709 2004-07-25  Martin Baulig  <martin@ximian.com>
8710
8711         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8712
8713 2004-07-25  Martin Baulig  <martin@ximian.com>
8714
8715         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8716         our parts before defining any methods.
8717         (TypeContainer.VerifyImplements): Make this virtual.
8718         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8719         on our PartialContainer.
8720
8721 2004-07-25  Martin Baulig  <martin@ximian.com>
8722
8723         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8724
8725         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8726         argument, we can just use the `Parent' field instead.
8727
8728         * class.cs
8729         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8730         (MemberBase.DoDefine): Likewise.
8731
8732 2004-07-24  Martin Baulig  <martin@ximian.com>
8733
8734         * decl.cs (MemberCore.Parent): New public field.
8735         (DeclSpace.Parent): Moved to MemberCore.
8736
8737         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8738         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8739         parent's .ctor.
8740         (FieldBase, Field, Operator): Likewise.
8741         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8742         (EventField, Event): Likewise.
8743
8744 2004-07-23  Martin Baulig  <martin@ximian.com>
8745
8746         * class.cs (PartialContainer): New public class.
8747         (ClassPart): New public class.
8748         (TypeContainer): Added support for partial classes.
8749         (TypeContainer.GetClassBases): Splitted some of the functionality
8750         out into GetNormalBases() and GetPartialBases().
8751
8752         * cs-tokenizer.cs (Token.PARTIAL): New token.
8753         (Tokenizer.consume_identifier): Added some hacks to recognize
8754         `partial', but only if it's immediately followed by `class',
8755         `struct' or `interface'.
8756
8757         * cs-parser.jay: Added support for partial clases.
8758
8759 2004-07-23  Martin Baulig  <martin@ximian.com>
8760
8761         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8762         a `DeclSpace' and also made it readonly.
8763         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8764         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8765         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8766
8767         * cs-parser.jay: Pass the `current_class', not the
8768         `current_container' (at the moment, this is still the same thing)
8769         to a new Method, Property, Event, Indexer or Constructor.
8770
8771 2004-07-23  Martin Baulig  <martin@ximian.com>
8772
8773         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8774         and removed the `current_interface' one.
8775         (struct_declaration, class_declaration, interface_declaration):
8776         Set `current_class' to the newly created class/struct/interface;
8777         set their `Bases' and call Register() before parsing their body.
8778
8779 2004-07-23  Martin Baulig  <martin@ximian.com>
8780
8781         * class.cs (Kind): New public enum.
8782         (TypeContainer): Made this class abstract.
8783         (TypeContainer.Kind): New public readonly field.
8784         (TypeContainer.CheckDef): New public method; moved here from
8785         cs-parser.jay.
8786         (TypeContainer.Register): New public abstract method.
8787         (TypeContainer.GetPendingImplementations): New public abstract
8788         method.
8789         (TypeContainer.GetClassBases): Removed the `is_class' and
8790         `is_iface' parameters.
8791         (TypeContainer.DefineNestedTypes): Formerly known as
8792         DoDefineType().
8793         (ClassOrStruct): Made this class abstract.
8794
8795         * tree.cs (RootTypes): New public type. 
8796
8797 2004-07-20  Martin Baulig  <martin@ximian.com>
8798
8799         * tree.cs (Tree.RecordNamespace): Removed.
8800         (Tree.Namespaces): Removed.
8801
8802         * rootcontext.cs (RootContext.IsNamespace): Removed.
8803
8804         * cs-parser.jay (namespace_declaration): Just create a new
8805         NamespaceEntry here.
8806
8807 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8808
8809         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8810         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8811         entry to make sure it runs in the correct runtime version.
8812         
8813 2004-07-18  Martin Baulig  <martin@ximian.com>
8814
8815         * generic.cs (ConstructedType.CheckConstraints): Improved
8816         constraints checking.
8817
8818 2004-07-18  Martin Baulig  <martin@ximian.com>
8819
8820         * expression.cs (Invocation.BetterMethod): Call
8821         TypeManager.TypeToCoreType() on all types and removed my previous
8822         hack; we're already doig the right thing here.
8823
8824 2004-07-17  Martin Baulig  <martin@ximian.com>
8825
8826         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8827
8828 2004-07-16  Martin Baulig  <martin@ximian.com>
8829
8830         * iterators.cs: Added generics support.
8831
8832 2004-07-16  Martin Baulig  <martin@ximian.com>
8833
8834         * iterators.cs: Rewrote this.  We're now using one single Proxy
8835         class for both the IEnumerable and the IEnumerator interface and
8836         `Iterator' derives from Class so we can use the high-level API.
8837
8838         * class.cs (TypeContainer.AddIterator): New method.
8839         (TypeContainer.DoDefineType): New protected virtual method, which
8840         is called from DefineType().
8841         (TypeContainer.DoDefineMembers): Call DefineType() and
8842         DefineMembers() on all our iterators.
8843         (TypeContainer.Emit): Call Emit() on all our iterators.
8844         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8845
8846         * codegen.cs (EmitContext.CurrentIterator): New public field.
8847
8848 2004-07-15  Martin Baulig  <martin@ximian.com>
8849
8850         * typemanager.cs
8851         (TypeManager.not_supported_exception_type): New type.   
8852
8853 2004-07-14  Martin Baulig  <martin@ximian.com>
8854
8855         * typemanager.cs
8856         (TypeManager.generic_ienumerable_type): New type.
8857         (TypeManager.generic_ienumerator_type): New type.
8858
8859         * rootcontext.cs
8860         (RootContext.interfaces_first_stage): Added
8861         "System.Collections.Generic.IEnumerator`1" and
8862         "System.Collections.Generic.IEnumerable`1".     
8863
8864 2004-07-14  Martin Baulig  <martin@ximian.com>
8865
8866         * iterators.cs: Use real error numbers.
8867
8868 2004-07-14  Martin Baulig  <martin@ximian.com>
8869
8870         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8871         requires this to be a System.Collection.IEnumerable and not a
8872         class implementing that interface.
8873         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8874
8875 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8876
8877         * class.cs: Fixed previous fix, it broke some error tests.
8878
8879 2004-07-12  Martin Baulig  <martin@ximian.com>
8880
8881         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8882         Fixes #61293.
8883
8884 2004-07-14  Martin Baulig  <martin@ximian.com>
8885
8886         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8887         an exclamation mark (!) for the generic arity to reflect the
8888         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8889
8890 2004-07-13  Martin Baulig  <martin@ximian.com>
8891
8892         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8893         specifiers being part of a type argument.
8894
8895 2004-07-13  Martin Baulig  <martin@ximian.com>
8896
8897         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8898         name for generic types.
8899
8900 2004-07-13  Martin Baulig  <martin@ximian.com>
8901
8902         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8903         bit to fix #60119.
8904
8905 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8906
8907         * assign.cs (LocalTemporary): Add new argument: is_address,If
8908         `is_address' is true, then the value that we store is the address
8909         to the real value, and not the value itself.
8910         
8911         * ecore.cs (PropertyExpr): use the new local temporary
8912         stuff to allow us to handle X.Y += z (where X is a struct)
8913
8914 2004-07-08  Martin Baulig  <martin@ximian.com>
8915
8916         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8917         not always return, just like we're doing in Using.Resolve().
8918
8919 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8920
8921         * cs-parser.jay (fixed_statement): flag this as Pinned.
8922
8923 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8924
8925         * typemanager.cs (TypeManager): Removed MakePinned method, this
8926         mechanism is replaced with the .NET 2.x compatible mechanism of
8927         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8928
8929         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8930         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8931         `IsFixed' property which has a different meaning.
8932
8933 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8934
8935         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8936         visible from inside a nested class, not just the names of the
8937         immediately enclosing class.
8938         Fix for bug #60730.
8939
8940 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8941
8942         * expression.cs (BetterConversion): Remove buggy special-case
8943         handling of "implicit constant expression conversions".  At this
8944         point, we already know that the conversion is possible -- we're
8945         only checking to see which is better.
8946
8947 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8948
8949         * cs-parser.jay: Added error CS0210 test.
8950
8951 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8952
8953         * cs-parser.jay: Added error CS0134 test.
8954
8955 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8956
8957         Fix bug #52507
8958         * cs-parser.jay: Added error CS0145 test.
8959
8960 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8961
8962         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8963
8964 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8965         
8966         * expression.cs (StackAlloc.Resolve): The argument may not
8967         be a constant; deal with this case.
8968         
8969 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8970
8971         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8972         GetIndexerAttributeValue.
8973         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8974
8975         * class.cs (Indexer.Define): Added error tests for CS0415,
8976         CS0609.
8977
8978 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8979
8980         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8981         property code.
8982
8983 2004-06-23  Martin Baulig  <martin@ximian.com>
8984
8985         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8986         neither return nor throw, reset the barrier as well.  Fixes #60457.
8987
8988 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8989
8990         * class.cs : EventAttributes is now set to None by default.
8991           This fixes bug #60459.
8992
8993 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8994
8995         Fix bug #60219
8996         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8997         Don't throw exception but return null (it's sufficient now).
8998
8999 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9000
9001         * typemanager.cs (GetArgumentTypes): Faster implementation.
9002
9003 2004-06-18  Martin Baulig  <martin@ximian.com>
9004
9005         * attribute.cs (Attribute.Resolve): Check whether we're an
9006         EmptyCast which a Constant child.  Fixes #60333.
9007
9008 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9009
9010         * statement.cs (EmitCollectionForeach): Account for the fact that
9011         not all valuetypes are in areas which we can take the address of.
9012         For these variables, we store to a temporary variable. Also, make
9013         sure that we dont emit a `callvirt' on a valuetype method.
9014
9015 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9016
9017         * expression.cs (StackAlloc.DoReSolve): Added test for
9018         negative parameter (CS0247).
9019
9020 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9021
9022         Fix bug #59792
9023         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9024
9025 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9026
9027         Fix bug #59781
9028         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9029         ulong.
9030
9031 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9032
9033         Fix bug #58254 & cs1555.cs, cs1556.cs
9034         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9035
9036 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9037
9038         * cs-parser.jay: Added error CS1669 test for indexers.
9039
9040 2004-06-18  Martin Baulig  <martin@ximian.com>
9041
9042         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9043         argument.  Fixes #60441.
9044
9045 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9046         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9047         The name needs to have the actual name of the method in order
9048         for other tests (such as the one in OverloadResolve for Invoke
9049         on a delegate) to work. As well, it does not really help
9050         error reporting because the method group had multiple methods.
9051         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9052         Make profiling work.
9053         
9054 2004-06-13  Martin Baulig  <martin@ximian.com>
9055
9056         * cs-parser.jay: Don't allow generic attributes.
9057
9058 2004-06-13  Martin Baulig  <martin@ximian.com>
9059
9060         * class.cs (MemberBase.DoDefineBase): New protected method.
9061         (MemberBase.DoDefine): Compute the `flags' in the new
9062         DoDefineBase() which must be called first.
9063         (Method.Define): Call DoDefineBase() first so we have the flags
9064         when defining the generic method.
9065
9066         * cs-parser.jay (interface_method_declaration): Support generic methods.
9067
9068 2004-06-13  Martin Baulig  <martin@ximian.com>
9069
9070         * decl.cs (TypeName): Removed.
9071         (MemberName): Removed TypeName and MemberNow; now we just have
9072         MemberName.
9073
9074         * cs-parser.jay: Don't distinguish between type arguments and type
9075         parameters in the grammar and simplified the rules a bit.  The
9076         reduce/reduce conflicts are now gone (except the one we inherited
9077         from mcs).
9078
9079 2004-06-11  Martin Baulig  <martin@ximian.com>
9080
9081         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9082         call this twice: for params and varargs methods.
9083
9084 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9085
9086         * class.cs:
9087         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9088
9089 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9090
9091         * attribute.cs (Attribute.GetValidTargets): Made public.
9092
9093         * class.cs: 
9094         (AbstractPropertyEventMethod): New class for better code sharing.
9095         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9096         CS1667 report.
9097         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9098
9099 2004-06-09  Martin Baulig  <martin@ximian.com>
9100
9101         * cs-parser.jay: Removed a reduce/reduce conflict.
9102
9103 2004-06-03  Martin Baulig  <martin@ximian.com>
9104
9105         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9106         GetSimpleName() and return a SimpleName.
9107
9108         * ecore.cs (SimpleName.Arguments): New public field.
9109         (SimpleName): Added overloaded ctor which takes an additional
9110         TypeArguments argument.
9111         (SimpleName.SimpleNameResolve): Added support for generic methods.
9112         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9113         formerly in MemberAccess.DoResolve(), but we also need it in
9114         SimpleNameResolve().
9115
9116         * expression.cs (MemberAccess.DoResolve): Use the new
9117         MethodGroupExpr.ResolveGeneric().       
9118
9119 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9120
9121         * decl.cs: If possible, use lookuptypedirect here. We can only do
9122         this if there is no `.' after the namespace. Avoids using
9123         LookupType, which does lots of slow processing.
9124         (FindNestedType) New method, does what it says :-).
9125         * namespace.cs: use LookupTypeDirect.
9126         * rootcontext.cs: use membercache, if possible.
9127         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9128
9129 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9130
9131         * expression.cs:
9132         According to the spec, 
9133
9134         In a member access of the form E.I, if E is a single identifier,
9135         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9136         field, property, localvariable, or parameter with the same type as
9137         the meaning of E as a type-name (§3.8), then both possible
9138         meanings of E are permitted.
9139
9140         We did not check that E as a simple-name had the same type as E as
9141         a type name.
9142
9143         This trivial check gives us 5-7% on bootstrap time.
9144
9145 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9146
9147         * expression.cs (Invocation.OverloadResolve): Avoid the
9148         use of hashtables and boxing here by allocating on demand.
9149
9150 2004-05-30  Martin Baulig  <martin@ximian.com>
9151
9152         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9153         we're doing a silent lookup.  Don't try to lookup nested types in
9154         TypeManager.object_type (thanks to Ben Maurer).
9155
9156 2004-05-30  Martin Baulig  <martin@ximian.com>
9157
9158         Committing a patch from Ben Maurer.
9159
9160         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9161
9162 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9163
9164         * convert.cs: add a trivial cache for overload operator resolution.
9165
9166 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9167
9168         * attribute.cs
9169         (AttributeTester.GetObsoleteAttribute): Returns instance of
9170         ObsoleteAttribute when type is obsolete.
9171
9172         * class.cs
9173         (TypeContainer.VerifyObsoleteAttribute): Override.
9174         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9175         (MethodCode.VerifyObsoleteAttribute): Override.
9176         (MemberBase.VerifyObsoleteAttribute): Override.
9177
9178         * decl.cs
9179         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9180         and report proper error.
9181
9182         *delegate.cs
9183         (Delegate.VerifyObsoleteAttribute): Override.
9184
9185         * ecore.cs
9186         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9187         and report proper error.
9188         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9189
9190         * enum.cs
9191         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9192         and enum member.
9193
9194         * expression.cs
9195         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9196         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9197         Added test for ObsoleteAttribute.
9198
9199         * statement.cs
9200         (Catch): Derived from Statement.
9201
9202 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9203
9204         * decl.cs: If possible, use lookuptypedirect here. We can only do
9205         this if there is no `.' after the namespace. Avoids using
9206         LookupType, which does lots of slow processing.
9207         (FindNestedType) New method, does what it says :-).
9208         * namespace.cs: use LookupTypeDirect.
9209         * rootcontext.cs: use membercache, if possible.
9210         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9211
9212 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9213
9214         * expression.cs:
9215         According to the spec, 
9216
9217         In a member access of the form E.I, if E is a single identifier,
9218         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9219         field, property, localvariable, or parameter with the same type as
9220         the meaning of E as a type-name (§3.8), then both possible
9221         meanings of E are permitted.
9222
9223         We did not check that E as a simple-name had the same type as E as
9224         a type name.
9225
9226         This trivial check gives us 5-7% on bootstrap time.
9227
9228 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9229
9230         Fixed bug #59071 & cs0160.cs
9231         * statement.cs (Try.Resolve): Check here whether order of catch
9232         clauses matches their dependencies.
9233
9234 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9235
9236         Fixed bug #58624
9237         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9238         unsafe type.
9239
9240 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9241
9242         * expression.cs (Invocation.OverloadResolve): Avoid the
9243         use of hashtables and boxing here by allocating on demand.
9244
9245 2004-05-30  Martin Baulig  <martin@ximian.com>
9246
9247         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9248         we're doing a silent lookup.  Don't try to lookup nested types in
9249         TypeManager.object_type (thanks to Ben Maurer).
9250
9251 2004-05-30  Martin Baulig  <martin@ximian.com>
9252
9253         Committing a patch from Ben Maurer.
9254
9255         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9256
9257 2004-05-29  Martin Baulig  <martin@ximian.com>
9258
9259         * class.cs (IMethodData.ShouldIgnore): New method.
9260
9261         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9262         `Location' argument, we don't need it anywhere.  Use
9263         `IMethodData.ShouldIgnore ()' instead of
9264         `MethodData.GetMethodFlags ()'.
9265         (TypeManager.AddMethod): Removed.
9266         (TypeManager.AddMethod2): Renamed to AddMethod.
9267
9268 2004-05-29  Martin Baulig  <martin@ximian.com>
9269
9270         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9271
9272         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9273         converting from a class type S to an interface type and we already
9274         have an object on the stack, don't box it again.  Fixes #52578.
9275
9276 2004-05-29  Martin Baulig  <martin@ximian.com>
9277
9278         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9279         Added support for `params' parameters.  Fixes #59267.
9280
9281 2004-05-29  Martin Baulig  <martin@ximian.com>
9282
9283         * literal.cs (NullPointer): Provide a private .ctor which sets
9284         `type' to TypeManager.object_type.  Fixes #59048.
9285
9286 2004-05-29  Martin Baulig  <martin@ximian.com>
9287
9288         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9289         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9290
9291         * ecore.cs (EventExpr.instance_expr): Make the field private.
9292
9293 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9294
9295         Fixed bug #50080 & cs0214-2.cs
9296         * expression.cs (Cast.DoResolve): Check unsafe context here.
9297         
9298         * statement.cs (Resolve.DoResolve): Likewise.
9299
9300 2004-05-26  Martin Baulig  <martin@ximian.com>
9301
9302         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9303
9304         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9305         (RootContext.LookupType): Pass down the `silent' flag.
9306
9307 2004-05-25  Martin Baulig  <martin@ximian.com>
9308
9309         * expression.cs
9310         (MethodGroupExpr.IdenticalTypeName): New public property.
9311         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9312         expression actually refers to a type.
9313
9314 2004-05-25  Martin Baulig  <martin@ximian.com>
9315
9316         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9317         for #56176 and made it actually work.
9318
9319 2004-05-25  Martin Baulig  <martin@ximian.com>
9320
9321         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9322         (FieldExpr, PropertyExpr): Override and implement
9323         CacheTemporaries.  Fixes #52279.
9324
9325 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9326
9327         * location.cs: In the new compiler listing a file twice is a
9328         warning, not an error.
9329
9330 2004-05-24  Martin Baulig  <martin@ximian.com>
9331
9332         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9333         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9334
9335 2004-05-24  Martin Baulig  <martin@ximian.com>
9336
9337         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9338         walking the `using' list.  Fixes #53921.
9339
9340 2004-05-24  Martin Baulig  <martin@ximian.com>
9341
9342         * const.cs (Const.LookupConstantValue): Added support for
9343         EmptyCast's; fixes #55251.
9344
9345 2004-05-24  Martin Baulig  <martin@ximian.com>
9346
9347         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9348         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9349         which does the CS0135 check.  The reason is that we first need to
9350         check whether the variable actually exists.
9351
9352 2004-05-24  Martin Baulig  <martin@ximian.com>
9353
9354         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9355         than RootContext.LookupType() to find the explicit interface
9356         type.  Fixes #58584.
9357
9358 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9359
9360         * Makefile: Simplify.  Use executable.make.
9361         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9362
9363 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9364
9365         * decl.cs:
9366         * enum.cs:
9367         Use the invariant culture when doing String.Compare for CLS case
9368         sensitivity.
9369         
9370 2004-05-23  Martin Baulig  <martin@ximian.com>
9371
9372         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9373         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9374
9375         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9376
9377 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9378
9379         * class.cs (MemberBase.Define): Reuse MemberType member for 
9380         resolved type. Other methods can use it too.
9381
9382 2004-05-23  Martin Baulig  <martin@ximian.com>
9383
9384         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9385         the variable also exists in the current block (otherwise, we need
9386         to report a CS0103).  Fixes #58670.
9387
9388 2004-05-23  Martin Baulig  <martin@ximian.com>
9389
9390         * flowanalysis.cs (Reachability.Reachable): Compute this
9391         on-the-fly rather than storing it as a field.
9392
9393 2004-05-23  Martin Baulig  <martin@ximian.com>
9394
9395         * flowanalysis.cs (Reachability.And): Manually compute the
9396         resulting `barrier' from the reachability.      
9397        
9398 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9399
9400         Fix bug #57835
9401         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9402         instance of ObsoleteAttribute when symbol is obsolete.
9403
9404         * class.cs
9405         (IMethodData): Extended interface for ObsoleteAttribute support.
9406
9407 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9408
9409         * attribute.cs: Fix bug #55970
9410
9411 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9412
9413         Fix bug #52705
9414         * attribute.cs
9415         (GetObsoleteAttribute): New method. Creates the instance of
9416         ObsoleteAttribute.
9417         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9418         ObsoleteAttribute when member is obsolete.
9419         (AttributeTester.Report_ObsoleteMessage): Common method for
9420         Obsolete error/warning reporting.
9421
9422         * class.cs
9423         (TypeContainer.base_classs_type): New member for storing parent type.
9424
9425         * decl.cs
9426         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9427         for this MemberCore.
9428
9429 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9430
9431         * attribute.cs, const.cs: Fix bug #58590
9432
9433 2004-05-21  Martin Baulig  <martin@ximian.com>
9434
9435         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9436         out parameters if the end of the method is unreachable.  Fixes
9437         #58098. 
9438
9439 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9440
9441         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9442         Hari was right, why extra method.
9443
9444 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9445
9446         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9447
9448 2004-05-20  Martin Baulig  <martin@ximian.com>
9449
9450         * delegate.cs: Convert this file to Unix mode - like the original
9451         version in mcs is.
9452
9453 2004-05-20  Martin Baulig  <martin@ximian.com>
9454
9455         * attribute.cs: Convert this file to Unix mode - like the original
9456         version in mcs is.
9457
9458 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9459
9460        Fix bug #58688 (MCS does not report error when the same attribute
9461        is assigned twice)
9462
9463        * attribute.cs (Attribute.Emit): Distinction between null and default.
9464
9465 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9466
9467        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9468        of a top-level attribute without an attribute target.
9469        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9470        Make non-static.
9471        (Attribute.Conditional_GetConditionName), 
9472        (Attribute.Obsolete_GetObsoleteMessage): Update.
9473        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9474        part of ScanForIndexerName.
9475        (Attribute.CanIgnoreInvalidAttribute): New function.
9476        (Attribute.ScanForIndexerName): Move to ...
9477        (Attributes.ScanForIndexerName): ... here.
9478        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9479        (Attributes.Search): New internal variant that can choose not to
9480        complain if types aren't resolved.  The original signature now
9481        complains.
9482        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9483        complaints suppressed.
9484        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9485        only if it not useful.
9486        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9487        top-level for attributes that are shared between the assembly
9488        and a top-level class.
9489        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9490        * class.cs: Update to reflect changes.
9491        (DefineIndexers): Fuse loops.
9492        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9493        a couple more variants of attribute names.
9494
9495 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9496
9497         Fix bug #52585 (Implemented explicit attribute declaration)
9498
9499         * attribute.cs:
9500         (Attributable.ValidAttributeTargets): New abstract method. It gets
9501         list of valid attribute targets for explicit target declaration.
9502         (Attribute.Target): It holds target itself.
9503         (AttributeSection): Removed.
9504         (Attribute.CheckTargets): New method. It checks whether attribute
9505         target is valid for the current element.
9506
9507         * class.cs:
9508         (EventProperty): New class. For events that are declared like
9509         property (with add and remove accessors).
9510         (EventField): New class. For events that are declared like field.
9511         class.cs
9512
9513         * cs-parser.jay: Implemented explicit attribute target declaration.
9514
9515         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9516         Override ValidAttributeTargets.
9517
9518         * parameter.cs:
9519         (ReturnParameter): Class for applying custom attributes on 
9520         the return type.
9521         (ParameterAtribute): New class. Class for applying custom
9522         attributes on the parameter type.
9523
9524 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9525
9526         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9527         definitions. 
9528
9529         (Method): Allow UNSAFE here.
9530
9531         * modifiers.cs: Support unsafe reporting.
9532
9533 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9534
9535         * decl.cs: Fix bug #58478.
9536
9537 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9538
9539         * statement.cs: When checking for unreachable code on an EmptyStatement,
9540         set the location. Fixes bug #58488.
9541
9542 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9543
9544         * driver.cs: Add -pkg handling.
9545
9546         From Gonzalo: UseShelLExecute=false
9547
9548 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9549
9550         * attribute.cs:
9551         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9552         for attribute.
9553         (Attribute.IsClsCompliaceRequired): Moved to base for better
9554         accesibility.
9555         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9556         when attribute is AttributeUsageAttribute.
9557         (Attribute.GetValidTargets): Simplified.
9558         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9559         attribute for this type.
9560         (Attribute.ApplyAttributes): Method renamed to Emit and make
9561         non-static.
9562         (GlobalAttributeSection): New class for special handling of global
9563         attributes (assembly, module).
9564         (AttributeSection.Emit): New method.
9565
9566         * class.cs: Implemented Attributable abstract methods.
9567         (MethodCore.LabelParameters): Moved to Parameter class.
9568         (Accessor): Is back simple class.
9569         (PropertyMethod): Implemented Attributable abstract class.
9570         (DelegateMethod): Implemented Attributable abstract class.
9571         (Event): New constructor for disctintion between normal Event
9572         and Event with accessors.
9573
9574         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9575
9576         * codegen.cs, const.cs, decl.cs, delegate.cs:
9577         (CommonAssemblyModulClass): Implemented Attributable abstract class
9578         and simplified.
9579
9580         * enum.cs: Implement IAttributeSupport interface.
9581         (EnumMember): New class for emum members. Implemented Attributable
9582         abstract class
9583
9584         * parameter.cs:
9585         (ParameterBase): Is abstract.
9586         (ReturnParameter): New class for easier [return:] attribute handling.
9587
9588         * typemanager.cs: Removed builder_to_attr.
9589
9590 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9591
9592         Fix bug #57151.
9593         * attribute.cs (Attribute.GetPositionalValue): New function.
9594         * class.cs (TypeContainer.VerifyMembers): New function.
9595         (TypeContainer.Emit): Use it.
9596         (ClassOrStruct): New base class for Class and Struct.
9597         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9598         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9599         class.
9600         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9601         then each non-static field should have a FieldOffset attribute.
9602         Otherwise, none of the fields should have a FieldOffset attribute.
9603         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9604         and FieldOffset attributes.
9605         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9606         (TypeManager.field_offset_attribute_type): New core types.
9607         (TypeManager.InitCoreTypes): Initialize them.
9608
9609 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9610
9611         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9612         Return correct type.
9613         From bug #58270.
9614
9615 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9616
9617         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9618         be implicitly converted to ulong.
9619         
9620         * expression.cs: The logic for allowing operator &, | and ^ worked
9621         was wrong, it worked before because we did not report an error in
9622         an else branch.  Fixes 57895.
9623
9624         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9625         allow volatile fields to be reference types.
9626
9627 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * driver.cs: Add support for /debug-
9630
9631 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9632
9633         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9634         Add a 'complain' parameter to silence errors.
9635         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9636         silently overlooked type-resolutions.
9637         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9638         to reflect changes.
9639         (Attributes.Search): New function.
9640         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9641         (Attributes.GetAttributeFullName): Remove hack.
9642         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9643         Update to reflect changes.
9644         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9645         Use Attributes.Search instead of nested loops.
9646
9647 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9648
9649         * decl.cs:
9650         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9651         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9652         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9653
9654         * report.cs: (Report.Warning): Renamed to Warning_T because of
9655         parameter collision.
9656
9657 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9658
9659         * expression.cs (MemberAccess.ResolveMemberAccess):
9660         Exit with non-zero status after Report.Error.
9661         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9662         Likewise.
9663         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9664
9665 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9666
9667         * support.cs: Don't hang when the file is empty.
9668
9669 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9670
9671         * support.cs: In SeekableStreamReader, compute the preamble size of the
9672           underlying stream. Position changes should take into account that initial
9673           count of bytes.
9674
9675 2004-05-03  Todd Berman  <tberman@sevenl.net>
9676
9677         * driver.cs: remove unused GetSysVersion function.
9678
9679 2004-05-03  Todd Berman  <tberman@sevenl.net>
9680
9681         * driver.cs: Remove the hack from saturday, as well as the hack
9682         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9683         link_paths to get that bit proper.
9684
9685 2004-05-01  Todd Berman  <tberman@sevenl.net>
9686
9687         * driver.cs: Try a LoadFrom before a Load, this checks the current
9688         path. This is currently a bug in mono that is be fixed, however, this
9689         provides a workaround for now. This will be removed when the bug
9690         is fixed.
9691
9692 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9693
9694         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9695         incomplete key pairs (#57941).
9696
9697 2004-05-01  Todd Berman  <tberman@sevenl.net>
9698
9699         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9700         from the GAC
9701
9702 2004-04-30  Jackson Harper  <jackson@ximian.com>
9703
9704         * codegen.cs: Open keys readonly.
9705         
9706 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9707
9708         * typemanager.cs: don't report cyclic struct layout when a struct
9709         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9710         which has 2 Pango.Rectangle fields.
9711
9712 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9713
9714         * expression.cs: Handle IntPtr comparisons with IL code
9715         rather than a method call.
9716
9717 2004-04-29  Martin Baulig  <martin@ximian.com>
9718
9719         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9720         the list of PropertyInfo's in class hierarchy and find the
9721         accessor.  Fixes #56013.
9722
9723 2004-04-29  Martin Baulig  <martin@ximian.com>
9724
9725         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9726
9727 2004-04-29  Martin Baulig  <martin@ximian.com>
9728
9729         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9730
9731         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9732
9733 2004-04-29  Martin Baulig  <martin@ximian.com>
9734
9735         * class.cs (ConstructorInitializer.Resolve): Check whether the
9736         parent .ctor is accessible.  Fixes #52146.
9737
9738 2004-04-29  Martin Baulig  <martin@ximian.com>
9739
9740         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9741
9742         * statement.cs (Using.EmitLocalVariableDecls): Use
9743         TypeManager.idisposable_type, not typeof (IDisposable).
9744         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9745
9746 2004-04-29  Martin Baulig  <martin@ximian.com>
9747
9748         * class.cs (Event.Define): Don't emit the field and don't set
9749         RTSpecialName and SpecialName for events on interfaces.  Fixes
9750         #57703. 
9751
9752 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9753
9754         Refactor Attribute.ApplyAttributes.
9755         * attribute.cs (Attributable): New base class for objects that can
9756         have Attributes applied on them.
9757         (Attribute): Make AttributeUsage fields public.
9758         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9759         (Attribute.IsInternalCall): New property.
9760         (Attribute.UsageAttr): Convert to a public read-only property.
9761         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9762         (Attribute.ResolveType, Attribute.Resolve)
9763         (Attribute.ScanForIndexerName): Update to reflect changes.
9764         (Attribute.CheckAttributeTarget): Re-format.
9765         (Attribute.ApplyAttributes): Refactor, to various
9766         Attributable.ApplyAttributeBuilder methods.
9767         * decl.cs (MemberCore): Make Attributable.
9768         * class.cs (Accessor): Make Attributable.
9769         (MethodData.ApplyAttributes): Use proper attribute types, not
9770         attribute names.
9771         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9772         (TypeContainer.ApplyAttributeBuilder)
9773         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9774         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9775         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9776         (Operator.ApplyAttributeBuilder): New factored-out methods.
9777         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9778         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9779         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9780         * parameter.cs (ParameterBase): New Attributable base class
9781         that can also represent Return types.
9782         (Parameter): Update to the changes.
9783
9784 2004-04-29  Jackson Harper  <jackson@ximian.com>
9785
9786         * driver.cs: Prefer the corlib system version when looking for
9787         assemblies in the GAC. This is still a hack, but its a better hack
9788         now.
9789         
9790 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9791
9792         * decl.cs, enum.cs: Improved error 3005 reporting.
9793   
9794         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9795         (related_symbols): New private member for list of symbols
9796         related to reported error/warning.
9797         
9798         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9799
9800 2004-04-29  Martin Baulig  <martin@ximian.com>
9801
9802         * ecore.cs (Expression.Constantify): If we're an enum and
9803         TypeManager.TypeToCoreType() doesn't give us another type, use
9804         t.UnderlyingSystemType.  Fixes #56178.  
9805
9806 2004-04-29  Martin Baulig  <martin@ximian.com>
9807
9808         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9809         interfaces and for each interface, only add members directly
9810         declared in that interface.  Fixes #53255.
9811
9812 2004-04-28  Martin Baulig  <martin@ximian.com>
9813
9814         * expression.cs (ConditionalLogicalOperator): Use a temporary
9815         variable for `left' to avoid that we evaluate it more than once;
9816         bug #52588.
9817
9818 2004-04-28  Martin Baulig  <martin@ximian.com>
9819
9820         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9821         `void[]' (CS1547).
9822
9823 2004-04-28  Martin Baulig  <martin@ximian.com>
9824
9825         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9826         void (CS1547).
9827
9828         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9829         whether the type is not void (CS1547).
9830
9831 2004-04-28  Martin Baulig  <martin@ximian.com>
9832
9833         * expression.cs (Unary.DoResolveLValue): Override this and report
9834         CS0131 for anything but Operator.Indirection.
9835
9836 2004-04-28  Martin Baulig  <martin@ximian.com>
9837
9838         Committing a patch from Ben Maurer; see bug #50820.
9839
9840         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9841         check for classes.
9842
9843         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9844         classes.        
9845
9846 2004-04-28  Martin Baulig  <martin@ximian.com>
9847
9848         Committing a patch from Ben Maurer; see bug #50820.
9849
9850         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9851         check for classes.
9852
9853         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9854         classes.        
9855
9856 2004-04-28  Martin Baulig  <martin@ximian.com>
9857
9858         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9859         (Block.AddLabel): Call DoLookupLabel() to only search in the
9860         current block.
9861
9862 2004-04-28  Martin Baulig  <martin@ximian.com>
9863
9864         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9865         comparing StringConstants and NullLiterals in Equality and Inequality.
9866
9867 2004-04-28  Jackson Harper  <jackson@ximian.com>
9868
9869         * driver.cs: Attempt to load referenced assemblies from the
9870         GAC. This is the quick and dirty version of this method that
9871         doesnt take into account versions and just takes the first
9872         canidate found. Will be good enough for now as we will not have more
9873         then one version installed into the GAC until I update this method.
9874
9875 2004-04-28  Martin Baulig  <martin@ximian.com>
9876
9877         * typemanager.cs (TypeManager.CheckStructCycles): New public
9878         static method to check for cycles in the struct layout.
9879
9880         * rootcontext.cs (RootContext.PopulateTypes): Call
9881         TypeManager.CheckStructCycles() for each TypeContainer.
9882         [Note: We only need to visit each type once.]
9883
9884 2004-04-28  Martin Baulig  <martin@ximian.com>
9885
9886         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9887
9888         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9889         success and added `out object value'.  Use a `bool resolved' field
9890         to check whether we've already been called rather than
9891         `ConstantValue != null' since this breaks for NullLiterals.
9892
9893 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9894
9895         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9896         setting of this flag, since the 'set' method may be non-public.
9897
9898 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9899
9900         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9901         check on current_vector.Block.
9902
9903 2004-04-27  Martin Baulig  <martin@ximian.com>
9904
9905         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9906         a field initializer.  Fixes #56459.
9907
9908 2004-04-27  Martin Baulig  <martin@ximian.com>
9909
9910         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9911         we're not attempting to use an indexer.  Fixes #52154.
9912
9913 2004-04-27  Martin Baulig  <martin@ximian.com>
9914
9915         * statement.cs (Return): Don't create a return label if we don't
9916         need it; reverts my change from January 20th.  Thanks to Ben
9917         Maurer for this.
9918
9919 2004-04-27  Martin Baulig  <martin@ximian.com>
9920
9921         According to the spec, `goto' can only leave a nested scope, but
9922         never enter it.
9923
9924         * statement.cs (Block.LookupLabel): Only lookup in the current
9925         block, don't recurse into parent or child blocks.
9926         (Block.AddLabel): Check in parent and child blocks, report
9927         CS0140/CS0158 if we find a duplicate.
9928         (Block): Removed this indexer for label lookups.
9929         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9930         this already does the error reporting for us.
9931
9932         * flowanalysis.cs
9933         (FlowBranching.UsageVector.Block): New public variable; may be null.
9934         (FlowBranching.CreateSibling): Added `Block' argument.
9935         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9936         label for the target of a `goto' and check whether we're not
9937         leaving a `finally'.
9938
9939 2004-04-27  Martin Baulig  <martin@ximian.com>
9940
9941         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9942         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9943         just for returns).
9944
9945 2004-04-27  Martin Baulig  <martin@ximian.com>
9946
9947         * statement.cs (Block.AddLabel): Also check for implicit blocks
9948         and added a CS0158 check.
9949
9950 2004-04-27  Martin Baulig  <martin@ximian.com>
9951
9952         * flowanalysis.cs (FlowBranchingLoop): New class.
9953         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9954         UsageVector's instead of an ArrayList.
9955         (FlowBranching.Label): Likewise.
9956         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9957         (FlowBranching.AddBreakVector): New method.
9958
9959 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9960
9961         * attribute.cs: Small regression fix: only convert the type if we
9962         the type is different, fixes System.Drawing build.
9963
9964 2004-04-27  Martin Baulig  <martin@ximian.com>
9965
9966         * attribute.cs (Attribute.Resolve): If we have a constant value
9967         for a named field or property, implicity convert it to the correct
9968         type.
9969
9970 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9971
9972         * statement.cs (Block.Block): Implicit blocks share
9973         'child_variable_names' fields with parent blocks.
9974         (Block.AddChildVariableNames): Remove.
9975         (Block.AddVariable): Mark variable as "used by a child block" in
9976         every surrounding block.
9977         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9978         been used in a child block, complain about violation of "Invariant
9979         meaning in blocks" rule.
9980         * cs-parser.jay (declare_local_variables): Don't use
9981         AddChildVariableNames.
9982         (foreach_statement): Don't create an implicit block: 'foreach'
9983         introduces a scope.
9984
9985 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9986
9987         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9988         converting from 0L to ulong.  Fixes 57522.
9989
9990 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9991
9992         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9993         derived class hides via 'new' keyword field from base class (test-242.cs).
9994         TODO: Handle this in the more general way.
9995         
9996         * class.cs (CheckBase): Ditto.
9997
9998 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9999
10000         * decl.cs (caching_flags): New member for storing cached values
10001         as bit flags.
10002         (MemberCore.Flags): New enum where bit flags for caching_flags
10003         are defined.
10004         (MemberCore.cls_compliance): Moved to caching_flags.
10005         (DeclSpace.Created): Moved to caching_flags.
10006
10007         * class.cs: Use caching_flags instead of DeclSpace.Created
10008         
10009 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10010
10011         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10012         if we are only a derived class, not a nested class.
10013
10014         * typemanager.cs: Same as above, but do this at the MemberLookup
10015         level (used by field and methods, properties are handled in
10016         PropertyExpr).   Allow for the qualified access if we are a nested
10017         method. 
10018
10019 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10020
10021         * class.cs: Refactoring.
10022         (IMethodData): New inteface; Holds links to parent members
10023         to avoid member duplication (reduced memory allocation).
10024         (Method): Implemented IMethodData interface.
10025         (PropertyBase): New inner classes for get/set methods.
10026         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10027         (Event): New inner classes for add/remove methods.
10028         (Event.DelegateMethod): Implemented IMethodData interface.
10029
10030         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10031         EmitContext (related to class.cs refactoring).
10032
10033 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10034
10035         * delegate.cs (Delegate.VerifyApplicability): If the number of
10036         arguments are the same as the number of parameters, first try to
10037         verify applicability ignoring  any 'params' modifier on the last
10038         parameter.
10039         Fixes #56442.
10040
10041 2004-04-08  Martin Baulig  <martin@ximian.com>
10042
10043         Merged latest changes into gmcs.  Please keep this comment in
10044         here, it makes it easier for me to see what changed in MCS since
10045         the last time I merged.
10046
10047 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10048
10049         * class.cs (TypeContainer.AddIndexer): Use
10050         'ExplicitInterfaceName' to determine if interface name was
10051         explicitly specified.  'InterfaceType' is not initialized at this time.
10052         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10053         Indexers array is already in the required order.  Initialize
10054         'IndexerName' only if there are normal indexers.
10055         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10056         (TypeContainer.Emit): Emit DefaultMember attribute only if
10057         IndexerName is initialized.
10058         Fixes #56300.
10059
10060 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10061
10062         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10063         Fixes #57007
10064
10065 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10066
10067         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10068         attributes.
10069         Fix for #56456.
10070
10071         * attribute.cs (Attribute.Resolve): Check for duplicate named
10072         attributes.
10073         Fix for #56463.
10074
10075 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10076
10077         * iterators.cs (MarkYield): track whether we are in an exception,
10078         and generate code accordingly.  Use a temporary value to store the
10079         result for our state.
10080
10081         I had ignored a bit the interaction of try/catch with iterators
10082         since their behavior was not entirely obvious, but now it is
10083         possible to verify that our behavior is the same as MS .NET 2.0
10084
10085         Fixes 54814
10086
10087 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10088
10089         * iterators.cs: Avoid creating temporaries if there is no work to
10090         do. 
10091
10092         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10093         Enumerations, use TypeManager.EnumToUnderlying and call
10094         recursively. 
10095
10096         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10097         bug #57013
10098
10099         (This.Emit): Use EmitContext.EmitThis to emit our
10100         instance variable.
10101
10102         (This.EmitAssign): Ditto.
10103
10104         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10105         codepaths, we will move all the functionality into
10106         Mono.CSharp.This 
10107
10108         (FieldExpr.EmitAssign): Ditto.
10109
10110         This fixes several hidden bugs that I uncovered while doing a code
10111         review of this today.
10112
10113         * codegen.cs (EmitThis): reworked so the semantics are more clear
10114         and also support value types "this" instances.
10115
10116         * iterators.cs: Changed so that for iterators in value types, we
10117         do not pass the value type as a parameter.  
10118
10119         Initialization of the enumerator helpers is now done in the caller
10120         instead of passing the parameters to the constructors and having
10121         the constructor set the fields.
10122
10123         The fields have now `assembly' visibility instead of private.
10124
10125 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10126
10127         * expression.cs (Argument.Resolve): Check if fields passed as ref
10128         or out are contained in a MarshalByRefObject.
10129
10130         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10131         another compiler type.
10132
10133 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10134
10135         * class.cs (Indexer.Define): use the new name checking method.
10136         Also, return false on an error.
10137         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10138         (is_identifier_[start/part]_character): make static.
10139
10140 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10141
10142         * expression.cs (Binary.ResolveOperator): Do no append strings
10143         twice: since we can be invoked more than once (array evaluation)
10144         on the same concatenation, take care of this here.  Based on a fix
10145         from Ben (bug #56454)
10146
10147 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10148
10149         * codegen.cs: Fix another case where CS1548 must be reported (when 
10150         delay-sign isn't specified and no private is available #56564). Fix
10151         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10152         error when MCS is used on the MS runtime and we need to delay-sign 
10153         (which seems unsupported by AssemblyBuilder - see #56621).
10154
10155 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10156
10157         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10158         (TypeManager.ComputeNamespaces): Faster implementation for
10159         Microsoft runtime.
10160
10161         * compiler.csproj: Updated AssemblyName to mcs.
10162
10163 2004-05-11  Jackson Harper  <jackson@ximian.com>
10164
10165         * Makefile: Preserve MONO_PATH
10166         
10167 2004-05-11  Jackson Harper  <jackson@ximian.com>
10168
10169         * Makefile: Use mono and mcs to build gmcs
10170         
10171 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10172
10173         * codegen.cs: Add patch from Robert Shade
10174         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10175         sync with mcs.
10176
10177 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10178
10179         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10180         incomplete key pairs (#57941).
10181
10182 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10183
10184         * codegen.cs: Fix another case where CS1548 must be reported (when 
10185         delay-sign isn't specified and no private is available #56564). Fix
10186         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10187         error when MCS is used on the MS runtime and we need to delay-sign 
10188         (which seems unsupported by AssemblyBuilder - see #56621).
10189
10190 2004-04-29  Jackson Harper  <jackson@ximian.com>
10191
10192         * Makefile: Set MONO_PATH to use the bootstrap corlib
10193         * driver.cs: Check the GAC for referenced assemblies.
10194                 
10195 2004-04-29  Martin Baulig  <martin@ximian.com>
10196
10197         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10198
10199 2004-04-07  Martin Baulig  <martin@ximian.com>
10200
10201         * expression.cs (Binary.ResolveOperator): Added special case for
10202         Equality/Inequality between a type parameter and a null literal.
10203
10204 2004-04-07  Martin Baulig  <martin@ximian.com>
10205
10206         * convert.cs: Check null literal -> type parameter conversions.
10207
10208 2004-04-07  Martin Baulig  <martin@ximian.com>
10209
10210         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10211         `class' and `struct' constraints.
10212
10213 2004-04-07  Martin Baulig  <martin@ximian.com>
10214
10215         * generic.cs (SpecialConstraint): New public enum.
10216         (Constraints.Resolve): Added support for the `class' and `struct'
10217         constraints.
10218
10219         * cs-parser.jay (type_parameter_constraint): Added support for the
10220         `class' and `struct' constraints.
10221
10222 2004-04-07  Martin Baulig  <martin@ximian.com>
10223
10224         * support.cs (GenericConstraints): Replaced `Types' by
10225         `ClassConstraint' and `InterfaceConstraints'; added
10226         `HasClassConstraint'.   
10227
10228 2004-04-07  Martin Baulig  <martin@ximian.com>
10229
10230         * generic.cs
10231         (Constraints.InterfaceConstraints): New public property.
10232         (Constraints.Types): Make this property public
10233         (TypeParameter): Implement IMemberContainer.
10234         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10235         instead of a TypeBuilder/MethodBuilder; pass the interface
10236         constraints to TypeManager.AddTypeParameter().
10237         (TypeParameter.DefineType): Just take an EmitContext and no
10238         TypeBuilder/MethodBuilder.  Use the new public API.
10239
10240         * typemanager.cs (TypeManager.AddTypeParameter): Added
10241         `TypeExpr[]' argument; add the interfaces to the
10242         `builder_to_ifaces' hash.
10243         (TypeManager.LookupMemberContainer): For
10244         GenericTypeParameterBuilders, get the TypeParameter from the
10245         `builder_to_type_param'.
10246         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10247         the TypeParameter and call FindMembers on it.
10248
10249 2004-04-07  Martin Baulig  <martin@ximian.com>
10250
10251         * class.cs
10252         (MethodCore.GenericMethod): Moved this field here from Method.
10253         (MethodCore.IsDuplicateImplementation): Take the number of type
10254         parameters into account if we're a generic method.
10255
10256         * expression.cs (Invocation.InferTypeArguments): Don't return true
10257         if `arguments' is null; we still need to check whether we actually
10258         don't need to infer anything in this case.
10259         (MemberAccess): Merged the functionality from GenericMemberAccess
10260         into this class.
10261
10262         * generic.cs (GenericMemberAccess): Removed.
10263
10264 2004-04-05  Martin Baulig  <martin@ximian.com>
10265
10266         * decl.cs (MemberCore): For generic classes, interfaces and
10267         structs, `Name' now includes the number of type parameters
10268         ("Stack!1.Node!1").
10269         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10270         encode the number of type arguments in the type name.
10271
10272         * expression.cs (Expression.MemberLookup): Removed the
10273         `num_type_args' argument; we now encode the number of type
10274         arguments in the type name.
10275
10276         * ecore.cs (SimpleName): Encode the number of type arguments in
10277         the type name itself.
10278
10279         * generic.cs (ConstructedType): Likewise.
10280
10281         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10282         `MemberName'; we now include the number of type parameters in the
10283         type name.
10284
10285         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10286         (TypeManager.MemberLookup): Removed the
10287         `num_type_args' argument; we now encode the number of type
10288         arguments in the type name.     
10289
10290 2004-04-03  Martin Baulig  <martin@ximian.com>
10291
10292         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10293         (MemberCore.MemberName): Moved here from MemberBase.
10294         (DeclSpace.SetParameterInfo): Just take the constraints as an
10295         ArrayList; we already have the type parameters in our
10296         `MemberName'; also do the CS0080 reporting here.
10297
10298         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10299         `IDENTIFIER opt_type_parameter_list'; when constructing our
10300         `MemberName', it'll already include our type parameters.
10301         (class_declaration, interface_declaration): Likewise.
10302         (delegate_declaration): Likewise.
10303         (MakeName): Take a MemberName and return a MemberName.
10304         The following two changes are required to avoid shift/reduce conflicts:
10305         (member_name): Don't include a TypeName anymore; ie. this is now
10306         just 'IDENTIFIER opt_type_parameter_list'.
10307         (property_declaration, event_declaration): Use a
10308         `namespace_or_type_name' instead of a `member_name'.            
10309
10310 2004-04-03  Martin Baulig  <martin@ximian.com>
10311
10312         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10313         `MemberName' class.
10314         (TypeName): Formerly known as MemberName.
10315
10316         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10317         instead of a `MemberName'.
10318
10319         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10320         (member_name): New rule; create a MemberName.
10321
10322 2004-04-02  Martin Baulig  <martin@ximian.com>
10323
10324         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10325         (CS0305 and CS0308).
10326
10327 2004-04-02  Martin Baulig  <martin@ximian.com>
10328
10329         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10330         support for nested types.
10331
10332 2004-04-02  Martin Baulig  <martin@ximian.com>
10333
10334         * ecore.cs (IAlias): New public interface.
10335         (TypeExpr, TypeExpression): Implement IAlias.
10336         (TypeAliasExpression): New public class.
10337
10338         * namespace.cs (Namespace): Implement IAlias.
10339         (Namespace.Lookup): Return an IAlias instead on an object.
10340         (Namespace.DefineName): Take an IAlias instead of an object.
10341         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10342         an object.
10343         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10344         Expression.
10345         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10346         object.
10347         (NamespaceEntry.Lookup): Likewise.
10348
10349         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10350         instead of a Type.      
10351
10352         * decl.cs (DeclSpace): Implement IAlias.
10353         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10354
10355         * generic.cs (ConstructedType): Improved error checking.
10356
10357 2004-04-02  Martin Baulig  <martin@ximian.com>
10358
10359         * convert.cs: Added type parameter conversions.
10360
10361         * ecore.cs
10362         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10363         (ClassCast.Emit): If the source type is a type parameter, box it.
10364         If the target type is a type parameter, emit an `unbox.any'
10365         instead of a `classcast'.1      
10366
10367 2004-04-01  Martin Baulig  <martin@ximian.com>
10368
10369         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10370
10371 2004-04-01  Martin Baulig  <martin@ximian.com>
10372
10373         * generic.cs (ConstructedType.CheckConstraints): Use
10374         Convert.ImplicitStandardConversionExists(); user-defined implicit
10375         conversions are not allowed according to the spec.
10376
10377 2004-03-30  Martin Baulig  <martin@ximian.com>
10378
10379         * expression.cs (New): Added support for type parameters.
10380
10381         * typemanager.cs
10382         (TypeManager.activator_type): New public static field.
10383         (TypeManager.activator_create_instance): Likewise.
10384
10385 2004-03-30  Martin Baulig  <martin@ximian.com>
10386
10387         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10388         public method.
10389
10390 2004-03-30  Martin Baulig  <martin@ximian.com>
10391
10392         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10393         the spec here: the argument type must be convertible to the
10394         constraints.
10395
10396 2004-03-30  Martin Baulig  <martin@ximian.com>
10397
10398         * generic.cs
10399         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10400         TypeManager.AddTypeParameter().
10401         (ConstructedType.CheckConstraints): Re-enable this and actually
10402         check whether we have a constructor constraint.
10403
10404         * typemanager.cs
10405         (TypeManager.builder_to_type_param): New static field.
10406         (TypeManager.AddTypeParameter): New static method.
10407         (TypeManager.LookupTypeParameter): New public method.
10408
10409 2004-03-30  Martin Baulig  <martin@ximian.com>
10410
10411         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10412         the new API to actually define the constructor constraint.
10413
10414         * typemanager.cs
10415         (TypeManager.new_constraint_attr_type): New static field.
10416         (TypeManager.InitCoreTypes): Initialize it.
10417
10418 2004-03-30  Martin Baulig  <martin@ximian.com>
10419
10420         * generic.cs (Constraints): Completed error checking, use correct
10421         error numbers.
10422
10423 2004-03-29  Martin Baulig  <martin@ximian.com>
10424
10425         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10426
10427         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10428         public version which takes a `ParameterData pd' instead of an
10429         `ArrayList args'.
10430
10431 2004-03-29  Martin Baulig  <martin@ximian.com>
10432
10433         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10434         not a MethodInfo.       
10435
10436 2004-03-29  Martin Baulig  <martin@ximian.com>
10437
10438         * expression.cs (Argument.ResolveMethodGroup): If we're a
10439         ConstructedType, call GetMemberAccess() on it.  
10440
10441 2004-03-29  Martin Baulig  <martin@ximian.com>
10442
10443         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10444         (MethodCore.CheckGenericOverride): When overriding a generic
10445         method, check whether the constraints match.
10446
10447         * support.cs (GenericConstraints): New public interface.
10448         (ParameterData.GenericConstraints): New public method.
10449
10450         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10451         method parameter and compute our constraints if appropriate.
10452         (Parameter.GenericConstraints): New public property.
10453
10454         * generic.cs (Constraints): Implement GenericConstraints.
10455
10456 2004-03-29  Martin Baulig  <martin@ximian.com>
10457
10458         * decl.cs (MemberCache.FindMemberToOverride): Use
10459         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10460
10461 2004-03-29  Martin Baulig  <martin@ximian.com>
10462
10463         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10464
10465 2004-03-29  Martin Baulig  <martin@ximian.com>
10466
10467         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10468         not allowed on non-generic declarations").
10469
10470 2004-03-29  Martin Baulig  <martin@ximian.com>
10471
10472         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10473         public version of this method.
10474
10475         * class.cs (MethodCore.IsDuplicateImplementation): Use
10476         Invocation.InferTypeArguments() to check this.
10477
10478 2004-03-29  Martin Baulig  <martin@ximian.com>
10479
10480         * convert.cs: Use TypeManager.IsDelegateType() instead of
10481         comparing types correctly.
10482
10483 2004-03-29  Martin Baulig  <martin@ximian.com>
10484
10485         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10486         types directly to make it work for generic instances.
10487
10488         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10489
10490 2004-03-29  Martin Baulig  <martin@ximian.com>
10491
10492         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10493         support for arrays.     
10494
10495 2004-03-24  Martin Baulig  <martin@ximian.com>
10496
10497         * decl.cs (DeclSpace.FindType): Also use
10498         TypeManager.CheckGeneric() for types from the using clauses.
10499
10500 2004-03-23  Martin Baulig  <martin@ximian.com>
10501
10502         * expression.cs (Invocation.OverloadResolve): Added `bool
10503         may_fail' argument and use it instead of the Location.IsNull() hack.
10504
10505 2004-03-23  Martin Baulig  <martin@ximian.com>
10506
10507         * expression.cs (Invocation.InferType): Use correct type inference
10508         rules here.     
10509
10510 2004-03-23  Martin Baulig  <martin@ximian.com>
10511
10512         * ecore.cs (MethodGroupExpr.Name): Use
10513         TypeManager.CSharpSignature() instead of just the name.
10514
10515         * expression.cs (Invocation.OverloadResolve): Provide better error
10516         reporting.
10517         (Invocation.DoResolve): OverloadResolve() never returns null
10518         without reporting an error, so removed the error -6 reporting here.
10519
10520 2004-03-23  Martin Baulig  <martin@ximian.com>
10521
10522         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10523         generic methods.
10524
10525         * cs-parser.jay (delegate_declaration): Support generic delegates.
10526
10527         * delegate.cs: Support generic delegates.
10528
10529 2004-03-22  Martin Baulig  <martin@ximian.com>
10530
10531         * expression.cs (Invocation.InferParamsTypeArguments): New static
10532         method; does type inference for params arguments.
10533
10534 2004-03-21  Martin Baulig  <martin@ximian.com>
10535
10536         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10537         method; checks whether a method is a generic method.    
10538
10539         * expression.cs (Invocation.InferTypeArguments): New static method;
10540         infer type arguments for generic method invocation.
10541
10542         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10543         property; we set this to true if we're resolving a generic method
10544         invocation and the user specified type arguments, ie. we're not
10545         doing type inference.
10546
10547 2004-03-20  Martin Baulig  <martin@ximian.com>
10548
10549         * class.cs (MethodData.DeclaringType): New public property.
10550         (MethodData.Define): Set DeclaringType here.
10551         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10552         instead of OperatorMethodBuilder.DeclaringType.
10553
10554 2004-03-20  Martin Baulig  <martin@ximian.com>
10555
10556         * cs-tokenizer.cs (xtoken): Return a special
10557         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10558
10559         * cs-parser.jay (default_value_expression): Switch to the new
10560         syntax (14.5.13).
10561
10562 2004-03-19  Martin Baulig  <martin@ximian.com>
10563
10564         * decl.cs (MemberName): New class.  We use this to "construct"
10565         namespace_or_type_name's.
10566
10567         * generics.cs (TypeArguments.GetDeclarations): New public method;
10568         returns the type arguments as a string[] and reports a CS0081 if
10569         one of them is not an identifier.
10570
10571         * class.cs (MemberBase): The .ctor now takes the name as a
10572         MemberName instead of a string.
10573         (MemberBase.ExplicitInterfaceName): Changed type from string to
10574         Expression.
10575         (MemberBase.DoDefine): If we're an explicit implementation, the
10576         InterfaceType may be a generic instance.
10577
10578         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10579         (namespace_name): Call MemberName.GetName () to transform the
10580         MemberName into a string and ensure we don't have any type
10581         arguments.
10582         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10583         MemberName into an expression.
10584         (method_header): Use namespace_or_type_name instead of member_name.     
10585
10586 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10587
10588         * rootcontext.cs: Add new types to the boot resolution.
10589
10590         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10591         MulticastDelegate is not allowed.
10592
10593         * typemanager.cs: Add new types to lookup: System.TypedReference
10594         and ArgIterator.
10595
10596         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10597         check for TypedReference or ArgIterator, they are not allowed. 
10598
10599         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10600         makes us properly catch 1510 in some conditions (see bug 56016 for
10601         details). 
10602
10603 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10604
10605         * CryptoConvert.cs: update from corlib version
10606         with endian fixes.
10607
10608 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10609
10610         * class.cs (Indexer.Define): Check indexername declaration
10611
10612 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10613
10614         * attribute.cs (IsClsCompliant): Fixed problem with handling
10615         all three states (compliant, not-compliant, undetected).
10616
10617 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10618
10619         * attribute.cs (Attribute): Location is now public.
10620         (Resolve): Store resolved arguments (pos_values) in attribute class.
10621         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10622         (GetClsCompliantAttributeValue): New method that gets
10623         CLSCompliantAttribute value.
10624         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10625         if exists else null.
10626         (AttributeTester): New class for CLS-Compliant verification routines.
10627
10628         * class.cs (Emit): Add CLS-Compliant verification.
10629         (Method.GetSignatureForError): Implemented.
10630         (Constructor.GetSignatureForError): Implemented
10631         (Constructor.HasCompliantArgs): Returns if constructor has
10632         CLS-Compliant arguments.
10633         (Constructor.Emit): Override.
10634         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10635         is needed to test only parameters.
10636         (FieldBase.GetSignatureForError): Implemented.
10637         (TypeContainer): New member for storing base interfaces.
10638         (TypeContainer.FindMembers): Search in base interfaces too.
10639
10640         * codegen.cs (GetClsComplianceAttribute): New method that gets
10641         assembly or module CLSCompliantAttribute value.
10642         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10643         for assembly.
10644         (ModuleClass.Emit): Add error 3012 test.
10645
10646         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10647
10648         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10649         state for all decl types.
10650         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10651         if CLS-Compliant tests are required.
10652         (IsClsCompliaceRequired): New method. Analyze whether code
10653         must be CLS-Compliant.
10654         (IsExposedFromAssembly): New method. Returns true when MemberCore
10655         is exposed from assembly.
10656         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10657         value or gets cached value.
10658         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10659         is explicitly marked with CLSCompliantAttribute.
10660         (IsIdentifierClsCompliant): New abstract method. This method is
10661         used to testing error 3005.
10662         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10663         for identifier and parameters CLS-Compliant testing.
10664         (VerifyClsCompliance): New method. The main virtual method for
10665         CLS-Compliant verifications.
10666         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10667         null. I don't know why is null (too many public members !).
10668         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10669         and get value of first CLSCompliantAttribute that found.
10670
10671         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10672         (VerifyClsCompliance): Override and add extra tests.
10673
10674         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10675         clscheck- disable CLS-Compliant verification event if assembly is has
10676         CLSCompliantAttribute(true).
10677
10678         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10679         ApllyAttribute is now called in emit section as in the other cases.
10680         Possible future Emit integration.
10681         (IsIdentifierClsCompliant): New override.
10682         (VerifyClsCompliance): New override.
10683         (GetEnumeratorName): Returns full enum name.
10684
10685         * parameter.cs (GetSignatureForError): Implemented.
10686
10687         * report.cs (WarningData): New struct for Warning message information.
10688         (LocationOfPreviousError): New method.
10689         (Warning): New method. Reports warning based on the warning table.
10690         (Error_T): New method. Reports error based on the error table.
10691
10692         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10693         verifications are done here.
10694
10695         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10696
10697         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10698         CLSCompliantAttribute.
10699         (all_imported_types): New member holds all imported types from other
10700         assemblies.
10701         (LoadAllImportedTypes): New method fills static table with exported types
10702         from all referenced assemblies.
10703         (Modules): New property returns all assembly modules.
10704
10705 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10706
10707         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10708         throwing a parser error.
10709
10710         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10711         which removes the hardcoded get_/set_ prefixes for properties, as
10712         IL allows for the properties to be named something else.  
10713
10714         Bug #56013
10715
10716         * expression.cs: Do not override operand before we know if it is
10717         non-null.  Fix 56207
10718
10719 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10720
10721         * typemanager.cs: support for pinned variables.
10722
10723 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10724
10725         * decl.cs, typemanager.cs: Avoid using an arraylist
10726         as a buffer if there is only one result set.
10727
10728 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10729
10730         * expression.cs: Make sure you cant call a static method
10731         with an instance expression, bug #56174.
10732
10733 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10734
10735         * class.cs (IsDuplicateImplementation): Improve error reporting to
10736         flag 663 (method only differs in parameter modifier).
10737
10738         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10739         in preprocessor directives.
10740
10741         * location.cs (LookupFile): Allow for the empty path.
10742
10743         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10744         better approach for some of that patch, but its failing with the
10745         CharSet enumeration.  For now try/catch will do.
10746
10747         * typemanager.cs: Do not crash if a struct does not have fields.
10748         Fixes 56150.
10749
10750 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10751
10752         * expression.cs: cs0213, cant fix a fixed expression.
10753         fixes 50231.
10754
10755 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10756
10757         * cs-parser.jay: detect invalid embeded statements gracefully.
10758         bug #51113.
10759
10760 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10761
10762         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10763         As a regex:
10764         s/
10765         the invocation type may not be a subclass of the tye of the item/
10766         The type of the item must be a subclass of the invocation item.
10767         /g
10768
10769         Fixes bug #50820.
10770
10771 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10772
10773         * attribute.cs: Added methods to get a string and a bool from an
10774         attribute. Required to information from AssemblyKeyFileAttribute,
10775         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10776         * codegen.cs: Modified AssemblyName creation to include support for
10777         strongnames. Catch additional exceptions to report them as CS1548.
10778         * compiler.csproj: Updated include CryptoConvert.cs.
10779         * compiler.csproj.user: Removed file - user specific configuration.
10780         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10781         Mono.Security assembly. The original class is maintained and tested in
10782         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10783         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10784         like CSC 8.0 (C# v2) supports.
10785         * Makefile: Added CryptoConvert.cs to mcs sources.
10786         * rootcontext.cs: Added new options for strongnames.
10787
10788 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10789
10790         * driver.cs: For --expect-error, report error code `2'
10791         if the program compiled with no errors, error code `1' if
10792         it compiled with an error other than the one expected.
10793
10794 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10795
10796         * compiler.csproj: Updated for Visual Studio .NET 2003.
10797         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10798         * compiler.sln: Updated for Visual Studio .NET 2003.
10799
10800 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10801
10802         * expression.cs: Fix bug #47234. We basically need to apply the
10803         rule that we prefer the conversion of null to a reference type
10804         when faced with a conversion to 'object' (csc behaviour).
10805
10806 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10807
10808         * statement.cs: Shorter form for foreach, eliminates
10809         a local variable. r=Martin.
10810
10811 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10812
10813         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10814         checks if we can use brtrue/brfalse to test for 0.
10815         * expression.cs: use the above in the test for using brtrue/brfalse.
10816         cleanup code a bit.
10817
10818 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10819
10820         * expression.cs: Rewrite string concat stuff. Benefits:
10821
10822         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10823         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10824         rather than a concat chain.
10825
10826         * typemanager.cs: Add lookups for more concat overloads.
10827
10828 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10829
10830         * expression.cs: Emit shorter il code for array init.
10831
10832         newarr
10833         dup
10834         // set 1
10835
10836         // set 2
10837
10838         newarr
10839         stloc.x
10840
10841         ldloc.x
10842         // set 1
10843
10844         ldloc.x
10845         // set 2
10846
10847 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10848
10849         * statement.cs: Before, two switch blocks would be merged if the
10850         total size of the blocks (end_item - begin_item + 1) was less than
10851         two times the combined sizes of the blocks.
10852
10853         Now, it will only merge if after the merge at least half of the
10854         slots are filled.
10855
10856         fixes 55885.
10857
10858 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10859
10860         * class.cs : csc build fix for GetMethods(). See bug #52503.
10861
10862 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10863
10864         * expression.cs: Make sure fp comparisons work with NaN.
10865         This fixes bug #54303. Mig approved this patch a long
10866         time ago, but we were not able to test b/c the runtime
10867         had a related bug.
10868
10869 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10870
10871         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10872
10873 2004-03-19  Martin Baulig  <martin@ximian.com>
10874
10875         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10876         two overloads may unify for some type parameter substitutions and
10877         report a CS0408 if appropriate.
10878
10879 2004-03-19  Martin Baulig  <martin@ximian.com>
10880
10881         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10882         error here and not in our caller.
10883
10884 2004-03-19  Martin Baulig  <martin@ximian.com>
10885
10886         * interface.cs: Completely killed this file.
10887         (Interface): We're now a TypeContainer and live in class.cs.
10888
10889         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10890         argument; we're now also called for interfaces.
10891         (TypeContainer.DefineMembers): Allow this method being called
10892         multiple times.
10893         (TypeContainer.GetMethods): New public method; formerly known as
10894         Interface.GetMethod().  This is used by PendingImplementation.
10895         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10896         it's now private and non-static.
10897         (Interface): Moved this here; it's now implemented similar to
10898         Class and Struct.
10899         (Method, Property, Event, Indexer): Added `bool is_interface'
10900         argument to their .ctor's.
10901         (MemberBase.IsInterface): New public field.
10902
10903         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10904         instances instead of InterfaceMethod, InterfaceProperty, etc.
10905         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10906         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10907
10908 2004-03-19  Martin Baulig  <martin@ximian.com>
10909
10910         * class.cs (MethodCore.IsDuplicateImplementation): New private
10911         method which does the CS0111 checking.
10912         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10913         Use IsDuplicateImplementation().
10914
10915 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10916
10917         * decl.cs (FindMemberToOverride): New method to find the correct
10918         method or property to override in the base class.
10919         * class.cs
10920             - Make Method/Property use the above method to find the
10921               version in the base class.
10922             - Remove the InheritableMemberSignatureCompare as it is now
10923               dead code.
10924
10925         This patch makes large code bases much faster to compile, as it is
10926         O(n) rather than O(n^2) to do this validation.
10927
10928         Also, it fixes bug 52458 which is that nested classes are not
10929         taken into account when finding the base class member.
10930
10931         Reviewed/Approved by Martin.
10932
10933 2004-03-17  Martin Baulig  <martin@ximian.com>
10934
10935         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10936         of type arguments into account; use the `real_num_type_args'
10937         approach like in DoResolveAsTypeStep().
10938
10939         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10940         nested types.
10941
10942 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10943
10944         * interface.cs: In all interface classes removed redundant
10945         member initialization.
10946
10947 2004-03-16  Martin Baulig  <martin@ximian.com>
10948
10949         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10950
10951 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10952
10953         * decl.cs (DefineTypeAndParents): New helper method to define a
10954         type's containers before the type itself is defined;  This is a
10955         bug exposed by the recent changes to Windows.Forms when an
10956         implemented interface was defined inside a class that had not been
10957         built yet.   
10958
10959         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10960
10961         (Check): Loop correctly to report errors modifiers
10962         (UNSAFE was not in the loop, since it was the same as TOP).
10963
10964         * interface.cs: Every interface member now takes a ModFlags,
10965         instead of a "is_new" bool, which we set on the base MemberCore. 
10966
10967         Every place where we called "UnsafeOk" in the interface, now we
10968         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10969         the unsafe settings from the member declaration instead of the
10970         container interface. 
10971
10972         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10973
10974         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10975         `set_indexer_name' to the pending bits (one per type).
10976
10977         We fixed a bug today that was picking the wrong method to
10978         override, since for properties the existing InterfaceMethod code
10979         basically ignored the method name.  Now we make sure that the
10980         method name is one of the valid indexer names.
10981
10982 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10983  
10984         * support.cs (SeekableStreamReader): Keep track of stream byte
10985         positions and don't mix them with character offsets to the buffer.
10986
10987         Patch from Gustavo Giráldez
10988
10989 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10990
10991         * interface.cs (InterfaceSetGetBase): Removed double member
10992         initialization, base class does it as well.
10993
10994 2004-03-13  Martin Baulig  <martin@ximian.com>
10995
10996         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10997         when compiling corlib.
10998
10999 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11000
11001         * convert.cs (ExplicitConversion): We were reporting an error on
11002         certain conversions (object_type source to a value type, when the
11003         expression was `null') before we had a chance to pass it through
11004         the user defined conversions.
11005
11006         * driver.cs: Replace / and \ in resource specifications to dots.
11007         Fixes 50752
11008
11009         * class.cs: Add check for duplicate operators.  Fixes 52477
11010
11011 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11012
11013         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11014         that are in the middle of the statements, not only at the end.
11015         Fixes #54987
11016
11017         * class.cs (TypeContainer.AddField): No longer set the
11018         `HaveStaticConstructor' flag, now we call it
11019         `UserDefineStaticConstructor' to diferentiate the slightly
11020         semantic difference.
11021
11022         The situation is that we were not adding BeforeFieldInit (from
11023         Modifiers.TypeAttr) to classes that could have it.
11024         BeforeFieldInit should be set to classes that have no static
11025         constructor. 
11026
11027         See:
11028
11029         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11030
11031         And most importantly Zoltan's comment:
11032
11033         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11034
11035         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11036          before its static fields are used', i.e. initialization does not need
11037          to be triggered by the first access to the type. Setting this flag
11038          helps the JIT to compile better code, since it can run the static
11039          constructor at JIT time, and does not need to generate code to call it
11040          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11041          this flag for lots of classes like String. 
11042          
11043          csc sets this flag if the type does not have an explicit static 
11044          constructor. The reasoning seems to be that if there are only static
11045          initalizers for a type, and no static constructor, then the programmer
11046          does not care when this initialization happens, so beforefieldinit
11047          can be used.
11048          
11049          This bug prevents the AOT compiler from being usable, since it 
11050          generates so many calls to mono_runtime_class_init that the AOT code
11051          is much slower than the JITted code. The JITted code is faster, 
11052          because it does not generate these calls if the vtable is type is
11053          already initialized, which is true in the majority of cases. But the
11054          AOT compiler can't do this."
11055
11056 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11057
11058         * class.cs (MethodData.Emit): Refactor the code so symbolic
11059         information is generated for destructors;  For some reasons we
11060         were taking a code path that did not generate symbolic information
11061         before. 
11062
11063 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11064
11065         * class.cs: Create a Constructor.CheckBase method that
11066         takes care of all validation type code. The method
11067         contains some code that was moved from Define.
11068
11069         It also includes new code that checks for duplicate ctors.
11070         This fixes bug #55148.
11071
11072 2004-03-09  Joshua Tauberer <tauberer@for.net>
11073
11074         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11075         a { ... }-style array creation invokes EmitStaticInitializers
11076         which is not good for reference-type arrays.  String, decimal
11077         and now null constants (NullCast) are not counted toward
11078         static initializers.
11079
11080 2004-03-05  Martin Baulig  <martin@ximian.com>
11081
11082         * location.cs (SourceFile.HasLineDirective): New public field;
11083         specifies whether the file contains or is referenced by a "#line"
11084         directive.
11085         (Location.DefineSymbolDocuments): Ignore source files which
11086         either contain or are referenced by a "#line" directive.        
11087
11088 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11089
11090         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11091         direct access to our parent, so check the method inline there.
11092
11093 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11094
11095         * expression.cs (Invocation.EmitCall): Miguel's last commit
11096         caused a regression. If you had:
11097
11098             T t = null;
11099             t.Foo ();
11100
11101         In Foo the implict this would be null.
11102
11103 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11104
11105         * expression.cs (Invocation.EmitCall): If the method is not
11106         virtual, do not emit a CallVirt to it, use Call.
11107
11108         * typemanager.cs (GetFullNameSignature): Improve the method to
11109         cope with ".ctor" and replace it with the type name.
11110
11111         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11112         as an argument the ConstructorBuilder where it is being defined,
11113         to catch the recursive constructor invocations.
11114
11115 2004-03-16  Martin Baulig  <martin@ximian.com>
11116
11117         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11118         ConstructedType, call ResolveType() on it to get the type rather
11119         than just using `expr.Type'.
11120
11121 2004-03-16  Martin Baulig  <martin@ximian.com>
11122
11123         * generics.cs (ConstructedType.GetMemberAccess): Take the
11124         EmitContext instead on the TypeExpr and use
11125         ec.TypeContainer.CurrentType/ec.ContainerType.
11126
11127 2004-03-16  Martin Baulig  <martin@ximian.com>
11128
11129         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11130         parameters before aliases.
11131
11132 2004-03-16  Martin Baulig  <martin@ximian.com>
11133
11134         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11135         New oublic function; checks whether two generic instances may become
11136         equal under some instantiations (26.3.1).
11137
11138         * class.cs (TypeContainer.Define): Call
11139         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11140         error.
11141
11142 2004-03-16  Martin Baulig  <martin@ximian.com>
11143
11144         * class.cs (TypeContainer.GetClassBases): Moved
11145         Error_TypeParameterAsBase() here and also check whether the base
11146         class is not an attribute.
11147
11148 2004-03-16  Martin Baulig  <martin@ximian.com>
11149
11150         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11151
11152 2004-03-16  Martin Baulig  <martin@ximian.com>
11153
11154         * class.cs (Error_TypeParameterAsBase): Use correct error number
11155         here (CS0689).  
11156
11157 2004-03-16  Martin Baulig  <martin@ximian.com>
11158
11159         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11160         for generics.
11161
11162         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11163         error reporting.
11164
11165 2004-03-15  Martin Baulig  <martin@ximian.com>
11166
11167         * typemanager.cs (TypeManager.GetFullName): New public method.
11168         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11169         argument; only return members with the correct number of type
11170         arguments.
11171         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11172         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11173         whether the number of type arguments matches.
11174
11175         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11176         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11177
11178         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11179         field; it's set by the protected .ctor when we're actually a
11180         GenericMemberAccess.
11181         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11182         arguments and pass it to MemberLookupFinal ().
11183
11184         * ecore.cs (Expression.MemberLookup): Added `int
11185         num_type_arguments' argument; only return members with the correct
11186         number of type arguments.
11187         (Expression.MemberLookupFailed): Check whether the MemberLookup
11188         failed because we did not have the correct number of type
11189         arguments; report CS0305 in this case.
11190
11191         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11192         `e.ResolveAsTypeTerminal()' already did so.
11193
11194 2004-03-15  Martin Baulig  <martin@ximian.com>
11195
11196         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11197         we're a ConstructedType; in this case, the caller must report an
11198         error (for instance CS0131).
11199
11200         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11201         (TypeArguments.Resolve): Actually report errors here.
11202
11203 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11204
11205         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11206         `set_indexer_name' to the pending bits (one per type).
11207
11208         We fixed a bug today that was picking the wrong method to
11209         override, since for properties the existing InterfaceMethod code
11210         basically ignored the method name.  Now we make sure that the
11211         method name is one of the valid indexer names.
11212
11213 2004-03-15  Martin Baulig  <martin@ximian.com>
11214
11215         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11216         for generic instances.
11217
11218 2004-03-13  Martin Baulig  <martin@ximian.com>
11219
11220         * class.cs (TypeContainer.DefineType): Call
11221         TypeManager.AddUserType() immediately after creating the
11222         TypeBuilder; pass all type parameters when creating the
11223         CurrentType.
11224
11225         * decl.cs (DeclSpace.FindNestedType): New public method.
11226         (DeclSpace.FindType): Added `int num_type_args' argument; only
11227         return types with the correct number of type parameters.
11228         (DeclSpace.CountTypeParams): New public property.
11229
11230         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11231         the number of type parameters; defaults to zero.
11232
11233         * generic.cs (TypeArguments.Count): New public property.
11234         (ConstructedType.DoResolveAsTypeStep): First call
11235         ds.FindNestedType() to find out whether we're nested in the
11236         current generic type; in this case, we inherit all type parameters
11237         from the current class.
11238
11239         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11240         num_type_args' argument.
11241         (RootContext.LookupType): Added overloaded version which takes the
11242         number of type arguments; only return types with the correct
11243         number of type arguments.
11244
11245         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11246         checks whether `Type t' has `int num_type_args'.
11247
11248 2004-03-13  Martin Baulig  <martin@ximian.com>
11249
11250         * generic.cs (GenericMethod.DefineType): New method; calls
11251         DefineType() on all the type parameters.
11252
11253         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11254         (MethodData.Define): If we're a generic method, call
11255         GenericMethod.DefineType() to define the type parameters.       
11256
11257 2004-03-10  Martin Baulig  <martin@ximian.com>
11258
11259         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11260         instead of IsAssignableFrom.    
11261
11262 2004-03-10  Martin Baulig  <martin@ximian.com>
11263
11264         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11265
11266         * support.cs (ParameterData.HasArrayParameter): New property.
11267         (ReflectionParameters.ctor): Take a MethodBase instead of a
11268         ParameterInfo[].  If we have any type parameters, get the generic
11269         method definition and ask it whether we have variable arguments.
11270
11271 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11274         routines to check if a type is an enumerable/enumerator allow
11275         classes that implement the IEnumerable or IEnumerator interfaces.
11276
11277         * class.cs (Property, Operator): Implement IIteratorContainer, and
11278         implement SetYields.
11279
11280         (Property.Define): Do the block swapping for get_methods in the
11281         context of iterators.   We need to check if Properties also
11282         include indexers or not.
11283
11284         (Operator): Assign the Block before invoking the
11285         OperatorMethod.Define, so we can trigger the Iterator code
11286         replacement. 
11287
11288         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11289         Property and Operator classes are not created when we parse the
11290         declarator but until we have the block completed, so we use a
11291         singleton SimpleIteratorContainer.Simple to flag whether the
11292         SetYields has been invoked.
11293
11294         We propagate this setting then to the Property or the Operator to
11295         allow the `yield' to function.
11296
11297 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11298
11299         * codegen.cs: Implemented attribute support for modules.
11300         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11301         Assembly/Module functionality.
11302
11303         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11304         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11305         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11306
11307 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11308
11309         * interface.cs (FindMembers): The operation is performed on all base
11310         interfaces and not only on the first. It is required for future CLS Compliance patch.
11311
11312 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11313
11314         * statement.cs, codegen.cs:
11315         This patch deals with patterns such as:
11316
11317         public class List : IEnumerable {
11318
11319                 public MyEnumerator GetEnumerator () {
11320                         return new MyEnumerator(this);
11321                 }
11322
11323                 IEnumerator IEnumerable.GetEnumerator () {
11324                         ...
11325                 }
11326                 
11327                 public struct MyEnumerator : IEnumerator {
11328                         ...
11329                 }
11330         }
11331
11332         Before, there were a few things we did wrong:
11333         1) we would emit callvirt on a struct, which is illegal
11334         2) we emited ldarg when we needed to emit ldarga
11335         3) we would mistakenly call the interface methods on an enumerator
11336         type that derived from IEnumerator and was in another assembly. For example:
11337
11338         public class MyEnumerator : IEnumerator
11339
11340         Would have the interface methods called, even if there were public impls of the
11341         method. In a struct, this lead to invalid IL code.
11342
11343 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11344
11345         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11346           renamed to Emit.
11347
11348         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11349
11350 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11351
11352         * cs-parser.jay: Fix small regression: we were not testing V2
11353         compiler features correctly.
11354
11355         * interface.cs: If the emit context is null, then create one
11356
11357 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11358
11359         * decl.cs (GetSignatureForError): New virtual method to get full name
11360           for error messages.
11361
11362         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11363           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11364
11365         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11366           Duplicated members and code in these classes has been removed.
11367           Better encapsulation in these classes.
11368
11369 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11370
11371         * assign.cs (Assign.DoResolve): When dealing with compound
11372         assignments, there is a new rule in ECMA C# 2.4 (might have been
11373         there before, but it is documented here) that states that in:
11374
11375         a op= b;
11376
11377         If b is of type int, and the `op' is a shift-operator, then the
11378         above is evaluated as:
11379
11380         a = (int) a op b 
11381
11382         * expression.cs (Binary.ResolveOperator): Instead of testing for
11383         int/uint/long/ulong, try to implicitly convert to any of those
11384         types and use that in pointer arithmetic.
11385
11386         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11387         method to print information for from the type, not from the
11388         null-method we were given.
11389
11390 2004-02-01  Duncan Mak  <duncan@ximian.com>
11391
11392         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11393         parsing for cmd, fixes bug #53694.
11394
11395 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11396
11397         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11398         in the member name duplication tests. Property and operator name duplication
11399         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11400
11401 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11402
11403         * interface.cs (PopulateMethod): Fixed crash when interface method
11404         returns not existing type (error test cs0246-3.cs).
11405
11406 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11407
11408         * cs-parser.jay (interface_accessors): Re-write actions to also
11409         store attributes attached to get and set methods. Fix spelling
11410         while at it.
11411
11412         (inteface_property_declaration): Modify accordingly.
11413
11414         (InterfaceAccessorInfo): New helper class to store information to pass
11415         around between rules that use interface_accessors.
11416
11417         * interface.cs (Emit): Apply attributes on the get and set
11418         accessors of properties and indexers too.
11419
11420         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11421         right MethodBuilder when applying attributes to the get and set accessors.
11422
11423 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11424
11425         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11426
11427 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11428
11429         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11430
11431 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11432
11433         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11434         changes that treat `yield' specially when present before `break'
11435         or `return' tokens.
11436
11437         * cs-tokenizer.cs: yield is no longer a keyword.
11438
11439 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11440
11441         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11442         setting for default constructors.
11443         For default constructors are almost every time set wrong Modifier. The
11444         generated IL code has been alright. But inside mcs this values was
11445         wrong and this was reason why several of my CLS Compliance tests
11446         failed.
11447
11448 2004-02-27  Martin Baulig  <martin@ximian.com>
11449
11450         * generics.cs (ConstructedType.ResolveType): Make the nested type
11451         stuff actually work.
11452
11453 2004-02-25  Martin Baulig  <martin@ximian.com>
11454
11455         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11456         property; returns the type parameters just from the current type,
11457         ie. with the ones from outer classes.
11458         (DeclSpace.LookupGeneric): First search in the current class, then
11459         in outer classes.
11460         (DeclSpace.initialize_type_params): When hiding a type parameter
11461         from an outer class, put it into the `type_param_list' anyways.
11462
11463         * expression.cs (MemberAccess.expr): Made this field protected.
11464
11465         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11466         the type parameters from the current class.
11467
11468         * generic.cs (ConstructedType.ResolveType): Support nested generic
11469         types by taking the type parameters which we inherit from outer
11470         classes into account.
11471         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11472         support for nested generic types.
11473
11474 2004-02-23  Martin Baulig  <martin@ximian.com>
11475
11476         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11477         field and check whether we're nested inside a generic type.
11478         (DeclSpace.ResolveType): If we're resolving to a generic type
11479         definition, create a ConstructedType and return its resolved type.
11480         (DeclSpace.initialize_type_params): New private method;
11481         initializes the `type_param_list' field from the type parameters
11482         from this and all enclosing classes.
11483         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11484         we're already initialized.
11485
11486 2004-02-23  Martin Baulig  <martin@ximian.com>
11487
11488         * class.cs (Method.Define): Create the generic method before
11489         calling DoDefine().
11490         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11491         the TypeContainer one); we use this for generic methods.
11492
11493         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11494         parent's TypeBuilder.
11495
11496 2004-02-18  Martin Baulig  <martin@ximian.com>
11497
11498         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11499         to check for equality.
11500
11501 2004-02-05  Martin Baulig  <martin@ximian.com>
11502
11503         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11504         `ec.TypeContainer.CurrentType', use it instead of
11505         `ec.ContainerType' to check whether we're in the type's ctor.
11506
11507 2004-01-29  Martin Baulig  <martin@ximian.com>
11508
11509         * expression.cs (Invocation.DoResolve): If we're a
11510         `ConstructedType', then we're actually a generic method, so
11511         rewrite the expr as a GenericMemberAccess.
11512
11513         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11514         here; manually parse it into a string.
11515
11516 2004-01-28  Martin Baulig  <martin@ximian.com>
11517
11518         * typemanager.cs (TypeManager.IsEqual): New static method.
11519         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11520         check for equality instead of using `=='.
11521
11522 2004-01-26  Martin Baulig  <martin@ximian.com>
11523
11524         * decl.cs (DeclSpace.CurrentType): New public field.
11525
11526         * expression.cs (This.ResolveBase): If we have an
11527         `ec.TypeContainer.CurrentType', use it instead of
11528         `ec.ContainerType'.
11529
11530         * class.cs (TypeContainer.DefineType): If we're a generic type,
11531         create the `CurrentType' (unresolved).
11532         (TypeContainer.GenericType): New private field.
11533         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11534         it and store it in `GenericType' before creating the MemberCache.
11535         (TypeContainer.GetMembers): If we have a `GenericType', call
11536         TypeManager.FindMembers() on it.
11537
11538         * interface.cs (Interface.GenericType): New private field.
11539         (Interface.DefineType): If we're a generic type, create the
11540         `CurrentType' (unresolved).
11541         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11542         and store it in `GenericType' before creating the MemberCache.
11543         (Interface.GetMembers): If we have a `GenericType', call
11544         TypeManager.FindMembers() on it.
11545
11546 2004-01-22  Martin Baulig  <martin@ximian.com>
11547
11548         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11549         not a QualifiedIdentifier.  This is what `type_name_expression'
11550         was previously doing.
11551         (type_name_expression): Removed; the code is now in
11552         `namespace_or_type_name'.
11553         (qualified_identifier): Removed, use `namespace_or_type_name'
11554         instead.
11555         (QualifiedIdentifier): Removed this class.      
11556
11557 2004-01-22  Martin Baulig  <martin@ximian.com>
11558
11559         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11560         not a string as alias name.
11561
11562 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11563
11564         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11565         #52730 bug, and instead compute correctly the need to use a
11566         temporary variable when requesting an address based on the
11567         static/instace modified of the field and the constructor.
11568  
11569 2004-01-21  Martin Baulig  <martin@ximian.com>
11570
11571         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11572         class and namespace before looking up aliases.  Fixes #52517.
11573
11574 2004-01-21  Martin Baulig  <martin@ximian.com>
11575
11576         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11577         assinged in a 'try'; fixes exception4.cs.
11578
11579 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11580         * class.cs : Implemented parameter-less constructor for TypeContainer
11581
11582         * decl.cs: Attributes are now stored here. New property OptAttributes
11583
11584         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11585
11586         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11587
11588 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11589
11590         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11591           (CSharpSignature): New method for indexer and property signature.
11592
11593 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11594
11595         * pending.cs (IsVirtualFilter): Faster implementation.
11596
11597 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11598
11599         * typemanager.cs: Avoid inclusion of same assembly more than once.
11600
11601 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11602
11603         * cs-parser.jay: Fixed problem where the last assembly attribute
11604           has been applied also to following declaration (class, struct, etc.)
11605           
11606 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11607
11608         * class.cs: Added error CS0538, CS0539 reporting.
11609         Fixed crash on Microsoft runtime when field type is void.
11610
11611         * cs-parser.jay: Added error CS0537 reporting.
11612
11613         * pending.cs: Added error CS0535 reporting.
11614         Improved error report for errors CS0536, CS0534.
11615
11616 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11617
11618         Merge a few bits from the Anonymous Method MCS tree.
11619
11620         * statement.cs (ToplevelBlock): New class for toplevel methods,
11621         will hold anonymous methods, lifted variables.
11622
11623         * cs-parser.jay: Create toplevel blocks for delegates and for
11624         regular blocks of code. 
11625
11626 2004-01-20  Martin Baulig  <martin@ximian.com>
11627
11628         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11629         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11630         and `NeedExplicitReturn'; added `IsLastStatement'.
11631         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11632         have a `ReturnLabel' or we're not unreachable.
11633
11634         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11635         child's reachability; don't just override ours with it.  Fixes
11636         #58058 (lluis's example).
11637         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11638         InFinally(), InLoop(), InSwitch() and
11639         BreakCrossesTryCatchBoundary() methods.
11640
11641         * statement.cs (Return): Do all error checking in Resolve().
11642         Unless we are the last statement in a top-level block, always
11643         create a return label and jump to it.
11644         (Break, Continue): Do all error checking in Resolve(); also make
11645         sure we aren't leaving a `finally'.
11646         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11647         statement in a top-level block.
11648         (Block.Flags): Added `IsDestructor'.
11649         (Block.IsDestructor): New public property.
11650
11651 2004-01-20  Martin Baulig  <martin@ximian.com>
11652
11653         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11654
11655 2004-01-20  Martin Baulig  <martin@ximian.com>
11656
11657         * statement.cs (Statement.ResolveUnreachable): New public method.
11658         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11659         (Block.Resolve): Resolve unreachable statements.
11660
11661 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11662
11663         * expression.cs: We need to fix the case where we do
11664         not have a temp variable here.
11665
11666         * assign.cs: Only expression compound assignments need
11667         temporary variables.
11668
11669 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11670
11671         * flowanalysis.cs: Reduce memory allocation in a few ways:
11672           - A block with no variables should not allocate a bit
11673             vector for itself.
11674           - A method with no out parameters does not need any tracking
11675             for assignment of the parameters, so we need not allocate
11676             any data for it.
11677           - The arrays:
11678                 public readonly Type[] VariableTypes;
11679                 public readonly string[] VariableNames;
11680             Are redundant. The data is already stored in the variable
11681             map, so we need not allocate another array for it.
11682           - We need to add alot of checks for if (params | locals) == null
11683             due to the first two changes.
11684
11685 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11686
11687         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11688         implement IMemoryLocation, we store a copy on a local variable and
11689         take the address of it.  Patch from Benjamin Jemlich
11690
11691         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11692         to use a special "type_name_expression" rule which reduces the
11693         number of "QualifiedIdentifier" classes created, and instead
11694         directly creates MemberAccess expressions.
11695
11696 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11697
11698         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11699         that fixes #52853.  Null literal assignment to ValueType
11700
11701         * class.cs (MethodData.Emit): Instead of checking the name of the
11702         method to determine if its a destructor, create a new derived
11703         class from Method called Destructor, and test for that.  
11704
11705         * cs-parser.jay: Create a Destructor object instead of a Method.  
11706
11707         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11708
11709         Fixes: 52933
11710
11711 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11712
11713         * expression.cs (Binary.ResolveOperator): Perform an implicit
11714         conversion from MethodGroups to their delegate types on the
11715         Addition operation.
11716
11717         * delegate.cs: Introduce a new class DelegateCreation that is the
11718         base class for `NewDelegate' and `ImplicitDelegateCreation',
11719         factor some code in here.
11720
11721         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11722         conversion from MethodGroups to compatible delegate types. 
11723
11724         * ecore.cs (Expression.Resolve): Do not flag error 654
11725         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11726         we allow conversions from MethodGroups to delegate types now.
11727
11728         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11729         assignments in v2 either.
11730
11731 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11732
11733         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11734         static read-only fields in ctors.
11735
11736         Applied patch from Benjamin Jemlich 
11737
11738         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11739
11740 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11741
11742         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11743         here to return true, as they can be used like this:
11744
11745                 (XXX) int.MEMBER ()
11746
11747         Fixed 49836 and all the other dups
11748
11749 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11750
11751         * driver.cs: Implement /win32res and /win32icon.
11752
11753 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * cs-parser.jay: Add a rule to improve error handling for the
11756         common mistake of placing modifiers after the type.
11757
11758 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11759
11760         * cs-parser.jay (interface_event_declaration): Catch
11761         initialization of events on interfaces, and report cs0068
11762
11763         * cs-parser.jay (interface_event_declaration): Catch
11764         initialization of events. 
11765
11766         * ecore.cs: Better report missing constructors.
11767
11768         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11769         the error reporting done in the wrong place.  Fix.
11770
11771         * expression.cs (Binary.ResolveOperator): Catch the 
11772         operator + (E x, E y) error earlier, and later allow for implicit
11773         conversions in operator +/- (E e, U x) from U to the underlying
11774         type of E.
11775
11776         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11777         52596, if the container class is abstract, the default constructor
11778         is protected otherwise its public (before, we were always public).
11779
11780         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11781         fixed statement.
11782
11783         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11784         Jemlich that fixes bug #52597, MCS was generating invalid code for
11785         idisposable structs.   Thanks to Ben for following up with this
11786         bug as well.
11787
11788 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11789
11790         * driver.cs: Allow assemblies without code to be generated, fixes
11791         52230.
11792
11793 2004-01-07  Nick Drochak <ndrochak@gol.com>
11794
11795         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11796
11797 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11798
11799         * cs-parser.jay: Add rules to improve error reporting if fields or
11800         methods are declared at the namespace level (error 116)
11801
11802         * Add rules to catch event add/remove
11803
11804 2004-01-04  David Sheldon <dave-mono@earth.li>
11805
11806   * expression.cs: Added matching ")" to error message for 
11807   CS0077
11808
11809 2004-01-03 Todd Berman <tberman@gentoo.org>
11810
11811         * ecore.cs, attribute.cs:
11812         Applying fix from #52429.
11813
11814 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11815
11816         * ecore.cs, expression.cs, statement.cs:
11817         Total rewrite of how we handle branching. We
11818         now handle complex boolean expressions with fewer
11819         jumps. As well if (x == 0) no longer emits a ceq.
11820
11821         if (x is Foo) is much faster now, because we generate
11822         better code.
11823
11824         Overall, we get a pretty big improvement on our benchmark
11825         tests. The code we generate is smaller and more readable.
11826
11827         I did a full two-stage bootstrap. The patch was reviewed
11828         by Martin and Miguel.
11829
11830 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11831
11832         * cs-parser.jay: Make primary_expression not take a QI.
11833         we dont need this because the member_access rule covers
11834         us here. So we replace the rule with just IDENTIFIER.
11835
11836         This has two good effects. First, we remove a s/r conflict.
11837         Second, we allocate many fewer QualifiedIdentifier objects.
11838
11839 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11840
11841         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11842         set the correct information via SRE. This prevents
11843         hanging on the MS runtime. Fixes #29374.
11844
11845 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11846
11847         * convert.cs: correctly handle conversions to value types
11848         from Enum and ValueType as unboxing conversions.
11849
11850         Fixes bug #52569. Patch by Benjamin Jemlich.
11851
11852 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11853
11854         * expression.cs (BetterConversion): Prefer int -> uint
11855         over int -> ulong (csc's behaviour). This fixed bug #52046.
11856
11857 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11858
11859         * decl.cs (MemberCache.FindMembers): now returns a
11860         MemberInfo [].
11861
11862         * typemanager.cs: In general, go with with ^^.
11863         (CopyNewMethods): take an IList.
11864         (RealMemberLookup): Only allocate an arraylist
11865         if we copy from two sets of methods.
11866
11867         This change basically does two things:
11868         1) Fewer array lists allocated due to CopyNewMethods.
11869         2) the explicit cast in MemberList costed ALOT.
11870
11871 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11872
11873         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11874         a hashtable to avoid needless string allocations when an identifier is
11875         used more than once (the common case).
11876
11877 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11878
11879         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11880         is broken, it will not return anything. So, we
11881         have to use the information we have in mcs to
11882         do the task.
11883
11884         * typemanager.cs: Add a cache for GetInterfaces,
11885         since this will now be used more often (due to ^^)
11886
11887         (GetExplicitInterfaces) New method that gets the
11888         declared, not effective, interfaces on a type
11889         builder (eg, if you have interface IFoo, interface
11890         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11891         { IBar }.
11892
11893         This patch makes MCS able to bootstrap itself on
11894         Windows again.
11895
11896 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11897
11898         * expression.cs: Remove the Nop's that Miguel put
11899         in by mistake.
11900
11901 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11902
11903         * report.cs, codegen.cs: Give the real stack trace to
11904         the error when an exception is thrown.
11905
11906 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11907
11908         * decl.cs: only allocate hashtables for ifaces if 
11909         it is an iface!
11910
11911 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11912
11913         * expression.cs: fix the error from cs0121-2.cs
11914         (a parent interface has two child interfaces that
11915         have a function with the same name and 0 params
11916         and the function is called through the parent).
11917
11918 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11919
11920         * class.cs, rootcontext.cs, typmanager.cs: do not
11921         leak pointers.
11922
11923 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11924
11925         * codegen.cs: remove stack for the ec flow branching.
11926         It is already a linked list, so no need.
11927
11928 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11929
11930         * Makefile: Allow custom profiler here.
11931
11932 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11933
11934         * typemanager.cs (LookupType):
11935           - Use a static char [], because split takes
11936             a param array for args, so it was allocating
11937             every time.
11938           - Do not store true in a hashtable, it boxes.
11939
11940 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11941
11942         * flowanalysis.cs: bytify common enums.
11943
11944 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11945
11946         * modifiers.cs: Add a new set of flags for the
11947         flags allowed on explicit interface impls.
11948         * cs-parser.jay: catch the use of modifiers in
11949         interfaces correctly.
11950         * class.cs: catch private void IFoo.Blah ().
11951
11952         All related to bug #50572.
11953
11954 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11955
11956         * decl.cs: Rewrite the consistant accessability checking.
11957         Accessability is not linear, it must be implemented in
11958         a tableish way. Fixes #49704.
11959
11960 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11961
11962         * expression.cs: Handle negation in a checked context.
11963         We must use subtraction from zero. Fixes #38674.
11964
11965 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11966
11967         * class.cs: Ignore static void main in DLLs.
11968         * rootcontext.cs: Handle the target type here,
11969         since we are have to access it from class.cs
11970         * driver.cs: account for the above.
11971
11972 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11973
11974         * report.cs: Give line numbers and files if available.
11975
11976 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11977
11978         * driver.cs: Implement /addmodule.
11979
11980         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11981         ModuleBuilders.
11982
11983 2003-12-20  Martin Baulig  <martin@ximian.com>
11984
11985         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11986         (FieldBase.IsAssigned): Removed this field.
11987         (FieldBase.SetAssigned): New public method.
11988         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11989
11990 2003-12-20  Martin Baulig  <martin@ximian.com>
11991
11992         * expression.cs (LocalVariableReference.DoResolve): Don't set
11993         `vi.Used' if we're called from DoResolveLValue().
11994
11995         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11996         returns the usage vector it just merged into the current one -
11997         pass this one to UsageWarning().
11998         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11999         of the `EmitContext', don't call this recursively on our children.
12000
12001 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12002
12003         * driver.cs: Implement /target:module.
12004
12005 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12006
12007         * support.cs (CharArrayHashtable): New helper class.
12008
12009         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12010         char arrays, not strings, so we can avoid creating a string in
12011         consume_identifier if the identifier is a keyword.
12012
12013 2003-12-16  Martin Baulig  <martin@ximian.com>
12014
12015         * statement.cs (LocalInfo.Assigned): Removed this property.
12016         (LocalInfo.Flags): Removed `Assigned'.
12017         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12018         and uses flow analysis.
12019         (Block.UsageWarning): Made this method private.
12020         (Block.Resolve): Call UsageWarning() if appropriate.
12021
12022         * expression.cs (LocalVariableReference.DoResolve): Always set
12023         LocalInfo.Used here.
12024
12025 2003-12-13  Martin Baulig  <martin@ximian.com>
12026
12027         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12028         any value here; we're now using flow analysis to figure out
12029         whether a statement/block returns a value.
12030
12031 2003-12-13  Martin Baulig  <martin@ximian.com>
12032
12033         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12034         working again.
12035         (FlowBranching.MergeFinally): Don't call
12036         `branching.CheckOutParameters()' here, this is called in
12037         MergeTopBlock().
12038         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12039         when adding the `finally' vector.       
12040
12041 2003-12-13  Martin Baulig  <martin@ximian.com>
12042
12043         * flowanalysis.cs
12044         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12045         actually work and also fix #48962.
12046
12047 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12048
12049         * decl.cs: Do not check System.Object for nested types,
12050         since we know it does not have any. Big bang for buck:
12051
12052         BEFORE:
12053            Run 1:   8.35 seconds
12054            Run 2:   8.32 seconds
12055            corlib:  17.99 seconds
12056         AFTER:
12057            Run 1:   8.17 seconds
12058            Run 2:   8.17 seconds
12059            corlib:  17.39 seconds
12060
12061 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12062
12063         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12064         time we are returning 0 members, so we save alot here.
12065
12066 2003-12-11  Martin Baulig  <martin@ximian.com>
12067
12068         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12069         `MergeChild()', also just take the `FlowBranching' as argument;
12070         call Merge() on it and return the result.
12071         (FlowBranching.Merge): We don't need to do anything if we just
12072         have one sibling.
12073
12074 2003-12-11  Martin Baulig  <martin@ximian.com>
12075
12076         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12077         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12078         Maurer for this idea.
12079
12080 2003-12-11  Martin Baulig  <martin@ximian.com>
12081
12082         * flowanalysis.cs (MergeResult): This class is now gone; we now
12083         use the `UsageVector' for this.  The reason for this is that if a
12084         branching just has one sibling, we don't need to "merge" them at
12085         all - that's the next step to do.
12086         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12087         `MergeResult'.
12088
12089 2003-12-11  Martin Baulig  <martin@ximian.com>
12090
12091         Reworked flow analyis and made it more precise and bug-free.  The
12092         most important change is that we're now using a special `Reachability'
12093         class instead of having "magic" meanings of `FlowReturns'.  I'll
12094         do some more cleanups and optimizations and also add some more
12095         documentation this week.
12096
12097         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12098         largely reworked this class.
12099         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12100         the new `Reachability' class instead of having "magic" values here.
12101         (FlowBranching): We're now using an instance of `Reachability'
12102         instead of having separate `Returns', `Breaks' etc. fields.
12103
12104         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12105         based on flow analysis; ignore the return value of block.Emit ().
12106
12107 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12108
12109         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12110         if they are private.
12111
12112 2003-12-09  Martin Baulig  <martin@ximian.com>
12113
12114         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12115         call them directly on the UsageVector.
12116
12117 2003-12-09  Martin Baulig  <martin@ximian.com>
12118
12119         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12120         Changed return type from `FlowReturns' to `Reachability'.
12121
12122 2003-12-09  Martin Baulig  <martin@ximian.com>
12123
12124         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12125         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12126         `Reachable' fields with a single `Reachability' one.
12127
12128 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12129
12130         * class.cs (FindMembers): Remove foreach's.
12131
12132         Bootstrap times:
12133
12134         BEFORE
12135                 Run 1:   8.74 seconds
12136                 Run 2:   8.71 seconds
12137
12138         AFTER
12139                 Run 1:   8.64 seconds
12140                 Run 2:   8.58 seconds
12141
12142
12143 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12144
12145         * cs-parser.jay:
12146         * gen-treedump.cs:
12147         * statement.cs:
12148         This patch does a few things:
12149                 1. EmptyStatement is now a singleton, so it is never reallocated.
12150                 2. All blah is EmptyStatement constructs have been changed to
12151                    blah == EmptyStatement.Value, which is much faster and valid
12152                    now that EmptyStatement is a singleton.
12153                 3. When resolving a block, rather than allocating a new array for
12154                    the non-empty statements, empty statements are replaced with
12155                    EmptyStatement.Value
12156                 4. Some recursive functions have been made non-recursive.
12157         Mainly the performance impact is from (3), however (1) and (2) are needed for
12158         this to work. (4) does not make a big difference in normal situations, however
12159         it makes the profile look saner.
12160
12161         Bootstrap times:
12162
12163         BEFORE
12164         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12165         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12166         Total memory allocated: 56397 KB
12167
12168         AFTER
12169         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12170         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12171         Total memory allocated: 55666 KB
12172
12173 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12174
12175         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12176         than the hashtable in a hashtable version
12177
12178         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12179         we always end up concating a string. This results in a huge perf
12180         loss, because many strings have to be tracked by the GC. In this
12181         patch, we first use a hashtable that works with two keys, so that
12182         the strings do not need to be concat'ed.
12183
12184         Bootstrap times:
12185         BEFORE
12186                 Run 1:   8.74 seconds
12187                 Run 2:   8.71 seconds
12188
12189         AFTER
12190                 Run 1:   8.65 seconds
12191                 Run 2:   8.56 seconds
12192
12193 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12194
12195         * Makefile: Add a new target `do-time' that does a quick and simple
12196         profile, leaving easy to parse output.
12197
12198 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12199
12200         * codegen.cs (Init): Create the dynamic assembly with 
12201         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12202
12203 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12204
12205         * support.cs: Make the PtrHashtable use only one
12206         instance of its comparer.
12207
12208 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12209
12210         * typemanager.cs: Fix lookup of GetNamespaces.
12211
12212 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12213
12214         * expression.cs: Removed redundant line.
12215
12216         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12217         ArrayLists, use for loops with bounds.  
12218
12219         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12220         arraylist.
12221
12222         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12223         arraylists, use for loop with bounds.
12224
12225         The above three changes give us a 0.071 second performance
12226         improvement out of 3.294 seconds down to 3.223.  On my machine
12227         the above changes reduced the memory usage by 1,387 KB during
12228         compiler bootstrap.
12229
12230         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12231         QualifiedIdentifiers.  Before we created a new string through
12232         concatenation, and mostly later on, the result would be
12233         manipulated by DecomposeQI through string manipulation.
12234
12235         This reduced the compiler memory usage for bootstrapping from
12236         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12237         compile times in 0.05 seconds.
12238
12239 2003-11-28  Dick Porter  <dick@ximian.com>
12240
12241         * support.cs: Do string compares with the Invariant culture.
12242
12243         * rootcontext.cs: 
12244         * gen-treedump.cs: 
12245         * expression.cs: 
12246         * driver.cs: 
12247         * decl.cs: 
12248         * codegen.cs: 
12249         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12250         the comparison is done with the Invariant culture.
12251
12252 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12255         GetEnumerator method.
12256
12257         (ProbeCollectionType): Iterate starting at the most specific type
12258         upwards looking for a GetEnumerator
12259
12260         * expression.cs: Shift count can be up to 31 for int/uint and 63
12261         for long/ulong.
12262
12263 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12264
12265         * statement.cs (Block.LookupLabel): Also look for the label on the
12266         children blocks.  Use a hash table to keep track of visited
12267         nodes. 
12268
12269         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12270         we actually did transform the other operand, otherwise fall back
12271         to the common codepath that casts to long.
12272
12273         * cs-tokenizer.cs: Use the same code pattern as the int case.
12274         Maybe I should do the parsing myself, and avoid depending on the
12275         Parse routines to get this done.
12276
12277 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12280         which fixes bug 51347.  This time test it.
12281
12282         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12283         attributes for example can not tell the difference between these.
12284         The difference was only a syntax feature of the language. 
12285
12286         * attribute.cs: Apply attributes to delegates.
12287
12288         * delegate.cs: Call the apply attributes method.
12289
12290 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12291
12292         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12293         comparing 0 vs Byte.MinValue, not the value
12294
12295         (ImplicitConversionRequired): When reporting a conversion error,
12296         use error 31 to print out the constant error instead of the
12297         simpler 29.
12298
12299         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12300         which fixes bug 51347.
12301
12302 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12303
12304         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12305         which fixes the -warnaserror command line option.
12306
12307 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12308
12309         * cfold.cs (DoNumericPromotions): During constant folding of
12310         additions on UIntConstant, special case intconstants with
12311         IntConstants like we do on the expression binary operator. 
12312
12313 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12314
12315         * convert.cs (ImplicitReferenceConversion): We were missing a case
12316         (System.Enum are not value types or class types, so we need to
12317         classify them separatedly).
12318
12319         * driver.cs: We do not support error 2007.
12320
12321 2003-11-12 Jackson Harper <jackson@ximian.com>
12322
12323         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12324         system directory. Also use the full file name so users can
12325         libraries names mscorlib-o-tron.dll in a non system dir.
12326         
12327 2004-01-04  David Sheldon <dave-mono@earth.li>
12328
12329         * expression.cs: Added matching ")" to error message for CS0077.
12330
12331 2003-12-19  Martin Baulig  <martin@ximian.com>
12332
12333         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12334         static method; see documentation in the method.
12335         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12336
12337         * convert.cs (Convert.ImplicitReferenceConversion,
12338         Convert.ImplicitReferenceConversionExists): Add support for
12339         generic type declarations; see gen-36.cs.
12340
12341 2003-12-19  Martin Baulig  <martin@ximian.com>
12342
12343         * pending.cs (Pending.InterfaceMethod): Use
12344         `Type.IsAssignableFrom()' instead of `=='.
12345
12346 2003-12-18  Martin Baulig  <martin@ximian.com>
12347
12348         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12349         byref types first.
12350
12351         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12352         `expr_type.Equals (target_type)' instead of `=='.
12353
12354 2003-12-08  Martin Baulig  <martin@ximian.com>
12355
12356         * generics.cs (Constraints.Types): Removed.
12357         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12358         to Type's.
12359         (Constraints.ResolveTypes): New public method; resolves the
12360         TypeExpr's to Type's.
12361         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12362         longer takes the constraints.
12363         (TypeParameter.DefineMethod): Likewise.
12364         (TypeParameter.DefineType): New public method.  Calls
12365         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12366         the constraints.
12367
12368 2003-12-08  Martin Baulig  <martin@ximian.com>
12369
12370         * convert.cs (Convert.ImplicitConversionStandard): Use
12371         `expr_type.Equals (target_type)' instead of `=='.
12372
12373 2003-12-08  Martin Baulig  <martin@ximian.com>
12374
12375         * typemanager.cs (TypeManager.GetReferenceType): Call
12376         `Type.MakeByRefType ()'.
12377
12378 2003-12-08  Martin Baulig  <martin@ximian.com>
12379
12380         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12381         just has some special meaning in some situations.  For instance,
12382         it is allowed to use `where' as the name of a variable etc.
12383
12384 2003-12-04  Martin Baulig  <martin@ximian.com>
12385
12386         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12387         `Type.MakeArrayType()' for array types.
12388
12389 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12390
12391         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12392         debugging message.
12393
12394         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12395         corlib to compile.
12396
12397 2003-11-16  Martin Baulig  <martin@ximian.com>
12398
12399         * codegen.cs (EmitContext.IsGeneric): Removed.
12400
12401         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12402         ResolveGeneric() on the DeclSpace.
12403
12404 2003-11-16  Martin Baulig  <martin@ximian.com>
12405
12406         * generic.cs (TypeArguments.Resolve):
12407         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12408         `ResolveType()' on it to get the Type.
12409
12410 2003-11-15  Martin Baulig  <martin@ximian.com>
12411
12412         * generic.cs (ConstructedType.GetInterfaces): Override this.
12413
12414 2003-11-14  Martin Baulig  <martin@ximian.com>
12415
12416         * interface.cs (Interface.DefineType): Define all type parameters
12417         before adding the interfaces we inherit.
12418
12419 2003-11-11  Martin Baulig  <martin@ximian.com>
12420
12421         * generic.cs (ConstructedType.ResolveType): Always call
12422         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12423
12424 2003-11-10  Martin Baulig  <martin@ximian.com>
12425
12426         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12427         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12428         calling `ResolveType()' on them, directly assign their `Type'.
12429
12430 2003-11-08  Martin Baulig  <martin@ximian.com>
12431
12432         * generic.cs (ConstructedType): Override `IsClass' etc.
12433
12434 2003-11-08  Martin Baulig  <martin@ximian.com>
12435
12436         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12437         return value and the `out parent' parameter.
12438         (TypeContainer.DefineType): Moved the CS0644 check into
12439         GetClassBases().  Don't pass the interface types to the
12440         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12441         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12442
12443         * ecore.cs (TypeExpr.IsAttribute): New property.
12444         (TypeExpr.GetInterfaces): New method.
12445
12446         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12447         TypeExpr instead of a Type.
12448         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12449         (Interface.DefineType): Don't pass the interface types to the
12450         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12451         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12452
12453         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12454         instead of a `Type[]'.
12455         (TypeManager.RegisterBuilder): Likewise.
12456         (TypeManager.AddUserInterface): Likewise.
12457         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12458         `Type[]' and also return a `TypeExpr[]'.
12459         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12460
12461 2003-11-08  Martin Baulig  <martin@ximian.com>
12462
12463         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12464         Expression.     
12465
12466 2003-11-08  Martin Baulig  <martin@ximian.com>
12467
12468         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12469         TypeManager.ResolveExpressionTypes().
12470
12471         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12472         instead of an Expression.
12473         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12474         (TypeExpression): New public class; formerly known as `TypeExpr'.
12475
12476         * expression.cs (ComposedCast): Derive from TypeExpr.
12477
12478         * typemanager.cs (TypeManager.system_*_expr): These are now
12479         TypExpr's instead of Expression's.
12480         (TypeManager.ResolveExpressionTypes): New public static function;
12481         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12482         of them.        
12483
12484 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * expression.cs (New.DoResolve): Do not dereference value that
12487         might be a null return.
12488
12489         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12490         sure that the constant value has the right type.  Fixes an
12491         unreported bug, similar to 50425.
12492
12493         * const.cs (Const.LookupConstantValue): Call
12494         ImplicitStandardConversionExists before doing a conversion to
12495         avoid havng the TypeManager.ChangeType do conversions.
12496
12497         Reduced the number of casts used
12498
12499         (Const.ChangeType): New routine to enable reuse of the constant
12500         type changing code from statement.
12501
12502         * typemanager.cs (ChangeType): Move common initialization to
12503         static global variables.
12504
12505         Fixes #50425.
12506
12507         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12508         every value type to go through, even if it was void.  Fix that. 
12509
12510         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12511         character of the define, and the is_identifier_part_character for
12512         the rest of the string.
12513
12514 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12515
12516         * expression.cs (UnaryMutator.EmitCode): When I updated
12517         LocalVariableReference.DoResolve, I overdid it, and dropped an
12518         optimization done on local variable references.
12519
12520 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * ecore.cs: Convert the return from Ldlen into an int.
12523
12524 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12525
12526         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12527         the accessibility, this is a special case for toplevel non-public
12528         classes (internal for instance).
12529
12530 2003-10-20  Nick Drochak <ndrochak@gol.com>
12531
12532         * ecore.cs: Fix typo and build.  Needed another right paren.
12533
12534 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12535
12536         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12537         `internal' case regular and protected, but not allowing protected
12538         to be evaluated later.  Bug 49840
12539
12540 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12541
12542         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12543         to kb.Nlast, and not the kb.nFirst to isolate the switch
12544         statement.
12545
12546         Extract the underlying type, so enumerations of long/ulong are
12547         treated like long/ulong.
12548
12549 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12550
12551         * expression.cs (New): Overload the meaning of RequestedType to
12552         track the possible creation of the NewDelegate type, since
12553         DoResolve is invoked more than once for new constructors on field
12554         initialization.
12555
12556         See bugs: #48800 and #37014
12557
12558         * cs-parser.jay (declare_local_constants): Take an arraylist
12559         instead of a single constant.
12560
12561         (local_constant_declaration): It should take a
12562         constant_declarators, not a constant_declarator.  Fixes 49487
12563
12564         * convert.cs: Fix error report.
12565
12566 2003-10-13 Jackson Harper <jackson@ximian.com>
12567
12568         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12569         bug #49611
12570         
12571 2003-11-03  Martin Baulig  <martin@ximian.com>
12572
12573         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12574         `out bool has_type_arg'; if set, we need to pass the type to
12575         ig.Emit().
12576         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12577         Stelem_Any/Ldelem_Any for generic parameters.   
12578
12579 2003-11-02  Martin Baulig  <martin@ximian.com>
12580
12581         * expression.cs (Invocation.EmitCall): Use
12582         `TypeManager.IsValueType()' to check whether it's a value type.
12583         Don't set `struct_call' when calling a method on a type parameter.
12584
12585 2003-11-02  Martin Baulig  <martin@ximian.com>
12586
12587         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12588         and removed the TypeBuilder argument.
12589
12590         * typemanager.cs (TypeManager.IsValueType): Return
12591         `t.IsGenericParameter || t.IsValueType'.
12592
12593 2003-10-25  Martin Baulig  <martin@ximian.com>
12594
12595         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12596         call ConstructedType.Resolve() on it.
12597
12598         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12599
12600 2003-10-25  Martin Baulig  <martin@ximian.com>
12601
12602         * class.cs (TypeContainer.GetClassBases): Changed
12603         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12604         CS8214 reporting here.
12605         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12606         instead of a `Type' for our parent.  In case of a recursive
12607         declaration (see tests/gen-23.cs for an example), our parent is a
12608         ConstructedType and it doesn't have its type set.  So, first
12609         create our own TypeBuilder, then call constructed.Resolve() to get
12610         the parent's type and finally TypeBuilder.SetParent() it.
12611
12612         * ecore.cs (TypeExpr.Name): New public virtual property.
12613
12614         * generic.cs
12615         (ConstructedType): We're now a TypeExpr and not just an Expression.
12616         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12617         arguments here; this is done later.
12618         (ConstructedType.Resolve): New public method to resolve the type
12619         arguments and bind them.
12620
12621 2003-10-21  Martin Baulig  <martin@ximian.com>
12622
12623         * convert.cs: Use `TypeManager.IsValueType' instead of
12624         'type.IsValueType' everywhere.
12625
12626         * typemanager.cs (TypeManager.IsValueType): Return true for type
12627         parameters.  The reason for this is that we need to box a type
12628         parameter when converting it to a reference type.
12629
12630         * cs-parser.jay: Added support for default value expressions.
12631
12632         * generics.cs (DefaultValueExpression): New public class.       
12633
12634 2003-10-17  Martin Baulig  <martin@ximian.com>
12635
12636         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12637         TypeContainer so we can also use this for Interfaces.
12638         (TypeParameter.Resolve): Likewise.
12639
12640         * interface.cs (Interface.DefineType): Added support for generic
12641         interfaces.
12642
12643         * cs-parser.jay: Added support for generic structs and interfaces.
12644
12645 2003-10-17  Martin Baulig  <martin@ximian.com>
12646
12647         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12648         call generic methods :-)
12649
12650 2003-10-16  Martin Baulig  <martin@ximian.com>
12651
12652         * cs-parser.jay (namespace_or_type_name): Only create a
12653         GenericMemberAccess if we actually have type arguments.
12654
12655 2003-10-13  Martin Baulig  <martin@ximian.com>
12656
12657         * class.cs (Method.Define): If we're a generic method, call
12658         TypeBuilder.DefineGenericMethod () before resolving
12659         the parameters.
12660         (MethodData): Added .ctor which takes an additional MethodBuilder
12661         argument; this is used for generic methods.
12662         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12663         we already have a MethodBuilder.
12664
12665 2003-10-10  Martin Baulig  <martin@ximian.com>
12666
12667         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12668         instead of a `DeclSpace'.  This is used for generic methods.
12669
12670         * cs-parser.jay (method_header): Added support for generic
12671         methods; create a `GenericMethod' instance and pass it to the
12672         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12673         parameters and locals.
12674
12675         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12676         since we already have the location.  Check whether we're a generic
12677         type declaration or a generic method and create the correct type
12678         parameter.
12679
12680         * generic.cs (TypeParameter.DefineMethod): New public method.
12681         (GenericMethod): New public class; derives from DeclSpace and is
12682         used for generic methods.       
12683
12684 2003-10-09  Martin Baulig  <martin@ximian.com>
12685
12686         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12687         to the .ctor.
12688         (MethodCore.DoDefineParameters): Removed the TypeContainer
12689         argument; use the DeclSpace which was passed to the .ctor instead.
12690         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12691         TypeContainer; we only need a DeclSpace here.
12692
12693 2003-10-09  Martin Baulig  <martin@ximian.com>
12694
12695         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12696         to the .ctor.
12697         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12698         EmitContext's .ctor.    
12699
12700 2003-10-09  Martin Baulig  <martin@ximian.com>
12701
12702         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12703         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12704         AsAccessible(), moved them as well.
12705
12706         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12707
12708 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12711         generation for >=, as spotted by Paolo, bug 48679.  
12712         Patch from David Waite.
12713
12714         * cs-tokenizer.cs: Add handling for #pragma.
12715
12716         * cs-parser.jay: Allow for both yield and yield return in the
12717         syntax.  The anti-cobolization of C# fight will go on!
12718
12719         * class.cs (TypeBuilder.DefineType): Catch error condition here
12720         (Parent.DefineType erroring out and returning null).
12721
12722         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12723         coping with enumerations variables, we were mistakenly processing
12724         them as a regular value type instead of built-in types.  Fixes the
12725         bug #48063
12726
12727         * typemanager.cs (IsBuiltinOrEnum): New method.
12728
12729 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12730
12731         * cs-parser.jay: Upgrade: yield now needs the return clause.
12732
12733 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12734
12735         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12736
12737 2003-09-29  Martin Baulig  <martin@ximian.com>
12738
12739         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12740         inflated generic methods.
12741
12742         * generics.cs (ConstructedType): Distinguish between open and
12743         closed constructed types; correctly resolve the arguments.
12744
12745 2003-09-22  Martin Baulig  <martin@ximian.com>
12746
12747         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12748         all type arguments meet their constraints.
12749
12750 2003-09-19  Martin Baulig  <martin@ximian.com>
12751
12752         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12753         `MemberCache parent' argument.  Normally, an interface doesn't
12754         have a parent type except System.Object, but we use this in gmcs
12755         for generic type parameters.
12756
12757 2003-09-18  Martin Baulig  <martin@ximian.com>
12758
12759         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12760         on `type.IsInterface'; don't check whether the type has a parent
12761         to determine whether it's an interface.
12762
12763 2003-09-17  Martin Baulig  <martin@ximian.com>
12764
12765         * generic.cs (ConstructedType.ToString): Always use `name' as the
12766         type name.
12767
12768 2003-09-15  Martin Baulig  <martin@ximian.com>
12769
12770         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12771
12772         * generic.cs (Constraints.Resolve): New public method; this is
12773         called to resolve the constraint types and to check whether all
12774         the constraints are correct.
12775         (Constraints.Types): New public property.
12776         (TypeParameter.Resolve): New public method; resolves all the
12777         type's constraints.
12778
12779         * class.cs (TypeContainer.DefineType): Call
12780         TypeParameter.Resolve() before actually defining the type.
12781
12782 2003-09-15  Martin Baulig  <martin@ximian.com>
12783
12784         * class.cs (TypeContainer.DefineType): Added an error flag to
12785         avoid reporting duplicate CS0146's ("class definition is
12786         circular.").
12787
12788         * driver.cs (Driver.MainDriver): Abort if
12789         RootContext.ResolveTree() reported any errors.
12790
12791 2003-09-07  Martin Baulig  <martin@ximian.com>
12792
12793         * report.cs (Error, Warning): Added overloaded versions which take
12794         a `params object[] args' and call String.Format().
12795
12796 2003-09-07  Martin Baulig  <martin@ximian.com>
12797
12798         * decl.cs (DeclSpace..ctor): Don't call
12799         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12800         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12801         (DeclSpace.RecordDecl): New method.
12802
12803         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12804
12805 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12806
12807         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12808         value attributes to be applied to ParameterBuilders.
12809
12810         * class.cs (MethodCore.LabelParameters): Make static and more
12811         generic so that it can be used from other places - like interface
12812         methods, for instance.
12813
12814         * interface.cs (Interface.Emit): Call LabelParameters before
12815         emitting attributes on the InterfaceMethod.
12816
12817 2003-09-07  Martin Baulig  <martin@ximian.com>
12818
12819         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12820         if the number of type parameters doesn't match.
12821
12822 2003-09-04  Martin Baulig  <martin@ximian.com>
12823
12824         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12825         for arrays of generic type params (ie. `!0[]').
12826
12827 2003-09-04  Martin Baulig  <martin@ximian.com>
12828
12829         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12830         for the moment.
12831
12832 2003-09-04  Martin Baulig  <martin@ximian.com>
12833
12834         * decl.cs (DeclSpace.LookupGeneric): New method.
12835         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12836         moment.
12837
12838         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12839         argument, not just a string.
12840         (TypeParameter.Define): New public method; this is called to
12841         actually define the generic parameter; after this, you can use the
12842         new `Type' property to get the type.
12843
12844 2003-09-04  Martin Baulig  <martin@ximian.com>
12845
12846         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12847         is now an ArrayList; initialize the result of the `TypeParameters'
12848         property here.
12849         (DeclSpace.GetGenericData): Removed.
12850         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12851         implement this in a different way.
12852         (DeclSpace.GetTypeParameters): Removed; there's now a
12853         `TypeParameters' property.
12854         (DeclSpace.TypeParameters): New public property.
12855
12856         * generic.cs (Constraints): Make this class public.
12857         (TypeParameter): New public class.
12858
12859 2003-09-04  Martin Baulig  <martin@ximian.com>
12860
12861         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12862         generic parameters.
12863
12864         * class.cs (TypeContainer.DefineType): Call
12865         TypeBuilder.DefineGenericParameter () on all generic parameters if
12866         this is a generic type.
12867
12868 2003-08-28  Martin Baulig  <martin@ximian.com>
12869
12870         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12871         sample-stack.il".
12872
12873         * sample-hello.cs: Compile this with gmcs: "gmcs
12874         /r:sample-stack.dll sample-hello.cs".
12875
12876 2003-08-28  Martin Baulig  <martin@ximian.com>
12877
12878         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12879         the parameters to the generic type.
12880
12881 2003-08-28  Martin Baulig  <martin@ximian.com>
12882
12883         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12884
12885 2003-08-28  Martin Baulig  <martin@ximian.com>
12886
12887         * cs-parser.jay (opt_type_argument_list): Use
12888         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12889         (primary_expression): Replace `qualified_identifier' with `type_name'.
12890         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12891
12892         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12893         parser to check whether it is syntactically a type parameter list;
12894         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12895         this case.
12896
12897 2003-08-26  Martin Baulig  <martin@ximian.com>
12898
12899         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12900         resolving aliases; fixes #47927.
12901
12902 2003-08-26  Martin Baulig  <martin@ximian.com>
12903
12904         * statement.cs (Using.DoResolve): This is internally emitting a
12905         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12906         do not always return.  Fixes #47681.
12907
12908 2003-08-26  Martin Baulig  <martin@ximian.com>
12909
12910         * decl.cs (MemberCore): Moved WarningNotHiding(),
12911         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12912         into MemberBase.
12913         (AdditionResult): Make this nested in DeclSpace.
12914         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12915         argument; call NamespaceEntry.Define() unless we're nested in a
12916         class or struct.
12917
12918         * namespace.cs (Namespace.DefineName): New public function.  This
12919         is called from DeclSpace's .ctor to add 
12920         (Namespace.Lookup): Include DeclSpaces in the lookup.
12921
12922         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12923
12924         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12925
12926 2003-08-25  Martin Baulig  <martin@ximian.com>
12927
12928         * convert.cs (Convert.ExplicitReferenceConversion): When
12929         converting from an interface type to a class, unbox if the target
12930         type is a struct type.  Fixes #47822.
12931
12932 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12933
12934         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12935         #47854.
12936
12937 2003-08-22  Martin Baulig  <martin@ximian.com>
12938
12939         * class.cs (TypeManager.DefineType): When defining a nested type,
12940         call DefineType() on our parent; fixes #47801.
12941
12942 2003-08-22  Martin Baulig  <martin@ximian.com>
12943
12944         * class.cs (MethodData.Define): While checking if a method is an
12945         interface implementation, improve the test a bit more to fix #47654.
12946
12947 2003-08-22  Martin Baulig  <martin@ximian.com>
12948
12949         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12950         correctly; fixes #47722.
12951
12952 2003-08-22  Martin Baulig  <martin@ximian.com>
12953
12954         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12955         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12956
12957         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12958
12959 2003-08-22  Martin Baulig  <martin@ximian.com>
12960
12961         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12962         can only be assigned in static constructors.  Fixes #47161.
12963
12964 2003-08-22  Martin Baulig  <martin@ximian.com>
12965
12966         Rewrote and improved the flow analysis code.
12967
12968         * flowbranching.cs (FlowBranching): Make this class abstract.
12969         (FlowBranching.CreateBranching): New static function to create a
12970         new flow branching.
12971         (FlowBranchingBlock, FlowBranchingException): New classes.
12972         (FlowBranching.UsageVector.Type): New public readonly field.
12973         (FlowBranching.UsageVector.Breaks): Removed the setter.
12974         (FlowBranching.UsageVector.Returns): Removed the setter.
12975         (FlowBranching.UsageVector): Added Break(), Return(),
12976         NeverReachable() and Throw() methods to modify the reachability.
12977         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12978         done by FlowBranching.Merge().
12979         (FlowBranching.UsageVector.MergeChild): New method; merges the
12980         merge result into the current vector.
12981         (FlowBranching.Merge): New abstract method to merge a branching.
12982
12983 2003-08-12  Martin Baulig  <martin@ximian.com>
12984
12985         * expression.cs (Indirection.CacheTemporaries): Create the
12986         LocalTemporary with the pointer type, not its element type.
12987
12988 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12989
12990         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12991         token was a keyword or not.
12992
12993         Add `error' options where an IDENTIFIER was expected;  Provide
12994         CheckToken and CheckIdentifierToken convenience error reporting
12995         functions. 
12996
12997         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12998
12999         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13000         NameSpaceEntry NameSpaceEntry.
13001
13002         (LookupInterfaceOrClass): Avoid creating a full qualified name
13003         from namespace and name: avoid doing lookups when we know the
13004         namespace is non-existant.   Use new Tree.LookupByNamespace which
13005         looks up DeclSpaces based on their namespace, name pair.
13006
13007         * driver.cs: Provide a new `parser verbose' to display the
13008         exception thrown during parsing.  This is turned off by default
13009         now, so the output of a failure from mcs is more graceful.
13010
13011         * namespace.cs: Track all the namespaces defined in a hashtable
13012         for quick lookup.
13013
13014         (IsNamespace): New method
13015
13016 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13017
13018         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13019         we know that we need to concatenate (full typename can never be
13020         null). 
13021
13022         * class.cs: ditto.
13023
13024         * statement.cs: Use a bitfield;  Do not initialize to null things
13025         which are done by the constructor by default.
13026
13027         * cs-parser.jay: bug fix, parameter was 4, not 3.
13028
13029         * expression.cs: Just use the property;
13030
13031         * statement.cs: No need for GetVariableInfo method.
13032
13033 2003-08-08  Martin Baulig  <martin@ximian.com>
13034
13035         * flowanalysis.cs (FlowReturns): This is now nested in the
13036         `FlowBranching' class.
13037         (MyBitVector): Moved this here from statement.cs.
13038         (FlowBranching.SiblingType): New enum type.
13039         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13040
13041 2003-08-07  Martin Baulig  <martin@ximian.com>
13042
13043         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13044         `FlowBranching' class and called `BranchingType'.
13045
13046 2003-08-07  Martin Baulig  <martin@ximian.com>
13047
13048         * flowanalysis.cs: Moved all the control flow analysis code into
13049         its own file.
13050
13051 2003-08-07  Martin Baulig  <martin@ximian.com>
13052
13053         * assign.cs (Assign.DoResolve): `target' must either be an
13054         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13055         #37319.
13056
13057 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13058
13059         * expression.cs (BinaryMethod): This kind of expression is created by the
13060         Binary class if it determines that the operator has to be handled
13061         by a method.
13062
13063         (BinaryDelegate): This kind of expression is created if we are
13064         dealing with a + or - operator on delegates.
13065
13066         (Binary): remove method, argumetns, and DelegateOperator: when
13067         dealing with methods, 
13068
13069         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13070
13071         * statement.cs (Block): use bitfields for the three extra booleans
13072         we had in use.   Remove unused topblock parameter.
13073
13074         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13075
13076         * assign.cs: Drop extra unneeded tests.
13077
13078 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13079
13080         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13081
13082         * statement.cs (Foreach): Use VariableStorage instead of
13083         LocalBuilders.   
13084
13085         * codegen.cs (VariableStorage): New class used by clients that
13086         require a variable stored: locals or fields for variables that
13087         need to live across yield.
13088
13089         Maybe provide a convenience api for EmitThis+EmitLoad?
13090
13091         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13092         these bad boys.
13093
13094 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13097         RemapParameterLValue): New methods that are used to turn a
13098         precomputed FieldInfo into an expression like this:
13099
13100                 instance.FieldInfo
13101
13102         The idea is to use this instead of making LocalVariableReference
13103         have more than one meaning.
13104
13105         * cs-parser.jay: Add error production to BASE.
13106
13107         * ecore.cs: Deal with TypeManager.GetField returning null, which
13108         is now a valid return value.
13109
13110         (FieldExprNoAddress): New expression for Fields whose address can
13111         not be taken.
13112
13113         * expression.cs (LocalVariableReference): During the resolve
13114         phases, create new expressions if we are in a remapping context.
13115         Remove code that dealt with remapping here.
13116
13117         (ParameterReference): same.
13118
13119         (ProxyInstance): New expression, like the `This' expression, but
13120         it is born fully resolved.  We know what we are doing, so remove
13121         the errors that are targeted to user-provided uses of `this'.
13122
13123         * statement.cs (Foreach): our variable is now stored as an
13124         Expression;  During resolution, follow the protocol, dont just
13125         assume it will return this.
13126
13127 2003-08-06  Martin Baulig  <martin@ximian.com>
13128
13129         * support.cs (SeekableStreamReader.cs): New public class.
13130
13131         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13132         SeekableStreamReader instead of the normal StreamReader.
13133
13134 2003-08-04  Martin Baulig  <martin@ximian.com>
13135
13136         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13137         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13138         deambiguate casts and delegate invocations.
13139         (parenthesized_expression): Use the new tokens to ensure this is
13140         not a cast of method invocation.
13141
13142         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13143         when reading a `)' and Deambiguate_CloseParens () was previously
13144         called.
13145
13146         * expression.cs (ParenthesizedExpression): New class.  This is
13147         just used for the CS0075 test.
13148         (Binary.DoResolve): Check for CS0075.   
13149
13150 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13151
13152         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13153         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13154         reference comparison.
13155
13156         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13157         examine the ReturnType for equality - this is necessary in the
13158         cases of implicit and explicit operators whose signature also
13159         includes the return type.
13160
13161 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13162
13163         * namespace.cs: Cache the result of the namespace computation,
13164         instead of computing it every time.
13165
13166 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13167
13168         * decl.cs: Use a global arraylist that we reuse over invocations
13169         to avoid excesive memory consumption.  Reduces memory usage on an
13170         mcs compile by one meg (45 average).
13171
13172         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13173         private, work around that.
13174
13175 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13176
13177         * literal.cs (IntLiteral): Define Zero and One static literals. 
13178
13179         * cs-parser.jay (integer_literal): use static literals to reduce
13180         memory usage for the most used literals (0, 1 and -1).  211kb
13181         reduced in memory usage.
13182
13183         Replace all calls to `new ArrayList' with `new
13184         ArrayList(4)' which is a good average number for most allocations,
13185         and also requires only 16 bytes of memory for its buffer by
13186         default. 
13187
13188         This reduced MCS memory usage in seven megabytes for the RSS after
13189         bootstrapping.
13190
13191 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13192
13193         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13194         handle params methods the correct way by forming only one
13195         applicable set with params and normal methods in them. Earlier we
13196         were looking at params methods only if we found no normal methods
13197         which was not the correct thing to do.
13198
13199         (Invocation.BetterFunction): Take separate arguments indicating
13200         when candidate and the best method are params methods in their
13201         expanded form.
13202
13203         This fixes bugs #43367 and #46199.
13204
13205         * attribute.cs: Documentation updates.
13206
13207         (CheckAttribute): Rename to CheckAttributeTarget.
13208         (GetValidPlaces): Rename to GetValidTargets.
13209
13210         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13211         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13212
13213         Fixes bug #44468.
13214
13215 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13216
13217         * codegen.cs: Compute IsGeneric correctly.
13218
13219         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13220         resolution. 
13221
13222         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13223         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13224         regressions, and I was chasing more bugs than I required.
13225
13226         * interface.cs: Use expressions for base type names (like classes
13227         and structs have been doing for a while now), and resolve that.
13228         This patch should probably go into head as well.
13229
13230         This makes it one less user of FindType.
13231
13232 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13233
13234         This compiler can not self host currently.  Need to fix that.
13235         
13236         * Makefile: compile to `gmcs.exe'
13237
13238         * driver.cs: Turn on v2 by default on gmcs.
13239
13240         * generic.cs (ConstructedType): Does no longer take a container
13241         type argument;  That will be taken care of later.
13242
13243         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13244         Use SimpleName to resolve for now, so we can continue the work on
13245         the parser, until we get Type.GetType that understands generics.
13246
13247         (ConstructedType.ToString): Implement
13248
13249         (TypeArguments.Resolve): Resolve the child expressions as types. 
13250         
13251         * cs-parser.jay: Rename interface_constraints to
13252         type_parameter_constraints
13253
13254         (namespace_or_type_name): Only use constructed types for the basic
13255         construction, we will deal with identifier<...> later.
13256
13257         (type/type_name): No longer call DecomposeQI, as
13258         namespace_or_type_name is always decoded now.
13259         
13260 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13261
13262         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13263         closely: we eliminate methods in base types when we have an
13264         applicable method in a top-level type.
13265
13266         Please see section 14.5.5.1 for an exact description of what goes
13267         on. 
13268
13269         This fixes bug #45127 and a host of other related to corlib compilation.
13270
13271         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13272         array is the method corresponding to the top-level type (this is
13273         because of the changes made to icall.c) so we change this
13274         accordingly.
13275
13276         (MethodGroupExpr.Name): This too.
13277
13278         * typemanager.cs (GetElementType): New method which does the right
13279         thing when compiling corlib. 
13280
13281         * everywhere: Make use of the above in the relevant places.
13282
13283 2003-07-22  Martin Baulig  <martin@ximian.com>
13284
13285         * cs-parser.jay (invocation_expression): Moved
13286         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13287         `cast_expression', but create a InvocationOrCast which later
13288         resolves to either an Invocation or a Cast.
13289
13290         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13291         method; call this before EmitStatement() to make sure that this
13292         expression can be used as a statement.
13293
13294         * expression.cs (InvocationOrCast): New class; resolves to either
13295         an Invocation or a Cast.
13296
13297         * statement.cs (StatementExpression): Call ResolveStatement() on
13298         the ExpressionStatement before emitting it.
13299
13300 2003-07-21  Martin Baulig  <martin@ximian.com>
13301
13302         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13303         `ref' and `out' attributes match; fixes #46220.
13304         (MemberAccess.ResolveMemberAccess): You can't reference a type
13305         through an expression; fixes #33180.
13306         (Indexers.GetIndexersForType): Don't return the indexers from
13307         interfaces the class implements; fixes #46502.
13308
13309 2003-07-21  Martin Baulig  <martin@ximian.com>
13310
13311         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13312         CS0661 checks; fixes bug #30442.
13313
13314 2003-07-21  Martin Baulig  <martin@ximian.com>
13315
13316         * decl.cs (AdditionResult): Added `Error'.
13317
13318         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13319
13320         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13321         cs0031.cs actually work.
13322
13323  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13324  
13325         * cs-parser.jay (namespace_name): do not use
13326         namespace_or_type_name, use qualified_identifier, because
13327         namespace_or_type_name will soon return a composed expression
13328         instead of a string.
13329  
13330         (namespace_or_type_name): Instead of returning a string, now this
13331         production returns an expression.
13332  
13333         * codegen.cs (EmitContext): Setup IsGeneric property based on
13334         whether our DeclSpace is generic, our the method is generic.
13335  
13336         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13337         the method is generic.
13338  
13339         * cs-parser.jay (type_arguments, opt_type_argument_list,
13340         type_parameters, type_parameter_list, opt_type_parameter_list,
13341         type_parameter,, opt_type_parameter_constraints_clauses,
13342         type_parameter_constraints_clauses,
13343         type_parameter_constraint_clause, type_parameter_constraint,
13344         interface_constraints): Add new production
13345  
13346         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13347         DeclSpace is generic or not.
13348  
13349         (DeclSpace.SetParameterInfo): New routine, used to set the
13350         parameter info for a type.
13351  
13352         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13353         returns a GenericTypeExpr
13354  
13355         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13356         generic, lookup the generic argument.
13357  
13358         * attribute.cs: Do not allow TypeParameterExpressions in
13359         Attributes.
13360  
13361         * class.cs: Do not allow the Main method to be defined in a
13362         Generic container.
13363  
13364         * expression.cs (SizeOf): Do not allow generic types to be used as
13365         arguments to sizeof.
13366  
13367         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13368         it: whether a type is generic or not.  Only works for types we are
13369         currently building for now.
13370         
13371 2003-07-20  Martin Baulig  <martin@ximian.com>
13372
13373         * namespace.cs: Fixed that bug which caused a crash when compiling
13374         the debugger's GUI.
13375
13376 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13377
13378         * typemanager.cs (LookupTypeReflection): Never expose types which
13379         are NotPublic, NestedPrivate, NestedAssembly, or
13380         NestedFamANDAssem.  We used to return these, and later do a check
13381         that would report a meaningful error, but the problem is that we
13382         would not get the real match, if there was a name override.
13383
13384 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13385
13386         * namespace.cs (Namespace, Name): Do not compute the namespace
13387         name dynamically, compute it in the constructor.  This reduced
13388         memory usage by 1697 KB.
13389
13390         * driver.cs: Use --pause to pause at the end.
13391
13392 2003-07-17  Peter Williams  <peter@newton.cx>
13393
13394         * Makefile: Change the name of the test target so that it doesn't
13395         conflict with the recursive test target.
13396
13397 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13398
13399         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13400         AddressOf): Do not use EmitThis, that was wrong, use the actual
13401         this pointer.
13402
13403 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * class.cs (MethodData.Define): While checking if a method is an
13406         interface implementation, improve the test: If we are not public
13407         (use new test here: use the computed MethodAttributes directly,
13408         instead of the parsed modifier flags) check if the `implementing'
13409         method comes from an interface or not.
13410
13411         * pending.cs (VerifyPendingMethods): Slightly better error
13412         message.
13413
13414         * makefile: add test target that does the mcs bootstrap.
13415
13416 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13417
13418         * interface.cs (Define): Do nothing here since there are no
13419         members to populate etc. Move the attribute emission out of here
13420         since this was just totally the wrong place to put it. Attribute
13421         application happens during the 'Emit' phase, not in the 'Define'
13422         phase.
13423
13424         (Emit): Add this method and move the attribute emission here
13425
13426         * rootcontext.cs (EmitCode): Call the Emit method on interface
13427         types too.
13428
13429 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13430
13431         * expression.cs (OverloadResolve): Report error only if Location
13432         is not 'Null' which means that there was a probe going on.
13433
13434 2003-07-14  Martin Baulig  <martin@ximian.com>
13435
13436         * expression.cs (ConditionalLogicalOperator): New public class to
13437         implement user defined conditional logical operators.
13438         This is section 14.11.2 in the spec and bug #40505.
13439
13440 2003-07-14  Martin Baulig  <martin@ximian.com>
13441
13442         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13443
13444 2003-07-14  Martin Baulig  <martin@ximian.com>
13445
13446         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13447
13448         * ecore.cs (IVariable.VerifyFixed): New interface method.
13449
13450         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13451         operator, check whether the variable is actually fixed.  Fixes bug
13452         #36055.  Set a variable definitely assigned when taking its
13453         address as required by the spec.
13454
13455         * statement.cs (LocalInfo.IsFixed): New field.
13456         (LocalInfo.MakePinned): Set `IsFixed' to true.
13457
13458 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13459
13460         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13461         for .ctors, ensure that we only ask for members declared in the
13462         attribute type (BindingFlags.DeclaredOnly).
13463
13464         Fixes bug #43632.
13465
13466         * expression.cs (Error_WrongNumArguments): Report error 1501
13467         correctly the way CSC does.
13468
13469 2003-07-13  Martin Baulig  <martin@ximian.com>
13470
13471         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13472         lookup on the fully qualified name, to make things like "X.X" work
13473         where "X.X" is a fully qualified type name, but we also have a
13474         namespace "X" in the using list.  Fixes #41975.
13475
13476 2003-07-13  Martin Baulig  <martin@ximian.com>
13477
13478         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13479         function. If we're a CompoundAssign, we need to create an embedded
13480         CompoundAssign, not an embedded Assign.
13481         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13482         Fixes #45854.
13483
13484 2003-07-13  Martin Baulig  <martin@ximian.com>
13485
13486         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13487         work to fix bug #46088.
13488
13489 2003-07-13  Ravi Pratap <ravi@ximian.com>
13490
13491         * class.cs (Operator.Emit): Do not emit attributes here - it is
13492         taken care of by the Method class that we delegate too. This takes
13493         care of bug #45876.
13494
13495 2003-07-10  Martin Baulig  <martin@ximian.com>
13496
13497         * expression.cs (TypeOfVoid): New class.
13498         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13499
13500 2003-07-10  Martin Baulig  <martin@ximian.com>
13501
13502         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13503         bug #35957.
13504
13505 2003-07-10  Martin Baulig  <martin@ximian.com>
13506
13507         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13508         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13509
13510         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13511
13512         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13513
13514 2003-07-10  Martin Baulig  <martin@ximian.com>
13515
13516         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13517         of decimal.  Fixes #42850.
13518
13519         NOTE: I also fixed the created byte blob, but this doesn't work on
13520         the MS runtime and csc never produces any byte blobs for decimal
13521         arrays.
13522
13523 2003-07-10  Martin Baulig  <martin@ximian.com>
13524
13525         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13526         structs; fixes #32068.
13527         (Block.AddChildVariableNames): Fixed #44302.
13528
13529 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13530
13531         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13532
13533 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13534
13535         * attribute.cs: And this test is onger needed.
13536
13537 2003-07-08  Martin Baulig  <martin@ximian.com>
13538
13539         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13540         inaccessible types.  Fixes #36313.
13541
13542         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13543
13544         * namespace.cs (NamespaceEntry): Create implicit entries for all
13545         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13546         implicit entries for N1.N2 and N1.
13547
13548 2003-07-08  Martin Baulig  <martin@ximian.com>
13549
13550         Rewrote the handling of namespaces to fix a lot of the issues
13551         wrt. `using' aliases etc.
13552
13553         * namespace.cs (Namespace): Splitted this class into a
13554         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13555
13556         * typemanager.cs (TypeManager.IsNamespace): Removed.
13557         (TypeManager.ComputeNamespaces): Only compute namespaces from
13558         loaded assemblies here, not the namespaces from the assembly we're
13559         currently compiling.
13560
13561 2003-07-08  Martin Baulig  <martin@ximian.com>
13562
13563         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13564
13565 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13566
13567         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13568         already fixed it.  
13569
13570         I thought about the memory savings here, but LookupTypeReflection
13571         is used under already very constrained scenarios.  Compiling
13572         corlib or mcs only exposes one hit, so it would not really reduce
13573         any memory consumption.
13574
13575 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13576
13577         * typemanager.cs: fixes bug #45889 by only adding public types from
13578         other assemblies to the list of known types.
13579
13580 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13581
13582         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13583         on the type we resolved.
13584
13585 2003-07-05  Martin Baulig  <martin@ximian.com>
13586
13587         * pending.cs (PendingImplementation.ParentImplements): Don't
13588         create the proxy if the parent is abstract.
13589
13590         * class.cs (TypeContainer.DefineIndexers): Process explicit
13591         interface implementations first.  Fixes #37714.
13592
13593 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13594
13595         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13596         defined recursively;  but since we modify the input parameters
13597         (left is set to `this' temporarily), we reset this value if the
13598         left_is_explicit is false, which gives the original semantics to
13599         the code.  
13600
13601         * literal.cs (NullPointer): new class used to represent a null
13602         literal in a pointer context.
13603
13604         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13605         type is a pointer, use a NullPointer object instead of a
13606         NullLiteral.   Closes 43687
13607
13608         (ExplicitConversion): Convert pointer values using
13609         the conv opcode to the proper type.
13610
13611         * ecore.cs (New): change ValueTypeVariable property into a method,
13612         that returns whether the valuetype is suitable for being used.
13613
13614         * expression.cs (Binary.DoNumericPromotions): Only return if we
13615         the int constant was a valid uint, and we can return both left and
13616         right as uints.  If not, we continue processing, to trigger the
13617         type conversion.  This fixes 39018.
13618
13619         * statement.cs (Block.EmitMeta): During constant resolution, set
13620         the CurrentBlock property on the emitcontext, so that we resolve
13621         constants propertly.
13622
13623 2003-07-02  Martin Baulig  <martin@ximian.com>
13624
13625         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13626         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13627
13628         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13629         than emitting it here.
13630
13631         * statement.cs: Fixed some more flow analysis bugs.
13632
13633 2003-07-02  Martin Baulig  <martin@ximian.com>
13634
13635         * class.cs (MethodData.Define): When implementing interface
13636         methods, set Final unless we're Virtual.
13637
13638         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13639         check work for interface methods.
13640
13641 2003-07-01  Martin Baulig  <martin@ximian.com>
13642
13643         * ecore.cs (EmitContext.This): Replaced this property with a
13644         GetThis() method which takes a Location argument.  This ensures
13645         that we get the correct error location for a CS0188.
13646
13647 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13648
13649         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13650         ImplicitStandardConversion.
13651
13652         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13653
13654 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13655
13656         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13657         optimization.
13658
13659 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13660
13661         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13662         constructors.
13663
13664         (MethodData.Define): Turn off initlocals for unsafe methods.
13665
13666 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13667
13668         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13669         complete;  Fixes #37521.
13670
13671         * delegate.cs: Use Modifiers.TypeAttr to compute the
13672         TypeAttributes, instead of rolling our own.  This makes the flags
13673         correct for the delegates.
13674
13675 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * class.cs (Constructor.Define): Set the private flag for static
13678         constructors as well.
13679
13680         * cs-parser.jay (statement_expression): Set the return value to
13681         null, to avoid a crash when we catch an error.
13682
13683 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13684
13685         * cs-parser.jay: Applied patch from Jackson that adds support for
13686         extern and unsafe modifiers to destructor declarations.
13687
13688         * expression.cs: Report error 21 if the user is trying to index a
13689         System.Array.
13690
13691         * driver.cs: Add an error message, suggested by the bug report.
13692
13693         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13694         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13695
13696 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * namespace.cs: Add some information to reduce FAQs.
13699
13700 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13701
13702         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13703         underlying enumeration types.  Fixes #43915.
13704
13705         * expression.cs: Treat ushort/short as legal values to be used in
13706         bitwise operations.
13707
13708 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13709
13710         * delegate.cs: transfer custom attributes for paramenters from
13711         the delegate declaration to Invoke and BeginInvoke.
13712
13713 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13714
13715         * attribute.cs: handle custom marshalers and emit marshal info
13716         for fields, too.
13717
13718 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13719
13720         * makefile.gnu: Added anonymous.cs to the compiler sources.
13721
13722 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13723
13724         * iterators.cs: Change the name of the proxy class to include two
13725         underscores.
13726
13727         * cs-parser.jay: Update grammar to include anonymous methods.
13728
13729         * anonymous.cs: new file.
13730
13731 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13732
13733         * class.cs (Field.Define): Add missing test for pointers and
13734         safety. 
13735
13736 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13737
13738         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13739         we use the stobj opcode.
13740
13741         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13742         since it wasn't the correct fix. 
13743
13744         It still is puzzling that we are required to use stobj for IntPtr
13745         which seems to be a ValueType.
13746
13747 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13748
13749         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13750         during regular simple name resolution.   Now, the trick is that
13751         instead of returning for processing the simplename, we do a
13752         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13753         contextual lookup type).   If a match is found, return that, if
13754         not, return for further composition.
13755
13756         This fixes long-standing 30485.
13757
13758         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13759         using the address to initialize an object, do an Stobj instead of
13760         using the regular Stelem.
13761
13762         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13763         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13764         Because if we are a BaseIndexerAccess that value will be true.
13765         Fixes 43643.
13766
13767         * statement.cs (GotoCase.Resolve): Return after reporting an
13768         error, do not attempt to continue. 
13769
13770         * expression.cs (PointerArithmetic.Emit): If our operand is a
13771         long, convert our constants to match the operand before
13772         multiplying.  Convert to I type before adding.   Fixes 43670.
13773
13774 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13775
13776         * enum.cs (ImplicitConversionExists) : Rename to
13777         ImplicitEnumConversionExists to remove ambiguity. 
13778
13779         * ecore.cs (NullCast): New type of cast expression class which
13780         basically is very similar to EmptyCast with the difference being
13781         it still is a constant since it is used only to cast a null to
13782         something else
13783         (eg. (string) null)
13784
13785         * convert.cs (ImplicitReferenceConversion): When casting a null
13786         literal, we return a NullCast.
13787
13788         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13789         should be around anymore.
13790
13791         The renaming (reported was slightly wrong). Corrections:
13792
13793         ConvertImplicitStandard -> ImplicitConversionStandard
13794         ConvertExplicitStandard -> ExplicitConversionStandard
13795
13796         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13797         before passing them in !
13798
13799         * convert.cs (ImplicitConversionStandard): When comparing for
13800         equal expr and target types, ensure that expr is not a
13801         NullLiteral.
13802
13803         In general, we must not be checking (expr_type ==
13804         target_type) in the top level conversion methods
13805         (ImplicitConversion, ExplicitConversion etc). This checking is
13806         done in the methods that they delegate to.
13807
13808 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13809
13810         * convert.cs: Move Error_CannotConvertType,
13811         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13812         ImplicitNumericConversion, ImplicitConversionExists,
13813         ImplicitUserConversionExists, StandardConversionExists,
13814         FindMostEncompassedType, FindMostSpecificSource,
13815         FindMostSpecificTarget, ImplicitUserConversion,
13816         ExplicitUserConversion, GetConversionOperators,
13817         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13818         TryImplicitIntConversion, Error_CannotConvertImplicit,
13819         ConvertImplicitRequired, ConvertNumericExplicit,
13820         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13821         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13822         its own file.
13823
13824         Perform the following renames:
13825
13826         StandardConversionExists -> ImplicitStandardConversionExists
13827         ConvertImplicit -> ImplicitConversion
13828         ConvertImplicitStandard -> ImplicitStandardConversion
13829         TryImplicitIntConversion -> ImplicitIntConversion
13830         ConvertImplicitRequired -> ImplicitConversionRequired
13831         ConvertNumericExplicit -> ExplicitNumericConversion
13832         ConvertReferenceExplicit -> ExplicitReferenceConversion
13833         ConvertExplicit -> ExplicitConversion
13834         ConvertExplicitStandard -> ExplicitStandardConversion
13835
13836 2003-05-19  Martin Baulig  <martin@ximian.com>
13837
13838         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13839         (TypeInfo): Added support for structs having structs as fields.
13840
13841         * ecore.cs (FieldExpr): Implement IVariable.
13842         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13843         VariableInfo for the field.
13844
13845 2003-05-18  Martin Baulig  <martin@ximian.com>
13846
13847         * expression.cs (This.DoResolve): Report a CS0027 if we're
13848         emitting a field initializer.
13849
13850 2003-05-18  Martin Baulig  <martin@ximian.com>
13851
13852         * expression.cs (This.ResolveBase): New public function.
13853         (This.DoResolve): Check for CS0188.
13854
13855         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13856         This.Resolve().
13857
13858         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13859         `instance_expression' to null if we don't have any non-static
13860         methods.
13861
13862 2003-05-18  Martin Baulig  <martin@ximian.com>
13863
13864         Reworked the way how local variables and parameters are handled by
13865         the flow analysis code.
13866
13867         * statement.cs (TypeInfo, VariableMap): New public classes.
13868         (VariableInfo): New public class.  This is now responsible for
13869         checking whether a variable has been assigned.  It is used for
13870         parameters and local variables.
13871         (Block.EmitMeta): Take the InternalParameters as argument; compute
13872         the layout of the flow vectors here.
13873         (Block.LocalMap, Block.ParameterMap): New public properties.
13874         (FlowBranching): The .ctor doesn't get the InternalParameters
13875         anymore since Block.EmitMeta() now computes the layout of the flow
13876         vector.
13877         (MyStructInfo): This class is now known as `StructInfo' and nested
13878         in `TypeInfo'; we don't access this directly anymore.
13879
13880         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13881         property and removed IsAssigned(), IsFieldAssigned(),
13882         SetAssigned() and SetFieldAssigned(); we now call them on the
13883         VariableInfo so we don't need to duplicate this code everywhere.
13884
13885         * expression.cs (ParameterReference): Added `Block block' argument
13886         to the .ctor.
13887         (LocalVariableReference, ParameterReference, This): The new
13888         VariableInfo class is now responsible for all the definite
13889         assignment stuff.
13890
13891         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13892         IsParameterAssigned, SetParameterAssigned): Removed.
13893
13894 2003-05-18  Martin Baulig  <martin@ximian.com>
13895
13896         * typemanager.cs (InitCoreTypes): Try calling
13897         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13898         the 3-args-version.  Corlib now also needs our `void_type'.
13899         (GetMethod): Added overloaded version which takes an optional
13900         `bool report_errors' to allow lookups of optional methods.
13901
13902 2003-05-12  Martin Baulig  <martin@ximian.com>
13903
13904         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13905         only used for locals and not for parameters.
13906
13907 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13908
13909         * support.cs (InternalParameters.ParameterType): Return the
13910         ExternalType of the parameter.
13911
13912         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13913         they were unused.
13914
13915 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13916
13917         * class.cs (MethodData.Define): Do not set the `newslot' on
13918         interface members, if they are also flagged as "override".
13919
13920         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13921         better code for ++i and i++.  This only works for static fields
13922         and local variables.
13923
13924         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13925         want to pull the DeclSpace out of the builder_to_declspace instead
13926         of the TypeBuilder (like in TypeContainer.FindMembers).
13927
13928         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13929         instead of LookupTypeContainer.  Fixes the crash on .NET for
13930         looking up interface members.
13931
13932         * const.cs: Create our own emit context during the Definition
13933         stage, so that constants are evaluated in the proper context, when
13934         a recursive definition happens.
13935
13936 2003-05-11  Martin Baulig  <martin@ximian.com>
13937
13938         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13939         new block for a switch section.
13940         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13941         the adding/lookup in the switch block.  Fixes #39828.
13942
13943 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13944
13945         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13946         functionality: I needed to convert the data after I had performed
13947         the add/sub operation into the operands type size.
13948
13949         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13950         pass the type for the box operation, otherwise the resulting
13951         object would have been of type object.
13952
13953         (BoxedCast): Add constructor to specify the type to box as.
13954
13955 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * iterators.cs: I was reusing the `count' variable inadvertently,
13958         take steps to not allow this to happen.
13959
13960 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13961
13962         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13963         by creating an array at the point where the params starts and
13964         putting all those arguments there, then adjusting the size of the
13965         array.
13966
13967 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * expression.cs (New.AddressOf): Implement interface
13970         IMemoryLocation.  This is used when the `new' operator is used in
13971         the context of an invocation to a method on a value type.
13972
13973         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13974         example. 
13975
13976         * namespace.cs: Also check the using aliases here.
13977
13978         * driver.cs: Move the test for using validity after the types have
13979         been entered, so we do a single pass that also includes the using
13980         aliases. 
13981
13982         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13983         in the regular case.   CreateSiblingForFinally is doing extra
13984         error checking.
13985
13986         * attribute.cs (GetAttributeArgumentExpression): Store the result
13987         on an out value, and use the return value to indicate failure
13988         instead of using null (which is a valid return for Constant.GetValue).
13989
13990         * statement.cs: Perform the analysis flow for the increment
13991         portion after the statement, because this will be the real flow of
13992         execution.  Fixes #42385
13993
13994         * codegen.cs (EmitContext.EmitArgument,
13995         EmitContext.EmitStoreArgument): New helper functions when the
13996         RemapToProxy flag is set.
13997
13998         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13999         function.
14000
14001         Add support for remapping parameters. 
14002
14003         * iterators.cs: Propagate parameter values;  Store parameter
14004         values in the proxy classes.
14005
14006 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14007
14008         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14009         need a proxy reference;  I do not know what I was thinking
14010
14011         * cs-parser.jay (constructor_initializer): catch another error,
14012         and display nice message.
14013
14014         (field_declaration): catch void field declaration
14015         to flag a better error. 
14016
14017         * class.cs (MemberBase.CheckBase): Report an error instead of a
14018         warning if a new protected member is declared in a struct. 
14019         (Field.Define): catch the error of readonly/volatile.
14020
14021         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14022
14023         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14024         volatile variable is taken
14025
14026 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * statement.cs (Fixed.Resolve): Report an error if we are not in
14029         an unsafe context.
14030
14031 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14032
14033         * typemanager.cs: reuse the code that handles type clashes for
14034         delegates and enumerations.
14035
14036         * class.cs (Report28): Always report.
14037
14038         * expression.cs (EncodeAsAttribute): Allow nulls here.
14039
14040 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14043         the functionality for testing whether an expression is valid for
14044         an attribute here.  Also handle the case of arrays of elements
14045         being stored. 
14046
14047         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14048         encoding a linear array into an array of objects that are suitable
14049         to be passed to an CustomAttributeBuilder.
14050
14051         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14052
14053         * ecore.cs: (FieldExpr): Handle field remapping here.
14054
14055         * iteratators.cs: Pass the instance variable (if the method is an
14056         instance method) to the constructors, so we can access the field
14057         variables on the class.
14058
14059         TODO: Test this with structs.  I think the THIS variable on
14060         structs might have to be a pointer, and not a refenrece
14061
14062 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14063
14064         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14065         local variables to fields in a proxy class.
14066
14067         * iterators.cs (PopulateProxy): Rename our internal fields to
14068         <XXX>.  
14069         Create a <THIS> field if we are an instance method, so we can
14070         reference our parent container variables.
14071         (MapVariable): Called back from the EmitContext code to enter a
14072         new variable to field mapping into the proxy class (we just create
14073         a FieldBuilder).
14074
14075         * expression.cs
14076         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14077         for using the remapped locals to fields.
14078
14079         I placed the code here, because that gives the same semantics to
14080         local variables, and only changes the Emit code.
14081
14082         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14083         statements inside iterators.
14084         (VariableInfo): Add a FieldBuilder for the cases when we are
14085         remapping local variables to fields in a proxy class
14086
14087         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14088         current_block != null.
14089
14090         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14091         not cope with strings, as it has been moved to the
14092         TableSwitchEmit.  Fixed bug in switch generation.
14093
14094         * expression.cs (New.DoResolve): Provide more context for the user
14095         when reporting an error.
14096
14097         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14098         pointers. 
14099
14100         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14101         check the permissions for it.  Note than in a type-resolution
14102         context the check was already present in DeclSpace.ResolveType,
14103         but was missing from the MemberAccess.
14104
14105         (ArrayCreation.CheckIndices): warn if the user has
14106         more nested levels of expressions, but there are no more
14107         dimensions specified.  Avoids crash on bug 41906.
14108
14109 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * statement.cs (Block): replace Implicit bool, for a generic
14112         flags.   
14113         New flag: `Unchecked'.  This is used during the EmitMeta phase
14114         (which is out-of-line with the regular Resolve/Emit process for a
14115         statement, as this is done ahead of time, but still gets a chance
14116         to call constant resolve).
14117
14118         (Block.Flags): new enum for adding a new flag.
14119
14120         (Block.EmitMeta): track the state of unchecked.
14121
14122         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14123         to enable constant resolution to work there as well.
14124
14125 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14126
14127         * typemanager.cs (ienumerable_type): Also look up
14128         System.Collections.IEnumerable. 
14129
14130 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14131
14132         TODO: Test more than one conditional per method.
14133
14134         * class.cs (Indexer.Define): Report the location where the user is
14135         referencing the unsupported feature.
14136
14137         (MethodData): Overload the use of `conditionals' to
14138         minimize the creation of needless ArrayLists.   This saves roughly
14139         212kb on my machine.
14140
14141         (Method): Implement the new IIteratorContainer interface.
14142         (Method.SetYields): Implement the method by setting the ModFlags
14143         to contain METHOD_YIELDS.
14144
14145         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14146         which just got set to null.
14147
14148         * iterators.cs: New file.
14149
14150         (Yield, YieldBreak): New statements.
14151
14152         * statement.cs (Return.Resolve): Flag an error if we are used in
14153         an iterator method.
14154
14155         * codegen.cs (InIterator): New flag set if the code is being
14156         compiled in an iterator method.
14157
14158         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14159         internal modifier, and we just use it to avoid adding extra
14160         fields, as this is seldom used.  
14161
14162         * cs-parser.jay: Add yield_statement (yield and yield break).
14163
14164         * driver.cs: New flag -v2 to turn on version 2 features. 
14165
14166         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14167         hashtable when v2 is enabled.
14168
14169 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14170
14171         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14172         there is already a namespace defined with this name.
14173
14174         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14175         people upgraded their corlibs.
14176
14177         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14178         always use fully qualified types, no need to use the compiler
14179         front end.
14180
14181         (TypeManager.IsNamespace): Use binarysearch.
14182
14183         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14184         AddDelegate): I did not quite use the new IsValid API properly: I
14185         have to pass the short-name and the fullname.  I was passing only
14186         the basename instead of the fullname sometimes. 
14187
14188         (TypeContainer.DefineType): call NamespaceClash.
14189
14190         * interface.cs (Interface.DefineType): use NamespaceClash before
14191         defining the type.
14192
14193         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14194         defining the type.
14195
14196         * enum.cs: (Enum.DefineType): use NamespaceClash before
14197         defining the type.
14198
14199         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14200         speed increase.  First, use the negative_hits cache when we get a
14201         negative.  Second, add the type with its full original name
14202         instead of the new . and + encoded name (reflection uses + to
14203         separate type from a nested type).  Use LookupTypeReflection
14204         directly which bypasses the type->name hashtable (that we already
14205         know does not contain the type.
14206
14207         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14208         location/container type. 
14209
14210         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14211
14212 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14213
14214         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14215
14216         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14217         method is being referenced in the method group from a static
14218         context, and report error 120 if so.
14219
14220         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14221         Error118. 
14222
14223         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14224         is created, we create the A namespace).
14225
14226         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14227         Fixes #41591
14228
14229 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14230
14231         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14232         invocation to ModuleBuilder.GetType with the same values will
14233         return a new type instance, so we need to cache its return
14234         values. 
14235
14236         * expression.cs (Binary.ResolveOperator): Only allow the compare
14237         operators on enums if they are of the same type.
14238
14239         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14240         types of ValueType on their own case.  Before we were giving them
14241         the same treatment as objects.
14242
14243         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14244         fullname.  Short name is used to compare against container name.
14245         Fullname is used to check against defined namespace names.
14246
14247         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14248         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14249
14250         (Method.CheckBase): Call parent.
14251         (MemberBase.CheckBase): Check for protected members on sealed
14252         classes.
14253         (PropertyBase.CheckBase): Call parent.
14254         (Field.Define): Call parent.
14255
14256         * report.cs: Negative error codes are now mapped to 8000 - code,
14257         so that the display is render more nicely.
14258
14259         * typemanager.cs: Do not use try/catch, instead report a regular
14260         error. 
14261
14262         (GetPointerType, GetReferenceType): These methods provide
14263         mechanisms to obtain the T* and T& from a T.  We had the code
14264         previously scattered around the code base, and it also used
14265         TypeManager.LookupType that would go through plenty of caches.
14266         This one goes directly to the type source.
14267
14268         In some places we did the Type.GetType followed by
14269         ModuleBuilder.GetType, but not in others, so this unifies the
14270         processing as well.
14271
14272         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14273         statements now that we have namespace information.
14274
14275         * typemanager.cs (IsNamespace): New method, returns whether the
14276         string presented is a namespace or not.
14277
14278         (ComputeNamespaces): New public entry point, computes the list of
14279         available namespaces, using the GetNamespaces API call in Mono, or
14280         the slower version in MS.NET.   
14281
14282         Now before we start the semantic analysis phase, we have a
14283         complete list of namespaces including everything that the user has
14284         provided.
14285
14286         Deleted old code to cache namespaces in .nsc files.
14287
14288 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14289
14290         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14291         class/struct location definition Location for the implicit
14292         constructor location.
14293
14294         (Operator.Define): Use the location of the operator for the
14295         implicit Method definition.
14296
14297         (Constructor.Emit): use the constructor location for the implicit
14298         base initializer constructor.
14299
14300         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14301         and the Expression class now contains two new methods:
14302
14303         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14304         isolate type lookup from the rest of the resolution process.
14305
14306         Since we use Expressions to hold type definitions due to the way
14307         we parse the input we have historically overloaded Resolve to
14308         perform the Type lookups if a special flag is passed.  Now this is
14309         eliminated and two methods take their place. 
14310
14311         The differences in the two methods between xStep and xTerminal is
14312         that xStep is involved in our current lookup system that uses
14313         SimpleNames to compose a name, while xTerminal is used just to
14314         catch the case where the simplename lookup failed.
14315
14316 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14317
14318         * expression.cs (ResolveMemberAccess): Remove redundant code.
14319         TypeExpr expressions are always born fully resolved.
14320
14321         * interface.cs (PopulateMethod): Do not lookup the types twice.
14322         We were doing it once during SemanticAnalysis and once during
14323         PopulateMethod.
14324
14325         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14326         in local variable type definitions, were being returned as a
14327         SimpleName (we decomposed everything into a string), that is
14328         because primary_expression was being used instead of a type in the
14329         grammar (reduce/reduce conflicts).
14330
14331         The part that was wrong is that we converted the expression into a
14332         string (an oversimplification in one hand, compounded with primary
14333         expressions doing string concatenation).
14334
14335         So things like:
14336
14337         A.B.C [] x;
14338
14339         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14340         using clauses from working on this particular context.  And a type
14341         was being matched directly against "A.B.C[]".
14342
14343         We now use the correct approach, and allow for ComposedCast to be
14344         part of the unary expression.  So the "A.B.C []" become a composed
14345         cast of "A.B.C" (as a nested group of MemberAccess with a
14346         SimpleName at the end) plus the rank composition "[]". 
14347
14348         Also fixes 35567
14349
14350 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14351
14352         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14353         for the access level checking.
14354
14355         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14356         `TypeContainer container', because I kept getting confused when I
14357         was debugging this code.
14358
14359         * expression.cs (Indexers): Instead of tracking getters/setters,
14360         we now track them in parallel.  We create one arraylist less, but
14361         most importantly it is possible now for the LValue code to find a
14362         matching get for a set.
14363
14364         (IndexerAccess.DoResolveLValue): Update the code.
14365         GetIndexersForType has been modified already to extract all the
14366         indexers from a type.  The code assumed it did not.
14367
14368         Also make the code set the correct return type for the indexer.
14369         This was fixed a long time ago for properties, but was missing for
14370         indexers.  It used to be void_type.
14371
14372         (Binary.Emit): Test first for doubles instead of
14373         floats, as they are more common.
14374
14375         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14376         when dealing with floats and the <=, >= operators.  This fixes bug
14377         #39314 
14378
14379         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14380         to load the array value by emitting a load on the foreach variable
14381         type.  This was incorrect.  
14382
14383         We now emit the code to load an element using the the array
14384         variable type, and then we emit the conversion operator.
14385
14386         Fixed #40176
14387
14388 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14389
14390         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14391
14392 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14393
14394         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14395         test for protection before we test for signatures. 
14396
14397         (MethodSignature.ToString): implement.
14398
14399         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14400         to the case where we reduced into a LongConstant.
14401
14402         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14403         depend on whether the information is acurrate, because the
14404         Microsoft runtime will always claim that the array type is public,
14405         regardless of the real state.
14406
14407         If the type is a pointer, another problem happens: the type is
14408         reported as non-public in Microsoft.  
14409
14410         In both cases we have to call CheckAccessLevel recursively with
14411         the underlying type as the argument to be tested.
14412
14413 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14414
14415         * assign.cs (Assign.Emit): If we are dealing with a compound
14416         assignment expression, we should use the code path that stores the
14417         intermediate result in a temporary value.  This fixes #40903.
14418
14419         *expression.cs (Indirection.ToString): Provide ToString method for
14420         debugging. 
14421
14422 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14423
14424         * class.cs: Null out fields holding references to Block objects so
14425         they can be garbage collected.
14426
14427         * expression.cs (OverloadResolve): Remove unused local.
14428
14429 2003-04-07  Martin Baulig  <martin@ximian.com>
14430
14431         * codegen.cs (EmitContext.CurrentFile): New public field.
14432         (EmitContext.Mark): Use the CurrentFile to check whether the
14433         location is in the correct file.
14434         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14435
14436 2003-04-07  Martin Baulig  <martin@ximian.com>
14437
14438         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14439
14440         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14441         location.  [FIXME: The location argument which gets passed to this
14442         method is sometimes wrong!]
14443
14444 2003-04-07  Nick Drochak <ndrochak@gol.com>
14445
14446         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14447
14448 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * expression.cs (Indirection.EmitAssign): We were using the
14451         temporary, but returning immediately instead of continuing the
14452         EmitAssing flow.
14453
14454 2003-04-06  Martin Baulig  <martin@ximian.com>
14455
14456         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14457         if it's a nested child, but also deriving from the outer class.
14458         See test 190.cs.
14459
14460         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14461         nested child, but also deriving from the outer class.  See
14462         test-190.cs.
14463         (FilterWithClosure): We may access private members of the outer
14464         class if we're a nested child and deriving from the outer class.
14465         (RealMemberLookup): Only set `closure_private_ok' if the
14466         `original_bf' contained BindingFlags.NonPublic.
14467
14468 2003-04-05  Martin Baulig  <martin@ximian.com>
14469
14470         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14471         probe if its a type parameter, and if so, flag an error.
14472
14473         * decl.cs: Move here the SetParameterInfo code from class.cs.
14474         Handle IsGeneric here.
14475
14476         Handle a variety of errors in the parameter info definition.
14477
14478         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14479         type parameters here.
14480
14481         * cs-parser.jay (class_declaration): report errors for parameters
14482         here as well.
14483
14484 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14485
14486         * generic.cs: New file, contains support code for generics.
14487
14488         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14489         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14490
14491         Update parser for the above removals.
14492
14493         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14494         now taken care of in the parser.
14495
14496 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14497
14498         * class.cs (Event.Define): Do not allow abstract events to have
14499         initializers. 
14500
14501 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14502
14503         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14504         block in event declarations.
14505
14506         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14507         value type, get its address.
14508
14509         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14510         leaving a class on the stack instead of a boolean value (int
14511         0/1).  Change the code so we compare against null, and then the
14512         result against zero.
14513
14514         * class.cs (TypeContainer.GetClassBases): We were checking for the
14515         parent class being sealed too late.
14516
14517         * expression.cs (Binary.Emit): For <= and >= when dealing with
14518         floating point values, use cgt.un and clt.un instead of cgt and
14519         clt alone.
14520
14521 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14522
14523         * statement.cs: Apply the same optimization as MS: skip the 
14524         GetEnumerator returning an IEnumerator, and use the one returning a 
14525         CharEnumerator instead. This allows us to avoid the try-finally block 
14526         and the boxing.
14527
14528 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14529
14530         * cs-parser.jay: Attributes cannot be applied to
14531                          namespaces. Fixes #40473
14532
14533 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14534
14535         * class.cs:
14536         (Add*): check if the name is valid using the full name for constants,
14537         fields, properties and events.
14538
14539 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14540
14541         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14542         char constants to be part of the enumeration.
14543
14544         * expression.cs (Conditional.DoResolve): Add support for operator
14545         true. Implements the missing functionality from 14.12
14546
14547         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14548         operator true/false as required by the spec.
14549
14550         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14551         implicit conversion to boolean.
14552
14553         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14554         also one where the type implements `operator true'. 
14555
14556         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14557         get an expression that will invoke operator true based on an
14558         expression.  
14559
14560         (GetConversionOperators): Removed the hack that called op_True
14561         here.  
14562
14563         (Expression.ResolveBoolean): Move this from Statement.
14564
14565 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14566
14567         * ecore.cs (FieldExpr): do not allow initialization of initonly
14568         fields on derived classes
14569
14570 2003-03-13  Martin Baulig  <martin@ximian.com>
14571
14572         * statement.cs (Block.Emit): Call ig.BeginScope() and
14573         ig.EndScope() when compiling with debugging info; call
14574         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14575
14576 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * expression.cs (Indexers): Do not construct immediately, allow
14579         for new members to be appended as we go.  Fixes 38143
14580
14581 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14582
14583         * expression.cs: save/restore context when resolving an unchecked
14584         expression.
14585
14586 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14587
14588         * cfold.cs: Catch division by zero in modulus operator during
14589         constant folding.
14590
14591 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * interface.cs (Interface.DefineMembers): Avoid defining members
14594         twice. 
14595
14596 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * driver.cs: handle the +/- options for -noconfig
14599
14600         * statement.cs (Unckeched.Resolve): Also track the state of
14601         unchecked in the Resolve phase.
14602
14603 2003-02-27  Martin Baulig  <martin@ximian.com>
14604
14605         * ecore.cs (Expression.MemberLookup): Don't create a
14606         MethodGroupExpr for something which is not a method.  Fixes #38291.
14607
14608 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14609
14610         * class.cs (MemberBase.CheckParameters): Also check that the type
14611         is unmanaged if it is a pointer.
14612
14613         * expression.cs (SizeOf.Resolve): Add location information.
14614
14615         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14616         a managed type is declared.
14617
14618         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14619         parameter modifiers as well.  Fixes bug 38606
14620
14621         * class.cs: Very sad.  Am backing out the speed up changes
14622         introduced by the ArrayList -> Array in the TypeContainer, as they
14623         were not actually that much faster, and introduced a bug (no error
14624         reports on duplicated methods).
14625
14626         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14627         source first, this will guarantee that we have a valid expression
14628         before calling in lower levels functions that will require a
14629         resolved object.  Then use this original_source in the
14630         target.ResolveLValue instead of the original source that was
14631         passed to us.
14632
14633         Another change.  Use target.Resolve instead of LValueResolve.
14634         Although we are resolving for LValues, we will let the Assign code
14635         take care of that (it will be called again from Resolve).  This
14636         basically allows code like this:
14637
14638         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14639         class Y { void A (X x) { x [0] += o; }
14640
14641         The problem was that the indexer was trying to resolve for
14642         set_Item (idx, object o) and never finding one.  The real set_Item
14643         was set_Item (idx, X).  By delaying the process we get the right
14644         semantics. 
14645
14646         Fixes bug 36505
14647
14648 2003-02-23  Martin Baulig  <martin@ximian.com>
14649
14650         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14651         while calling DoEmit ().
14652
14653         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14654         source files; if you use the #line directive inside a method, the
14655         compiler stops emitting line numbers for the debugger until it
14656         reaches the end of the method or another #line directive which
14657         restores the original file.
14658
14659 2003-02-23  Martin Baulig  <martin@ximian.com>
14660
14661         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14662
14663 2003-02-23  Martin Baulig  <martin@ximian.com>
14664
14665         * statement.cs (Block.AddChildVariableNames): We need to call this
14666         recursively, not just for our immediate children.
14667
14668 2003-02-23  Martin Baulig  <martin@ximian.com>
14669
14670         * class.cs (Event.Define): Always make the field private, like csc does.
14671
14672         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14673         actually work, fixes bug #37521.
14674
14675 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14676
14677         * delegate.cs: When creating the various temporary "Parameters"
14678         classes, make sure that we call the ComputeAndDefineParameterTypes
14679         on those new parameters (just like we do with the formal ones), to
14680         allow them to be resolved in the context of the DeclSpace.
14681
14682         This fixes the bug that Dick observed in Bugzilla #38530.
14683
14684 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14685
14686         * expression.cs (ResolveMemberAccess): When resolving a constant,
14687         do not attempt to pull a constant if the value was not able to
14688         generate a valid constant.
14689
14690         * const.cs (LookupConstantValue): Do not report more errors than required.
14691
14692 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14693
14694         * expression.cs: fixes bug #38328.
14695
14696 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * class.cs: Changed all the various members that can be part of a
14699         class from being an ArrayList to be an Array of the right type.
14700         During the DefineType type_list, interface_list, delegate_list and
14701         enum_list are turned into types, interfaces, delegates and enums
14702         arrays.  
14703
14704         And during the member population, indexer_list, event_list,
14705         constant_list, field_list, instance_constructor_list, method_list,
14706         operator_list and property_list are turned into their real arrays.
14707
14708         Although we could probably perform this operation earlier, for
14709         good error reporting we need to keep the lists and remove the
14710         lists for longer than required.
14711
14712         This optimization was triggered by Paolo profiling the compiler
14713         speed on the output of `gen-sample-program.pl' perl script. 
14714
14715         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14716         not crash in methods like MemberLookupFailed that use this field.  
14717
14718         This problem arises when the compiler fails to resolve a type
14719         during interface type definition for example.
14720
14721 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14724         inherit from System.Object, so we have to stop at null, not only
14725         when reaching System.Object.
14726
14727 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14730         DeclaredOnly because the parent indexer might have had a different
14731         name, but did not loop until the top of the hierarchy was reached.
14732
14733         The problem this one fixes is 35492: when a class implemented an
14734         indexer from an interface, we were getting the interface method
14735         (which was abstract) and we were flagging an error (can not invoke
14736         abstract method).
14737
14738         This also keeps bug 33089 functioning, and test-148 functioning.
14739
14740         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14741         out if a method is special is to see if it is declared in a
14742         property or event, or whether it is one of the predefined operator
14743         names.   This should fix correctly #36804.
14744
14745 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14746
14747         The goal here is to remove the dependency on EmptyCast.Peel ().
14748         Killing it completely.
14749
14750         The problem is that currently in a number of places where
14751         constants are expected, we have to "probe" for an EmptyCast, and
14752         Peel, which is not the correct thing to do, as this will be
14753         repetitive and will likely lead to errors. 
14754
14755         The idea is to remove any EmptyCasts that are used in casts that
14756         can be reduced to constants, so we only have to cope with
14757         constants. 
14758
14759         This bug hunt was triggered by Bug 37363 and the desire to remove
14760         the duplicate pattern where we were "peeling" emptycasts to check
14761         whether they were constants.  Now constants will always be
14762         constants.
14763
14764         * ecore.cs: Use an enumconstant here instead of wrapping with
14765         EmptyCast.  
14766
14767         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14768         throwing me off.  By handling this we can get rid of a few hacks.
14769
14770         * statement.cs (Switch): Removed Peel() code.
14771
14772 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14773
14774         * class.cs: Location information for error 508
14775
14776         * expression.cs (New.DoResolve): Add a guard against double
14777         resolution of an expression.  
14778
14779         The New DoResolve might be called twice when initializing field
14780         expressions (see EmitFieldInitializers, the call to
14781         GetInitializerExpression will perform a resolve on the expression,
14782         and later the assign will trigger another resolution
14783
14784         This leads to bugs (#37014)
14785
14786         * delegate.cs: The signature for EndInvoke should contain any ref
14787         or out parameters as well.  We were not doing this in the past. 
14788
14789         * class.cs (Field.Define): Do not overwrite the type definition
14790         inside the `volatile' group.  Turns out that volatile enumerations
14791         were changing the type here to perform a validity test, which
14792         broke conversions. 
14793
14794 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14795
14796         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14797         and structs, we do not want to load the instance variable
14798
14799         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14800         enum_type has to be handled like an object reference (implicit
14801         conversions exists from this to object), but the regular IsClass
14802         and IsValueType tests will never return true for this one.
14803
14804         Also we use TypeManager.IsValueType instead of type.IsValueType,
14805         just for consistency with the rest of the code (this is only
14806         needed if we ever use the construct exposed by test-180.cs inside
14807         corlib, which we dont today).
14808
14809 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14810
14811         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14812         just InternalCall.
14813
14814 2003-02-09  Martin Baulig  <martin@ximian.com>
14815
14816         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14817         (Namespace.DefineNamespaces): New static public method; this is
14818         called when we're compiling with debugging to add all namespaces
14819         to the symbol file.
14820
14821         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14822         pass it to the Namespace's .ctor.
14823
14824         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14825         and MethodBase arguments; pass the namespace ID to the symwriter;
14826         pass the MethodBase instead of the token to the symwriter.
14827         (SymbolWriter.DefineNamespace): New method to add a namespace to
14828         the symbol file.
14829
14830 2003-02-09  Martin Baulig  <martin@ximian.com>
14831
14832         * symbolwriter.cs: New file.  This is a wrapper around
14833         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14834         methods here in near future.
14835
14836 2003-02-09  Martin Baulig  <martin@ximian.com>
14837
14838         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14839         ILGenerator.MarkSequencePoint() which are actually used by the
14840         symbol writer.
14841
14842 2003-02-09  Martin Baulig  <martin@ximian.com>
14843
14844         * location.cs (SourceFile): New public sealed class.  This
14845         contains the name and an index which is used in the location's token.
14846         (Location): Reserve an appropriate number of bits in the token for
14847         the source file instead of walking over that list, this gives us a
14848         really huge performance improvement when compiling with debugging.
14849
14850         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14851         `SourceFile' argument instead of a string.
14852         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14853         but don't parse/tokenize here, we need to generate the list of all
14854         source files before we do that.
14855         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14856         the files.
14857
14858         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14859         instead of a string.
14860
14861         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14862         of a string.
14863
14864 2003-02-09  Martin Baulig  <martin@ximian.com>
14865
14866         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14867         filename on `#line default'.
14868
14869 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14870
14871         * statement.cs: don't clear the pinned var when the fixed statement
14872         returns from the method (fixes bug#37752).
14873
14874 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14875
14876         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14877         to IsValueType.
14878
14879 2003-02-07  Martin Baulig  <martin@ximian.com>
14880
14881         * driver.cs: Removed the `--debug-args' command line argument.
14882
14883         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14884         automatically by the AsssemblyBuilder.
14885         (CodeGen.InitializeSymbolWriter): We don't need to call any
14886         initialization function on the symbol writer anymore.  This method
14887         doesn't take any arguments.
14888
14889 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14890
14891         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14892         from referenced assemblies as well.
14893
14894 2003-02-02  Martin Baulig  <martin@ximian.com>
14895
14896         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14897
14898 2003-02-02  Martin Baulig  <martin@ximian.com>
14899
14900         * class.cs (Constructor.Emit): Open the symbol writer before
14901         emitting the constructor initializer.
14902         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14903         single-stepping through constructor initializers.
14904
14905 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14906
14907         * class.cs: Handle error 549: do not allow virtual methods in
14908         sealed classes. 
14909
14910 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14911
14912         * decl.cs: Check access levels when resolving types
14913
14914 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14915
14916         * statement.cs: Add parameters and locals set in catch blocks that might 
14917         return to set vector
14918
14919 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14920
14921         * class.cs (Operator): Set the SpecialName flags for operators.
14922
14923         * expression.cs (Invocation.DoResolve): Only block calls to
14924         accessors and operators on SpecialName methods.
14925
14926         (Cast.TryReduce): Handle conversions from char constants.
14927
14928
14929 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14930
14931         * statement.cs: small memory and time optimization in FlowBranching.
14932
14933 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14934
14935         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14936         problem that the last fix but in the other sid (Set).
14937
14938         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14939         access when there is no indexer in the hierarchy.
14940
14941 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14942
14943         * class.cs: Combine some if statements.
14944
14945 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14946
14947         * driver.cs: fixed bug #37187.
14948
14949 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14950
14951         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14952         any indexer, it's needed to build a list with all the indexers in the
14953         hierarchy (AllGetters), else we have problems. Fixes #35653.
14954
14955 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * class.cs (MethodData.Define): It is wrong for an interface
14958         implementation to be static in both cases: explicit and implicit.
14959         We were only handling this in one case.
14960
14961         Improve the if situation there to not have negations.
14962
14963         * class.cs (Field.Define): Turns out that we do not need to check
14964         the unsafe bit on field definition, only on usage.  Remove the test.
14965
14966 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14967
14968         * driver.cs: use assembly.Location instead of Codebase (the latest
14969         patch made mcs fail when using MS assemblies).
14970
14971 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14972
14973         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14974         get the path to *corlib.dll.
14975
14976 2003-01-21  Nick Drochak <ndrochak@gol.com>
14977
14978         * cs-tokenizer.cs:
14979         * pending.cs:
14980         * typemanager.cs: Remove compiler warnings
14981
14982 2003-01-20  Duncan Mak  <duncan@ximian.com>
14983
14984         * AssemblyInfo.cs: Bump the version number to 0.19.
14985
14986 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14987
14988         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14989
14990 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14991
14992         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14993
14994 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14995
14996         * cs-parser.jay: Small fix: we were not comparing the constructor
14997         name correctly.   Thanks to Zoltan for the initial pointer.
14998
14999 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15000
15001         * cs-tokenizer.cs: Set file name when specified with #line
15002
15003 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15004
15005         * cs-parser.jay: Only perform the constructor checks here if we
15006         are named like the class;  This will help provider a better
15007         error.  The constructor path is taken when a type definition is
15008         not found, but most likely the user forgot to add the type, so
15009         report that rather than the constructor error.
15010
15011 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15012
15013         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15014         allocations.
15015
15016 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15017
15018         * cs-parser.jay: Add cleanup call.
15019
15020 2003-01-13  Duncan Mak  <duncan@ximian.com>
15021
15022         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15023         consistent with other methods.
15024
15025 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15026
15027         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15028
15029 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15030
15031         * attribute.cs: only set GuidAttr to true when we have a
15032         GuidAttribute.
15033
15034 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15035
15036         * ecore.cs:
15037         * expression.cs:
15038         * typemanager.cs: fixes to allow mcs compile corlib with the new
15039         Type.IsSubclassOf fix.
15040
15041 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * expression.cs (LocalVariableReference.DoResolve): Classify a
15044         constant as a value, not as a variable.   Also, set the type for
15045         the variable.
15046
15047         * cs-parser.jay (fixed_statement): take a type instead of a
15048         pointer_type, so we can produce a better error message later.
15049
15050         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15051         as an error.  
15052
15053         (For.DoEmit): Make inifinite loops have a
15054         non-conditional branch back.
15055
15056         (Fixed.DoEmit): First populate the pinned variables, then emit the
15057         statement, then clear the variables.  Before I was emitting the
15058         code once for each fixed piece.
15059
15060
15061 2003-01-08  Martin Baulig  <martin@ximian.com>
15062
15063         * statement.cs (FlowBranching.MergeChild): A break in a
15064         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15065
15066 2003-01-08  Martin Baulig  <martin@ximian.com>
15067
15068         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15069         lives in the same number space than `param_map'.  Fixes #36154.
15070
15071 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * cs-parser.jay (constructor_declaration): Set the
15074         Constructor.ModFlags before probing for it.  This makes the
15075         compiler report 514, 515 and 132 (the code was there, but got
15076         broken). 
15077
15078         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15079         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15080         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15081
15082 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15083
15084         * enum.cs: create the enum static fields using the enum type.
15085
15086 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15087
15088         * class.cs: don't try to create the ParamBuilder for the return
15089         type if it's not needed (and handle it breaking for the ms runtime
15090         anyway).
15091
15092 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15093
15094         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15095
15096 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15099         the command.   This showed up while compiling the JANET source
15100         code, which used \r as its only newline separator.
15101
15102 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * class.cs (Method.Define): If we are an operator (because it
15105         reuses our code), then set the SpecialName and HideBySig.  #36128
15106
15107 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15108
15109         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15110         exception, report error 120 `object reference required'.
15111
15112         * driver.cs: Add --pause option, used during to measure the size
15113         of the process as it goes with --timestamp.
15114
15115         * expression.cs (Invocation.DoResolve): Do not allow methods with
15116         SpecialName to be invoked.
15117
15118 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15119
15120         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15121         number before adding it.
15122
15123 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15124
15125         * ecore.cs (StandardImplicitConversion): When in an unsafe
15126         context, we allow conversion between void * to any other pointer
15127         type. This fixes bug #35973.
15128
15129 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15130
15131         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15132         is not thrown when extensionless outputs are used 
15133
15134 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15135
15136         * rootcontext.cs: fixed compilation of corlib.
15137
15138 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * attribute.cs (Attributes.Contains): Add new method.
15141
15142         * class.cs (MethodCore.LabelParameters): if the parameter is an
15143         `out' parameter, check that no attribute `[In]' has been passed.
15144
15145         * enum.cs: Handle the `value__' name in an enumeration.
15146
15147 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15148
15149         * decl.cs: Added special case to allow overrides on "protected
15150         internal" methods
15151
15152 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15153
15154         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15155         since it makes much more sense.
15156
15157         (Attributes.ctor): Don't require a Location parameter.
15158
15159         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15160
15161         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15162         since we already have that information per attribute.
15163
15164         * everywhere : make appropriate changes.
15165
15166         * class.cs (LabelParameters): Write the code which actually
15167         applies attributes to the return type. We can't do this on the MS
15168         .NET runtime so we flag a warning in the case an exception is
15169         thrown.
15170
15171 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15172
15173         * const.cs: Handle implicit null conversions here too.
15174
15175 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15176
15177         * class.cs (MethodCore.LabelParameters): Remove the extra
15178         Type [] parameter since it is completely unnecessary. Instead
15179         pass in the method's attributes so that we can extract
15180         the "return" attribute.
15181
15182 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15183
15184         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15185         of ignoring it and letting the compile continue.
15186
15187         * typemanager.cs (ChangeType): use an extra argument to return an
15188         error condition instead of throwing an exception.
15189
15190 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15191
15192         * expression.cs (Unary.TryReduce): mimic the code for the regular
15193         code path.  Perform an implicit cast in the cases where we can
15194         implicitly convert to one of the integral types, and then reduce
15195         based on that constant.   This fixes bug #35483.
15196
15197 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15198
15199         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15200
15201 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15202
15203         * namespace.cs: fixed bug #35489.
15204
15205 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15206
15207         * class.cs: Remove some dead code.
15208
15209         * cs-parser.jay: Estimate the number of methods needed
15210         (RootContext.MethodCount);
15211
15212         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15213         numbers instead of StringBuilders.
15214
15215         * support.cs (PtrHashtable): Add constructor with initial size;
15216         We can now reduce reallocations of the method table.
15217
15218 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15219
15220         * attribute.cs (ApplyAttributes): Keep track of the emitted
15221         attributes on a per-target basis. This fixes bug #35413.
15222
15223 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15224
15225         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15226         default to the Windows 1252 encoding.
15227
15228         (UnixParseOption): Support version, thanks to Alp for the missing
15229         pointer. 
15230
15231         * AssemblyInfo.cs: Add nice assembly information.
15232
15233         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15234         (bug 35169).
15235
15236         * cs-parser.jay: Allow a trailing comma before the close bracked
15237         in the attribute_section production.
15238
15239         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15240         address of the instance was being taken, I will take this out,
15241         because we take the address of the object immediately here.
15242
15243 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15244
15245         * typemanager.cs (AreMultipleAllowed): Take care of the most
15246         obvious case where attribute type is not in the current assembly -
15247         stupid me ;-)
15248
15249 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15250
15251         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15252         definitions, instead of doing that afterwards.  
15253
15254         Also we use a nice little hack, depending on the constructor, we
15255         know if we are a "composed" name or a simple name.  Hence, we
15256         avoid the IndexOf test, and we avoid 
15257
15258         * codegen.cs: Add code to assist in a bug reporter to track down
15259         the source of a compiler crash. 
15260
15261 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15262
15263         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15264         types have been emitted for a given element and flag an error
15265         if something which does not have AllowMultiple set is used more
15266         than once.
15267
15268         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15269         attribute types and their corresponding AllowMultiple properties
15270
15271         (AreMultipleAllowed): Check the property for a given type.
15272
15273         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15274         property in the case we have a TypeContainer.
15275
15276         (Attributes.AddAttribute): Detect duplicates and just skip on
15277         adding them. This trivial fix catches a pretty gross error in our
15278         attribute emission - global attributes were being emitted twice!
15279
15280         Bugzilla bug #33187 is now fixed.
15281
15282 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15283
15284         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15285         instead of pp_and).
15286
15287         * expression.cs (Binary.ResolveOperator): I can only use the
15288         Concat (string, string, string) and Concat (string, string,
15289         string, string) if the child is actually a concatenation of
15290         strings. 
15291
15292 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15295         context where we need a 2-character lookahead.
15296
15297         * pending.cs (PendingImplementation): Rework so we can keep track
15298         of interface types all the time, and flag those which were
15299         implemented by parents as optional.
15300
15301 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15302
15303         * expression.cs (Binary.ResolveOperator): Use
15304         String.Concat(string,string,string) or
15305         String.Concat(string,string,string,string) when possible. 
15306
15307         * typemanager: More helper methods.
15308
15309
15310 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15311
15312         * pending.cs: remove the bogus return from GetMissingInterfaces()
15313         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15314
15315 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15316
15317         * namespace.cs: avoid duplicated 'using xxx' being added to
15318         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15319         when we get more than one 'using' statement for the same namespace.
15320         Report a CS0105 warning for it.
15321
15322 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15325         of calling getChar/putback, uses internal knowledge of it.    
15326
15327         (xtoken): Reorder tokenizer so most common patterns are checked
15328         first.  This reduces the compilation time in another 5% (from 8.11s
15329         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15330
15331         The parsing time is 22% of the compilation in mcs, and from that
15332         64% is spent on the tokenization process.  
15333
15334         I tried using a binary search for keywords, but this is slower
15335         than the hashtable.  Another option would be to do a couple of
15336         things:
15337
15338                 * Not use a StringBuilder, instead use an array of chars,
15339                   with a set value.  Notice that this way we could catch
15340                   the 645 error without having to do it *afterwards*.
15341
15342                 * We could write a hand-parser to avoid the hashtable
15343                   compares altogether.
15344
15345         The identifier consumption process takes 37% of the tokenization
15346         time.  Another 15% is spent on is_number.  56% of the time spent
15347         on is_number is spent on Int64.Parse:
15348
15349                 * We could probably choose based on the string length to
15350                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15351                   computations. 
15352
15353         Another 3% is spend on wrapping `xtoken' in the `token' function.
15354
15355         Handle 0xa0 as whitespace (#34752)
15356
15357 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15358
15359         * typemanager.cs (IsCLRType): New routine to tell whether a type
15360         is one of the builtin types.  
15361
15362         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15363         typecode in more places instead of doing pointer comparissions.
15364         We could leverage some knowledge about the way the typecodes are
15365         laid out.
15366
15367         New code to cache namespaces in assemblies, it is currently not
15368         invoked, to be used soon.
15369
15370         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15371
15372         * expression.cs (Binary.ResolveOperator): specially handle
15373         strings, and do not perform user-defined operator overloading for
15374         built-in types.
15375
15376 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15377
15378         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15379         internalcall as it is a pretty simple operation;  Avoid whenever
15380         possible to call Char.IsLetter.
15381
15382         (consume_identifier): Cut by half the number of
15383         hashtable calls by merging the is_keyword and GetKeyword behavior.
15384
15385         Do not short-circuit, because if we do, we
15386         report errors (ie, #if false && true would produce an invalid
15387         directive error);
15388
15389
15390 2002-11-24  Martin Baulig  <martin@ximian.com>
15391
15392         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15393         check constant ranges and report a CS0221.  Fixes #33186.
15394
15395 2002-11-24  Martin Baulig  <martin@ximian.com>
15396
15397         * cs-parser.jay: Make this work for uninitialized variable
15398         declarations in the `for' initializer.  Fixes #32416.
15399
15400 2002-11-24  Martin Baulig  <martin@ximian.com>
15401
15402         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15403         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15404
15405 2002-11-24  Martin Baulig  <martin@ximian.com>
15406
15407         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15408         argument; if true, we also check for user-defined conversions.
15409         This is only needed if both arguments are of a user-defined type.
15410         Fixes #30443, added test-175.cs.
15411         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15412
15413         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15414
15415 2002-11-24  Martin Baulig  <martin@ximian.com>
15416
15417         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15418         function to get the store opcode.
15419         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15420         only emit the Ldelema if the store opcode is Stobj.  You must run
15421         both test-34 and test-167 to test this.  Fixes #34529.
15422
15423 2002-11-23  Martin Baulig  <martin@ximian.com>
15424
15425         * ecore.cs (Expression.MemberLookup): Added additional
15426         `qualifier_type' argument which is used when we're being called
15427         from MemberAccess.DoResolve() and null if we're called from a
15428         SimpleName lookup.
15429         (Expression.MemberLookupFailed): New method to report errors; this
15430         does the CS1540 check and reports the correct error message.
15431
15432         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15433         argument for the CS1540 check and redone the way how we're dealing
15434         with private members.  See the comment in the source code for details.
15435         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15436         `closure_start_type' to `closure_qualifier_type' and check whether
15437         it's not null.  It was not this filter being broken, it was just
15438         being called with the wrong arguments.
15439
15440         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15441         and pass it the correct `qualifier_type'; this also does the error
15442         handling for us.
15443
15444 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * expression.cs (Invocation.EmitParams): If the we are dealing
15447         with a non-built-in value type, load its address as well.
15448
15449         (ArrayCreation): Use a a pretty constant instead
15450         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15451         static initializers.  
15452
15453         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15454         because they are not really value types, just glorified integers. 
15455
15456         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15457
15458         * ecore.cs: Remove redundant code for enumerations, make them use
15459         the same code path as everything else, fixes the casting issue
15460         with enumerations in Windows.Forms.
15461
15462         * attribute.cs: Do only cast to string if it is a string, the
15463         validation happens later.
15464
15465         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15466         people upgrade their corlibs.
15467
15468         * ecore.cs: Oops, enumerations were not following the entire code path
15469
15470 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15471
15472         * typemanager.cs (FilterWithClosure): Commented out the test for
15473         1540 in typemanager.cs, as it has problems when accessing
15474         protected methods from a parent class (see test-174.cs). 
15475
15476         * attribute.cs (Attribute.ValidateGuid): new method.
15477         (Attribute.Resolve): Use above.
15478
15479 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15482
15483         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15484         handling for enumerations, as we only needed the TypeContainer
15485         functionality to begin with (this is required for the fix below to
15486         work for enums that reference constants in a container class for
15487         example). 
15488
15489         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15490
15491         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15492         a valid TypeBuilder to perform lookups on.o
15493
15494         * class.cs (InheritableMemberSignatureCompare): Use true in the
15495         call to GetGetMethod and GetSetMethod, because we are comparing
15496         the signature, and we need to get the methods *even* if they are
15497         private. 
15498
15499         (PropertyBase.CheckBase): ditto.
15500
15501         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15502         GotoCase.Resolve): Use Peel on EmpytCasts.
15503
15504         * ecore.cs (EmptyCast): drop child, add Peel method.
15505
15506 2002-11-17  Martin Baulig  <martin@ximian.com>
15507
15508         * ecore.cs (EmptyCast.Child): New public property.
15509
15510         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15511         label resolved to an EmptyCast.  Fixes #34162.
15512         (GotoCase.Resolve): Likewise.
15513         (Block.EmitMeta): Likewise.
15514
15515 2002-11-17  Martin Baulig  <martin@ximian.com>
15516
15517         * expression.cs (Invocation.BetterConversion): Prefer int over
15518         uint; short over ushort; long over ulong for integer literals.
15519         Use ImplicitConversionExists instead of StandardConversionExists
15520         since we also need to check for user-defined implicit conversions.
15521         Fixes #34165.  Added test-173.cs.
15522
15523 2002-11-16  Martin Baulig  <martin@ximian.com>
15524
15525         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15526         with the `true' and `false' literals.  Fixes #33151.
15527
15528 2002-11-16  Martin Baulig  <martin@ximian.com>
15529
15530         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15531         October 22nd; don't do the cs1540 check for static members.
15532
15533         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15534         now using our own filter here and doing the cs1540 check again.
15535
15536 2002-11-16  Martin Baulig  <martin@ximian.com>
15537
15538         * support.cs (InternalParameters): Don't crash if we don't have
15539         any fixed parameters.  Fixes #33532.
15540
15541 2002-11-16  Martin Baulig  <martin@ximian.com>
15542
15543         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15544         when looking up static methods to make this work on Windows.
15545         Fixes #33773.
15546
15547 2002-11-16  Martin Baulig  <martin@ximian.com>
15548
15549         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15550         a setter rather than using PropertyInfo.CanWrite.
15551
15552 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15553
15554         * class.cs: Allow acces to block member by subclasses. Fixes build
15555         breaker.
15556
15557 2002-11-14  Martin Baulig  <martin@ximian.com>
15558
15559         * class.cs (Constructor.Emit): Added the extern/block check.
15560         Fixes bug #33678.
15561
15562 2002-11-14  Martin Baulig  <martin@ximian.com>
15563
15564         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15565         iteration while looking for indexers, this is needed because the
15566         indexer may have a different name in our base classes.  Fixed the
15567         error reporting (no indexers at all, not get accessor, no
15568         overloaded match).  Fixes bug #33089.
15569         (IndexerAccess.DoResolveLValue): Likewise.
15570
15571 2002-11-14  Martin Baulig  <martin@ximian.com>
15572
15573         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15574         indexers.  Fixes the first part of bug #33089.
15575         (MethodSignature.InheritableMemberSignatureCompare): Added support
15576         for properties.
15577
15578 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15579
15580         * attribute.cs (Attribute.Resolve): Catch the
15581         NullReferenceException and report it since it isn't supposed to
15582         happen. 
15583
15584 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15587         LogicalOr and LogicalAnd that can benefit from recursively
15588         handling EmitBranchable.  The code now should be nice for Paolo.
15589
15590 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15593         the Type lookups, as we perform quite a number of lookups on
15594         non-Types.  This can be removed once we can deterministically tell
15595         whether we have a type or a namespace in advance.
15596
15597         But this might require special hacks from our corlib.
15598
15599         * TODO: updated.
15600
15601         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15602         and double which avoids a conversion from an integer to a double.
15603
15604         * expression.cs: tiny optimization, avoid calling IsConstant,
15605         because it effectively performs the lookup twice.
15606
15607 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15608
15609         But a bogus return here to keep the semantics of the old code
15610         until the Mono runtime is fixed.
15611
15612         * pending.cs (GetMissingInterfaces): New method used to remove all
15613         the interfaces that are already implemented by our parent
15614         classes from the list of pending methods. 
15615
15616         * interface.cs: Add checks for calls after ResolveTypeExpr.
15617
15618 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15619
15620         * class.cs (Class.Emit): Report warning 67: event not used if the
15621         warning level is beyond 3.
15622
15623         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15624         being a NullLiteral.
15625
15626         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15627         specifiers. 
15628
15629         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15630         path that might fail if a type can not be resolved.
15631
15632         * expression.cs (Binary.Emit): Emit unsigned versions of the
15633         operators. 
15634
15635         * driver.cs: use error 5.
15636
15637 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15638
15639         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15640
15641 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15642
15643         * cs-parser.jay (switch_section): A beautiful patch from Martin
15644         Baulig that fixed 33094.
15645
15646 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15649         Check whether the base is abstract and report an error if so.
15650
15651         * expression.cs (IndexerAccess.DoResolveLValue,
15652         IndexerAccess.DoResolve): ditto. 
15653
15654         (Invocation.DoResolve): ditto.
15655
15656         (Invocation.FullMethodDesc): Improve the report string.
15657
15658         * statement.cs (Block): Eliminate IsVariableDefined as it is
15659         basically just a wrapper for GetVariableInfo.
15660
15661         * ecore.cs (SimpleName): Use new 
15662
15663         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15664         type, as we return the actual parameter ref/unref state on a
15665         different call.
15666
15667 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15668
15669         * support.cs: Return proper flags REF/OUT fixing the previous
15670         commit.  
15671
15672         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15673         not used to mean `ref' but `ref or out' in ParameterReference
15674
15675         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15676         full type signature instead of calling TypeManger.CSharpName
15677         ourselves. 
15678
15679         * support.cs (InternalParameters.ParameterDesc): Do not compare
15680         directly to the modflags, because REF/OUT will actually be bitsets
15681         if set. 
15682
15683         * delegate.cs (VerifyMethod): Check also the modifiers.
15684
15685         * cs-tokenizer.cs: Fix bug where floating point values with an
15686         exponent where a sign was missing was ignored.
15687
15688         * driver.cs: Allow multiple assemblies to be specified in a single
15689         /r: argument
15690
15691 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15694         because identifiers after a parenthesis would end up in this kind
15695         of production, and we needed to desamiguate it for having casts
15696         like:
15697
15698                 (UserDefinedType *) xxx
15699
15700 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15701
15702         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15703         we should set on the Bindingflags.NonPublic, but not turn on
15704         private_ok.  private_ok controls whether a Private member is
15705         returned (this is chekced on the filter routine), while the
15706         BindingFlags.NonPublic just controls whether private/protected
15707         will be allowed.   This fixes the problem part of the problem of
15708         private properties being allowed to be used in derived classes.
15709
15710         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15711         so we can call the children DoResolveLValue method (this will
15712         properly signal errors on lvalue assignments to base properties)
15713
15714         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15715         getter are null, and we have a property info, we know that this
15716         happened because the lookup failed, so we report an error 122 for
15717         protection level violation.
15718
15719         We also silently return if setter and getter are null in the
15720         resolve functions, this condition only happens if we have flagged
15721         the error before.  This is the other half of the problem. 
15722
15723         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15724         not have accessibility information, that is why we were returning
15725         true in the filter function in typemanager.cs.
15726
15727         To properly report 122 (property is inaccessible because of its
15728         protection level) correctly, we report this error in ResolveAccess
15729         by failing if both the setter and the getter are lacking (ie, the
15730         lookup failed). 
15731
15732         DoResolve and DoLResolve have been modified to check for both
15733         setter/getter being null and returning silently, the reason being
15734         that I did not want to put the knowledge about this error in upper
15735         layers, like:
15736
15737         int old = Report.Errors;
15738         x = new PropertyExpr (...);
15739         if (old != Report.Errors)
15740                 return null;
15741         else
15742                 return x;
15743
15744         So the property expr is returned, but it is invalid, so the error
15745         will be flagged during the resolve process. 
15746
15747         * class.cs: Remove InheritablePropertySignatureCompare from the
15748         class, as we no longer depend on the property signature to compute
15749         whether it is possible to implement a method or not.
15750
15751         The reason is that calling PropertyInfo.GetGetMethod will return
15752         null (in .NET, in Mono it works, and we should change this), in
15753         cases where the Get Method does not exist in that particular
15754         class.
15755
15756         So this code:
15757
15758         class X { public virtual int A { get { return 1; } } }
15759         class Y : X { }
15760         class Z : Y { public override int A { get { return 2; } } }
15761
15762         Would fail in Z because the parent (Y) would not have the property
15763         defined.  So we avoid this completely now (because the alternative
15764         fix was ugly and slow), and we now depend exclusively on the
15765         method names.
15766
15767         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15768         reference method, instead of using the property.
15769
15770         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15771         routines are gone now.
15772
15773         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15774         names, they were incorrectly named.
15775
15776         * cs-tokenizer.cs: Return are more gentle token on failure. 
15777
15778         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15779         had an out-of-sync index variable, which caused it to remove from
15780         the list of pending methods the wrong method sometimes.
15781
15782 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15783
15784         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15785         CanWrite, because those refer to this particular instance of the
15786         property, and do not take into account the fact that we can
15787         override single members of a property.
15788
15789         Constructor requires an EmitContext.  The resolution process does
15790         not happen here, but we need to compute the accessors before,
15791         because the resolution does not always happen for properties.
15792
15793         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15794         subclass, before we did not update this flag, but we did update
15795         bindingflags. 
15796
15797         (GetAccessors): Drop this routine, as it did not work in the
15798         presence of partially overwritten set/get methods. 
15799
15800         Notice that this broke the cs1540 detection, but that will require
15801         more thinking. 
15802
15803 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15804
15805         * class.cs:
15806         * codegen.cs:
15807         * driver.cs: issue a warning instead of an error if we don't support
15808         debugging for the platform. Also ignore a couple of errors that may
15809         arise when trying to write the symbols. Undo my previous patch.
15810
15811 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15812
15813         * driver.cs: ignore /debug switch except for Unix platforms.
15814
15815 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15816
15817         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15818
15819 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15820
15821         * driver.cs: Do not make mcs-debug conditional, so we do not break
15822         builds that use it.
15823
15824         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15825         review this patch.  But basically after all the children variables
15826         have been merged, the value of "Breaks" was not being set to
15827         new_breaks for Switch blocks.  I think that it should be set after
15828         it has executed.  Currently I set this to the value of new_breaks,
15829         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15830         conservative, but I do not understand this code very well.
15831
15832         I did not break anything in the build, so that is good ;-)
15833
15834         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15835
15836 2002-10-20  Mark Crichton  <crichton@gimp.org>
15837
15838         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15839
15840 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15841
15842         * cfold.cs: Fixed compile blocker.
15843
15844 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15845
15846         * driver.cs: I was chekcing the key, not the file.
15847
15848 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15849
15850         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15851         message that we were generating - we just need to silently return
15852         a null.
15853
15854 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15855
15856         * class.cs (Event.Define): Change my previous commit, as this
15857         breaks the debugger.  This is a temporary hack, as it seems like
15858         the compiler is generating events incorrectly to begin with.
15859
15860         * expression.cs (Binary.ResolveOperator): Added support for 
15861         "U operator - (E x, E y)"
15862
15863         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15864         y)".
15865
15866         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15867         init-only variables, but this path did not take into account that
15868         there might be also instance readonly variables.  Correct this
15869         problem. 
15870
15871         This fixes bug 32253
15872
15873         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15874         delegates as well.
15875
15876         * driver.cs: Change the extension for modules to `netmodule'
15877
15878         * cs-parser.jay: Improved slightly the location tracking for
15879         the debugger symbols.
15880
15881         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15882         modifiers that were specified instead of the hardcoded value
15883         (FamAndAssem).  This was basically ignoring the static modifier,
15884         and others.  Fixes 32429.
15885
15886         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15887         fixed a bug in the process (32476)
15888
15889         * expression.cs (ArrayAccess.EmitAssign): Patch from
15890         hwang_rob@yahoo.ca that fixes bug 31834.3
15891
15892 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15893
15894         * driver.cs: Make the module extension .netmodule.
15895
15896 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15897
15898         * driver.cs: Report an error if the resource file is not found
15899         instead of crashing.
15900
15901         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15902         false, like Emit does.
15903
15904 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15905
15906         * typemanager.cs: Remove unused private member.  Also reported mcs
15907         bug to report this as a warning like csc.
15908
15909 2002-10-15  Martin Baulig  <martin@gnome.org>
15910
15911         * statement.cs (Statement.Emit): Made this a virtual method; emits
15912         the line number info and calls DoEmit().
15913         (Statement.DoEmit): New protected abstract method, formerly knows
15914         as Statement.Emit().
15915
15916         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15917
15918 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15919
15920         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15921         have fixed a remaining problem: not every AddXXXX was adding a
15922         fully qualified name.  
15923
15924         Now everyone registers a fully qualified name in the DeclSpace as
15925         being defined instead of the partial name.  
15926
15927         Downsides: we are slower than we need to be due to the excess
15928         copies and the names being registered this way.  
15929
15930         The reason for this is that we currently depend (on the corlib
15931         bootstrap for instance) that types are fully qualified, because
15932         we dump all the types in the namespace, and we should really have
15933         types inserted into the proper namespace, so we can only store the
15934         basenames in the defined_names array.
15935
15936 2002-10-10  Martin Baulig  <martin@gnome.org>
15937
15938         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15939         from bug #31834, see the bug report for a testcase which is
15940         miscompiled.
15941
15942 2002-10-10  Martin Baulig  <martin@gnome.org>
15943
15944         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15945         flow analysis code for this.
15946
15947         * statement.cs (Do, While, For): Tell the flow analysis code about
15948         infinite loops.
15949         (FlowBranching.UsageVector): Added support for infinite loops.
15950         (Block.Resolve): Moved the dead code elimination here and use flow
15951         analysis to do it.
15952
15953 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15954
15955         * class.cs (Field.Define): Catch cycles on struct type
15956         definitions. 
15957
15958         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15959         fields if the fields are static.  We only need to check instance
15960         fields. 
15961
15962         * expression.cs (As.DoResolve): Test for reference type.
15963
15964         * statement.cs (Using.ResolveExpression): Use
15965         ConvertImplicitRequired, not ConvertImplicit which reports an
15966         error on failture
15967         (Using.ResolveLocalVariableDecls): ditto.
15968
15969         * expression.cs (Binary.ResolveOperator): Report errors in a few
15970         places where we had to.
15971
15972         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15973
15974 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15975
15976         * expression.cs: Use StoreFromPtr instead of extracting the type
15977         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15978
15979         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15980         an enumeration value to a System.Enum, but System.Enum is not a
15981         value type, but an class type, so we need to box.
15982
15983         (Expression.ConvertExplicit): One codepath could return
15984         errors but not flag them.  Fix this.  Fixes #31853
15985
15986         * parameter.cs (Resolve): Do not allow void as a parameter type.
15987
15988 2002-10-06  Martin Baulig  <martin@gnome.org>
15989
15990         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15991         if it's a class type and not a struct.  Fixes #31815.
15992
15993 2002-10-06  Martin Baulig  <martin@gnome.org>
15994
15995         * statement.cs: Reworked the flow analysis code a bit to make it
15996         usable for dead code elimination.
15997
15998 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15999
16000         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16001
16002 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16005         to fix the test 165, will investigate deeper.
16006
16007 2002-10-04  Martin Baulig  <martin@gnome.org>
16008
16009         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16010         finally blocks actually work.
16011         (Try.Resolve): We don't need to create a sibling for `finally' if
16012         there is no finally block.
16013
16014 2002-10-04  Martin Baulig  <martin@gnome.org>
16015
16016         * class.cs (Constructor.Define): The default accessibility for a
16017         non-default constructor is private, not public.
16018
16019 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * class.cs (Constructor): Make AllowedModifiers public, add
16022         EXTERN.
16023
16024         * cs-parser.jay: Perform the modifiers test here, as the
16025         constructor for the Constructor class usually receives a zero
16026         because of the way we create it (first we create, later we
16027         customize, and we were never checking the modifiers).
16028
16029         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16030         is a version of LookupTypeReflection that includes the type-name
16031         cache.  This can be used as a fast path for functions that know
16032         the fully qualified name and are only calling into *.GetType() to
16033         obtain a composed type.
16034
16035         This is also used by TypeManager.LookupType during its type
16036         composition.
16037
16038         (LookupType): We now also track the real type name, as sometimes
16039         we can get a quey for the real type name from things like
16040         ComposedCast.  This fixes bug 31422.
16041
16042         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16043         complete type fullname, it does not have to go through the type
16044         resolution system to obtain the composed version of the type (for
16045         obtaining arrays or pointers).
16046
16047         (Conditional.Emit): Use the EmitBoolExpression to
16048         generate nicer code, as requested by Paolo.
16049
16050         (ArrayCreation.CheckIndices): Use the patch from
16051         hwang_rob@yahoo.ca to validate the array initializers. 
16052
16053 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * class.cs (ConstructorInitializer.Emit): simplify code by using
16056         Invocation.EmitCall, and at the same time, fix the bugs in calling
16057         parent constructors that took variable arguments. 
16058
16059         * ecore.cs (Expression.ConvertNumericExplicit,
16060         Expression.ImplicitNumericConversion): Remove the code that
16061         manually wrapped decimal (InternalTypeConstructor call is now gone
16062         as well).
16063
16064         * expression.cs (Cast.TryReduce): Also handle decimal types when
16065         trying to perform a constant fold on the type.
16066
16067         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16068
16069         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16070         that only turned off an error report, and did nothing else. 
16071
16072 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16073
16074         * driver.cs: Handle and ignore /fullpaths
16075
16076 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16077
16078         * expression.cs (Binary.ResolveOperator): Catch the case where
16079         DoNumericPromotions returns true, 
16080
16081         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16082
16083 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16084
16085         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16086         report error 70.
16087
16088 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16091         conversion exists, but it is also required that the conversion be
16092         performed.  This manifested in "(Type64Enum) 2".  
16093
16094         * class.cs (TypeManager.AddMethod): The fix is not to change
16095         AddEnum, because that one was using a fully qualified name (every
16096         DeclSpace derivative does), but to change the AddMethod routine
16097         that was using an un-namespaced name.  This now correctly reports
16098         the duplicated name.
16099
16100         Revert patch until I can properly fix it.  The issue
16101         is that we have a shared Type space across all namespaces
16102         currently, which is wrong.
16103
16104         Options include making the Namespace a DeclSpace, and merge
16105         current_namespace/current_container in the parser.
16106
16107 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * cs-parser.jay: Improve error reporting when we get a different
16110         kind of expression in local_variable_type and
16111         local_variable_pointer_type. 
16112
16113         Propagate this to avoid missleading errors being reported.
16114
16115         * ecore.cs (ImplicitReferenceConversion): treat
16116         TypeManager.value_type as a target just like object_type.   As
16117         code like this:
16118
16119         ValueType v = 1;
16120
16121         Is valid, and needs to result in the int 1 being boxed before it
16122         is assigned to the value type v.
16123
16124         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16125         to validate the enumeration name.
16126
16127         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16128         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16129         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16130
16131         * ecore.cs (TryImplicitIntConversion): When doing an
16132         implicit-enumeration-conversion, check if the type is 64-bits and
16133         perform a conversion before passing to EnumConstant.
16134
16135 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16136
16137         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16138         report ambiguous type references.  Unlike the MS version, we
16139         report what the ambiguity is.   Innovation at work ;-)
16140
16141         (DeclSpace.FindType): Require a location argument to
16142         display when we display an ambiguous error.
16143
16144         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16145
16146         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16147
16148         * expression.cs (EmitDynamicInitializers): Apply patch from
16149         hwang_rob@yahoo.ca that fixes the order in which we emit our
16150         initializers. 
16151
16152 2002-09-21  Martin Baulig  <martin@gnome.org>
16153
16154         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16155         delegate takes no arguments.
16156
16157 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16158
16159         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16160         from integers.
16161
16162         * expression.cs: Extract the underlying type.
16163
16164         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16165
16166         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16167
16168 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16169
16170         * class.cs (TypeContainer.DefineType): We can not use the nice
16171         PackingSize with the size set to 1 DefineType method, because it
16172         will not allow us to define the interfaces that the struct
16173         implements.
16174
16175         This completes the fixing of bug 27287
16176
16177         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16178         means also structs.  This fixes part of the problem. 
16179         (Expresion.ImplicitReferenceConversionExists): ditto.
16180
16181         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16182         error if there were no errors reported during the type lookup
16183         process, to avoid duplicates or redundant errors.  Without this
16184         you would get an ambiguous errors plus a type not found.  We have
16185         beaten the user enough with the first error.  
16186
16187         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16188         reference. 
16189
16190         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16191         during the resolution process, stop the lookup, this avoids
16192         repeated error reports (same error twice).
16193
16194         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16195
16196         * typemanager.cs (LookupType): Redo the type lookup code to match
16197         the needs of System.Reflection.  
16198
16199         The issue is that System.Reflection requires references to nested
16200         types to begin with a "+" sign instead of a dot.  So toplevel
16201         types look like: "NameSpace.TopLevelClass", and nested ones look
16202         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16203         levels. 
16204
16205 2002-09-19  Martin Baulig  <martin@gnome.org>
16206
16207         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16208         says that a method always returns or always throws an exception,
16209         don't report the CS0161.
16210
16211         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16212         set `Returns = new_returns'.
16213
16214 2002-09-19  Martin Baulig  <martin@gnome.org>
16215
16216         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16217         to an enum constant, check for a CS0176.
16218
16219 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16220
16221         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16222         for operators that must be in pairs and report errors.
16223
16224         * ecore.cs (SimpleName.DoResolveType): During the initial type
16225         resolution process, when we define types recursively, we must
16226         check first for types in our current scope before we perform
16227         lookups in the enclosing scopes.
16228
16229         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16230
16231         (Invocation.VerifyArgumentsCompat): Call
16232         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16233         I thought we were supposed to always call this, but there are a
16234         few places in the code where we dont do it.
16235
16236 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16237
16238         * driver.cs: Add support in -linkres and -resource to specify the
16239         name of the identifier.
16240
16241 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16242
16243         * ecore.cs (StandardConversionExists): Sync with the conversion
16244         code: allow anything-* to void* conversions.
16245
16246         (FindMostSpecificSource): Use an Expression argument
16247         instead of a Type, because we might be handed over a Literal which
16248         gets a few more implicit conversions that plain types do not.  So
16249         this information was being lost.
16250
16251         Also, we drop the temporary type-holder expression when not
16252         required.
16253
16254 2002-09-17  Martin Baulig  <martin@gnome.org>
16255
16256         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16257         this is an explicit interface implementation.
16258
16259 2002-09-17  Martin Baulig  <martin@gnome.org>
16260
16261         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16262         different `IndexerName' attributes.
16263
16264         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16265         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16266         virtual CommonResolve().
16267
16268 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16269
16270         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16271         and convert that to the UnderlyingType.
16272
16273         * statement.cs (Foreach.Resolve): Indexers are just like variables
16274         or PropertyAccesses.
16275
16276         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16277         inside quoted strings, we were not doing this before.
16278
16279 2002-09-16  Martin Baulig  <martin@gnome.org>
16280
16281         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16282         resolve it.  This is needed for the definite assignment check of the
16283         instance expression, fixes bug #29846.
16284         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16285
16286 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16287
16288         * parameter.cs: Fix compile error.  Cannot reference static member
16289         from an instance object.  Is this an mcs bug?
16290
16291 2002-09-14  Martin Baulig  <martin@gnome.org>
16292
16293         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16294         multiple times.  Fixes bug #30295, added test-166.cs.
16295
16296 2002-09-14  Martin Baulig  <martin@gnome.org>
16297
16298         * statement.cs (Block.Emit): Don't emit unreachable code.
16299         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16300         `break' statements.
16301         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16302
16303 2002-09-14  Martin Baulig  <martin@gnome.org>
16304
16305         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16306         is set.
16307
16308 2002-09-14  Martin Baulig  <martin@gnome.org>
16309
16310         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16311         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16312         be false on the ms runtime.
16313
16314 2002-09-13  Martin Baulig  <martin@gnome.org>
16315
16316         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16317         the CS0038 error message.
16318
16319 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16322         constant inside, return it.
16323
16324 2002-09-12  Martin Baulig  <martin@gnome.org>
16325
16326         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16327         implicit conversion can be done between enum types.
16328
16329         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16330         check whether an implicit conversion to the current enum's UnderlyingType
16331         exists and report an error if not.
16332
16333         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16334         without debugging support.
16335
16336         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16337         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16338
16339 2002-09-12  Martin Baulig  <martin@gnome.org>
16340
16341         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16342
16343         * ecore.cs (IMemberExpr.DeclaringType): New property.
16344         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16345         nonstatic member of an outer type (CS0038).
16346
16347 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16348
16349         * driver.cs: Activate the using-error detector at warning level
16350         4 (at least for MS-compatible APIs).
16351
16352         * namespace.cs (VerifyUsing): Small buglett fix.
16353
16354         * pending.cs (PendingImplementation): pass the container pointer. 
16355
16356         * interface.cs (GetMethods): Allow for recursive definition.  Long
16357         term, I would like to move every type to support recursive
16358         definitions, not the current ordering mechanism that we have right
16359         now.
16360
16361         The situation is this: Attributes are handled before interfaces,
16362         so we can apply attributes to interfaces.  But some attributes
16363         implement interfaces, we will now handle the simple cases
16364         (recursive definitions will just get an error).  
16365
16366         * parameter.cs: Only invalidate types at the end if we fail to
16367         lookup all types.  
16368
16369 2002-09-09  Martin Baulig  <martin@gnome.org>
16370
16371         * ecore.cs (PropertyExpr.Emit): Also check for
16372         TypeManager.system_int_array_get_length so this'll also work when
16373         compiling corlib.  Fixes #30003.
16374
16375 2002-09-09  Martin Baulig  <martin@gnome.org>
16376
16377         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16378         and throw an exception if we can't get the type's size.  Fixed #30040,
16379         added test-165.cs.
16380
16381 2002-09-09  Martin Baulig  <martin@gnome.org>
16382
16383         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16384
16385         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16386         context.  Fixes bug #30027.
16387
16388         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16389         virtual functions.  Fixes bug #30043, added test-164.cs.
16390
16391 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16392
16393         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16394
16395 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16396
16397         * driver.cs: Use an object to get the windows codepage since it's not a
16398         static property.
16399
16400 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16401
16402         * statement.cs (For.Emit): for infinite loops (test == null)
16403         return whether there is a break inside, not always "true".
16404
16405         * namespace.cs (UsingEntry): New struct to hold the name of the
16406         using definition, the location where it is defined, and whether it
16407         has been used in a successful type lookup.
16408
16409         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16410         strings.
16411
16412         * decl.cs: ditto.
16413
16414 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16415
16416         * attribute.cs : Fix incorrect code which relied on catching
16417         a NullReferenceException to detect a null being passed in
16418         where an object was expected.
16419
16420 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16421
16422         * statement.cs (Try): flag the catch variable as assigned
16423
16424         * expression.cs (Cast): Simplified by using ResolveType instead of
16425         manually resolving.
16426
16427         * statement.cs (Catch): Fix bug by using ResolveType.
16428
16429 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16430
16431         * expression.cs (BetterConversion): Special case for when we have
16432         a NullLiteral as the argument and we have to choose between string
16433         and object types - we choose string the way csc does.
16434
16435         * attribute.cs (Attribute.Resolve): Catch the
16436         NullReferenceException and report error #182 since the Mono
16437         runtime no more has the bug and having this exception raised means
16438         we tried to select a constructor which takes an object and is
16439         passed a null.
16440
16441 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16442
16443         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16444         message (1502, 1503) when we can't locate a method after overload
16445         resolution. This is much more informative and closes the bug
16446         Miguel reported.
16447
16448         * interface.cs (PopulateMethod): Return if there are no argument
16449         types. Fixes a NullReferenceException bug.
16450
16451         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16452         expressions too. Previously we were checking only in one place for
16453         positional arguments leaving out named arguments.
16454
16455         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16456         type to the enum type is not allowed. Remove code corresponding to
16457         that.
16458
16459         (ConvertNumericExplicit): Allow explicit conversions from
16460         the underlying type to enum type. This precisely follows the spec
16461         and closes a bug filed by Gonzalo.
16462
16463 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16464
16465         * compiler.csproj:
16466         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16467
16468 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16469
16470         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16471         it was important that we stored the right value after the
16472         reduction in `converted'.
16473
16474 2002-09-04  Martin Baulig  <martin@gnome.org>
16475
16476         * location.cs (Location.SymbolDocument): Use full pathnames for the
16477         source files.
16478
16479 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16482         of the expression resolve mechanism, because that will catch the
16483         SimpleName error failures.
16484
16485         (Conditional): If we can not resolve the
16486         expression, return, do not crash.
16487
16488 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16489
16490         * cs-tokenizer.cs:
16491         (location): display token name instead of its number.
16492
16493 2002-08-28  Martin Baulig  <martin@gnome.org>
16494
16495         * expression.cs (Binary.ResolveOperator): Don't silently return
16496         but return an error if an operator cannot be applied between two
16497         enum types.
16498
16499 2002-08-28  Martin Baulig  <martin@gnome.org>
16500
16501         * class.cs (Constructor.Define): Set the permission attributes
16502         correctly instead of making all constructors public.
16503
16504 2002-08-28  Martin Baulig  <martin@gnome.org>
16505
16506         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16507         for private members before reporting a CS0103; if we find anything,
16508         it's a CS0122.
16509
16510 2002-08-28  Martin Baulig  <martin@gnome.org>
16511
16512         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16513         to check whether `closure_start_type == closure_invocation_type',
16514         we also need to check whether `m.DeclaringType == closure_invocation_type'
16515         before bypassing the permission checks.  We might be accessing
16516         protected/private members from the base class.
16517         (TypeManager.RealMemberLookup): Only set private_ok if private
16518         members were requested via BindingFlags.NonPublic.
16519
16520         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16521
16522         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16523         MethodGroupExpr.IsExplicitImpl if appropriate.
16524         (Invocation.DoResolve): Don't report the CS0120 for explicit
16525         interface implementations.
16526
16527 2002-08-27  Martin Baulig  <martin@gnome.org>
16528
16529         * expression.cs (Invocation.DoResolve): If this is a static
16530         method and we don't have an InstanceExpression, we must report
16531         a CS0120.
16532
16533 2002-08-25  Martin Baulig  <martin@gnome.org>
16534
16535         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16536         `==' between a valuetype and an object.
16537
16538 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16539
16540         * ecore.cs (TypeExpr): Provide a ToString method.
16541
16542 2002-08-24  Martin Baulig  <martin@gnome.org>
16543
16544         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16545         now called proggie.dbg and it's a binary file.
16546
16547 2002-08-23  Martin Baulig  <martin@gnome.org>
16548
16549         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16550
16551 2002-08-23  Martin Baulig  <martin@gnome.org>
16552
16553         * struct.cs (MyStructInfo.ctor): Make this work with empty
16554         structs; it's not allowed to use foreach() on null.
16555
16556 2002-08-23  Martin Baulig  <martin@gnome.org>
16557
16558         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16559         writer the full pathname of the generated assembly.
16560
16561 2002-08-23  Martin Baulig  <martin@gnome.org>
16562
16563         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16564         A `finally' block never returns or breaks; improved handling of
16565         unreachable code.
16566
16567 2002-08-23  Martin Baulig  <martin@gnome.org>
16568
16569         * statement.cs (Throw.Resolve): Allow `throw null'.
16570
16571 2002-08-23  Martin Baulig  <martin@gnome.org>
16572
16573         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16574         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16575         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16576         MemberLookup would return a wrong event if this is an explicit
16577         interface implementation and the class has an event with the same
16578         name.
16579
16580 2002-08-23  Martin Baulig  <martin@gnome.org>
16581
16582         * statement.cs (Block.AddChildVariableNames): New public method.
16583         (Block.AddChildVariableName): Likewise.
16584         (Block.IsVariableNameUsedInChildBlock): Likewise.
16585         (Block.AddVariable): Check whether a variable name has already
16586         been used in a child block.
16587
16588         * cs-parser.jay (declare_local_variables): Mark all variable names
16589         from the current block as being used in a child block in the
16590         implicit block.
16591
16592 2002-08-23  Martin Baulig  <martin@gnome.org>
16593
16594         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16595         find the symbol writer.
16596
16597         * driver.cs: csc also allows the arguments to /define being
16598         separated by commas, not only by semicolons.
16599
16600 2002-08-23  Martin Baulig  <martin@gnome.org>
16601
16602         * interface.cs (Interface.GetMembers): Added static check for events.
16603
16604 2002-08-15  Martin Baulig  <martin@gnome.org>
16605
16606         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16607         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16608
16609         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16610         why the MethodData.EmitDestructor() change was necessary.
16611
16612 2002-08-20  Martin Baulig  <martin@gnome.org>
16613
16614         * class.cs (TypeContainer.FindMembers): Added static check for events.
16615
16616         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16617
16618         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16619         use Type.GetEvents(), not Type.FindMembers().
16620
16621 2002-08-20  Martin Baulig  <martin@gnome.org>
16622
16623         * decl.cs (MemberCache): Added a special method cache which will
16624         be used for method-only searched.  This ensures that a method
16625         search will return a MethodInfo with the correct ReflectedType for
16626         inherited methods.      
16627
16628 2002-08-20  Martin Baulig  <martin@gnome.org>
16629
16630         * decl.cs (DeclSpace.FindMembers): Made this public.
16631
16632 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16633
16634         * delegate.cs: fixed build on windows.
16635         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16636
16637 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16638
16639         * ecore.cs (StandardConversionExists): Return a false
16640         if we are trying to convert the void type to anything else
16641         since that is not allowed.
16642
16643         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16644         we flag error 70 in the event an event is trying to be accessed
16645         directly from outside the declaring type.
16646
16647 2002-08-20  Martin Baulig  <martin@gnome.org>
16648
16649         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16650         MemberCache from typemanager.cs to decl.cs.
16651
16652 2002-08-19  Martin Baulig  <martin@gnome.org>
16653
16654         * class.cs (TypeContainer): Implement IMemberContainer.
16655         (TypeContainer.DefineMembers): Create the MemberCache.
16656         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16657         return public members if BindingFlags.Public was given, check
16658         whether members are static.
16659
16660 2002-08-16  Martin Baulig  <martin@gnome.org>
16661
16662         * decl.cs (DeclSpace.Define): Splitted this in Define and
16663         DefineMembers.  DefineMembers is called first and initializes the
16664         MemberCache.
16665
16666         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16667         DefineMembers() on all our DeclSpaces.
16668
16669         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16670         but call DefineMembers() on all nested interfaces.  We call their
16671         Define() in our new Define() function.
16672
16673         * interface.cs (Interface): Implement IMemberContainer.
16674         (Interface.Define): Moved all code except the attribute stuf to
16675         DefineMembers().
16676         (Interface.DefineMembers): Initialize the member cache.
16677
16678         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16679         need this anymore since we can use MemberCache.FindMembers directly.
16680
16681 2002-08-19  Martin Baulig  <martin@gnome.org>
16682
16683         * typemanager.cs (MemberCache): When creating the cache for an
16684         interface type, add all inherited members.
16685         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16686         to `out bool used_cache' and documented it.
16687         (TypeManager.MemberLookup): If we already used the cache in the first
16688         iteration, we don't need to do the interfaces check.
16689
16690 2002-08-19  Martin Baulig  <martin@gnome.org>
16691
16692         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16693         here from IMemberFinder and don't implement this interface anymore.
16694         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16695
16696         * typemanager.cs (IMemberFinder): This interface is now only used by
16697         classes which actually support the member cache.
16698         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16699         since we only put DeclSpaces into this Hashtable.
16700         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16701         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16702
16703 2002-08-16  Martin Baulig  <martin@gnome.org>
16704
16705         * typemanager.cs (ICachingMemberFinder): Removed.
16706         (IMemberFinder.MemberCache): New property.
16707         (TypeManager.FindMembers): Merged this with RealFindMembers().
16708         This function will never be called from TypeManager.MemberLookup()
16709         so we can't use the cache here, just the IMemberFinder.
16710         (TypeManager.MemberLookup_FindMembers): Check whether the
16711         IMemberFinder has a MemberCache and call the cache's FindMembers
16712         function.
16713         (MemberCache): Rewrote larger parts of this yet another time and
16714         cleaned it up a bit.
16715
16716 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * driver.cs (LoadArgs): Support quoting.
16719
16720         (Usage): Show the CSC-like command line arguments.
16721
16722         Improved a few error messages.
16723
16724 2002-08-15  Martin Baulig  <martin@gnome.org>
16725
16726         * typemanager.cs (IMemberContainer.Type): New property.
16727         (IMemberContainer.IsInterface): New property.
16728
16729         The following changes are conditional to BROKEN_RUNTIME, which is
16730         defined at the top of the file.
16731
16732         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16733         class'es members, but add all members from TypeHandle.ObjectType
16734         if we're an interface.
16735         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16736         is the current type.
16737         (MemberCache.CacheEntry.Container): Removed this field.
16738         (TypeHandle.GetMembers): Include inherited members.
16739
16740 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16741
16742         * typemanager.cs: fixed compilation and added a comment on a field that
16743         is never used.
16744
16745 2002-08-15  Martin Baulig  <martin@gnome.org>
16746
16747         * class.cs (ConstructorInitializer.Resolve): In the
16748         Expression.MemberLookup call, use the queried_type as
16749         invocation_type.
16750
16751         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16752         declared' attribute, it's always true.
16753         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16754         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16755         temporary wrapper for FindMembers which tells MemberLookup whether
16756         members from the base classes are included in the return value.
16757         This will go away soon.
16758         (TypeManager.MemberLookup): Use this temporary hack here; once the
16759         new MemberCache is completed, we don't need to do the DeclaredOnly
16760         looping here anymore since the MemberCache will take care of this.
16761         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16762         (MemberCache): When creating the MemberCache for a class, get
16763         members from the current class and all its base classes.
16764         (MemberCache.CacheEntry.Container): New field.  This is a
16765         temporary hack until the Mono runtime is fixed to distinguish
16766         between ReflectedType and DeclaringType.  It allows us to use MCS
16767         with both the MS runtime and the unfixed Mono runtime without
16768         problems and without accecting performance.
16769         (MemberCache.SearchMembers): The DeclaredOnly looping from
16770         TypeManager.MemberLookup is now done here.      
16771
16772 2002-08-14  Martin Baulig  <martin@gnome.org>
16773
16774         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16775         Type.GetFields on dynamic types but get the fields from the
16776         corresponding TypeContainer.
16777         (MyStructInfo.GetStructInfo): Added check for enum types.
16778
16779         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16780         (MemberList.SyncRoot): Implemented.
16781         (TypeManager.FilterWithClosure): No need to check permissions if
16782         closure_start_type == closure_invocation_type, don't crash if
16783         closure_invocation_type is null.
16784
16785 2002-08-13  Martin Baulig  <martin@gnome.org>
16786
16787         Rewrote TypeContainer.FindMembers to use a member cache.  This
16788         gives us a speed increase of about 35% for the self-hosting MCS
16789         build and of about 15-20% for the class libs (both on GNU/Linux).
16790
16791         * report.cs (Timer): New class to get enhanced profiling.  This
16792         whole class is "TIMER" conditional since it remarkably slows down
16793         compilation speed.
16794
16795         * class.cs (MemberList): New class.  This is an IList wrapper
16796         which we're now using instead of passing MemberInfo[]'s around to
16797         avoid copying this array unnecessarily.
16798         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16799         (ICachingMemberFinder, IMemberContainer): New interface.
16800         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16801         has already been checked, otherwise use it for the name comparision.
16802         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16803         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16804         if possible.  Returns a MemberList, not a MemberInfo [].
16805         (TypeHandle): New class, implements IMemberContainer.  We create
16806         one instance of this class per type, it contains a MemberCache
16807         which is used to do the member lookups.
16808         (MemberCache): New class.  Each instance of this class contains
16809         all members of a type and a name-based hash table.
16810         (MemberCache.FindMembers): This is our new member lookup
16811         function.  First, it looks up all members of the requested name in
16812         the hash table.  Then, it walks this list and sorts out all
16813         applicable members and returns them.
16814
16815 2002-08-13  Martin Baulig  <martin@gnome.org>
16816
16817         In addition to a nice code cleanup, this gives us a performance
16818         increase of about 1.4% on GNU/Linux - not much, but it's already
16819         half a second for the self-hosting MCS compilation.
16820
16821         * typemanager.cs (IMemberFinder): New interface.  It is used by
16822         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16823         Enum, Delegate or Interface.
16824         (TypeManager.finder_to_member_finder): New PtrHashtable.
16825         (TypeManager.finder_to_container): Removed.
16826         (TypeManager.finder_to_delegate): Removed.
16827         (TypeManager.finder_to_interface): Removed.
16828         (TypeManager.finder_to_enum): Removed.
16829
16830         * interface.cs (Interface): Implement IMemberFinder.
16831
16832         * delegate.cs (Delegate): Implement IMemberFinder.
16833
16834         * enum.cs (Enum): Implement IMemberFinder.
16835
16836         * class.cs (TypeContainer): Implement IMemberFinder.
16837
16838 2002-08-12  Martin Baulig  <martin@gnome.org>
16839
16840         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16841
16842 2002-08-12  Martin Baulig  <martin@gnome.org>
16843
16844         * ecore.cs (ITypeExpression): New interface for expressions which
16845         resolve to a type.
16846         (TypeExpression): Renamed to TypeLookupExpression.
16847         (Expression.DoResolve): If we're doing a types-only lookup, the
16848         expression must implement the ITypeExpression interface and we
16849         call DoResolveType() on it.
16850         (SimpleName): Implement the new ITypeExpression interface.
16851         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16852         hack, the situation that we're only looking up types can't happen
16853         anymore when this method is called.  Moved the type lookup code to
16854         DoResolveType() and call it.
16855         (SimpleName.DoResolveType): This ITypeExpression interface method
16856         is now doing the types-only lookup.
16857         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16858         (ResolveFlags): Added MaskExprClass.
16859
16860         * expression.cs (MemberAccess): Implement the ITypeExpression
16861         interface.
16862         (MemberAccess.DoResolve): Added support for a types-only lookup
16863         when we're called via ITypeExpression.DoResolveType().
16864         (ComposedCast): Implement the ITypeExpression interface.
16865
16866         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16867         Expression.Resolve() with ResolveFlags.Type instead.
16868
16869 2002-08-12  Martin Baulig  <martin@gnome.org>
16870
16871         * interface.cs (Interface.Define): Apply attributes.
16872
16873         * attribute.cs (Attribute.ApplyAttributes): Added support for
16874         interface attributes.
16875
16876 2002-08-11  Martin Baulig  <martin@gnome.org>
16877
16878         * statement.cs (Block.Emit): Only check the "this" variable if we
16879         do not always throw an exception.
16880
16881         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16882         whether the property has a set accessor.
16883
16884 2002-08-11  Martin Baulig  <martin@gnome.org>
16885
16886         Added control flow analysis support for structs.
16887
16888         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16889         with control flow analysis turned off.
16890         (IVariable): New interface.
16891         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16892         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16893         (FieldExpr.DoResolve): Resolve the instance expression with flow
16894         analysis turned off and do the definite assignment check after the
16895         resolving when we know what the expression will resolve to.
16896
16897         * expression.cs (LocalVariableReference, ParameterReference):
16898         Implement the new IVariable interface, only call the flow analysis
16899         code if ec.DoFlowAnalysis is true.
16900         (This): Added constructor which takes a Block argument.  Implement
16901         the new IVariable interface.
16902         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16903         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16904         This does the definite assignment checks for struct members.
16905
16906         * class.cs (Constructor.Emit): If this is a non-static `struct'
16907         constructor which doesn't have any initializer, call
16908         Block.AddThisVariable() to tell the flow analysis code that all
16909         struct elements must be initialized before control returns from
16910         the constructor.
16911
16912         * statement.cs (MyStructInfo): New public class.
16913         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16914         argument to this indexer.  If non-zero, check an individual struct
16915         member, not the whole struct.
16916         (FlowBranching.CheckOutParameters): Check struct members.
16917         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16918         overloaded versions of these methods which take an additional
16919         `int field_idx' argument to check struct members.
16920         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16921         overloaded versions of these methods which take an additional
16922         `string field_name' argument to check struct member.s
16923         (VariableInfo): Implement the IVariable interface.
16924         (VariableInfo.StructInfo): New public property.  Returns the
16925         MyStructInfo instance of the variable if it's a struct or null.
16926         (Block.AddThisVariable): New public method.  This is called from
16927         Constructor.Emit() for non-static `struct' constructor which do
16928         not have any initializer.  It creates a special variable for the
16929         "this" instance variable which will be checked by the flow
16930         analysis code to ensure that all of the struct's fields are
16931         initialized before control returns from the constructor.
16932         (UsageVector): Added support for struct members.  If a
16933         variable/parameter is a struct with N members, we reserve a slot
16934         in the usage vector for each member.  A struct is considered fully
16935         initialized if either the struct itself (slot 0) or all its
16936         members are initialized.
16937
16938 2002-08-08  Martin Baulig  <martin@gnome.org>
16939
16940         * driver.cs (Driver.MainDriver): Only report an error CS5001
16941         if there were no compilation errors.
16942
16943         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16944         `UnsafeContext' property to determine whether the parent is in
16945         unsafe context rather than checking the parent's ModFlags:
16946         classes nested in an unsafe class are unsafe as well.
16947
16948 2002-08-08  Martin Baulig  <martin@gnome.org>
16949
16950         * statement.cs (UsageVector.MergeChildren): Distinguish between
16951         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16952         we return.  Added test17() and test18() to test-154.cs.
16953
16954 2002-08-08  Martin Baulig  <martin@gnome.org>
16955
16956         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16957         Family access, make sure the invoking type isn't a subclass of the
16958         queried type (that'd be a CS1540).
16959
16960         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16961         this method which takes an additional `Type invocation_type'.
16962
16963         * expression.cs (BaseAccess.DoResolve): Use the base type as
16964         invocation and query type.
16965         (MemberAccess.DoResolve): If the lookup failed and we're about to
16966         report a CS0122, try a lookup with the ec.ContainerType - if this
16967         succeeds, we must report a CS1540.
16968
16969 2002-08-08  Martin Baulig  <martin@gnome.org>
16970
16971         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16972         (MethodGroupExpr): Implement the IMemberExpr interface.
16973
16974         * expression (MemberAccess.ResolveMemberAccess): No need to have
16975         any special code for MethodGroupExprs anymore, they're now
16976         IMemberExprs.   
16977
16978 2002-08-08  Martin Baulig  <martin@gnome.org>
16979
16980         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16981         Family, FamANDAssem and FamORAssem permissions.
16982         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16983
16984 2002-08-08  Martin Baulig  <martin@gnome.org>
16985
16986         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16987         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16988         or loop block.
16989
16990 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16991
16992         * driver.cs: implemented /resource option to embed managed resources.
16993
16994 2002-08-07  Martin Baulig  <martin@gnome.org>
16995
16996         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16997         (FieldBase.HasFieldInitializer): New public property.
16998         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16999         returns the field initializer and makes sure it is only resolved once.
17000         (TypeContainer.EmitFieldInitializers): Call
17001         FieldBase.GetInitializerExpression to get the initializer, this ensures
17002         that it isn't resolved multiple times.
17003
17004         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17005         the resolving process (SimpleName/MemberLookup) that we're currently
17006         emitting a field initializer (which must not access any instance members,
17007         this is an error CS0236).
17008
17009         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17010         argument, if the `IsFieldInitializer' flag is set, we must report and
17011         error CS0236 and not an error CS0120.   
17012
17013 2002-08-07  Martin Baulig  <martin@gnome.org>
17014
17015         * ecore.cs (IMemberExpr): New public interface.
17016         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17017         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17018         if the expression is an IMemberExpr.
17019
17020         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17021         to be null, implicitly default to `this' if we're non-static in
17022         this case.  Simplified the code a lot by using the new IMemberExpr
17023         interface.  Also fixed bug #28176 here.
17024
17025 2002-08-06  Martin Baulig  <martin@gnome.org>
17026
17027         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17028         ParameterReferences during semantic analysis so that we can do a
17029         type-only search when resolving Cast, TypeOf and SizeOf.
17030         (block): Pass the `current_local_parameters' to the Block's
17031         constructor.
17032
17033         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17034         argument to the constructor.
17035         (ConstructorInitializer.Resolve): Create a temporary implicit
17036         block with the parameters.
17037
17038         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17039         references here if we aren't doing a type-only search.
17040
17041         * statement.cs (Block): Added constructor which takes a
17042         `Parameters parameters' argument.
17043         (Block.Parameters): New public property.
17044
17045         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17046         to `Parameters' and made it public readonly.
17047
17048 2002-08-06  Martin Baulig  <martin@gnome.org>
17049
17050         * ecore.cs (Expression.Warning): Made this public as well.
17051
17052         * report.cs (Report.Debug): Print the contents of collections.
17053
17054 2002-08-06  Martin Baulig  <martin@gnome.org>
17055
17056         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17057         used to tell Resolve() which kinds of expressions it may return.
17058         (Expression.Resolve): Added overloaded version of this method which
17059         takes a `ResolveFlags flags' argument.  This can be used to tell
17060         Resolve() which kinds of expressions it may return.  Reports a
17061         CS0118 on error.
17062         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17063         ResolveFlags.SimpleName.
17064         (Expression.Error118): Added overloaded version of this method which
17065         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17066         which kinds of expressions are allowed.
17067
17068         * expression.cs (Argument.ResolveMethodGroup): New public method.
17069         Resolves an argument, but allows a MethodGroup to be returned.
17070         This is used when invoking a delegate.
17071
17072         * TODO: Updated a bit.
17073
17074 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17075
17076         Fixed compilation with csc.
17077
17078         * ecore.cs: Expression.Error made public. Is this correct? Should
17079         Warning be made public too?
17080
17081         * expression.cs: use ea.Location instead of ea.loc.
17082         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17083
17084 2002-08-06  Martin Baulig  <martin@gnome.org>
17085
17086         * ecore.cs (Expression.loc): Moved the location here instead of
17087         duplicating it in all derived classes.
17088         (Expression.Location): New public property.
17089         (Expression.Error, Expression.Warning): Made them non-static and
17090         removed the location argument.
17091         (Expression.Warning): Added overloaded version which takes an
17092         `int level' argument.
17093         (Expression.Error118): Make this non-static and removed the
17094         expression and location arguments.
17095         (TypeExpr): Added location argument to the constructor.
17096
17097         * expression.cs (StaticCallExpr): Added location argument to
17098         the constructor.
17099         (Indirection, PointerArithmetic): Likewise.
17100         (CheckedExpr, UnCheckedExpr): Likewise.
17101         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17102         (StringPtr): Likewise.
17103
17104
17105 2002-08-05  Martin Baulig  <martin@gnome.org>
17106
17107         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17108
17109         * assign.cs (Assign.DoResolve): Check whether the source
17110         expression is a value or variable.
17111
17112         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17113         while resolving the corresponding blocks.
17114
17115         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17116         an error, don't silently return null.
17117
17118         * statement.cs (Block.AddVariable): Do the error reporting here
17119         and distinguish between CS0128 and CS0136.
17120         (Block.DoResolve): Report all unused labels (warning CS0164).
17121         (LabeledStatement): Pass the location to the constructor.
17122         (LabeledStatement.HasBeenReferenced): New property.
17123         (LabeledStatement.Resolve): Set it to true here.
17124
17125         * statement.cs (Return.Emit): Return success even after reporting
17126         a type mismatch error (CS0126 or CS0127), this is what csc does and
17127         it avoids confusing the users with any consecutive errors.
17128
17129 2002-08-05  Martin Baulig  <martin@gnome.org>
17130
17131         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17132
17133         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17134
17135         * expression.cs (MemberAccess.DoResolve): Silently return if an
17136         error has already been reported.
17137
17138         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17139         error has already been reported.
17140
17141 2002-08-05  Martin Baulig  <martin@gnome.org>
17142
17143         * statement.cs (UsageVector): Only initialize the `parameters'
17144         vector if we actually have any "out" parameters.
17145
17146 2002-08-05  Martin Baulig  <martin@gnome.org>
17147
17148         * expression.cs (Binary.ResolveOperator): When combining delegates,
17149         they must have the same type.
17150
17151 2002-08-05  Martin Baulig  <martin@gnome.org>
17152
17153         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17154         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17155         work with the ms runtime and we also don't need it: if we're a
17156         PropertyBuilder and not in the `indexer_arguments' hash, then we
17157         are a property and not an indexer.
17158
17159         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17160         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17161         since the latter one doesn't work with the ms runtime.
17162
17163 2002-08-03  Martin Baulig  <martin@gnome.org>
17164
17165         Fixed bugs #27998 and #22735.
17166
17167         * class.cs (Method.IsOperator): New public field.
17168         (Method.CheckBase): Report CS0111 if there's already a method
17169         with the same parameters in the current class.  Report CS0508 when
17170         attempting to change the return type of an inherited method.
17171         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17172         and it's not marked abstract or extern.
17173         (PropertyBase): New abstract base class for Property and Indexer.
17174         (PropertyBase.CheckBase): Moved here from Property and made it work
17175         for indexers.
17176         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17177         the same so we can reuse it there.
17178         (Property, Indexer): Derive from PropertyBase.
17179         (MethodSignature.inheritable_property_signature_filter): New delegate
17180         to find properties and indexers.
17181
17182         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17183         argument and improved error reporting.
17184
17185         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17186         EmptyReadOnlyParameters and made it a property.
17187
17188         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17189         version of this method which takes a `PropertyInfo indexer'.
17190         (TypeManager.RegisterIndexer): New method.
17191
17192         * class.cs: Added myself as author of this file :-)
17193
17194 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17195
17196         * class.cs: fixed compilation on windoze.
17197
17198 2002-08-03  Martin Baulig  <martin@gnome.org>
17199
17200         * interface.cs (Interface.GetInterfaceBases): Check whether all
17201         base interfaces are at least as accessible than the current one.
17202
17203         * class.cs (TypeContainer.GetClassBases): Check whether base types
17204         are at least as accessible than the current type.
17205         (TypeContainer.AsAccessible): Implemented and made non-static.
17206         (MemberBase.CheckParameters): Report errors if the accessibility
17207         checks fail.
17208
17209         * delegate.cs (Delegate.Delegate): The default visibility is
17210         internal for top-level types and private for nested types.
17211         (Delegate.Define): Report errors if the accessibility checks fail.
17212
17213         * enum.cs (Enum.Enum): The default visibility is internal for
17214         top-level types and private for nested types.
17215         (Enum.DefineType): Compute the correct visibility.
17216
17217         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17218         function which takes a `bool is_toplevel' instead of a TypeContainer.
17219
17220         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17221         builtin type.
17222
17223 2002-08-02  Martin Baulig  <martin@gnome.org>
17224
17225         * expression.cs (LocalVariableReferenc): Added constructor which
17226         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17227         (LocalVariableReference.IsReadOnly): New property.
17228         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17229         variable is readonly, use our own readonly flag to do this; you can
17230         use the new constructor to get a writable reference to a read-only
17231         variable.
17232
17233         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17234         reference to the local variable.
17235
17236 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * rootcontext.cs (ResolveCore): Also include System.Exception
17239
17240         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17241         we reach an EmptyStatement.
17242
17243         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17244         is also fine.
17245
17246         * expression.cs (Binary.ResolveOperator): Check error result in
17247         two places.
17248
17249         use brtrue/brfalse directly and avoid compares to null.
17250
17251 2002-08-02  Martin Baulig  <martin@gnome.org>
17252
17253         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17254         Fixes bug #28407, added test-155.cs.
17255
17256 2002-08-01  Martin Baulig  <martin@gnome.org>
17257
17258         * class.cs (Event.EmitDefaultMethod): Make this work with static
17259         events.  Fixes #28311, added verify-3.cs.
17260
17261 2002-08-01  Martin Baulig  <martin@gnome.org>
17262
17263         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17264         `is_disposable' fields.
17265         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17266         `hm.is_disposable' if we're using the collection pattern.
17267         (Foreach.EmitCollectionForeach): Use the correct type for the
17268         enumerator's local variable, only emit the try/finally block if
17269         necessary (fixes #27713).
17270
17271 2002-08-01  Martin Baulig  <martin@gnome.org>
17272
17273         * ecore.cs (Expression.report118): Renamed to Error118 and made
17274         it public static.
17275
17276         * statement.cs (Throw.Resolve): Check whether the expression is of
17277         the correct type (CS0118) and whether the type derives from
17278         System.Exception (CS0155).
17279         (Catch.Resolve): New method.  Do the type lookup here and check
17280         whether it derives from System.Exception (CS0155).
17281         (Catch.CatchType, Catch.IsGeneral): New public properties.
17282
17283         * typemanager.cs (TypeManager.exception_type): Added.
17284
17285 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17286
17287         * driver.cs: Updated About function.
17288
17289 2002-07-31  Martin Baulig  <martin@gnome.org>
17290
17291         Implemented Control Flow Analysis.
17292
17293         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17294         (EmitContext.CurrentBranching): Added.
17295         (EmitContext.StartFlowBranching): Added.
17296         (EmitContext.EndFlowBranching): Added.
17297         (EmitContext.KillFlowBranching): Added.
17298         (EmitContext.IsVariableAssigned): Added.
17299         (EmitContext.SetVariableAssigned): Added.
17300         (EmitContext.IsParameterAssigned): Added.
17301         (EmitContext.SetParameterAssigned): Added.
17302         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17303         Added control flow analysis stuff here.
17304
17305         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17306         resolve the expression as lvalue.
17307         (LocalVariableReference.DoResolve): Check whether the variable has
17308         already been assigned.
17309         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17310         the parameter as assigned here.
17311         (ParameterReference.DoResolve): Check whether the parameter has already
17312         been assigned.
17313         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17314         expression as lvalue.
17315
17316         * statement.cs (FlowBranching): New class for the flow analysis code.
17317         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17318         (LabeledStatement.IsDefined): New public property.
17319         (LabeledStatement.AddUsageVector): New public method to tell flow
17320         analyis that the label may be reached via a forward jump.
17321         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17322         flow analysis.
17323         (VariableInfo.Number): New public field.  This is used by flow analysis
17324         to number all locals of a block.
17325         (Block.CountVariables): New public property.  This is the number of
17326         local variables in this block (including the locals from all parent
17327         blocks).
17328         (Block.EmitMeta): Number all the variables.
17329
17330         * statement.cs: Added flow analysis support to all classes.
17331
17332 2002-07-31  Martin Baulig  <martin@gnome.org>
17333
17334         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17335         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17336         then use this argument.
17337
17338         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17339
17340         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17341         use this to specify /define options.
17342
17343 2002-07-29  Martin Baulig  <martin@gnome.org>
17344
17345         * statement.cs (Fixed): Moved all code that does variable lookups
17346         and resolvings from Emit to Resolve.
17347
17348         * statement.cs (For): Moved all code that does variable lookups
17349         and resolvings from Emit to Resolve.
17350
17351         * statement.cs (Using): Moved all code that does variable lookups
17352         and resolvings from Emit to Resolve.
17353
17354 2002-07-29  Martin Baulig  <martin@gnome.org>
17355
17356         * attribute.cs (Attribute.Resolve): Explicitly catch a
17357         System.NullReferenceException when creating the
17358         CustromAttributeBuilder and report a different warning message.
17359
17360 2002-07-29  Martin Baulig  <martin@gnome.org>
17361
17362         * support.cs (ParameterData.ParameterName): Added method to
17363         get the name of a parameter.
17364
17365         * typemanager.cs (TypeManager.IsValueType): New public method.
17366
17367 2002-07-29  Martin Baulig  <martin@gnome.org>
17368
17369         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17370         is a flag which specifies that it's either ref or out.
17371         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17372         the out parameter to `out Parameter.Modifier mod', also set the
17373         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17374
17375         * support.cs (InternalParameters.ParameterModifier): Distinguish
17376         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17377         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17378
17379         * expression.cs (Argument.GetParameterModifier): Distinguish
17380         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17381         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17382
17383 2002-07-29  Martin Baulig  <martin@gnome.org>
17384
17385         * expression.cs (ParameterReference.ParameterReference): Added
17386         `Location loc' argument to the constructor.
17387
17388         * cs-parser.jay: Pass location to ParameterReference.
17389
17390 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17391
17392         * statement.cs (Try): Initialize the location.
17393
17394         * cs-parser.jay: pass location to Try.
17395
17396         * expression.cs (Unary.Reduce): Change the prototype to return
17397         whether a constant fold could be performed or not.  The result is
17398         returned in an out parameters.  In the case of Indirection and
17399         AddressOf, we want to perform the full tests.
17400
17401 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17402
17403         * statement.cs (Statement.Emit): Flag dead code.
17404
17405 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17406
17407         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17408
17409 2002-07-27  Martin Baulig  <martin@gnome.org>
17410
17411         * class.cs (MethodData.Define): Put back call to
17412         TypeManager.AddMethod(), accidentally commented this out.
17413
17414         * report.cs (Debug): New public method to print debugging information,
17415         this is `[Conditional ("DEBUG")]'.
17416
17417 2002-07-26  Martin Baulig  <martin@gnome.org>
17418
17419         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17420         (switch_statement): Push the current_block to the switch_stack and
17421         pop it again when we're done with the switch.
17422         (switch_section): The new block is a child of the current_block.
17423         Fixes bug #24007, added test-152.cs.
17424
17425 2002-07-27  Martin Baulig  <martin@gnome.org>
17426
17427         * expression.cs (Invocation.EmitArguments): When calling a varargs
17428         function with only its fixed arguments, we need to pass an empty
17429         array.
17430
17431 2002-07-27  Martin Baulig  <martin@gnome.org>
17432
17433         Mono 0.13 has been released.
17434
17435 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17436
17437         * driver.cs: Rename --resource to --linkres, because that is what
17438         we do currently, we dont support --resource yet.
17439
17440         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17441
17442 2002-07-25  Martin Baulig  <martin@gnome.org>
17443
17444         * class.cs (MethodData): New public class.  This is a `method builder'
17445         class for a method or one accessor of a Property/Indexer/Event.
17446         (MethodData.GetMethodFlags): Moved here from MemberBase.
17447         (MethodData.ApplyAttributes): Likewise.
17448         (MethodData.ApplyObsoleteAttribute): Likewise.
17449         (MethodData.ApplyConditionalAttribute): Likewise.
17450         (MethodData.ApplyDllImportAttribute): Likewise.
17451         (MethodData.CheckAbstractAndExternal): Likewise.
17452         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17453         (MethodData.Emit): Formerly known as Method.Emit().
17454         (MemberBase): Moved everything which was specific to a single
17455         accessor/method to MethodData.
17456         (Method): Create a new MethodData and call Define() and Emit() on it.
17457         (Property, Indexer, Event): Create a new MethodData objects for each
17458         accessor and call Define() and Emit() on them.
17459
17460 2002-07-25  Martin Baulig  <martin@gnome.org>
17461
17462         Made MethodCore derive from MemberBase to reuse the code from there.
17463         MemberBase now also checks for attributes.
17464
17465         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17466         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17467         as virtual.
17468         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17469         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17470         (MemberBase.ApplyAttributes): New virtual method; applies the
17471         attributes to a method or accessor.
17472         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17473         (MemberBase.ApplyConditionalAttribute): Likewise.
17474         (MemberBase.ApplyDllImportAttribute): Likewise.
17475         (MemberBase.CheckAbstractAndExternal): Likewise.
17476         (MethodCore.ParameterTypes): This is now a property instead of a
17477         method, it's initialized from DoDefineParameters().
17478         (MethodCore.ParameterInfo): Removed the set accessor.
17479         (MethodCore.DoDefineParameters): New protected virtual method to
17480         initialize ParameterTypes and ParameterInfo.
17481         (Method.GetReturnType): We can now simply return the MemberType.
17482         (Method.GetMethodFlags): Override the MemberBase version and add
17483         the conditional flags.
17484         (Method.CheckBase): Moved some code from Define() here, call
17485         DoDefineParameters() here.
17486         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17487         here to avoid some larger code duplication.
17488         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17489         ensure that abstract and external accessors don't declare a body.
17490
17491         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17492         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17493         lookup in the attribute's parent classes, so we need to abort as soon
17494         as we found the first match.
17495         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17496         the attribute has no arguments.
17497
17498         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17499         of a Method.
17500
17501 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17502
17503         * cs-parser.jay: reverted previous patch.
17504
17505 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17506
17507         * cs-parser.jay: fixed bug #22119.
17508
17509 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17510
17511         * attribute.cs: fixed compilation. The error was:
17512         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17513         be assigned to before control leaves the current method."
17514         [FIXME:  Filed as bug #28186: MCS must report this error.]
17515
17516 2002-07-25  Martin Baulig  <martin@gnome.org>
17517
17518         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17519         method to pull the condition name ouf of a Conditional attribute.
17520         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17521         the obsolete message and error flag out of an Obsolete attribute.
17522
17523         * class.cs (Method.GetMethodFlags): New public method to get the
17524         TypeManager.MethodFlags for this method.
17525         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17526         private methods.
17527         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17528         if we're overriding a virtual function, set the new private variable
17529         `parent_method'; call the new TypeManager.AddMethod().
17530
17531         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17532         the MethodBuilder and the Method in a PtrHashtable.
17533         (TypeManager.builder_to_method): Added for this purpose.
17534         (TypeManager.MethodFlags): Added IsObsoleteError.
17535         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17536         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17537         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17538         the message from the attribute.
17539
17540 2002-07-24  Martin Baulig  <martin@gnome.org>
17541
17542         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17543         preprocessor directives, ensure that the argument to #define/#undef is
17544         exactly one identifier and that it's actually an identifier.
17545
17546         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17547         did not work ....
17548
17549 2002-07-24  Martin Baulig  <martin@gnome.org>
17550
17551         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17552         initialize it to TypeManager.object_type in the constructor.
17553         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17554         of the `hm.get_current' method if we're using the collection pattern.
17555         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17556         for the explicit conversion to make it work when we're using the collection
17557         pattern and the `Current' property has a different return type than `object'.
17558         Fixes #27713.
17559
17560 2002-07-24  Martin Baulig  <martin@gnome.org>
17561
17562         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17563         does not match, but don't report any errors.  This method is called in
17564         order for all methods in a MethodGroupExpr until a matching method is
17565         found, so we don't want to bail out if the first method doesn't match.
17566         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17567         matches, report the 123.  Fixes #28070.
17568
17569 2002-07-24  Martin Baulig  <martin@gnome.org>
17570
17571         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17572         TypeManager.TypeToCoreType() to the top of the method so the
17573         following equality checks will work.  Fixes #28107.
17574
17575 2002-07-24  Martin Baulig  <martin@gnome.org>
17576
17577         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17578         operand is of type uint, and the other operand is of type sbyte,
17579         short or int, the operands are converted to type long." -
17580         Actually do what this comment already told us.  Fixes bug #28106,
17581         added test-150.cs.
17582
17583 2002-07-24  Martin Baulig  <martin@gnome.org>
17584
17585         * class.cs (MethodBase): New abstract class.  This is now a base
17586         class for Property, Indexer and Event to avoid some code duplication
17587         in their Define() and DefineMethods() methods.
17588         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17589         generic methods for Define() and DefineMethods().
17590         (FieldBase): Derive from MemberBase, not MemberCore.
17591         (Property): Derive from MemberBase, not MemberCore.
17592         (Property.DefineMethod): Moved all the code from this method to the
17593         new MethodBase.DefineAccessor(), just call it with appropriate
17594         argumetnts.
17595         (Property.Define): Call the new Property.DoDefine(), this does some
17596         sanity checks and we don't need to duplicate the code everywhere.
17597         (Event): Derive from MemberBase, not MemberCore.
17598         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17599         accessors, this will also make them work with interface events.
17600         (Indexer): Derive from MemberBase, not MemberCore.
17601         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17602         (Indexer.Define): Use the new MethodBase functions.
17603
17604         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17605         argument to the constructor.
17606         (Interface.FindMembers): Added support for interface events.
17607         (Interface.PopluateEvent): Implemented.
17608
17609         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17610
17611 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17612
17613         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17614         but this is required to check for a method name being the same as
17615         the containing class.  
17616
17617         Handle this now.
17618
17619 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17620
17621         * interface.cs: initialize variable.
17622
17623 2002-07-23  Martin Baulig  <martin@gnome.org>
17624
17625         Implemented the IndexerName attribute in interfaces.
17626
17627         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17628         name if this is an explicit interface implementation.
17629         (Indexer.InterfaceIndexerName): New public variable.  If we're
17630         implementing an interface indexer, this is the IndexerName in that
17631         interface.  Otherwise, it's the IndexerName.
17632         (Indexer.DefineMethod): If we're implementing interface indexer,
17633         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17634         and Pending.ImplementIndexer methods.
17635         (Indexer.Define): Also define the PropertyBuilder if we're
17636         implementing an interface indexer and this is neither an explicit
17637         interface implementation nor do the IndexerName match the one in
17638         the interface.
17639
17640         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17641         If a method is defined here, then we always need to create a proxy
17642         for it.  This is used when implementing interface indexers.
17643         (Pending.IsInterfaceIndexer): New public method.
17644         (Pending.ImplementIndexer): New public method.
17645         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17646         This is used when implementing interface indexers to define a proxy
17647         if necessary.
17648         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17649         define a proxy if necessary.
17650
17651         * interface.cs (Interface.IndexerName): New public variable.
17652         (Interface.PopulateIndexer): Set the IndexerName.
17653         (Interface.DefineIndexers): New private method.  Populate all the
17654         indexers and make sure their IndexerNames match.
17655
17656         * typemanager.cs (IndexerPropertyName): Added support for interface
17657         indexers.
17658
17659 2002-07-22  Martin Baulig  <martin@gnome.org>
17660
17661         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17662         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17663         ret if HasReturnLabel.
17664         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17665         variables.
17666
17667         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17668         and set the ec.LoopBeginTryCatchLevel.
17669         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17670         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17671         the current ec.TryCatchLevel, the branch goes out of an exception
17672         block.  In this case, we need to use Leave and not Br.
17673
17674 2002-07-22  Martin Baulig  <martin@gnome.org>
17675
17676         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17677         block unless the block does not always return or it is contained in
17678         another try { ... } catch { ... } block.  Fixes bug #26506.
17679         Added verify-1.cs to the test suite.
17680
17681 2002-07-22  Martin Baulig  <martin@gnome.org>
17682
17683         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17684         then we do not always return.  Fixes bug #24985.
17685
17686 2002-07-22  Martin Baulig  <martin@gnome.org>
17687
17688         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17689         lookup on a per-class level; ie. walk up the class hierarchy until we
17690         found at least one applicable method, then choose the best among them.
17691         Fixes bug #24463 and test-29.cs.
17692
17693 2002-07-22  Martin Baulig  <martin@gnome.org>
17694
17695         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17696         return types of the methods.  The return type is not part of the
17697         signature and we must not check it to make the `new' modifier work.
17698         Fixes bug #27999, also added test-147.cs.
17699         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17700
17701         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17702         on the method's return type.
17703
17704 2002-07-21  Martin Baulig  <martin@gnome.org>
17705
17706         * assign.cs: Make this work if the rightmost source is a constant and
17707         we need to do an implicit type conversion.  Also adding a few more tests
17708         to test-38.cs which should have caught this.
17709
17710         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17711         target in the makefile for this.  The makefile.gnu is primarily intended
17712         for end-users who don't want to debug the compiler.
17713
17714 2002-07-21  Martin Baulig  <martin@gnome.org>
17715
17716         * assign.cs: Improved the Assign class so it can now handle embedded
17717         assignments (X = Y = Z = something).  As a side-effect this'll now also
17718         consume less local variables.  test-38.cs now passes with MCS, added
17719         a few new test cases to that test.
17720
17721 2002-07-20  Martin Baulig  <martin@gnome.org>
17722
17723         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17724         instructions.  Fixes bug #27977, also added test-146.cs.
17725
17726 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17727
17728         * cs-tokenizer.cs: fixed getHex ().
17729
17730 2002-07-19  Martin Baulig  <martin@gnome.org>
17731
17732         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17733         not Type.GetType() to lookup the array type.  This is needed when
17734         we're constructing an array of a user-defined type.
17735         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17736         single-dimensional arrays, but also for single-dimensial arrays of
17737         type decimal.
17738
17739 2002-07-19  Martin Baulig  <martin@gnome.org>
17740
17741         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17742         this function is called, it's not allowed to share LocalBuilders
17743         among ILGenerators.
17744
17745 2002-07-19  Martin Baulig  <martin@gnome.org>
17746
17747         * expression.cs (Argument.Resolve): Report an error 118 when trying
17748         to pass a type as argument.
17749
17750 2002-07-18  Martin Baulig  <martin@gnome.org>
17751
17752         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17753         Conv_R_Un for the signed `long' type.
17754
17755 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17756
17757         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17758         `expr' for the temporary result, as that will fail if we do
17759         multiple resolves on the same expression.
17760
17761 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17764         ec.TypeContainer for looking up aliases. 
17765
17766         * class.cs (TypeContainer): Remove LookupAlias from here.
17767
17768         * decl.cs (DeclSpace); Move here.
17769
17770 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17771
17772         * class.cs (FindMembers): Only call filter if the constructor
17773         bulider is not null.
17774
17775         Also handle delegates in `NestedTypes' now.  Now we will perform
17776         type lookups using the standard resolution process.  This also
17777         fixes a bug.
17778
17779         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17780         This uses Expressions (the limited kind that can be parsed by the
17781         tree) instead of strings.
17782
17783         * expression.cs (ComposedCast.ToString): Implement, used to flag
17784         errors since now we have to render expressions.
17785
17786         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17787         FormArrayType. 
17788
17789         * ecore.cs (SimpleName.ToString): ditto.
17790
17791         * cs-parser.jay: Instead of using strings to assemble types, use
17792         Expressions to assemble the type (using SimpleName, ComposedCast,
17793         MemberAccess).  This should fix the type lookups in declarations,
17794         because we were using a different code path for this.
17795
17796         * statement.cs (Block.Resolve): Continue processing statements
17797         even when there is an error.
17798
17799 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17800
17801         * class.cs (Event.Define): Also remove the `remove' method from
17802         the list of pending items.
17803
17804         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17805         generate more compact code. 
17806
17807 2002-07-17  Martin Baulig  <martin@gnome.org>
17808
17809         * const.cs (Const.LookupConstantValue): Add support for constant
17810         `unchecked' and `checked' expressions.
17811         Also adding test case test-140.cs for this.
17812
17813 2002-07-17  Martin Baulig  <martin@gnome.org>
17814
17815         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17816         check whether mi.ReturnType implements the IEnumerator interface; the
17817         `==' and the IsAssignableFrom() will fail in this situation.
17818
17819 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17820
17821         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17822         here too.
17823
17824 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17825
17826         * expression.cs: fixed bug #27811.
17827
17828 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17829
17830         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17831         Molaro: when we are a ref, the value already contains a pointer
17832         value, do not take the address of it.
17833
17834 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17835         * removed mb-parser.jay and mb-tokenizer.cs
17836
17837 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17838
17839         * expression.cs: check against the building corlib void type.
17840
17841 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17842
17843         * ecore.cs: fix for valuetype static readonly fields: when 
17844         initializing them, we need their address, not the address of a copy.
17845
17846 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17847
17848         * typemanager.cs: register also enum_type in corlib.
17849
17850 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17851
17852         * class.cs: allow calling this (but not base) initializers in structs.
17853
17854 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17855
17856         * ecore.cs: make sure we compare against the building base types
17857         in GetTypeSize ().
17858
17859 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17860
17861         * typemanager.cs: fix TypeToCoreType() to handle void and object
17862         (corlib gets no more typerefs after this change).
17863
17864 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17865
17866         * expression.cs (ArrayCreation.EmitArrayArguments): use
17867         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17868
17869         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17870         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17871         array indexes, the runtime actually forbids them.
17872
17873         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17874         for array arguments here.
17875
17876         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17877         instead of the default for ValueTypes.
17878
17879         (New.DoEmit): Use IsValueType instead of
17880         IsSubclassOf (value_type)
17881         (New.DoResolve): ditto.
17882         (Invocation.EmitCall): ditto.
17883
17884         * assign.cs (Assign): ditto.
17885
17886         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17887         Statements *are* currently doing part of their resolution during
17888         Emit.  
17889
17890         Expressions do always resolve during resolve, but statements are
17891         only required to propagate resolution to their children.
17892
17893 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17894
17895         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17896
17897         (LoadAssembly): Do not add the dll if it is already specified
17898
17899         (MainDriver): Add the System directory to the link path at the end,
17900         after all the other -L arguments. 
17901
17902         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17903         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17904         ldelem.u1) and using the opposite for sbytes.
17905
17906         This fixes Digger, and we can finally run it.
17907
17908         * driver.cs (UnixParseOption): Move the option parsing here.  
17909         (CSCParseOption): Implement CSC-like parsing of options.
17910
17911         We now support both modes of operation, the old Unix way, and the
17912         new CSC-like way.  This should help those who wanted to make cross
17913         platform makefiles.
17914
17915         The only thing broken is that /r:, /reference: and /lib: are not
17916         implemented, because I want to make those have the same semantics
17917         as the CSC compiler has, and kill once and for all the confussion
17918         around this.   Will be doing this tomorrow.
17919
17920         * statement.cs (Unsafe.Resolve): The state is checked during
17921         resolve, not emit, so we have to set the flags for IsUnsfe here.
17922
17923 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17926         not catch the Error_ObjectRefRequired in SimpleName (as it is
17927         possible to have a class/instance variable name that later gets
17928         deambiguated), we have to check this here.      
17929
17930 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17931
17932         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17933         make static and put into Expression.
17934
17935         (Event.Define): Register the private field of the event with the 
17936         TypeManager so that GetFieldFromEvent can get at it.
17937
17938         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17939         keep track of the private field associated with an event which
17940         has no accessors.
17941
17942         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17943         private field.
17944
17945         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17946
17947 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17948
17949         * expression.cs (Binary.EmitBranchable): this routine emits the
17950         Binary expression in a branchable context.  This basically means:
17951         we need to branch somewhere, not just get the value on the stack.
17952
17953         This works together with Statement.EmitBoolExpression.
17954
17955         * statement.cs (Statement.EmitBoolExpression): Use
17956         EmitBranchable. 
17957
17958 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17959
17960         * statement.cs (For): Reduce the number of jumps in loops.
17961
17962         (For): Implement loop inversion for the For statement.
17963
17964         (Break): We can be breaking out of a Try/Catch controlled section
17965         (foreach might have an implicit try/catch clause), so we need to
17966         use Leave instead of Br.
17967
17968         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17969         now).  If the instace expression supports IMemoryLocation, we use
17970         the AddressOf method from the IMemoryLocation to extract the
17971         address instead of emitting the instance.
17972
17973         This showed up with `This', as we were emitting the instance
17974         always (Emit) instead of the Address of This.  Particularly
17975         interesting when This is a value type, as we dont want the Emit
17976         effect (which was to load the object).
17977
17978 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17979
17980         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17981
17982         * statement.cs (Checked): Set the CheckedState during the resolve
17983         process too, as the ConvCast operations track the checked state on
17984         the resolve process, and not emit.
17985
17986         * cs-parser.jay (namespace_member_declaration): Flag that we have
17987         found a declaration when we do.  This is used to flag error 1529
17988
17989         * driver.cs: Report ok when we display the help only.
17990
17991 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17992
17993         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17994
17995 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17996
17997         * cs-tokenizer.cs (define): We also have to track locally the
17998         defines.  AllDefines is just used for the Conditional Attribute,
17999         but we also need the local defines for the current source code. 
18000
18001 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18002
18003         * statement.cs (While, For, Do): These loops can exit through a
18004         Break statement, use this information to tell whether the
18005         statement is the last piece of code.
18006
18007         (Break): Flag that we break.
18008
18009         * codegen.cs (EmitContexts): New `Breaks' state variable.
18010
18011 2002-07-03  Martin Baulig  <martin@gnome.org>
18012
18013         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18014         modifiers in method declarations in structs.  Otherwise, you won't
18015         be able to override things like Object.Equals().
18016
18017 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18018
18019         * class.cs (Method, Property, Indexer): Do not allow the public
18020         modifier to be used in explicit interface implementations.
18021
18022         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18023         override modifiers in method declarations in structs
18024
18025 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18026
18027         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18028         integer or real overflow, report an error
18029
18030 2002-07-02  Martin Baulig  <martin@gnome.org>
18031
18032         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18033         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18034         to tell the runtime about our newly created System.Object and
18035         System.ValueType types.
18036
18037 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18038
18039         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18040         struct instead of Ldarg/Starg.
18041
18042 2002-07-02  Martin Baulig  <martin@gnome.org>
18043
18044         * expression.cs (Indirection.Indirection): Call
18045         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18046
18047 2002-07-02  Martin Baulig  <martin@gnome.org>
18048
18049         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18050         ValueType, call TypeManager.TypeToCoreType() on it.
18051         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18052         the OpCodes.Newarr argument.
18053
18054 2002-07-02  Martin Baulig  <martin@gnome.org>
18055
18056         * expression.cs (Invocation.EmitCall): When compiling corlib,
18057         replace all calls to the system's System.Array type to calls to
18058         the newly created one.
18059
18060         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18061         System.Array methods.
18062         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18063         from the system's System.Array type which must be replaced.
18064
18065 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18066
18067         * typemanager.cs: load unverifiable_code_ctor so we can build
18068         corlib using the correct type. Avoid using GetTypeCode() with
18069         TypeBuilders.
18070         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18071         TypeManager.object_type to allow building corlib.
18072
18073 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18074
18075         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18076
18077 2002-07-01  Martin Baulig  <martin@gnome.org>
18078
18079         * class.cs: Make the last change actually work, we need to check
18080         whether `ifaces != null' to avoid a crash.
18081
18082 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18083
18084         * class.cs: when we build structs without fields that implement
18085         interfaces, we need to add the interfaces separately, since there is
18086         no API to both set the size and add the interfaces at type creation
18087         time.
18088
18089 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18090
18091         * expression.cs: the dimension arguments to the array constructors
18092         need to be converted if they are a long.
18093
18094 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18095
18096         * class.cs: don't emit ldarg.0 if there is no parent constructor
18097         (fixes showstopper for corlib).
18098
18099 2002-06-29  Martin Baulig  <martin@gnome.org>
18100
18101         MCS now compiles corlib on GNU/Linux :-)
18102
18103         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18104         ie. check for MethodImplOptions.InternalCall.
18105
18106         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18107         and TypeManager.attribute_type are null, so we must explicitly check
18108         whether parent is not null to find out whether it's an attribute type.
18109         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18110         and SetBuilder, not only if the property is neither abstract nor external.
18111         This is necessary to set the MethodImplOptions on the accessor methods.
18112         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18113         SetBuilder, see Property.Emit().
18114
18115         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18116         populate "System.Object", "System.ValueType" and "System.Attribute" since
18117         they've already been populated from BootCorlib_PopulateCoreTypes().
18118
18119 2002-06-29  Martin Baulig  <martin@gnome.org>
18120
18121         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18122         is the NullLiteral, we also need to make sure that target_type is not
18123         an enum type.   
18124
18125 2002-06-29  Martin Baulig  <martin@gnome.org>
18126
18127         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18128         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18129         before calling BootstrapCorlib_ResolveDelegate ().
18130
18131 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18132
18133         * statement.cs: fixed build-breaker. All tests passed ok.
18134
18135 2002-06-27  Martin Baulig  <martin@gnome.org>
18136
18137         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18138         for System.Decimal when compiling corlib.
18139
18140 2002-06-27  Martin Baulig  <martin@gnome.org>
18141
18142         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18143         switch blocks which contain nothing but a default clause.
18144
18145 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18146
18147        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18148
18149 2002-06-27  Martin Baulig  <martin@gnome.org>
18150
18151         * ecore.cs (PropertyExpr.PropertyExpr): Call
18152         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18153
18154         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18155         is already a TypeBuilder.
18156
18157 2002-06-27  Martin Baulig  <martin@gnome.org>
18158
18159         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18160         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18161         the "from an array-type to System.Array" case.  This makes it work
18162         when compiling corlib.
18163
18164 2002-06-27  Martin Baulig  <martin@gnome.org>
18165
18166         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18167         non-static PropertyExpr, set its InstanceExpression.  This makes
18168         the `ICollection.Count' property work in System/Array.cs.
18169
18170 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18171
18172         * driver.cs: Made error handling more consistent.  Errors now
18173         tracked by Report class, so many methods which used to return int
18174         now return void.  Main() now prints success/failure and 
18175         errors/warnings message.
18176
18177         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18178         the magic number return values (123 and 124).  Now, if the
18179         expected error occurs, the compiler exits with success (exit value
18180         0).  If the compilation completes without seeing that particular
18181         error, the compiler exits with failure (exit value 1).  The
18182         makefile in mcs/errors has been changed to handle the new behaviour.
18183
18184         * report.cs: Made 'expected error' number a property and renamed
18185         it from 'Probe' to 'ExpectedError'.
18186
18187         * genericparser.cs: Removed error handling support, since it is
18188         now all done by Report class.
18189
18190         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18191         class, so parse() no longer returns an int.
18192
18193         * namespace.cs: Use Report.Error instead of GenericParser.error
18194
18195 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18196
18197         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18198         TypeContainer.AddOperator): At the front of the list put the
18199         explicit implementations, so they get resolved/defined first. 
18200
18201 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18202
18203         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18204         interface type is implemented by this TypeContainer.  Used during
18205         explicit interface implementation.
18206
18207         (Property.Define, Indexer.Define, Method.Define): Validate that
18208         the given interface in the explicit implementation is one of the
18209         base classes for the containing type.
18210
18211         Also if we are explicitly implementing an interface, but there is
18212         no match in the pending implementation table, report an error.
18213
18214         (Property.Define): Only define the property if we are
18215         not explicitly implementing a property from an interface.  Use the
18216         correct name also for those properties (the same CSC uses,
18217         although that is really not needed).
18218
18219         (Property.Emit): Do not emit attributes for explicitly implemented
18220         properties, as there is no TypeBuilder.
18221
18222         (Indexer.Emit): ditto.
18223
18224         Hiding then means that we do not really *implement* a pending
18225         implementation, which makes code fail.
18226
18227 2002-06-22  Martin Baulig  <martin@gnome.org>
18228
18229         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18230         the return value of Object.GetType().  [FIXME: we need to do this whenever
18231         we get a type back from the reflection library].
18232
18233 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18234
18235         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18236
18237 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * attribute.cs: Return null if we can not look up the type.
18240
18241         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18242         the interface types found.
18243
18244         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18245         interface types found.
18246
18247         * typemanager.cs (GetInterfaces): Make this routine returns alll
18248         the interfaces and work around the lame differences between
18249         System.Type and System.Reflection.Emit.TypeBuilder in the results
18250         result for GetInterfaces.
18251
18252         (ExpandInterfaces): Given an array of interface types, expand and
18253         eliminate repeated ocurrences of an interface.  This expands in
18254         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18255         be IA, IB, IC.
18256
18257 2002-06-21  Martin Baulig  <martin@gnome.org>
18258
18259         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18260         on System.Enum.
18261
18262 2002-06-21  Martin Baulig  <martin@gnome.org>
18263
18264         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18265         and called with one of the core types, return the corresponding typebuilder for
18266         that type.
18267
18268         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18269         element type.
18270
18271 2002-06-21  Martin Baulig  <martin@gnome.org>
18272
18273         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18274         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18275         (Expression.ConvertReferenceExplicit): Likewise.
18276
18277         * expression.cs (ElementAccess.DoResolve): Likewise.
18278         (ElementAccess.DoResolveLValue): Likewise.
18279
18280 2002-06-10  Martin Baulig  <martin@gnome.org>
18281
18282         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18283         add the "value" parameter to the parameter list.
18284
18285         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18286         to our caller.
18287
18288 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18289
18290         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18291         the argument to an int, uint, long or ulong, per the spec.  Also
18292         catch negative constants in array creation.
18293
18294 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18295
18296         * class.cs: do not allow the same interface to appear twice in
18297         the definition list.
18298
18299 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18300
18301         * ecore.cs: don't use ldlen with System.Array.
18302
18303 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18304
18305         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18306
18307 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18308
18309         * modifiers.cs: produce correct field attributes for protected
18310         internal. Easy fix so miguel can work on ther harder stuff:-)
18311
18312 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18313
18314         * pending.cs: New file.  Move the code from class.cs here.
18315         Support clearning the pending flag for all methods (when not doing
18316         explicit interface implementation).
18317
18318 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18319
18320         * rootcontext.cs: added a couple more types needed to bootstrap.
18321
18322 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18323
18324         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18325         constructor in the type, instead of any constructor in the type
18326         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18327         a bug in the Mono runtime when applying the params attribute). 
18328
18329 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18330         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18331
18332 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18333
18334         * expression.cs (Unary.ResolveOperator): Use TypeManager
18335         to resolve the type.
18336
18337 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18338
18339         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18340         attached.
18341
18342         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18343         with each member too.
18344
18345         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18346         field builders too - this takes care of the enum member case.
18347
18348 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18349
18350         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18351         address-of operator on both value types and pointers.
18352
18353 2002-06-10  Martin Baulig  <martin@gnome.org>
18354
18355         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18356         PropertyBuilder to the `property_builders' list.
18357
18358         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18359         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18360         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18361         find any indexers which are inherited from an interface.
18362
18363 2002-06-09  Martin Baulig  <martin@gnome.org>
18364
18365         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18366         the same type as the constant if necessary.  There's also a test-130.cs
18367         for this.
18368
18369         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18370
18371         * typemanager.cs (TypeManager.ChangeType): Previously known as
18372         Enum.ChangeEnumType().
18373
18374 2002-06-09  Martin Baulig  <martin@gnome.org>
18375
18376         * expression.cs (Cast.TryReduce): Added support for consts.
18377
18378 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18379
18380         * class.cs (Accessor): Hold attributes information so we can pass
18381         it along.
18382
18383         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18384         Modify to pass in attributes attached to the methods.
18385
18386         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18387
18388         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18389         to handle the Accessor kind :-)
18390
18391         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18392
18393 2002-06-08  Martin Baulig  <martin@gnome.org>
18394
18395         * expression.cs (Unary.TryReduceNegative): Added support for
18396         ULongConstants.
18397
18398 2002-06-08  Martin Baulig  <martin@gnome.org>
18399
18400         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18401         name can't be found in the `defined_names' - the caller will do a
18402         MemberLookup in this case and thus find methods in System.Enum
18403         such as Enum.IsDefined().
18404
18405 2002-06-08  Martin Baulig  <martin@gnome.org>
18406
18407         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18408         Convert.ChangeType() which works with TypeBuilder created types.
18409         (Enum.LookupEnumValue, Enum.Define): Use it here.
18410
18411         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18412         `TypeBuilder.BaseType != null' check.
18413         (TypeContainer.FindMembers): Only lookup parent members if we
18414         actually have a parent.
18415         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18416         (ConstructorInitializer.Resolve): Likewise.
18417
18418         * interface.cs (Interface.FindMembers): Added
18419         `TypeBuilder.BaseType != null' check.
18420
18421         * rootcontext.cs (RootContext.ResolveCore): Added
18422         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18423         classes_second_stage.
18424
18425         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18426         debug_type and trace_type when compiling with --nostdlib.       
18427
18428 2002-06-07  Martin Baulig  <martin@gnome.org>
18429
18430         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18431         (AddField): Set it to true when adding a non-static field.
18432         (DefineType): Use `have_nonstatic_fields' to find out whether we
18433         have non-static fields, not `Fields != null'.
18434
18435 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18436
18437         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18438         dereferencing a null on the static-field code path)
18439
18440 2002-05-30  Martin Baulig  <martin@gnome.org>
18441
18442         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18443         to take command line arguments.  Use reflection to call the new
18444         custom `Initialize' function on the symbol writer and pass it the
18445         command line arguments.
18446
18447         * driver.cs (--debug-args): New command line argument to pass command
18448         line arguments to the symbol writer.
18449
18450 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18453         the target type for indexers and properties.  Thanks to Joe for
18454         catching this.
18455
18456 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18457
18458         * typemanager.cs (MethodFlags): returns the method flags
18459         (Obsolete/ShouldIgnore) that control warning emission and whether
18460         the invocation should be made, or ignored. 
18461
18462         * expression.cs (Invocation.Emit): Remove previous hack, we should
18463         not do this on matching a base type, we should do this based on an attribute
18464
18465         Only emit calls to System.Diagnostics.Debug and
18466         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18467         on the command line.
18468
18469         * rootcontext.cs: Global settings for tracing and debugging.
18470
18471         * cs-tokenizer.cs (define): New utility function to track
18472         defines.   Set the global settings for TRACE and DEBUG if found.
18473
18474 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18475
18476         * interface.cs (Populate*): Pass in the TypeContainer as well as
18477         the DeclSpace as parameters so that we can create EmitContexts and
18478         then use that to apply attributes etc.
18479
18480         (PopulateMethod, PopulateEvent, PopulateProperty)
18481         (PopulateIndexer): Apply attributes everywhere.
18482
18483         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18484         etc.
18485
18486         (ApplyAttributes): Update accordingly.
18487
18488         We now apply interface attributes for all members too.
18489
18490 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18491
18492         * class.cs (Indexer.Define); Correctly check if we are explicit
18493         implementation (instead of checking the Name for a ".", we
18494         directly look up if the InterfaceType was specified).
18495
18496         Delay the creation of the PropertyBuilder.
18497
18498         Only create the PropertyBuilder if we are not an explicit
18499         interface implementation.   This means that explicit interface
18500         implementation members do not participate in regular function
18501         lookups, and hence fixes another major ambiguity problem in
18502         overload resolution (that was the visible effect).
18503
18504         (DefineMethod): Return whether we are doing an interface
18505         implementation. 
18506
18507         * typemanager.cs: Temporary hack until we get attributes in
18508         interfaces (Ravi is working on that) and we get IndexerName
18509         support in interfaces.
18510
18511         * interface.cs: Register the indexers as properties.
18512
18513         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18514         warning, I have verified that this is a bug in the .NET runtime
18515         (JavaScript suffers of the same problem).
18516
18517         * typemanager.cs (MemberLookup): When looking up members for
18518         interfaces, the parent of an interface is the implicit
18519         System.Object (so we succeed in searches of Object methods in an
18520         interface method invocation.  Example:  IEnumerable x;  x.ToString
18521         ()) 
18522
18523 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18524
18525         * class.cs (Event): Events should also register if they do
18526         implement the methods that an interface requires.
18527
18528         * typemanager.cs (MemberLookup); use the new GetInterfaces
18529         method. 
18530
18531         (GetInterfaces): The code used to lookup interfaces for a type is
18532         used in more than one place, factor it here. 
18533
18534         * driver.cs: Track the errors at the bottom of the file, we kept
18535         on going.
18536
18537         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18538         instance if the method we are calling is static!
18539
18540 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18541
18542         * attribute.cs (ApplyAttributes): Make this function filter out
18543         the IndexerName attribute (as that attribute in reality is never
18544         applied) and return the string constant for the IndexerName
18545         attribute. 
18546
18547         * class.cs (TypeContainer.Emit): Validate that all the indexers
18548         have the same IndexerName attribute, and if so, set the
18549         DefaultName attribute on the class. 
18550
18551         * typemanager.cs: The return value might contain other stuff (not
18552         only methods).  For instance, consider a method with an "Item"
18553         property and an Item method.
18554
18555         * class.cs: If there is a problem with the parameter types,
18556         return. 
18557
18558 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18559
18560         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18561         looks at user defined conversion after making a call to 
18562         StandardConversionExists - we need this for overload resolution.
18563
18564         * expression.cs : Update accordingly the various method calls.
18565
18566         This fixes 2 bugs filed against implicit user defined conversions 
18567
18568 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18569
18570         * statement.cs: Track the result of the assignment.
18571
18572 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18573
18574         * expression.cs (MemberAccess): Improved error reporting for
18575         inaccessible members.
18576
18577 2002-05-22  Martin Baulig  <martin@gnome.org>
18578
18579         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18580         itself with debugging support.
18581
18582 2002-05-22  Martin Baulig  <martin@gnome.org>
18583
18584         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18585         Removed, this isn't needed anymore.
18586
18587 2002-05-20  Martin Baulig  <martin@gnome.org>
18588
18589         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18590         be underlying type for an enum.
18591
18592 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18593
18594         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18595         that splits out the loading of just the core types.
18596
18597         * rootcontext.cs (ResolveCore): Split the struct resolution in
18598         two, so we can load the enumeration underlying types before any
18599         enums are used.
18600
18601         * expression.cs (Is): Bandaid until we fix properly Switch (see
18602         bug #24985 for details).
18603
18604         * typemanager.cs (ImplementsInterface): The hashtable will contain
18605         a null if there are no interfaces implemented.
18606
18607 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18608
18609         * cs-parser.jay (indexer_declarator): It is fine to have array
18610         parameters
18611
18612 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18613
18614         * typemanager.cs: (RegisterBuilder): New function used to register
18615         TypeBuilders that implement interfaces.  Since
18616         TypeBuilder.GetInterfaces (as usual) does not work with lame
18617         Reflection.Emit. 
18618         (AddUserType): register interfaces.
18619
18620         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18621         dealing with TypeBuilder.  Also, arrays are showing up as
18622         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18623         methods can not be invoked on them!
18624
18625         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18626         (ImplicitReferenceConversionExists): Split out from
18627         StandardConversionExists. 
18628
18629         * expression.cs (As): We were only implementing one of the three
18630         cases for the as operator.  We now implement them all.
18631         (Is): Implement the various other cases for Is as well.
18632
18633         * typemanager.cs (CACHE): New define used to control if we want or
18634         not the FindMembers cache.  Seems to have a negative impact on
18635         performance currently
18636
18637         (MemberLookup): Nested types have full acess to
18638         enclosing type members
18639
18640         Remove code that coped with instance/static returns for events, we
18641         now catch this in RealFindMembers.
18642
18643         (RealFindMembers): only perform static lookup if the instance
18644         lookup did not return a type or an event.  
18645
18646 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18647
18648         * assign.cs (CompoundAssign): We pass more semantic information
18649         now to Compound Assignments than we did before: now we have all
18650         the information at hand, and now we resolve the target *before* we
18651         do the expression expansion, which allows the "CacheValue" method
18652         to have the effect we intended (before, a [x] += 1 would generate
18653         two differen ArrayAccess expressions from the ElementAccess,
18654         during the resolution process).
18655
18656         (CompoundAssign.DoResolve): Resolve target and original_source here.
18657
18658 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18659
18660         * expression.cs (ArrayAccess): dropped debugging information. 
18661
18662         * typemanager.cs: Small bug fix: I was always returning i_members,
18663         instead of one of i_members or s_members (depending on which had
18664         the content).
18665
18666         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18667         method is invoked before any code generation takes place, and it
18668         is a mechanism to inform that the expression will be invoked more
18669         than once, and that the method should use temporary values to
18670         avoid having side effects
18671
18672         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18673
18674         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18675         implementation.
18676
18677         * expression.cs (Indirection, ArrayAccess): Add support for
18678         CacheTemporaries in these two bad boys. 
18679
18680         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18681         ldobj or ldind_ref.  
18682         (StoreFromPtr): Handle stobj as well.
18683
18684         * expression.cs (UnaryMutator): Share more code.
18685
18686         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18687         down: I was not tracking the Filter function as well, which
18688         was affecting the results of the cache.
18689
18690 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18691
18692         * attribute.cs: Remove the hack to handle the CharSet property on
18693         StructLayouts. 
18694
18695 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18696
18697         * attribute.cs (DoResolve): More uglyness, we now only try to
18698         resolve the attribute partially, to extract the CharSet
18699         information (only if we are a StructLayout attribute).  Otherwise 
18700
18701         (GetExtraTypeInfo): Add some code to conditionally kill in the
18702         future this.   I am more and more convinced that the .NET
18703         framework has special code to handle the attribute setting on
18704         certain elements.
18705
18706         * expression.cs (IsParamsMethodApplicable): Revert my previous
18707         foreach change here, it was wrong.
18708
18709 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18712         (pp_expr): do not abort on unknown input, just return.
18713         (eval): abort if there are pending chars.
18714
18715         * attribute.cs (Attribute.Resolve): Positional parameters are
18716         optional.  Deal with that case.
18717
18718         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18719         the Ansi/Unicode/Auto information for the type.
18720
18721         (TypeContainer.DefineType): instantiate the EmitContext here, as
18722         we will be using it during the type definition (to resolve
18723         attributes) and during the emit phase.
18724
18725         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18726         to pull type information out of the attributes
18727
18728         (Attribute.Resolve): track the constructor builder, and allow for
18729         multiple invocations (structs and classes will use this).
18730
18731         * ecore.cs (MemberLookupFinal): new version with all the
18732         parameters customizable.
18733
18734         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18735         constructors.  Return if the result value is null (as the error
18736         would have been flagged already by MemberLookupFinal)
18737
18738         Do not allow instances of abstract classes or interfaces to be
18739         created.
18740
18741         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18742         We have to compare the assembly property here when dealing with
18743         FamANDAssem and Assembly access modifiers, because we might be
18744         creating an assembly from *modules* (that means that we are not
18745         getting TypeBuilders for types defined in other modules that are
18746         part of this assembly).
18747
18748         (Method.Emit): If the method is marked abstract and has a body,
18749         emit an error. 
18750
18751         (TypeContainer.DefineMembers): If both the defined member and the
18752         parent name match are methods, then do not emit any warnings: let
18753         the Method.Define routine take care of flagging warnings.  But if
18754         there is a mismatch (method overrides something else, or method is
18755         overriwritten by something, then emit warning).
18756
18757         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18758         set to null, this means `do not check for the return type on the
18759         signature'. 
18760
18761         (Method.Define): set the return type for the method signature to
18762         null, so that we get methods with the same name and parameters and
18763         different return types.  This is used to flag warning 114 (you are
18764         hiding a method, and you probably want to use the new/override
18765         keywords instead).
18766
18767         * typemanager.cs (MemberLookup): Implemented proper access
18768         control, closing a long standing set of bug reports.  The problem
18769         was that the Framework only has two bits: Public and NonPublic,
18770         and NonPublic includes private and protected methods, but we need
18771         to enforce the FamANDAssem, FamOrAssem and Family. 
18772
18773 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18774
18775         * statement.cs (GotoCase): Return true: Ammounts to giving up
18776         knowledge on whether we return or not, and letting the other case
18777         be responsible for it.
18778
18779 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18780
18781         * driver.cs: Do not load directories for each file processed, only
18782         do it if there is a pattern.
18783
18784         * ecore.cs: Report readonly assigns here as well, as we might have
18785         been resolved only by MemberAccess.
18786
18787         (SimpleName.SimpleNameResolve): Also be useful for LValue
18788         resolution.   We need this to propagate assign to local readonly variables
18789
18790         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18791         do not want to reuse potential criteria memory.
18792
18793         * class.cs (MyEventBuilder): Set reflected_type;
18794
18795         * ecore.cs (Constantify): Added support for constifying bools.
18796
18797         (RootContext.LookupType): Added a cache for values looked up in
18798         the declaration space.
18799
18800         * typemanager.cs (FindMembers): Now is a front-end to
18801         RealFindMembers, and provides a two-level hashtable-based cache to
18802         the request.  
18803
18804         15% performance improvement: from 22.5 to 19.2 seconds.
18805
18806         * expression.cs (IsParamsMethodApplicable): use foreach.
18807         (Invocation.DoResolve): ditto.
18808         (New.DoResolve): ditto.
18809         (ArrayCreation.DoResolve): ditto.
18810
18811         * ecore.cs (FindMostEncompassingType): use foreach.
18812
18813         * delegate.cs (NewDelegate.DoResolve): Use foreach
18814
18815         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18816         (RemoveMethods): use foreach.
18817
18818         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18819         nested foreach statements instead of for, and also break out of
18820         the inner loop once a match is found.
18821
18822         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18823
18824 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18827         we actually unwrap the expression to allow for extra information
18828         to be extracted. 
18829
18830         * expression.cs: Use Shr_Un on unsigned operations. 
18831
18832 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18833
18834         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18835         applicable operators was not being considered correctly. This closes
18836         the bug Miguel reported.
18837
18838 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18839
18840         * attribute.cs: check that the type derives from System.Attribute
18841         and report the correct error in that case (moved the duplicate code to
18842         its own method, too).
18843
18844 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18845
18846         * attribute.cs: lookup attribute type name as the spec says: first the
18847         bare attribute name and then name + "Attribute" (nant compiles with
18848         mcs after this fix).
18849
18850 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18851
18852         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18853         Because of the way we parse things, we should try to see if a
18854         UIntConstant can fit in an integer.
18855
18856 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18857
18858         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18859         when we are in an explicit context.
18860
18861         (ConvertReferenceExplicit): When converting from Iface type S to Class
18862         T make sure the rules are implemented as an OR.
18863
18864         * parameter.cs (ParameterType): Make it a property for now although the
18865         purpose really isn't anything immediate.
18866
18867         * expression.cs (Is*Applicable): Do better checking on the parameter type
18868         of a ref/out parameter. The ones from the system assemblies are already 
18869         marked with the correct type so we don't need to do any correction.
18870
18871         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18872         the object type is standard too so include that.
18873
18874 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18875
18876         * ecore.cs (StandardConversionExists): Augment with missing code:
18877         deal with IntConstant, LongConstants and Enumerations.
18878
18879         * assign.cs: Report the error, instead of failing silently
18880
18881         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18882         typecontainer that they are declared, because the
18883         typecontainer/namespace will have the list of using clauses that
18884         need to be applied.
18885
18886         Assembly Attributes were escaping the normal registration
18887         mechanism. 
18888
18889         (EmitCode): Apply attributes within an EmitContext that represents
18890         the container they were declared on.
18891
18892         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18893
18894 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18895
18896         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18897         Revamp completely - make much cleaner as we now operate only
18898         on a set of Types.
18899
18900         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18901         to implement the logic detailed in the spec more correctly.
18902
18903         (UserDefinedConversion): Update accordingly.
18904
18905 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18906
18907         * statement.cs: Return flow analysis information up.
18908
18909         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18910         and the default.
18911
18912         (token): Do not consume an extra character before calling
18913         decimal_digits.
18914
18915 2002-05-06  Piers Haken <piersh@friskit.com>
18916
18917         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18918
18919 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18922         EmitContext during the instance constructor initializer
18923         resolution, to stop access to instance variables.
18924
18925         This is mandated by the spec, last paragraph of the `constructor
18926         initializers' section. 
18927
18928 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18929
18930         * cs-parser.jay, class.cs (Accessor): new class used to represent
18931         an accessor (get or set).  In the past we used `null' to represent
18932         a missing accessor.  But this is ambiguous because there was no
18933         way to tell in abstract indexers/properties if one of them was
18934         specified.
18935
18936         Now there is a way of addressing that.
18937
18938         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18939         instead of FindMembers.
18940
18941         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18942         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18943
18944         * attribute.cs: Treat indexers and properties as the same in terms
18945         of applying attributes
18946
18947         * ecore.cs (FindMostEncompassedType): Use statically initialized
18948         EmptyExpressions()s like we do elsewhere to avoid creating useless
18949         objects (and we take this out of the tight loop).
18950
18951         (GetConversionOperators): Move the code to extract the actual
18952         operators to a separate routine to clean things up.
18953
18954 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18957         events are always registered FieldBuilders.
18958
18959         * class.cs (FieldBase): New class shared by Fields 
18960
18961         * delegate.cs: If we are a toplevel delegate, use our full name.
18962         If we are a nested delegate, then only use our tail name.
18963
18964 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18965
18966         * expression.cs (IsApplicable): Ensure that we add the "&" to
18967         ref/out types before comparing it with the type of the argument.
18968
18969         (IsParamsMethodApplicable): Ditto.
18970
18971         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18972         silly me ;-)
18973
18974         * delegate.cs : Handle the case when we have more than one applicable
18975         method. Flag an error only when we finish checking all.
18976
18977 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * expression.cs: Add support for boolean static initializers.
18980
18981 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18982
18983         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18984
18985         * parameter.cs (ComputeParameterTypes,
18986         ComputeAndDefineParameterTypes): Better error handling: now we
18987         clear the `types' cache if we fail during any of the type lookups.
18988         We also return the status code correctly to our caller
18989
18990         * delegate.cs: If we fail to define a delegate, abort the extra
18991         steps. 
18992
18993         * expression.cs (Binary.ResolveOperator): for
18994         operator==(object,object) and operator !=(object, object) we also
18995         have to verify that there is an implicit conversion from one to
18996         the other.
18997
18998         (ArrayAccess.DoResolve): Array Access can operate on
18999         non-variables. 
19000
19001 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19002
19003         * assign.cs (CompoundAssign): A new class used as a "flag" that
19004         the assignment actually is happening as part of a compound
19005         assignment operator.
19006
19007         During compound assignment, a few new rules exist to enable things
19008         like:
19009
19010         byte b |= 1 + 2
19011
19012         From the spec:
19013
19014         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19015         to the type of x) if y is implicitly convertible to the type of x,
19016         and the operator is a builtin operator and the return type of the
19017         operator is explicitly convertible to the type of x. 
19018
19019         * rootcontext.cs: Reset warning level to 2.  4 catches various
19020         "interesting" features in mcs, we must clean this up at some
19021         point, but currently am trying to kill other bugs ;-)
19022
19023         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19024         in container classes as well.  
19025
19026         * expression.cs (Binary.ResolveOperator): Handle string case
19027         before anything else (as operator overloading does emit an error
19028         before doing anything else).
19029
19030         This code could go away when we move to a table driven model, but
19031         i could not come up with a good plan last night.
19032
19033 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19034
19035         * typemanager.cs (CSharpName): reimplementation using regex.
19036         * class.cs: added null check for fields in Emit
19037         * rootcontext.cs: set warninglevel to 4
19038
19039 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * typemanager.cs (CSharpName): reimplemented with Lupus
19042         suggestion.
19043
19044 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19045
19046         * statement.cs (If): correclty implement Resolve, because we were
19047         not catching sem errors in there.  The same process is needed
19048         everywhere else. 
19049         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19050
19051
19052         (Statement.Warning_DeadCodeFound): Factorize code.
19053         (While): Report dead code here too.
19054
19055         (Statement): Added Resolve virtual method to allow
19056         for resolution split from the emit code.
19057
19058 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19059
19060         * statement.cs (EmitBoolExpression): No longer try to resolve the
19061         expression here.    
19062         (MakeBoolean): New utility function that resolve, implicitly
19063         converts to boolean and tags the expression. 
19064
19065
19066         (If, Do): Implement dead code elimination.
19067         (While): Implement loop inversion
19068
19069         (Do, While, For, If): Resolve the expression prior to calling our
19070         code generation.
19071
19072 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19073
19074         * class.cs:
19075           - added method Report28 (warning: program has more than one entry point)
19076           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19077           - modified method Method.Define, the part at the end of the method
19078
19079         * rootcontext.cs: added static public Location EntryPointLocation;
19080           
19081         * ../errors/cs0028.cs : Add test case for the above warning.              
19082
19083         * typemanager.cs:
19084           - modified method CSharpName to allow arrays of primitive type to
19085             be printed nicely (e.g. instead of System.Int32[][] it now prints
19086             int[][])
19087           - added method CSharpSignature: returns the signature of a method
19088             in string format to be used in reporting errors, warnings, etc.
19089
19090         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19091         with String.Empty.
19092
19093 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19094
19095         * delegate.cs (Define): Fix extremely silly bug where I was
19096         setting the type of the 'object' parameter of the BeginInvoke
19097         method to System.IAsyncResult instead of System.Object ;-)
19098
19099 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19100
19101         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19102         here. 
19103
19104         (Constructor.Emit): return if we fail to initialize the
19105         constructor.  Another door closed!  
19106
19107         * expression.cs (New.DoResolve): Improve error message (from -6 to
19108         1501).  Use DeclaredOnly lookup to find the exact constructor.
19109
19110         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19111         loop.  This is useful.
19112
19113         * cs-parser.jay: Adjust the default parameters so that destructors
19114         have the proper signature.
19115
19116 2002-04-26  Martin Baulig  <martin@gnome.org>
19117
19118         * driver.cs (LoadAssembly): If `assembly' contains any characters
19119         which are only valid in path names and not in assembly names
19120         (currently slash, backslash and point), use Assembly.LoadFrom ()
19121         instead of Assembly.Load () on the `assembly' (before iteration
19122         over the link_paths).
19123
19124 2002-04-26  Martin Baulig  <martin@gnome.org>
19125
19126         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19127
19128 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19129
19130         * class.cs (Property): use the new typemanager.MemberLookup
19131
19132         (TypeContainer.MemberLookup): Implement using the
19133         TypeManager.MemberLookup now. 
19134
19135         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19136         and return MemberInfos, so that these can be used without an
19137         EmitContext (what we had before).
19138
19139 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19140
19141         * expression.cs: Fix the case where the argument to params if the
19142         type of the params.  I omitted handling this before.   Fixed
19143
19144 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * driver.cs: Call BootCorlib_PopulateCoreType
19147
19148         * class.cs (Property.CheckBase): Check for properties only, not
19149         for all members. 
19150
19151         * interface.cs: Temporary hack: try/catch around the
19152         CustomAttributeBuilder, because I am getting an exception that I
19153         do not understand.
19154
19155         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19156         types whose definitions are required to be there (attributes are
19157         defined before standard types).
19158
19159         Compute definitions as we boot the various types, as they are used
19160         immediately (value_type class will need object_type, but if we do
19161         not initialize object_type, we will pass a null, which will let
19162         the runtime pick the System.Object from the existing corlib, which
19163         is not what we want).
19164
19165 2002-04-22  Patrik Torstensson <totte@labs2.com>
19166
19167         * cs-tokenizer.cs: fixed a number of trim() issues.
19168
19169 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19170
19171         * expression.cs (Argument.Type): Ensure that we return the correct
19172         type when we have out or ref parameters [in which case we 
19173         append a "&"].
19174
19175 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * class.cs (Property, Indexer): Allow extern modifier in there. 
19178
19179         * typemanager.cs (InitBaseTypes): Initializes object_type and
19180         value_type, since those will be used early on during the bootstrap
19181         process to compile corlib.
19182
19183         (InitCoreTypes): Move code from here to InitBaseTypes.
19184
19185 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19186
19187         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19188         single-dimension arrays as using the ldlen opcode.  
19189
19190         Daniel Lewis discovered this optimization.  
19191
19192         * typemanager.cs: Add signature for System.Array::get_Length
19193
19194 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19195
19196         * statement.cs: report the error when the foreach does not apply to an
19197         array nor a collection.
19198
19199 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19200
19201         * expression.cs: Add implicit conversions to the operator ~.
19202
19203         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19204
19205         * typemanager.cs: Locate the decimal constructor.
19206
19207 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19208
19209         * attribute.cs: use the new property of TypeOf.
19210         * expression.cs: added 'get' property around typearg.
19211
19212         These changes fix a build breaker reported by NickD. Is this the
19213         correct way to fix?  If not, please, revert my changes and make it
19214         work :-).
19215
19216 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19217
19218         * attribute.cs: Add support for typeof in attribute invocations.
19219         I am not sure that this is right though.
19220
19221 2002-04-14  Duncan Mak  <duncan@ximian.com>
19222
19223         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19224         Binary.Operator.Division case.
19225
19226 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19227
19228         * class.cs (DefineType): Ensure that we do a proper check on
19229         attribute types and also register it with the TypeManager.
19230
19231         (TypeContainer.Targets): The default for attribute types is
19232         AttributeTargets.All.
19233
19234         * attribute.cs (ApplyAttributes): Registering the attribute type
19235         is done elsewhere, not when we discover we have a Usage attribute.
19236
19237 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19238
19239         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19240         and get rid of is_delegate parameter.
19241
19242         * everywhere : update.
19243
19244 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19245
19246         * cs-parser.jay (compilation_unit): Revamp completely to use
19247         some new ideas that I got from Rhys' grammar to solve the problems
19248         with assembly level attributes.
19249
19250         (outer_declaration): New grammar production.
19251
19252         (attribute_sections): Add.
19253
19254         (opt_attributes): Base on attribute_sections
19255
19256         (namespace_declaration): Allow opt_attributes to tackle the case
19257         when we have assembly level attributes - we are clever in this
19258         regard now ;-)
19259
19260         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19261         attributes in the non-global context.
19262
19263         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19264         instead of SetGlobalAttributes.
19265
19266         * class.cs, rootcontext.cs : Ensure we define and generate 
19267         attribute types before anything else.
19268
19269         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19270         and flag the new error -20 for the case when the attribute type
19271         does not have valid targets specified. csc does not catch this.
19272
19273         * ../errors/errors.txt : update for error # -20
19274
19275 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19276
19277         * support.cs (InternalParameters.ParameterModifier): Do some null
19278         checking and return sane values.
19279
19280         * class.cs (Method.Define): If we are a PInvoke method, ensure
19281         that we are static and extern. Report error # 601
19282
19283         * ../errors/cs0601.cs : Add test case for the above error.
19284
19285 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19286
19287         * rootcontext.cs (attribute_types): We need to keep type of
19288         all attribute types separately and emit code for them first.
19289
19290         (RegisterAttribute) : Implement.
19291
19292         * class.cs (DefineType): Check if the current Type is a custom
19293         attribute type and register it accordingly.
19294
19295         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19296         adding the first attribute twice and rename to
19297
19298         (SetGlobalAttributes): this.
19299
19300         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19301         lookups.
19302
19303         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19304         if we are processing global arguments. Hmm, I am unsure of this.
19305
19306 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19307
19308         * expression.cs: added static array of strings to avoid calling
19309         Enum.ToString () for Operator in Binary. Significant recover of
19310         performance.
19311
19312 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * class.cs (FindMembers): Allow the Builders of the various
19315         members to be null.  If they are skip them.  This only happens
19316         during the PInvoke declaration.
19317
19318 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19319
19320         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19321         failure, so we do not keep going afterwards.
19322
19323         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19324         wanted to pass `false' as the `is_delegate' argument.  If this is
19325         the case, why not use delegate_type == null to mean `is_delegate =
19326         false' and anything else as is_delegate = true.
19327
19328 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19329
19330         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19331         code for the section, not the beginning of the tests.
19332
19333 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19334
19335         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19336
19337         * expression.cs (Binary): same.  Warn about errors where we have
19338         Enum/Enum in operator + as well.
19339
19340 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19341
19342         * statement.cs:
19343                 - added support for switch(bool)
19344                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19345                 - add TableSwitchEmit() to handle table-based switch statements
19346
19347 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19348
19349         * expression.cs (Invocation.OverloadResolve): Factor out code which
19350         does parameter compatibility checking with arguments so that we can 
19351         re-use the code even from Delegate.VerifyApplicability
19352
19353         (VerifyArgumentsCompat): Move above code here.
19354
19355         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19356         and instead make a call to the above method.
19357
19358 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19359
19360         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19361         We use it to keep track of classes which are attribute types.
19362
19363 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19364
19365         * delegate.cs (Delegate.Define): Correctly define the types in the
19366         presence of fixed and array parameters.
19367
19368         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19369         doing FindMembers.
19370
19371         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19372         include NonPublic after the first iteration.
19373
19374         * class.cs (Indexer.CheckBase): Only check if both parents are
19375         non-null. 
19376
19377         * cs-parser.jay (accessor_body): If empty, set to null.
19378
19379         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19380         same code path here to resolve constants names that we did have in
19381         MemberAccess.DoResolve.  There is too much code duplicated here.
19382
19383 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19384
19385         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19386
19387         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19388         to MakeUnionSet.
19389
19390         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19391         tokens, numbers and strings.
19392
19393         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19394         parenthesis.
19395
19396         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19397         asyncronous parameters and the regular parameters.  
19398
19399         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19400         specify the target directory.
19401
19402         * expression.cs: (This.DoResolve): Simplify
19403         (As.Emit): Optimize, do not generate IsInst if the expression is
19404         always of the given type.
19405
19406         (Is.DoResolve): Bug fix, we were reporting both always/never for
19407         the is expression.
19408
19409         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19410         creating too many unnecessary arrays.
19411
19412 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19413
19414         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19415         fields instead of rolling our own initializer.   Takes care of all
19416         implicit conversions, and drops unnecessary static checks/argument.
19417
19418 2002-03-31  Dick Porter  <dick@ximian.com>
19419
19420         * driver.cs: use the GetDirectories() return values properly, and
19421         use "/" as path separator.
19422
19423 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19424
19425         * expression.cs (Unary): Optimize - - expr into expr.
19426         (Binary): Optimize a + (-b) into a -b.
19427
19428         * codegen.cs (CodeGen): Made all methods static.
19429
19430 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * rootcontext.cs: 
19433
19434         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19435         TypeBuilder property.
19436
19437         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19438         instead. 
19439
19440         * tree.cs: Removed the various RecordXXXX, and replaced with a
19441         single RecordDecl.  Removed all the accessor methods, and just
19442         left a single access point Type 
19443
19444         * enum.cs: Rename DefineEnum to DefineType.
19445
19446         * decl.cs: New abstract method `DefineType' used to unify the
19447         Defines for Enumerations, Interfaces, TypeContainers and
19448         Delegates.
19449
19450         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19451         LookupBaseClasses method that used to live in class.cs and
19452         interface.cs here, and renamed to FindType.
19453
19454         * delegate.cs: Implement DefineType.  Take advantage of the
19455         refactored pattern for locating the parent builder without taking
19456         the parent_builder argument (which we know does not work if we are
19457         nested, and triggering a toplevel definition).
19458
19459 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19460
19461         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19462         accessibility of a member has changed during override and report
19463         an error if so.
19464
19465         * class.cs (Method.Define, Property.Define): Only complain on
19466         overrides if the method is private, any other accessibility is
19467         fine (and since we just checked the permission is the same, we are
19468         good to go).
19469
19470         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19471         and elif are processed always.  The other pre-processing
19472         directives are only processed if we are "taking" the path
19473
19474 2002-03-29  Martin Baulig  <martin@gnome.org>
19475
19476         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19477         current location is not Null.
19478
19479         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19480         a separate method so we can profile it.
19481
19482         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19483         `span.Seconds' are just seconds, but no minutes or hours.
19484         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19485
19486 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19489         Remove the gratuitous set of Final:
19490
19491                                 // If an interface implementation, then we can set Final.
19492                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19493                                     implementing.DeclaringType.IsInterface)
19494                                         flags |= MethodAttributes.Final;
19495
19496         I do not know what I was smoking when I used that.
19497
19498
19499         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19500         step into fixing the name resolution issues for delegates and
19501         unifying the toplevel name resolution.
19502
19503 2002-03-28  Martin Baulig  <martin@gnome.org>
19504
19505         * class.cs (Method.Emit): If we have a symbol writer, call its
19506         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19507         tell it about the current method.
19508
19509         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19510         writer that we're going to emit the first byte of IL code for a new
19511         statement (a new source line).
19512         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19513         EmitContext.Mark() before emitting any code.
19514
19515         * location.cs (SymbolDocument): Return null when we're Null.
19516
19517         * statement.cs (Statement): Moved the `Location loc' variable here.
19518         (Statement.EmitBoolExpression): If we have a symbol writer, call
19519         ec.Mark() before emitting any code to tell it that we're at the
19520         beginning of a new statement.
19521         (StatementExpression): Added `Location' argument to the constructor.
19522         (Block): Added public readonly variable `StartLocation' and public
19523         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19524         (Block): Added constructor which takes a start and end location.
19525         (Block.SetEndLocation): New method. This sets the end location.
19526         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19527         local variables we create.
19528         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19529         each statement and do also mark the begin and end of the block.
19530
19531         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19532         tell it the current lexer.Location, use Location.Null for the end of the
19533         block.
19534         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19535         current block, set its end location using SetEndLocation().
19536         (statement_expression): StatementExpression constructor now takes the
19537         lexer.Location as additional argument.
19538         (for_statement, declare_local_variables): Likewise.
19539         (declare_local_variables): When creating a new implicit block, use the
19540         new Block constructor and pass it the lexer.Location.
19541
19542 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19545         members also on the parent interfaces recursively.
19546
19547 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19548
19549         * report.cs: Use new formats, since Gonzalo finished the missing
19550         bits. 
19551
19552         * expression.cs (Binary.ResolveOperator): added missing operator|
19553         operator& and operator^ for bool/bool.
19554
19555         * cs-parser.jay: CheckDef now takes a Location argument that is
19556         used to report errors more precisly (instead of reporting the end
19557         of a definition, we try to track something which is a lot closer
19558         to the source of the problem).
19559
19560         * cs-tokenizer.cs: Track global token use, so we can properly flag
19561         the use of #define/#undef after the first token has been seen.
19562
19563         Also, rename the reportXXXX to Error_DescriptiveName
19564
19565         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19566         TypeContainer, so that Enum and Interface can use this too.
19567
19568         * class.cs (TypeContainer.LookupInterfaceOrClass,
19569         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19570         `builder' argument.  Typically this was used to pass the parent
19571         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19572         the definition).  
19573
19574         The problem is that a nested class could trigger the definition of
19575         a toplevel class, and the builder would be obviously wrong in that
19576         case. 
19577
19578         So we drop this argument, and we compute dynamically the
19579         TypeBuilder/ModuleBuilder (the correct information was available
19580         to us anyways from DeclSpace.Parent)
19581
19582         * interface.cs (Interface.DefineInterface): Drop builder
19583         parameter cleanup like class.cs
19584
19585         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19586         like class.cs
19587
19588         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19589         values. 
19590
19591         (Try.Emit): Propagate the returns value from the statement.
19592
19593         (Return.Emit): Even if we are leavning 
19594
19595         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19596
19597         * modifiers.cs: Fix the computation of MethodAttributes flags.
19598
19599 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19600
19601         * driver.cs: allow compilation of files that start with '/'.
19602         Add a default case when checking the argument of --target.
19603
19604 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * interface.cs: Implement the same search algorithm for types in
19607         the interface code.
19608
19609         * delegate.cs: Do not allow multiple definition.
19610
19611         * Recovered ChangeLog that got accidentally amputated
19612
19613         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19614
19615         * rootcontext.cs: Load manually enum to allow core classes to
19616         contain enumerations.
19617
19618         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19619         Update to new static methods in TypeManager.
19620
19621         * typemanager.cs (GetMethod, GetConstructor): Use our
19622         implementation of FindMembers to find the members, since during
19623         corlib compilation, the types are TypeBuilders and GetMethod and
19624         GetConstructor do not work.
19625
19626         Make all methods in TypeManager static.
19627
19628         (InitCodeHelpers): Split the functionality from
19629         the InitCodeTypes function.
19630
19631         * driver.cs: Call InitCodeHelpers after we have populated the
19632         types. 
19633
19634         * cs-parser.jay (delegate_declaration): we did not used to compute
19635         the delegate name correctly for void delegates.
19636
19637 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19638
19639         * rootcontext.cs (RootContext): Init the interface_resolve_order
19640         and type_container_resolve_order always.
19641
19642         (ResolveCore, BootstrapCorlib_ResolveClass,
19643         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19644         compiler when compiling with --nostdlib
19645
19646         * class.cs (TypeContainer.DefineType): Check that our parent is
19647         not null.  This test is most important when we are bootstraping
19648         the core types.
19649
19650         * codegen.cs: Split out the symbol writing code.
19651
19652 2002-03-25  Martin Baulig  <martin@gnome.org>
19653
19654         * driver.cs (-g): Made -g an alias for --debug.
19655
19656 2002-03-24  Martin Baulig  <martin@gnome.org>
19657
19658         * codegen.cs (SymbolWriter): New public variable. Returns the
19659         current symbol writer.
19660         (CodeGen): Added `bool want_debugging_support' argument to the
19661          constructor. If true, tell the ModuleBuild that we want debugging
19662         support and ask it for the ISymbolWriter.
19663         (Save): If we have a symbol writer, call it's Close() method after
19664         saving the assembly.
19665
19666         * driver.c (--debug): New command line argument to create a
19667         debugger information file.
19668
19669         * location.cs (SymbolDocument): New public property. Returns an
19670         ISymbolDocumentWriter object for the current source file or null
19671         if we don't have a symbol writer.
19672
19673 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19674
19675         * driver.cs (LoadAssembly): Correctly return when all the paths
19676         have been tried and not before.
19677
19678         * statement.cs (Switch.Emit): return the actual coverage for this
19679         statement (returns/not-returns)
19680
19681         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19682         switch of the statement if we are the last switch section.  That
19683         kills two problems: try/catch problems (we used to emit an empty
19684         nop at the end) and switch statements where all branches would
19685         return. 
19686
19687 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * driver.cs: Add default assemblies (the equivalent to the
19690         Microsoft CSC.RSP file)
19691
19692         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19693         also update tokens_seen and set it to false.
19694
19695         * driver.cs: Implement --recurse for Mike.
19696
19697         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19698         correctly splitting out the paths.
19699
19700 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19701
19702         * interface.cs (Interface.PopulateProperty): Instead of using
19703         `parent' as the declaration space for the set parameters, use
19704         `this' 
19705
19706         * support.cs (InternalParameters): InternalParameters constructor
19707         takes a DeclSpace instead of a TypeContainer.
19708
19709         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19710         types are being initialized, load the address of it before calling
19711         the function.  
19712
19713         (New): Provide a mechanism to disable the generation of local
19714         value type temporaries when the caller will be providing us with
19715         an address to store it.
19716
19717         (ArrayCreation.EmitDynamicInitializers): Use it.
19718
19719 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19720
19721         * expression.cs (Invocation.EmitArguments): Only probe for array
19722         property if there is more than one argument.  Sorry about that.
19723
19724         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19725         empty param arrays.
19726
19727         * class.cs (Method.LabelParameters): Fix incorrect code path that
19728         prevented the `ParamArrayAttribute' from being applied to the
19729         params attribute.
19730
19731 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19732
19733         * support.cs (ReflectionParameters): Correctly compute whether the
19734         last argument is a params array.  Fixes the problem with
19735         string.Split ('a')
19736
19737         * typemanager.cs: Make the assemblies array always be non-null
19738         (empty, but non-null)
19739
19740         * tree.cs (RecordDecl): New function that abstracts the recording
19741         of names.  This reports error 101, and provides a pointer to the
19742         previous declaration.  Fixes a crash in the compiler.
19743
19744         * cs-parser.jay (constructor_declaration): Update to new grammar,
19745         and provide a constructor_body that can be empty.
19746
19747 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19748
19749         * driver.cs: Add support for --resources.
19750
19751         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19752         Make all types for the various array helper methods be integer.
19753
19754         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19755         CheckState to ConvCast.
19756
19757         (ConvCast): Now it takes a `checked' state argument, to avoid
19758         depending on the emit context for the conversion, and just using
19759         the resolve time setting.
19760
19761         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19762         instead of Invocation.EmitArguments.  We do not emit the original
19763         arguments, instead we emit those which have been converted to
19764         unsigned int expressions.
19765
19766         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19767
19768         * codegen.cs: ditto.
19769
19770         * expression.cs (LocalVariableReference): Drop the use of the
19771         Store function that depended on the variable index.
19772
19773         * statement.cs (VariableInfo): Drop the `Idx' property from this
19774         class, as this is not taking into account the indexes for
19775         temporaries tat we generate during the execution, getting the
19776         indexes wrong.
19777
19778         * class.cs: First emit class initializers, then call the parent
19779         constructor. 
19780
19781         * expression.cs (Binary): Fix opcode emision.
19782         (UnaryMutator.EmitCode): Support checked code generation
19783
19784         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19785         matches for events for both the Static and Instance scans,
19786         pointing to the same element.   Fix that.
19787
19788 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * rootcontext.cs (ResolveTree): Always set the
19791         interface_resolve_order, because nested interfaces will be calling
19792         into us.
19793
19794         * class.cs (GetInterfaceOrClass): Track the same resolution
19795         process used by TypeManager.LookupType.  This fixes the nested
19796         type lookups in class declarations (separate path from
19797         LookupType). 
19798
19799         (TypeContainer.DefineType): Also define nested interfaces.
19800         (TypeContainer.RegisterOrder): New public function used to
19801         register the order in which child interfaces need to be closed.
19802
19803         Nested interfaces need to be closed after their parents have been
19804         created. 
19805
19806         * interface.cs (InterfaceAttr): Put all the logic for computing
19807         the interface attribute here. 
19808
19809         (DefineInterface): Register our interface order with the
19810         RootContext or with the TypeContainer depending on the case.
19811
19812 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19813
19814         * cs-parser.jay: rework foreach statement to work with the new
19815         changes to the policy on SimpleNames.
19816
19817         * report.cs: support Stacktrace on warnings as well.
19818
19819         * makefile: drop --unsafe and /unsafe from the compile.
19820
19821 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19822
19823         * ecore.cs (StandardConversionExists): Modify to take an Expression
19824         as the first parameter. Ensure we do null -> reference type conversion
19825         checking.
19826
19827         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19828         temporary Expression objects.
19829
19830 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19831
19832         * interface.cs: workaround bug in method overloading resolution
19833         (there is already a bugzilla bug for it).
19834
19835 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19836
19837         We could also solve this problem by having a separate path for
19838         performing type lookups, instead of DoResolve, we could have a
19839         ResolveType entry point, and only participating pieces of the
19840         production (simplename, deref, array) would implement this. 
19841
19842         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19843         signal SimpleName to only resolve type names and not attempt to
19844         resolve anything else.
19845
19846         * expression.cs (Cast): Set the flag.
19847
19848         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19849
19850         * class.cs: Only report 108 if there is no `new' modifier.
19851
19852         * cs-parser.jay: rework foreach statement to work with the new
19853         changes to the policy on SimpleNames.
19854         
19855         * report.cs: support Stacktrace on warnings as well.
19856
19857         * makefile: drop --unsafe and /unsafe from the compile.
19858
19859 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19860
19861         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19862         lookups here, instead of doing that at parse time.  This means
19863         that our grammar will not introduce `LocalVariableReferences' as
19864         expressions at this point.  That solves the problem of code like
19865         this:
19866
19867         class X {
19868            static void Main ()
19869            { int X = 1;
19870             { X x = null }}}
19871
19872         This is only half the fix.  The full fix requires parameters to
19873         also be handled in this way.
19874
19875         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19876         makes the use more obvious of the DeclSpace.  The
19877         ec.TypeContainer.TypeBuilder is now only used to pull the
19878         TypeBuilder for it.
19879
19880         My theory is that I can get rid of the TypeBuilder completely from
19881         the EmitContext, and have typecasts where it is used (from
19882         DeclSpace to where it matters).  
19883
19884         The only pending problem is that the code that implements Aliases
19885         is on TypeContainer, and probably should go in DeclSpace.
19886
19887         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19888         lookups here, instead of doing that at parse time.  This means
19889         that our grammar will not introduce `LocalVariableReferences' as
19890         expressions at this point.  That solves the problem of code like
19891         this:
19892
19893         class X {
19894            static void Main ()
19895            { int X = 1;
19896             { X x = null }}}
19897
19898         This is only half the fix.  The full fix requires parameters to
19899         also be handled in this way.
19900
19901         * class.cs (Property.DefineMethod): When implementing an interface
19902         method, set newslot, when implementing an abstract method, do not
19903         set the flag (before we tried never setting it, or always setting
19904         it, which is the difference).
19905         (Indexer.DefineMethod): same.
19906         (Method.DefineMethod): same.
19907
19908         * ecore.cs: Only set the status used flag if we get back a Field.
19909
19910         * attribute.cs: Temporary hack, so Paolo can keep working.
19911
19912 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19913
19914         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19915         the unmanaged type in the case we have a MarshalAs attribute.
19916
19917         (Resolve): Handle the case when we are parsing the special MarshalAs
19918         attribute [we need to store the unmanaged type to use later]
19919
19920         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19921         MarshalAs Attribute.
19922
19923         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19924         on parameters and accordingly set the marshalling info.
19925
19926 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19927
19928         * class.cs: Optimizing slightly by removing redundant code after
19929         we switched to the `NoTypes' return value.
19930         (Property.DefineMethod): use NoTypes here too.
19931
19932         This fixes the bug I introduced in my last batch of changes.
19933
19934 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19935
19936         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19937
19938         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19939         Enums since those are types too. 
19940
19941         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19942
19943         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19944         thanks to a call during the lookup process.
19945
19946 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19947
19948         * statement.cs (Foreach): Lots of work to accomodate a particular
19949         kind of foreach statement that I had not kept in mind.  It is
19950         possible to have foreachs on classes that provide a GetEnumerator
19951         method that return objects that implement the "pattern" for using
19952         a foreach, there is no need to support GetEnumerator
19953         specifically. 
19954
19955         This is needed to compile nant.
19956
19957         * decl.cs: Only report 114 if the member is not `Finalize' and if
19958         the warning level is at least 2.
19959
19960         * class.cs: Moved the compare function from Method to
19961         MethodSignature. 
19962
19963         (MethodSignature.InheritableMemberSignatureCompare): Add new
19964         filter function that is used to extract inheritable methods from a
19965         class. 
19966
19967         (Method.Define): Use the new `inheritable_method_signature_filter'
19968         delegate
19969
19970         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19971         command. 
19972
19973 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19974
19975         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19976
19977         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19978
19979         * expression.cs: Pass location information to
19980         ConvertImplicitStandard. 
19981
19982         * class.cs: Added debugging code to track return values from
19983         interfaces. 
19984
19985 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19986
19987         * expression.cs (Is.DoResolve): If either side of the `is' is an
19988         interface, do not flag the warning.
19989
19990         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19991         for interfaces
19992
19993         * report.cs: Allow for --fatal to be used with --probe.
19994
19995         * typemanager.cs (NoTypes): Move the definition for the empty Type
19996         array here. 
19997
19998         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19999         properties. 
20000         (TypeContainer.DefineProxy): New function used to proxy to parent
20001         implementations when implementing interfaces.
20002         (TypeContainer.ParentImplements): used to lookup if our parent
20003         implements a public function that is required by an interface.
20004         (TypeContainer.VerifyPendingMethods): Hook this up.
20005
20006         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20007         `modules' and `assemblies' arraylists into arrays.  We only grow
20008         these are the very early start up of the program, so this improves
20009         the speedof LookupType (nicely measured).
20010
20011         * expression.cs (MakeByteBlob): Replaced unsafe code with
20012         BitConverter, as suggested by Paolo.
20013
20014         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20015         folding of string concatenation, but if either side is a string,
20016         and the other is not, then return null, and let the runtime use
20017         the concatenation on the string plus the object (using
20018         `Object.ToString'). 
20019
20020 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20021
20022         Constant Folding has been implemented now.
20023
20024         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20025         the error instead on types that are not supported in one's
20026         complement. 
20027
20028         * constant.cs (Constant and all children): New set of functions to
20029         perform implict and explicit conversions.
20030
20031         * ecore.cs (EnumConstant): Implement the new functions to perform
20032         conversion by proxying to the child expression.
20033
20034         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20035         own separate setting that can not be turned off from the command
20036         line using --unchecked or --checked and is only controlled using
20037         the checked/unchecked statements and expressions.  This setting is
20038         used by the constant folder to flag errors.
20039
20040         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20041         ConstantCheckState as well.   
20042
20043         During Resolve, they also have to flag the state, because the
20044         constant folder runs completely in the Resolve phase.
20045
20046         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20047         well.
20048
20049 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * cfold.cs: New file, this file contains the constant folder.
20052
20053         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20054         argument to track whether we are using the resulting address to
20055         load or store a value and provide better error messages. 
20056
20057         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20058         new AddressOf arguments.
20059
20060         * statement.cs (Foreach.EmitCollectionForeach): Update
20061
20062         * expression.cs (Argument.Emit): Call AddressOf with proper
20063         arguments to track usage.
20064
20065         (New.DoEmit): Call AddressOf with new arguments.
20066
20067         (Unary.Emit): Adjust AddressOf call.
20068
20069 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20070
20071         * cs-parser.jay (member_access): Change the case for pre-defined types
20072         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20073         this suggestion.
20074
20075         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20076         a method body.
20077
20078         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20079         essentially like methods and apply attributes like MethodImplOptions to them too.
20080
20081         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20082         not being null.
20083
20084         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20085         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20086         is the DeclSpace.
20087
20088         * Update code everywhere accordingly.
20089
20090         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20091
20092         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20093
20094 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20095
20096         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20097         try performing lookups against those instead of jumping straight into using
20098         the 'using' clauses.
20099
20100         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20101
20102         (LookupType): Perform lookups in implicit parents too.
20103
20104         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20105         sequence as RootContext.LookupType. 
20106
20107         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20108         the various cases of namespace lookups into this method.
20109
20110 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20111
20112         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20113         in positional arguments)
20114
20115         * class.cs (Operator): Update the AllowedModifiers to contain
20116         extern. 
20117
20118         * cs-parser.jay: Update operator declaration to allow for the
20119         operator body to be empty.
20120
20121         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20122         values. 
20123
20124 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * class.cs (Method.Emit): Label parameters.
20127
20128         * driver.cs: Return 1 or 0 as the program exit code.
20129
20130 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * expression.cs: Special case the `null' object when trying to
20133         auto-compute the type, as anything can be explicitly converted to
20134         that. 
20135
20136         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20137         spotting this Paolo.
20138
20139         (Expression.ImplicitNumericConversion): Perform comparissions of
20140         the type using the underlying type in the case of an enumeration
20141         rather than using the enumeration type for the compare.
20142
20143         Cope with the underlying == type case, which is not possible to
20144         catch before. 
20145
20146         (Expression.ConvertNumericExplicit): Perform comparissions of
20147         the type using the underlying type in the case of an enumeration
20148         rather than using the enumeration type for the compare.
20149
20150         * driver.cs: If the user does not supply an extension, assume .exe
20151
20152         * cs-parser.jay (if_statement): Rewrote so that we can track the
20153         location for the if statement.
20154
20155         * expression.cs (Binary.ConstantFold): Only concat strings when
20156         the operation is "+", not everything ;-)
20157
20158         * statement.cs (Statement.EmitBoolExpression): Take a location
20159         argument. 
20160         (If, While, Do): Track location.
20161
20162         * expression.cs (Binary.ResolveOperator): In the object + string
20163         case, I was missing a call to ConvertImplicit
20164
20165 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20166
20167         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20168         Location arguments. Ensure we use RootContext.LookupType to do our work
20169         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20170
20171         * interface.cs (PopulateMethod): Handle the type of the parameter being
20172         null gracefully.
20173
20174         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20175         have a params method with no fixed arguments and a call is made with no
20176         arguments.
20177
20178 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20179
20180         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20181         the verbatim-string-literal
20182
20183         * support.cs (InternalParameters.ParameterModifier): handle null
20184         fixed parameters.
20185         (InternalParameters.ParameterType): ditto.
20186
20187         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20188         duplicating the name of the variable parameter.
20189         (GetParameterByName): Fix bug where we were not looking up array
20190         paramters if they were the only present (thanks Paolo!).
20191         (GetParameterInfo): We only have an empty set of types if both
20192         fixed and array are set to null.
20193         (GetParameterInfo-idx): Handle FixedParameter == null
20194
20195         * cs-parser.jay: Handle the case where there is no catch
20196         statements (missing null test).
20197
20198 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20199
20200         * driver.cs (MainDriver): Be conservative on our command line
20201         handling.
20202
20203         Catch DirectoryNotFoundException when calling GetFiles.
20204
20205         (SplitPathAndPattern): Used to split the input specification into
20206         a path and a pattern that we can feed to Directory.GetFiles.
20207
20208 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20209
20210         * statement.cs (Fixed): Implement the last case of the Fixed
20211         statement (string handling).
20212
20213         * expression.cs (StringPtr): New class used to return a char * to
20214         a string;  Used by the Fixed statement.
20215
20216         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20217
20218         * expression.cs (Binary.ResolveOperator): Remove redundant
20219         MemberLookup pn parent type.
20220         Optimize union call, we do not need a union if the types are the same.
20221         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20222         type.
20223
20224         Specialize the use of MemberLookup everywhere, instead of using
20225         the default settings. 
20226
20227         (StackAlloc): Implement stackalloc keyword.
20228
20229         * cs-parser.jay: Add rule to parse stackalloc.
20230
20231         * driver.cs: Handle /h, /help, /?
20232
20233         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20234         before we supported unsafe code.
20235
20236         * makefile: add --unsafe to the self compilation of mcs.
20237
20238 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20239
20240         * expression.cs (PointerArithmetic): New class that is used to
20241         perform pointer arithmetic.
20242         (Binary.Resolve): Handle pointer arithmetic
20243         Handle pointer comparission.
20244         (ArrayPtr): Utility expression class that is used to take the
20245         address of an array.
20246
20247         (ElementAccess): Implement array access for pointers
20248
20249         * statement.cs (Fixed): Implement fixed statement for arrays, we
20250         are missing one more case before we are done.
20251
20252         * expression.cs (Indirection): Implement EmitAssign and set the
20253         ExprClass to Variable.  This allows pointer dereferences to be
20254         treated as variables, and to have values assigned to them.
20255
20256         * ecore.cs (Expression.StoreFromPtr): New utility function to
20257         store values dereferencing.
20258
20259 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20260
20261         * expression.cs (Binary.ResolveOperator): Ensure that we are
20262         not trying to operate on a void type - this fixes the reported
20263         bug.
20264
20265         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20266         the parent implementation is sealed.
20267
20268         * ../errors/cs0239.cs : Add.
20269
20270         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20271
20272         * typemanager.cs (unverifiable_code_type): Corresponds to 
20273         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20274         which have unsafe code in them.
20275
20276         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20277         unsafe context.
20278
20279 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20280
20281         * cs-tokenizer.cs: Add support for @"litreal strings"
20282
20283         Make tokenizer accept pre-processor directives
20284         on any column (remove the old C-like limitation). 
20285
20286         * rootcontext.cs (EmitCode): Emit any global attributes.
20287         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20288
20289         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20290
20291         * cs-parser.jay: Add support for global attributes.  
20292
20293 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20294
20295         * expression.cs (Indirection): New helper class.  Unary will
20296         create Indirection classes to be able to implement the
20297         IMemoryLocation interface on it.
20298
20299 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20300
20301         * cs-parser.jay (fixed_statement): reference the right statement.
20302
20303         * statement.cs (Fixed.Emit): Finish implementing the fixed
20304         statement for the &x case.
20305
20306 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * class.cs (Property.Define, Method.Define): Remove newslot when
20309         `implementing'.  
20310
20311         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20312         wrong.  NewSlot should only be used if the `new' keyword is present.
20313
20314         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20315         locating our system dir.  Sorry about this.
20316
20317 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20318
20319         * driver.cs (GetSystemDir): Compute correctly the location of our
20320         system assemblies.  I was using the compiler directory instead of
20321         the library directory.
20322
20323 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20324
20325         * expression.cs (BetterFunction): Put back in what Miguel commented out
20326         since it is the correct fix. The problem is elsewhere ;-)
20327
20328         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20329         parameters of the parms method are themselves compatible or not !
20330
20331         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20332         to check that a class implements an interface before saying that an implicit
20333         conversion was allowed. Use ImplementsInterface to do the checking.
20334
20335 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20336
20337         * class.cs (Method.Define): Track whether we are an explicit
20338         implementation or not.  And only call DefineMethodOverride if we
20339         are an explicit implementation.
20340
20341         (Property.DefineMethod): Ditto.
20342
20343 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20344
20345         * expression.cs (BetterFunction): Catch hideous bug which was
20346          preventing us from detecting ambiguous calls due to implicit casts i.e
20347         cs0121.
20348
20349 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20350
20351         * support.cs (Pair): Remove un-needed method.  I figured why I was
20352         getting the error in cs-parser.jay, the variable in a foreach loop
20353         is readonly, and the compiler does not really treat this as a variable.
20354
20355         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20356         instead of EQUALS in grammar.  
20357
20358         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20359
20360         * expression.cs (Unary.DoResolve): Check whether the argument is
20361         managed or not.
20362
20363 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20364
20365         * support.cs: Api for Pair to set a value.  Despite the fact that
20366         the variables are public the MS C# compiler refuses to compile
20367         code that accesses the field if the variable is part of a foreach
20368         statement. 
20369
20370         * statement.cs (Fixed): Begin implementation of the fixed
20371         statement.
20372
20373         (Block.AddVariable): Return the VariableInfo on success and null
20374         on failure instead of true/false. 
20375
20376         * cs-parser.jay (foreach): Catch errors on variables already
20377         defined (we were ignoring this value before) and properly unwind
20378         the block hierarchy
20379
20380         (fixed_statement): grammar for the fixed statement.
20381
20382 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20383
20384         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20385         pointer types to be incretemented.
20386
20387         (SizeOf): Implement.
20388
20389         * cs-parser.jay (pointer_member_access): Implement
20390         expr->IDENTIFIER production.
20391
20392         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20393         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20394         on safe contexts.
20395
20396         (Unary): Implement indirection.
20397
20398         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20399         use in non-unsafe context).
20400
20401         (SimpleName.DoResolve): Check for pointers in field access on safe
20402         contexts. 
20403
20404         (Expression.LoadFromPtr): Factor the load-indirect code in this
20405         function.  This was duplicated in UnboxCast and ParameterReference
20406
20407 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * expression.cs (ComposedCast): report an error if a pointer cast
20410         is used in a safe region.
20411
20412         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20413         pointer type casts in unsafe context.
20414
20415         * codegen.cs (EmitContext): Set up IsUnsafe.
20416
20417         * cs-parser.jay (non_expression_type): Add productions for pointer
20418         casts. 
20419
20420         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20421         code.  We should not use force into static mode if the method is
20422         not virtual.  Fixes bug in MIS
20423
20424         * statement.cs (Do.Emit, While.Emit, For.Emit,
20425         Statement.EmitBoolExpression): Add support to Do and While to
20426         propagate infinite loop as `I do return' semantics.
20427
20428         Improve the For case to also test for boolean constants.
20429
20430         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20431         to the list of attributes we can add.
20432
20433         Remove `EmitContext' argument.
20434
20435         * class.cs (Method.Define): Apply parameter attributes.
20436         (Constructor.Define): Apply parameter attributes.
20437         (MethodCore.LabelParameters): Move here the core of labeling
20438         parameters. 
20439
20440         * support.cs (ReflectionParameters.ParameterModifier,
20441         InternalParameters.ParameterModifier): Use IsByRef on the type and
20442         only return the OUT bit for these parameters instead of in/out/ref
20443         flags.
20444
20445         This is because I miss-understood things.  The ParameterInfo.IsIn
20446         and IsOut represent whether the parameter has the [In] and [Out]
20447         attributes set.  
20448
20449 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20450
20451         * ecore.cs (FieldExpr.Emit): Release temporaries.
20452
20453         * assign.cs (LocalTemporary.Release): new function.
20454
20455         * codegen.cs (EmitContext.GetTemporaryStorage,
20456         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20457         temporary storage.  Now we can "put back" localbuilders when we
20458         are done with them
20459
20460 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20461
20462         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20463         need to make a copy of the variable to generate verifiable code.
20464
20465 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20466
20467         * driver.cs: Compute dynamically the system directory.
20468
20469         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20470         Slower, but more generally useful.  Used by the abstract
20471         registering implementation. 
20472
20473         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20474         the rules for the special rule on Type/instances.  First check if
20475         we have the same name, and if so, try that special static path
20476         rather than the instance path.
20477
20478 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20479
20480         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20481         for, while and if.
20482
20483         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20484         Enum, ValueType, Delegate or Array for non-corlib compiles.
20485
20486         * cs-tokenizer.cs: Catch long identifiers (645)
20487
20488         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20489         piece of code.
20490
20491         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20492         fix, we were returning too early, so we were not registering
20493         pending methods from abstract classes.
20494
20495         Do not register pending methods if the class is abstract.
20496
20497         * expression.cs (Conditional.DoResolve): Report circular implicit
20498         conversions when we neecd to compute it for conditional
20499         expressions. 
20500
20501         (Is.DoResolve): If the expression is always of the provided type,
20502         flag warning 183.  If the expression can not ever be of the
20503         provided type flag warning 184.
20504
20505         * class.cs: Catch 169 as well.
20506
20507         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20508         read. 
20509
20510 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20511
20512         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20513
20514 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20515
20516         * interface.cs: (PopulateMethod): Check for pointers being defined
20517         only if the unsafe context is active.
20518         (PopulateProperty): ditto.
20519         (PopulateIndexer): ditto.
20520
20521         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20522         specified.  If pointers are present, make sure that they are
20523         present in an unsafe context.
20524         (Constructor, Constructor.Define): ditto.
20525         (Field, Field.Define): ditto.
20526         (Property, Property.Define): ditto.
20527         (Event, Event.Define): ditto.
20528
20529         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20530         hashtable if there are classes or structs defined.
20531
20532         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20533         code, as the constant resolution moved.
20534
20535         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20536         the metadata, so we can flag error 133. 
20537
20538         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20539         pointer is being declared in an unsafe context.
20540
20541 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20542
20543         * modifiers.cs (Modifiers.Check): Require a Location argument.
20544         Report error 227 for Unsafe use.
20545
20546         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20547
20548         * statement.cs (For.Emit): If the test is null, then report that
20549         we do `return', as we wont reach anything afterwards.
20550
20551         (Switch.SwitchGoverningType): Track the expression that matched
20552         the conversion.
20553
20554         * driver.cs: Allow negative numbers as an error code to flag.
20555
20556         * cs-parser.jay: Handle 1551.
20557
20558         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20559
20560 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20561
20562         * cs-parser.jay: Report 1518 (type declaration can only contain
20563         class, struct, interface, enum or delegate)
20564
20565         (switch_label): Report 1523 (keywords `case' or `default' must
20566         preced code)
20567
20568         (opt_switch_sections): Report 1522 (empty switch)
20569
20570         * driver.cs: Report 1515 (response file specified multiple times)
20571         Report 1516 (Source file specified multiple times).
20572
20573         * expression.cs (Argument.Resolve): Signal 1510
20574
20575         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20576         access not allowed in static code)
20577
20578 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20579
20580         * typemanager.cs (IsPointerType): Utility method which we are going
20581         to need a lot.
20582
20583         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20584         the object type, so we take care of that.
20585
20586         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20587
20588         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20589         added to non-params parameters :-)
20590
20591         * typemanager.cs (CSharpName): Include 'void' type too. 
20592
20593         (void_ptr_type): Include in the set of core types.
20594
20595         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20596         duplicating code.
20597
20598         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20599         an unsafe context.
20600
20601         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20602         completely forgotten about it.
20603
20604 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20605
20606         * cs-parser.jay (pointer_type): Add. This begins our implementation
20607         of parsing rules for unsafe code.
20608
20609         (unsafe_statement): Implement.
20610
20611         (embedded_statement): Modify to include the above.
20612
20613         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20614
20615         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20616         if the current context is an unsafe one.
20617
20618         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20619         are handled differently, we need separate rules for them.
20620
20621         (local_variable_declaration): Update to use local_variable_pointer_type
20622         to allow variable declarations of unmanaged pointer types.
20623
20624         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20625         in unsafe contexts.
20626
20627         * ../errors/cs0214.cs : Add.
20628
20629 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20630
20631         * makefile: remove 'response' file when cleaning.
20632
20633 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20634
20635         * cs-parser.jay: Report 1524.
20636
20637 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20638
20639         * typemanager.cs (RegisterMethod): drop checking if we have
20640         registered this from here
20641
20642 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20643
20644         * class.cs (Method.EmitDestructor): Implement calling our base
20645         destructor. 
20646
20647         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20648         value of InFinally.
20649
20650         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20651         this routine and will wrap the call in a try/catch block.  Deal
20652         with the case.
20653
20654 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20655
20656         * ecore.cs (Expression.MemberLookup): instead of taking a
20657         parameter `same_type' that was used to tell whether we could
20658         access private members we compute our containing type from the
20659         EmitContext.
20660
20661         (FieldExpr): Added partial support for volatile fields.  This does
20662         not work for volatile fields exposed from assemblies, as I can not
20663         figure out how to extract the modreq from it.
20664
20665         Updated all the source files to use this.
20666
20667         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20668         because it is referenced by MemberLookup very often. 
20669
20670 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20671
20672         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20673         TypeBuilder.GetCustomAttributes to retrieve what we need.
20674
20675         Get rid of redundant default_member_attr_type as this is the same as
20676         default_member_type which already exists.
20677
20678         * interface.cs, attribute.cs : Update accordingly.
20679
20680 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20681
20682         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20683         work for TYpeBuilders though.  Ravi, can you please fix this?
20684
20685         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20686
20687         * expression.cs (Argument.Emit): Handle the case of ref objects
20688         being passed to ref functions;  
20689
20690         (ParameterReference.EmitLoad): Loads the content of the pointer
20691         without dereferencing.
20692
20693 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20694
20695         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20696
20697 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20698
20699         * class.cs (Indexer.DefineMethod): Incorporate the interface
20700         type in the name of the method if we are doing explicit interface
20701         implementation.
20702
20703         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20704
20705         (BetterConversion): Fix extremely trivial bug where we were referring to
20706         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20707         again !
20708
20709         * ../errors/bug16.cs : Add although we have fixed it.
20710
20711 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20712
20713         * expression.cs (BaseIndexer): Begin implementation.
20714
20715         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20716
20717         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20718         production directly to remove a shift/reduce, and implement
20719         explicit interface implementation.
20720
20721         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20722         after a floating point suffix.
20723
20724         * expression.cs (DoNumericPromotions): Improved the conversion for
20725         uint/uint.  If we have a constant, we avoid doing a typecast to a
20726         larger type.
20727
20728         * class.cs (Indexer): Implement explicit interface implementation
20729         for indexers.
20730
20731 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20732
20733         * class.cs: make the default instance constructor public and hidebysig.
20734
20735 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20736
20737         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20738         so we can call it from elsewhere.
20739
20740         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20741         we emit it internally if the class has a defined indexer; otherwise the user
20742         emits it by decorating the class definition with the DefaultMemberAttribute.
20743
20744         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20745         attribute is not used on a type which defines an indexer.
20746
20747         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20748         character when we skip whitespace.
20749
20750         * ../errors/cs0646.cs : Add.
20751
20752 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20753
20754         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20755         again. 
20756
20757         * makefile: Add practical target `mcs3.exe' which builds the third
20758         generation compiler. 
20759
20760         * expression.cs (New): Fix structures constructor calling.
20761
20762         * class.cs (Property, Method, Indexer): Emit Final flag on the
20763         method if we are an interface implementation and we are not
20764         abstract. 
20765
20766         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20767         whether this property is referencing a `base' method.
20768
20769         * expression.cs (Invocation.EmitCall): take an extra argument:
20770         is_base, this is used to determine whether the `call' or
20771         `callvirt' opcode should be used.
20772
20773
20774         * delegate.cs: update EmitCall.
20775
20776         * class.cs (Method.Define): Set NewSlot for the cases where we are
20777         not implementing an interface method.
20778
20779         (Property.Define): ditto.
20780
20781 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20782
20783         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20784         'r'.  Allows mcs to parse itself fully.
20785
20786 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20787
20788         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20789         of the number of initializers that require the InitializeArray method.
20790
20791         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20792         update the above field where necessary.
20793
20794         (MakeByteBlob): Update accordingly.
20795
20796         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20797         greater than 2.
20798
20799         (EmitDynamicInitializers): Update in accordance with the new optimization.
20800
20801         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20802         same OpCode applies.
20803
20804         * cs-parser.jay : Fix some glaring errors I introduced.
20805
20806 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20807
20808         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20809         so that we can check for name clashes there too.
20810
20811         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20812         for interface indexers.
20813
20814         * interfaces.cs (Define): Emit the default member attribute.
20815
20816         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20817         variable was being referred to while setting the value ;-)
20818
20819 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20820
20821         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20822         byte-by-byte information when we know the data is zero.
20823
20824         Make the block always a multiple of 4, because
20825         DefineInitializedData has a bug.
20826
20827         * assign.cs: Fix, we should assign from the temporary, not from
20828         the source. 
20829
20830         * expression.cs (MakeByteBlob): Fix my incorrect code.
20831
20832 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * typemanager.cs (EnumToUnderlying): This function is used to get
20835         the underlying type from an enumeration, because it does not
20836         always work. 
20837
20838         * constant.cs: Use the I4_S form for values between -128 and 127.
20839
20840         * statement.cs (Block.LookupLabel): Looks up a label.
20841         (Block): Drop support for labeled blocks.
20842
20843         (LabeledStatement): New kind of statement that represents a label
20844         only.
20845
20846         (Goto): Finally implement this bad boy.
20847
20848         * cs-parser.jay: Update to reflect new mechanism to implement
20849         labels.
20850
20851 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20852
20853         * codegen.cs (EmitContext.This): a codegen property that keeps the
20854         a single instance of this instead of creating many different this
20855         instances. 
20856
20857         * delegate.cs (Delegate.DoResolve): Update to use the property;
20858
20859         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20860
20861         * expression.cs (BaseAccess.DoResolve): Ditto.
20862
20863 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20864
20865         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20866         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20867
20868         (InitCoreTypes): Update accordingly.
20869
20870         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20871         so we can quickly store the state.
20872
20873         (ApplyAttributes): Set the correct implementation flags
20874         for InternalCall methods.
20875
20876 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20877
20878         * expression.cs (EmitCall): if a method is not virtual, then do
20879         not use callvirt on it.
20880
20881         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20882         user defined stuff) requires the use of stobj, which takes an
20883         address on the stack instead of an array and an index.  So emit
20884         the Ldelema operation for it.
20885
20886         (EmitStoreOpcode): Use stobj for valuetypes.
20887
20888         (UnaryMutator.EmitCode): Use the right 1 value depending on
20889         whether we are dealing with int64/uint64, float or doubles.
20890
20891         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20892         constructors that I implemented last night.
20893
20894         (Constructor.IsDefault): Fix to work properly for static
20895         constructors.
20896
20897         * cs-parser.jay (CheckDef): report method signature errors.
20898         Update error number 103 to be 132.
20899
20900         * decl.cs: New AdditionResult enumeration value: MethodExists.
20901         Although we do this check for methods later on in the semantic
20902         analysis, catching repeated default constructors is so easy that
20903         we catch these here. 
20904
20905         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20906         promotions code.
20907
20908         (ParameterReference.EmitAssign, Emit): handle
20909         bools as bytes.
20910
20911         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20912         (ArrayAccess.EmitStoreOpcode): ditto.
20913
20914         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20915
20916         * expression.cs (MakeByteBlob): Complete all the missing types
20917         (uint, short, ushort, byte, sbyte)
20918
20919         * class.cs: Only init instance field initializers on instance
20920         constructors. 
20921
20922         Rename `constructors' to instance_constructors. 
20923
20924         (TypeContainer.AddConstructor): Only add constructors to the list
20925         if it is not static.
20926
20927         Make sure that we handle default_static_constructor independently
20928         everywhere where we handle instance_constructors
20929
20930 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20931
20932         * class.cs: Do not lookup or create a base initializer for a
20933         static constructor.
20934
20935         (ConstructorInitializer.Resolve): use the proper type to lookup
20936         for constructors.
20937
20938         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20939
20940         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20941         in DeclSpace. 
20942
20943         * decl.cs: CloseType is now an virtual method, the default
20944         implementation just closes this type.
20945
20946 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20947
20948         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20949         to PreserveSig by default. Also emit HideBySig on such methods.
20950
20951         Basically, set the defaults to standard values.
20952
20953         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20954         argument, if candidate is better, it can't be worse than the best !
20955
20956         (Invocation): Re-write bits to differentiate between methods being
20957         applicable in their expanded form and their normal form - for params
20958         methods of course.
20959
20960         Get rid of use_standard everywhere as only standard conversions are allowed
20961         in overload resolution. 
20962
20963         More spec conformance.
20964
20965 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20966
20967         * driver.cs: Add --timestamp, to see where the compiler spends
20968         most of its time.
20969
20970         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20971         `this' in static code.
20972
20973         (SimpleName.DoResolve): Implement in terms of a helper function
20974         that allows static-references to be passed upstream to
20975         MemberAccess.
20976
20977         (Expression.ResolveWithSimpleName): Resolve specially simple
20978         names when called by MemberAccess to implement the special
20979         semantics. 
20980
20981         (Expression.ImplicitReferenceConversion): Handle conversions from
20982         Null to reference types before others, as Null's type is
20983         System.Object. 
20984
20985         * expression.cs (Invocation.EmitCall): Handle the special case of
20986         calling methods declared on a reference type from a ValueType
20987         (Base classes System.Object and System.Enum)
20988
20989         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20990         the left hand side is a TypeExpr, not on every enumeration. 
20991
20992         (Binary.Resolve): If types are reference types, then do a cast to
20993         object on operators != and == of both arguments.
20994
20995         * typemanager.cs (FindMembers): Extract instance and static
20996         members if requested.
20997
20998         * interface.cs (PopulateProperty): Use void_type instead of null
20999         as the return type for the setter method.
21000
21001         (PopulateIndexer): ditto.
21002
21003 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21004
21005         * support.cs (ReflectionParameters): Fix minor bug where we
21006         were examining the wrong parameter for the ParamArray attribute.
21007
21008         Cope with requests for the type of the parameter at position
21009         greater than the params parameter's. We now return the element
21010         type of the params array as that makes more sense.
21011
21012         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21013         accordingly as we no longer have to extract the element type
21014         ourselves.
21015
21016         (Invocation.OverloadResolve): Update.
21017
21018 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21019
21020         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21021         against IEnumerator, test whether the return value is a descendant
21022         of the IEnumerator interface.
21023
21024         * class.cs (Indexer.Define): Use an auxiliary method to implement
21025         the other bits of the method definition.  Begin support for
21026         explicit interface implementation.
21027
21028         (Property.DefineMethod): Use TypeManager.void_type instead of null
21029         for an empty return value.
21030
21031 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21034         dealing with a FieldExpr which is composed of a FieldBuilder, in
21035         the code path we did extract the constant, but we should have
21036         obtained the underlying value to be able to cast it (otherwise we
21037         end up in an infinite loop, this is what Ravi was running into).
21038
21039         (ArrayCreation.UpdateIndices): Arrays might be empty.
21040
21041         (MemberAccess.ResolveMemberAccess): Add support for section
21042         14.5.4.1 that deals with the special case of E.I when E is a type
21043         and something else, that I can be a reference to a static member.
21044
21045         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21046         handle a particular array type to create byte blobs, it is just
21047         something we dont generate byteblobs for.
21048
21049         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21050         arguments. 
21051
21052         * location.cs (Push): remove the key from the hashtable that we
21053         are about to add.   This happens for empty files.
21054
21055         * driver.cs: Dispose files after we have parsed them.
21056
21057         (tokenize): new function that only runs the tokenizer on its
21058         input, for speed testing.
21059
21060 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21061
21062         * class.cs (Event.Define): Define the private field only if there
21063         are no accessors defined.
21064
21065         * expression.cs (ResolveMemberAccess): If there is no associated
21066         field with the event, that means we have an event defined with its
21067         own accessors and we should flag error cs0070 since transforming
21068         ourselves into a field is not valid in that case.
21069
21070         * ecore.cs (SimpleName.DoResolve): Same as above.
21071
21072         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21073         and charset to sane values.
21074
21075 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21076
21077         * assign.cs (DoResolve): Perform check on events only if they 
21078         are being accessed outside the declaring type.
21079
21080         * cs-parser.jay (event_declarations): Update rules to correctly
21081         set the type of the implicit parameter etc.
21082
21083         (add_accessor, remove_accessor): Set current local parameters.
21084
21085         * expression.cs (Binary): For delegate addition and subtraction,
21086         cast the return value from the method into the appropriate delegate
21087         type.
21088
21089 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21090
21091         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21092         of these as the workaround is unnecessary.
21093
21094         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21095         delegate data - none of that is needed at all.
21096
21097         Re-write bits to extract the instance expression and the delegate method
21098         correctly.
21099
21100         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21101         on delegates too.
21102
21103         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21104         of attaching attributes instead of duplicating code everywhere.
21105
21106         * everywhere : Update code to do attribute emission using the above method.
21107
21108 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21109
21110         * expression.cs (IsParamsMethodApplicable): if there are not
21111         parameters, return immediately.
21112
21113         * ecore.cs: The 0 literal can be implicity converted to an enum
21114         type. 
21115
21116         (SimpleName.DoResolve): First lookup the type, then lookup the
21117         members. 
21118
21119         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21120         want to get its address.  If the InstanceExpression is not
21121         addressable, store the result in a temporary variable, then get
21122         the address of it.
21123
21124         * codegen.cs: Only display 219 errors on warning level or above. 
21125
21126         * expression.cs (ArrayAccess): Make it implement the
21127         IMemoryLocation interface.
21128
21129         (Binary.DoResolve): handle the operator == (object a, object b)
21130         and operator != (object a, object b) without incurring into a
21131         BoxedCast (because 5 != o should never be performed).
21132
21133         Handle binary enumerator operators.
21134
21135         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21136         value type, otherwise use Ldelem_ref.
21137
21138         Use precomputed names;
21139
21140         (AddressOf): Implement address of
21141
21142         * cs-parser.jay (labeled_statement): Fix recursive block
21143         addition by reworking the production.
21144
21145         * expression.cs (New.DoEmit): New has a special case:
21146                 
21147                  If we are dealing with a ValueType, we have a few
21148                  situations to deal with:
21149                 
21150                     * The target of New is a ValueType variable, that is
21151                       easy, we just pass this as the variable reference
21152                 
21153                     * The target of New is being passed as an argument,
21154                       to a boxing operation or a function that takes a
21155                       ValueType.
21156                 
21157                       In this case, we need to create a temporary variable
21158                       that is the argument of New.
21159
21160
21161 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21162
21163         * rootcontext.cs (LookupType): Check that current_type is not null before
21164         going about looking at nested types.
21165
21166         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21167         not implement the IAssignMethod interface any more.
21168
21169         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21170         where we tranform them into FieldExprs if they are being resolved from within
21171         the declaring type.
21172
21173         * ecore.cs (SimpleName.DoResolve): Do the same here.
21174
21175         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21176
21177         * ../errors/bug10.cs : Add.
21178
21179         * ../errors/cs0070.cs : Add.
21180
21181         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21182
21183         * assign.cs : Get rid of EventIsLocal everywhere.
21184
21185 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21186
21187         * ecore.cs (ConvertIntLiteral): finished the implementation.
21188
21189         * statement.cs (SwitchLabel): Convert the value we are using as a
21190         key before looking up the table.
21191
21192 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21193
21194         * codegen.cs (EmitTopBlock): Require a Location argument now.
21195
21196         * cs-parser.jay (constructor_declarator): We need to setup
21197         current_local_parameters before we parse the
21198         opt_constructor_initializer, to allow the variables to be bound
21199         to the constructor arguments.
21200
21201         * rootcontext.cs (LookupType): First lookup nested classes in our
21202         class and our parents before we go looking outside our class.
21203
21204         * expression.cs (ConstantFold): Extract/debox the values at the
21205         beginnning. 
21206
21207         * rootcontext.cs (EmitCode): Resolve the constants first before we
21208         resolve the types.  This is not really needed, but it helps debugging.
21209
21210         * statement.cs: report location.
21211
21212         * cs-parser.jay: pass location to throw statement.
21213
21214         * driver.cs: Small bug fix.
21215
21216         * report.cs: Updated format to be 4-zero filled digits.
21217
21218 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21219
21220         * expression.cs (CheckIndices): Fix minor bug where the wrong
21221         variable was being referred to ;-)
21222
21223         (DoEmit): Do not call EmitStaticInitializers when the 
21224         underlying type is System.Object.
21225
21226 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21227
21228         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21229         and do the usual workaround for SRE.
21230
21231         * class.cs (MyEventBuilder.EventType): New member to get at the type
21232         of the event, quickly.
21233
21234         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21235
21236         * assign.cs (Assign.DoResolve): Handle the case when the target
21237         is an EventExpr and perform the necessary checks.
21238
21239         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21240         interface.
21241
21242         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21243
21244         (EventExpr): Set the type in the constructor itself since we 
21245         are meant to be born fully resolved.
21246
21247         (EventExpr.Define): Revert code I wrote earlier.
21248                 
21249         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21250         instance expression is null. The instance expression is a This in that case
21251         or a null, depending on whether it is a static method or not.
21252
21253         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21254         refers to more than one method.
21255
21256         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21257         and accordingly flag errors.
21258
21259 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21262
21263 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21264
21265         * location.cs (ToString): Provide useful rutine.
21266
21267 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21270         objects, return the actual integral boxed.
21271
21272         * statement.cs (SwitchLabel): define an ILLabel for each
21273         SwitchLabel. 
21274
21275         (Switch.CheckSwitch): If the value is a Literal, extract
21276         the underlying literal.
21277
21278         Also in the unused hashtable we had, add the SwitchLabel so we can
21279         quickly look this value up.
21280
21281         * constant.cs: Implement a bunch of new constants.  Rewrite
21282         Literal based on this.  Made changes everywhere to adapt to this.
21283
21284         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21285         dereferencing array only once, and also copes with enumrations.
21286
21287         bytes are two bytes wide, not one.
21288
21289         (Cast): Perform constant conversions.
21290
21291         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21292         wrappers to the literals here.
21293
21294         * expression.cs (DoNumericPromotions): long literals can converted
21295         to ulong implicity (this is taken care of elsewhere, but I was
21296         missing this spot).
21297
21298         * ecore.cs (Expression.Literalize): Make the return type Literal,
21299         to improve type checking.
21300
21301         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21302
21303 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21304
21305         * literal.cs: Revert code from ravi that checked the bounds.  The
21306         bounds are sane by the definition of the type itself. 
21307
21308         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21309         need to actually look up in our parent hierarchy for interfaces
21310         implemented. 
21311
21312         * const.cs: Use the underlying type for enumerations
21313
21314         * delegate.cs: Compute the basename for the delegate creation,
21315         that should fix the delegate test case, and restore the correct
21316         Type Lookup semantics in rootcontext
21317
21318         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21319         referencing a nested type with the Reflection API is using the "+"
21320         sign. 
21321
21322         * cs-parser.jay: Do not require EOF token at the end.
21323
21324 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21325
21326         * rootcontext.cs (LookupType): Concatenate type names with
21327         a '.' instead of a '+' The test suite passes again.
21328
21329         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21330         field of the enumeration.
21331
21332         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21333         the case when the member is an EventExpr.
21334
21335         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21336         static has an associated instance expression.
21337
21338         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21339
21340         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21341
21342         * class.cs (Event.Define): Register event and perform appropriate checks
21343         for error #111.
21344
21345         We define the Add and Remove methods even if the use provides none because
21346         in that case, we provide default implementations ourselves.
21347
21348         Define a private field of the type of the event. This is done by the CSC compiler
21349         and we should be doing it too ;-)
21350
21351         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21352         More methods we use in code we generate.
21353
21354         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21355         is important.
21356
21357         (InitCoreTypes): Update accordingly for the above.
21358
21359         * class.cs (Event.Emit): Generate code for default accessors that we provide
21360
21361         (EmitDefaultMethod): Do the job in the above.
21362
21363         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21364         appropriate place.
21365
21366 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21367
21368         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21369         builders even if we were missing one.
21370
21371         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21372         pass the Basename as our class name instead of the Name.  The
21373         basename will be correctly composed for us.
21374
21375         * parameter.cs (Paramters): Now takes a Location argument.
21376
21377         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21378         make all the code call directly LookupType in RootContext and take
21379         this chance to pass the Location information everywhere.
21380
21381         * Everywhere: pass Location information.
21382
21383 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21384
21385         * class.cs (Constructor.Define): Updated way of detecting the
21386         length of the parameters.
21387
21388         (TypeContainer.DefineType): Use basename as the type name for
21389         nested types.
21390
21391         (TypeContainer.Define): Do not recursively define types here, as
21392         definition is taken care in order by the RootContext.
21393
21394         * tree.cs: Keep track of namespaces in a per-file basis.
21395
21396         * parameter.cs (Parameter.ComputeSignature): Update to use
21397         DeclSpace. 
21398
21399         (Parameters.GetSignature): ditto.
21400
21401         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21402         instead of a TypeContainer.
21403
21404         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21405         resolve names.  Because we need to be resolve in our context, not
21406         our parents.
21407
21408         * driver.cs: Implement response files.
21409
21410         * class.cs (TypeContainer.DefineType): If we are defined, do not
21411         redefine ourselves.
21412
21413         (Event.Emit): Emit the code for add/remove handlers.
21414         (Event.Define): Save the MethodBuilders for add/remove.
21415
21416         * typemanager.cs: Use pair here too.
21417
21418         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21419         DictionaryEntry requires the first argument to be non-null.  
21420
21421         (enum_declaration): Compute full name for registering the
21422         enumeration.
21423
21424         (delegate_declaration): Instead of using
21425         formal_parameter_list, use opt_formal_parameter_list as the list
21426         can be empty.
21427
21428         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21429         (EventParsing): New property that controls whether `add' and
21430         `remove' are returned as tokens or identifiers (for events);
21431
21432 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21433
21434         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21435         use MyEventBuilder only and let it wrap the real builder for us.
21436
21437         (MyEventBuilder): Revamp constructor etc.
21438
21439         Implement all operations that we perform on EventBuilder in precisely the same
21440         way here too.
21441
21442         (FindMembers): Update to use the EventBuilder member.
21443
21444         (Event.Emit): Update accordingly.
21445
21446 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21447
21448         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21449         by calling the appropriate methods.
21450
21451         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21452         useful.
21453
21454         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21455
21456 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21457
21458         * delegate.cs (Delegate.Populate): Check that the return type
21459         and various parameters types are indeed accessible.
21460
21461         * class.cs (Constructor.Define): Same here.
21462
21463         (Field.Define): Ditto.
21464
21465         (Event.Define): Ditto.
21466
21467         (Operator.Define): Check that the underlying Method defined itself
21468         correctly - so it's MethodBuilder should not be null.
21469
21470         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21471         expression happens to be null.
21472
21473         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21474         members but as of now we don't seem to be able to do anything really useful with it.
21475
21476         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21477         not the EventBuilder.
21478
21479 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21480
21481         * cs-tokenizer.cs: Add support for defines.
21482         Add support for #if, #elif, #else, #endif
21483
21484         (eval_var): evaluates a variable.
21485         (eval): stubbed for evaluating functions.
21486
21487         * cs-parser.jay: Pass the defines information
21488
21489         * driver.cs: Add --define command line option.
21490
21491         * decl.cs: Move MemberCore here.
21492
21493         Make it the base class for DeclSpace.  This allows us to catch and
21494         report 108 and 109 for everything now.
21495
21496         * class.cs (TypeContainer.Define): Extract all the members
21497         before populating and emit the warning 108 (new keyword required
21498         to override) instead of having each member implement this.
21499
21500         (MemberCore.Define): New abstract method, we will be using this in
21501         the warning reporting engine in Populate.
21502
21503         (Operator.Define): Adjust to new MemberCore protocol. 
21504
21505         * const.cs (Const): This does not derive from Expression, it is a
21506         temporary object we use to create fields, it is a MemberCore. 
21507
21508         * class.cs (Method.Define): Allow the entry point to be in a
21509         specific class.
21510
21511         * driver.cs: Rewrite the argument handler to clean it up a bit.
21512
21513         * rootcontext.cs: Made it just an auxiliary namespace feature by
21514         making everything static.
21515
21516         * driver.cs: Adapt code to use RootContext type name instead of
21517         instance variable.
21518
21519         * delegate.cs: Remove RootContext argument.
21520
21521         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21522         argument. 
21523
21524         * class.cs (Event.Define): The lookup can fail.
21525
21526         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21527
21528         * expression.cs: Resolve the this instance before invoking the code.
21529
21530 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21531
21532         * cs-parser.jay: Add a production in element_access that allows
21533         the thing to become a "type" reference.  This way we can parse
21534         things like "(string [])" as a type.
21535
21536         Note that this still does not handle the more complex rules of
21537         casts. 
21538
21539
21540         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21541
21542         * ecore.cs: (CopyNewMethods): new utility function used to
21543         assemble the list of methods from running FindMembers.
21544
21545         (MemberLookup): Rework FindMembers so that 
21546
21547 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21548
21549         * class.cs (TypeContainer): Remove Delegates who fail to be
21550         defined.
21551
21552         * delegate.cs (Populate): Verify that we dont get null return
21553         values.   TODO: Check for AsAccessible.
21554
21555         * cs-parser.jay: Use basename to emit error 574 (destructor should
21556         have the same name as container class), not the full name.
21557
21558         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21559         possible representation.  
21560
21561         Also implements integer type suffixes U and L.
21562
21563 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21564
21565         * expression.cs (ArrayCreation.DoResolve): We need to do the
21566         argument resolution *always*.
21567
21568         * decl.cs: Make this hold the namespace.  Hold the root context as
21569         well.
21570         (LookupType): Move here.
21571
21572         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21573
21574         * location.cs (Row, Name): Fixed the code, it was always returning
21575         references to the first file.
21576
21577         * interface.cs: Register properties defined through interfaces.
21578
21579         * driver.cs: Add support for globbing on the command line
21580
21581         * class.cs (Field): Make it derive from MemberCore as well.
21582         (Event): ditto.
21583
21584 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21585
21586         * class.cs (Event::Define): Check that the type of the event is a delegate
21587         type else flag error #66.
21588
21589         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21590         same.
21591
21592         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21593         values of EntryPoint, CharSet etc etc.
21594
21595         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21596
21597         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21598         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21599         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21600         which needs this to do its work.
21601
21602         * ../errors/cs0066.cs : Add.
21603
21604 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21605
21606         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21607         helper functions.
21608
21609         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21610         clears out the parameters field.
21611         (MemberSignatureCompare): Cleanup
21612
21613         (MemberCore): New base class used to share code between MethodCore
21614         and Property.
21615
21616         (RegisterRequiredImplementations) BindingFlags.Public requires
21617         either BindingFlags.Instace or Static.  Use instance here.
21618
21619         (Property): Refactored code to cope better with the full spec.
21620
21621         * parameter.cs (GetParameterInfo): Return an empty array instead
21622         of null on error.
21623
21624         * class.cs (Property): Abstract or extern properties have no bodies.
21625
21626         * parameter.cs (GetParameterInfo): return a zero-sized array.
21627
21628         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21629         method modifier validation to the typecontainer so we can reuse
21630         this on properties.
21631
21632         (MethodCore.ParameterTypes): return an empty sized array of types.
21633
21634         (Property.Define): Test property modifier validity.
21635
21636         Add tests for sealed/override too.
21637
21638         (Method.Emit): abstract or extern methods have no bodies.
21639
21640 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21641
21642         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21643         thing.
21644
21645         (Method::Define, ::Emit): Modify accordingly.
21646
21647         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21648
21649         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21650
21651         * makefile: Pass in /unsafe.
21652
21653 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * class.cs (MakeKey): Kill routine.
21656
21657         * class.cs (TypeContainer.Define): Correctly define explicit
21658         method implementations (they require the full interface name plus
21659         the method name).
21660
21661         * typemanager.cs: Deply the PtrHashtable here and stop using the
21662         lame keys.  Things work so much better.
21663
21664         This of course broke everyone who depended on `RegisterMethod' to
21665         do the `test for existance' test.  This has to be done elsewhere.
21666
21667         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21668         the object stupid Equals method (because, that like fails all over
21669         the place).  We still do not use it.
21670
21671         * class.cs (TypeContainer.SetRequiredInterface,
21672         TypeContainer.RequireMethods): Killed these two routines and moved
21673         all the functionality to RegisterRequiredImplementations.
21674
21675         (TypeContainer.RegisterRequiredImplementations): This routine now
21676         registers all the implementations required in an array for the
21677         interfaces and abstract methods.  We use an array of structures
21678         which can be computed ahead of time to reduce memory usage and we
21679         also assume that lookups are cheap as most classes will not
21680         implement too many interfaces.
21681
21682         We also avoid creating too many MethodSignatures.
21683
21684         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21685         clear the "pending" bit if we find that there are problems with
21686         the declaration.
21687
21688         (TypeContainer.VerifyPendingMethods): Update to report errors of
21689         methods that look like implementations but are not.
21690
21691         (TypeContainer.Define): Add support for explicit interface method
21692         implementation. 
21693
21694 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21695
21696         * typemanager.cs: Keep track of the parameters here instead of
21697         being a feature of the TypeContainer.
21698
21699         * class.cs: Drop the registration of parameters here, as
21700         InterfaceMethods are also interface declarations.
21701
21702         * delegate.cs: Register methods with the TypeManager not only with
21703         the TypeContainer.  This code was buggy.
21704
21705         * interface.cs: Full registation here.
21706
21707 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21708
21709         * expression.cs: Remove reducer for binary expressions, it can not
21710         be done this way.
21711
21712         * const.cs: Put here the code that used to go into constant.cs
21713
21714         * constant.cs: Put here the code for constants, this is a new base
21715         class for Literals.
21716
21717         * literal.cs: Make Literal derive from Constant.
21718
21719 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21720
21721         * statement.cs (Return.Emit): Report error 157 if the user
21722         attempts to return from a finally block.
21723
21724         (Return.Emit): Instead of emitting a return, jump to the end of
21725         the function.
21726
21727         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21728         LocalBuilder to store the result of the function.  ReturnLabel is
21729         the target where we jump.
21730
21731
21732 2001-12-09  Radek Doulik  <rodo@ximian.com>
21733
21734         * cs-parser.jay: remember alias in current namespace
21735
21736         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21737         namespaces
21738
21739         * class.cs (LookupAlias): lookup alias in my_namespace
21740
21741         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21742         aliases hashtable
21743         (LookupAlias): lookup alias in this and if needed in parent
21744         namespaces
21745
21746 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21747
21748         * support.cs: 
21749
21750         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21751         making things static.  I need this to avoid passing the
21752         TypeContainer when calling ParameterType.
21753
21754         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21755         that did string manipulation to compute the type and then call
21756         GetType.  Use Parameter.ParameterType instead.
21757
21758         * cs-tokenizer.cs: Consume the suffix for floating values.
21759
21760         * expression.cs (ParameterReference): figure out whether this is a
21761         reference parameter or not.  Kill an extra variable by computing
21762         the arg_idx during emission.
21763
21764         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21765         function that returns whether a parameter is an out/ref value or not.
21766
21767         (Parameter.ParameterType): The type of the parameter (base,
21768         without ref/out applied).
21769
21770         (Parameter.Resolve): Perform resolution here.
21771         (Parameter.ExternalType): The full type (with ref/out applied).
21772
21773         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21774         support for expressions on the using statement.
21775
21776 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21777
21778         * statement.cs (Using.EmitLocalVariableDecls): Split the
21779         localvariable handling of the using statement.
21780
21781         (Block.EmitMeta): Keep track of variable count across blocks.  We
21782         were reusing slots on separate branches of blocks.
21783
21784         (Try.Emit): Emit the general code block, we were not emitting it. 
21785
21786         Check the type of the declaration to be an IDisposable or
21787         something that can be implicity converted to it. 
21788
21789         Emit conversions if required.
21790
21791         * ecore.cs (EmptyExpression): New utility class.
21792         (Expression.ImplicitConversionExists): New utility function.
21793
21794 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21795
21796         * statement.cs (Using): Implement.
21797
21798         * expression.cs (LocalVariableReference): Support read only variables.
21799
21800         * statement.cs: Remove the explicit emit for the Leave opcode.
21801         (VariableInfo): Add a readonly field.
21802
21803 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21804
21805         * ecore.cs (ConvCast): new class used to encapsulate the various
21806         explicit integer conversions that works in both checked and
21807         unchecked contexts.
21808
21809         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21810         properly generate the overflow opcodes.
21811
21812 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21813
21814         * statement.cs: The correct type for the EmptyExpression is the
21815         element_type, not the variable type.  Ravi pointed this out.
21816
21817 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21818
21819         * class.cs (Method::Define): Handle PInvoke methods specially
21820         by using DefinePInvokeMethod instead of the usual one.
21821
21822         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21823         above to do the task of extracting information and defining the method.
21824
21825 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21826
21827         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21828         of the condition for string type.
21829
21830         (Emit): Move that here. 
21831
21832         (ArrayCreation::CheckIndices): Keep string literals in their expression
21833         form.
21834
21835         (EmitDynamicInitializers): Handle strings appropriately.
21836
21837 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21838
21839         * codegen.cs (EmitContext): Replace multiple variables with a
21840         single pointer to the current Switch statement.
21841
21842         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21843         EmitContext.
21844
21845 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21846
21847         * statement.cs 
21848
21849         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21850         default'.
21851
21852         (Foreach.Emit): Foreach on arrays was not setting
21853         up the loop variables (for break/continue).
21854
21855         (GotoCase): Semi-implented.
21856
21857 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21858
21859         * attribute.cs (CheckAttribute): Handle system attributes by using
21860         Attribute.GetAttributes to examine information we need.
21861
21862         (GetValidPlaces): Same here.
21863
21864         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21865
21866         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21867
21868         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21869
21870         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21871
21872         (Method::Emit): Handle the case when we are a PInvoke method.
21873
21874 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21875
21876         * expression.cs: Use ResolveWithSimpleName on compound names.
21877
21878 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21879
21880         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21881         before trying to reduce it.
21882
21883         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21884
21885         * constant.cs (LookupConstantValue): Implement.
21886
21887         (EmitConstant): Use the above in emitting the constant.
21888
21889         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21890         that are user-defined by doing a LookupConstantValue on them.
21891
21892         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21893         too, like above.
21894
21895 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21896
21897         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21898
21899         (BaseAccess.DoResolve): Implement.
21900
21901         (MemberAccess.DoResolve): Split this routine into a
21902         ResolveMemberAccess routine that can be used independently
21903
21904 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21905
21906         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21907         As that share bits of the implementation.  Is returns a boolean,
21908         while As returns the Type that is being probed.
21909
21910 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21911
21912         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21913         instead of a Literal - much easier.
21914
21915         (EnumInTransit): Remove - utterly useless :-)
21916
21917         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21918
21919         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21920
21921         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21922         chain when we have no associated expression.
21923
21924 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21925
21926         * constant.cs (Define): Use Location while reporting the errror.
21927
21928         Also emit a warning when 'new' is used and there is no inherited
21929         member to hide.
21930
21931         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21932         populated.
21933
21934         (LookupEnumValue): Implement to lookup an enum member's value and define it
21935         if necessary.
21936
21937         (Populate): Re-write accordingly to use the above routine.
21938
21939 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21940
21941         * expression.cs (This): Fix prototype for DoResolveLValue to
21942         override the base class DoResolveLValue.
21943
21944         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21945         declarations) 
21946
21947         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21948         (we need to load the address of the field here).  This fixes
21949         test-22. 
21950
21951         (FieldExpr.DoResolveLValue): Call the DoResolve
21952         function to initialize the Instance expression.
21953
21954         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21955         correctly the GetEnumerator operation on a value type.
21956
21957         * cs-parser.jay: Add more simple parsing error catches.
21958
21959         * statement.cs (Switch): Add support for string switches.
21960         Handle null specially.
21961
21962         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21963
21964 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21965
21966         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21967
21968         (declare_local_constant): New helper function.
21969
21970         * statement.cs (AddConstant): Keep a separate record of constants
21971
21972         (IsConstant): Implement to determine if a variable is a constant.
21973
21974         (GetConstantExpression): Implement.
21975
21976         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21977
21978         * statement.cs (IsVariableDefined): Re-write.
21979
21980 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21981
21982         * class.cs (TypeContainer::FindMembers): Look for constants
21983         in the case when we are looking for MemberTypes.Field
21984
21985         * expression.cs (MemberAccess::DoResolve): Check that in the
21986         case we are a FieldExpr and a Literal, we are not being accessed
21987         by an instance reference.
21988
21989         * cs-parser.jay (local_constant_declaration): Implement.
21990
21991         (declaration_statement): Implement for constant declarations.
21992
21993 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21994
21995         * statement.cs (Switch): Catch double defaults.
21996
21997         (Switch): More work on the switch() statement
21998         implementation.  It works for integral values now, need to finish
21999         string support.
22000
22001
22002 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22003
22004         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22005         integer literals into other integer literals.  To be used by
22006         switch. 
22007
22008 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22009
22010         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22011         some memory.
22012
22013         (EmitDynamicInitializers): Cope with the above since we extract data
22014         directly from ArrayData now.
22015
22016         (ExpectInitializers): Keep track of whether initializers are mandatory
22017         or not.
22018
22019         (Bounds): Make it a hashtable to prevent the same dimension being 
22020         recorded for every element in that dimension.
22021
22022         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22023         from being found.
22024
22025         Also fix bug which was causing the indices to be emitted in the reverse
22026         order.
22027
22028 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22029
22030         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22031         unfinished.  They do not work, because the underlying code is
22032         sloppy.
22033
22034 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * cs-parser.jay: Remove bogus fixme.
22037
22038         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22039         on Switch statement.
22040
22041 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22042
22043         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22044         the same. 
22045
22046         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22047         parameter. Apparently, any expression is allowed. 
22048
22049         (ValidateInitializers): Update accordingly.
22050
22051         (CheckIndices): Fix some tricky bugs thanks to recursion.
22052
22053         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22054         I was being completely brain-dead.
22055
22056         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22057         and re-write acordingly.
22058
22059         (DelegateInvocation): Re-write accordingly.
22060
22061         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22062
22063         (MakeByteBlob): Handle types more correctly.
22064
22065         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22066         initialization from expressions but it is incomplete because I am a complete
22067         Dodo :-|
22068
22069 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22070
22071         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22072         on If.  Basically, we have to return `true' (ie, we do return to
22073         our caller) only if both branches of the if return.
22074
22075         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22076         short-circuit operators, handle them as short circuit operators. 
22077
22078         (Cast.DoResolve): Resolve type.
22079         (Cast.Cast): Take an expression as the target type.
22080
22081         * cs-parser.jay (cast_expression): Remove old hack that only
22082         allowed a limited set of types to be handled.  Now we take a
22083         unary_expression and we resolve to a type during semantic
22084         analysis.
22085
22086         Use the grammar productions from Rhys to handle casts (this is
22087         not complete like Rhys syntax yet, we fail to handle that corner
22088         case that C# has regarding (-x), but we will get there.
22089
22090 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22091
22092         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22093         field which is an array type.
22094
22095         * cs-parser.jay (declare_local_variables): Support array initialization too.
22096
22097         * typemanager.cs (MakeKey): Implement.
22098
22099         (everywhere): Use the above appropriately.
22100
22101         * cs-parser.jay (for_statement): Update for array initialization while
22102         declaring variables.
22103
22104         * ecore.cs : The error message was correct, it's the variable's names that
22105         were misleading ;-) Make the code more readable.
22106
22107         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22108         the correct type etc.
22109
22110         (ConvertExplicit): Handle Enum types by examining the underlying type.
22111
22112 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22113
22114         * parameter.cs (GetCallingConvention): Always return
22115         CallingConventions.Standard for now.
22116
22117 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22118
22119         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22120         and `r' after calling DoNumericPromotions.
22121
22122         * ecore.cs: Fix error message (the types were in the wrong order).
22123
22124         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22125         BindingFlags.Instance as well 
22126
22127         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22128         implicit int literal conversion in an empty cast so that we
22129         propagate the right type upstream.
22130
22131         (UnboxCast): new class used to unbox value types.
22132         (Expression.ConvertExplicit): Add explicit type conversions done
22133         by unboxing.
22134
22135         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22136         the target type before applying the implicit LongLiterals to ULong
22137         literal cast.
22138
22139 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22140
22141         * cs-parser.jay (for_statement): Reworked the way For works: now
22142         we declare manually any variables that are introduced in
22143         for_initializer to solve the problem of having out-of-band code
22144         emition (that is what got for broken).
22145
22146         (declaration_statement): Perform the actual variable declaration
22147         that used to be done in local_variable_declaration here.
22148
22149         (local_variable_declaration): Do not declare anything, just pass
22150         the information on a DictionaryEntry
22151
22152 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22153
22154         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22155         re-write of the logic to now make it recursive.
22156
22157         (UpdateIndices): Re-write accordingly.
22158
22159         Store element data in a separate ArrayData list in the above methods.
22160
22161         (MakeByteBlob): Implement to dump the array data into a byte array.
22162
22163 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22164
22165         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22166         into CheckIndices.
22167
22168         * constant.cs (Define): Implement.
22169
22170         (EmitConstant): Re-write fully.
22171
22172         Pass in location info.
22173
22174         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22175         respectively.
22176
22177         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22178         DictionaryEntry since we need location info too.
22179
22180         (constant_declaration): Update accordingly.
22181
22182         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22183         code into another method : UpdateIndices.
22184
22185 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22186
22187         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22188         some type checking etc.
22189
22190 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22191
22192         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22193         bits to provide dimension info if the user skips doing that.
22194
22195         Update second constructor to store the rank correctly.
22196
22197 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22198
22199         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22200         and try to implement.
22201
22202         * ../errors/cs0150.cs : Add.
22203
22204         * ../errors/cs0178.cs : Add.
22205
22206 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * statement.cs: Implement foreach on multi-dimensional arrays. 
22209
22210         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22211         name of the params argument.
22212
22213         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22214         initializing the array.
22215
22216         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22217         we can use this elsewhere.
22218
22219         * statement.cs: Finish implementation of foreach for single
22220         dimension arrays.
22221
22222         * cs-parser.jay: Use an out-of-band stack to pass information
22223         around, I wonder why I need this.
22224
22225         foreach_block: Make the new foreach_block the current_block.
22226
22227         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22228         function used to return a static Parameters structure.  Used for
22229         empty parameters, as those are created very frequently.
22230
22231         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22232
22233 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22234
22235         * interface.cs : Default modifier is private, not public. The
22236         make verify test passes again.
22237
22238 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22239
22240         * support.cs (ReflectionParameters): Fix logic to determine
22241         whether the last parameter is a params one. Test 9 passes again.
22242
22243         * delegate.cs (Populate): Register the builders we define with
22244         RegisterParameterForBuilder. Test 19 passes again.
22245
22246         * cs-parser.jay (property_declaration): Reference $6 instead
22247         of $$ to get at the location.
22248
22249         (indexer_declaration): Similar stuff.
22250
22251         (attribute): Ditto.
22252
22253         * class.cs (Property): Register parameters for the Get and Set methods
22254         if they exist. Test 23 passes again.
22255
22256         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22257         call to EmitArguments as we are sure there aren't any params arguments. 
22258         Test 32 passes again.
22259
22260         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22261         IndexOutOfRangeException. 
22262
22263         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22264         Test 33 now passes again.
22265
22266 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22267
22268         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22269         broke a bunch of things.  Will have to come up with a better way
22270         of tracking locations.
22271
22272         * statement.cs: Implemented foreach for single dimension arrays.
22273
22274 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22275
22276         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22277         an error.  This removes the lookup from the critical path.
22278
22279         * cs-parser.jay: Removed use of temporary_loc, which is completely
22280         broken. 
22281
22282 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22283
22284         * support.cs (ReflectionParameters.ParameterModifier): Report
22285         whether the argument is a PARAMS argument or not.
22286
22287         * class.cs: Set the attribute `ParamArrayAttribute' on the
22288         parameter argument.
22289
22290         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22291         and cons_param_array_attribute (ConstructorInfo for
22292         ParamArrayAttribute)., 
22293
22294         * codegen.cs: Emit the return using the `Return' statement, that
22295         way we can report the error correctly for missing return values. 
22296
22297         * class.cs (Method.Emit): Clean up.
22298
22299         * expression.cs (Argument.Resolve): Take another argument: the
22300         location where this argument is used.  Notice that this is not
22301         part of the "Argument" class as to reduce the size of the
22302         structure (we know the approximate location anyways).
22303
22304         Test if the argument is a variable-reference, if not, then
22305         complain with a 206.
22306
22307         (Argument.Emit): Emit addresses of variables.
22308
22309         (Argument.FullDesc): Simplify.
22310
22311         (Invocation.DoResolve): Update for Argument.Resolve.
22312
22313         (ElementAccess.DoResolve): ditto.
22314
22315         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22316         method should be virtual, as this method is always virtual.
22317
22318         (NewDelegate.DoResolve): Update for Argument.Resolve.
22319
22320         * class.cs (ConstructorInitializer.DoResolve): ditto.
22321
22322         * attribute.cs (Attribute.Resolve): ditto.
22323
22324 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22325
22326         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22327
22328         * expression.cs (ParameterReference): Drop IStackStorage and implement
22329         IAssignMethod instead. 
22330
22331         (LocalVariableReference): ditto.
22332
22333         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22334         IAssignMethod instead. 
22335
22336 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22337
22338         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22339         enumerations that are used in heavily used structures derive from
22340         byte in a laughable and pathetic attempt to reduce memory usage.
22341         This is the kind of pre-optimzations that you should not do at
22342         home without adult supervision.
22343
22344         * expression.cs (UnaryMutator): New class, used to handle ++ and
22345         -- separatedly from the other unary operators.  Cleans up the
22346         code, and kills the ExpressionStatement dependency in Unary.
22347
22348         (Unary): Removed `method' and `Arguments' from this class, making
22349         it smaller, and moving it all to SimpleCall, so I can reuse this
22350         code in other locations and avoid creating a lot of transient data
22351         strucutres when not required.
22352
22353         * cs-parser.jay: Adjust for new changes.
22354
22355 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22356
22357         * enum.cs (Enum.Populate): If there is a failure during
22358         definition, return
22359
22360         * cs-parser.jay (opt_enum_base): we used to catch type errors
22361         here, but this is really incorrect.  The type error should be
22362         catched during semantic analysis.
22363
22364 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22365
22366         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22367         current_local_parameters as expected since I, in my stupidity, had forgotten
22368         to do this :-)
22369
22370         * attribute.cs (GetValidPlaces): Fix stupid bug.
22371
22372         * class.cs (Method::Emit): Perform check on applicability of attributes.
22373
22374         (Constructor::Emit): Ditto.
22375
22376         (Field::Emit): Ditto.
22377
22378         (Field.Location): Store location information.
22379
22380         (Property, Event, Indexer, Operator): Ditto.
22381
22382         * cs-parser.jay (field_declaration): Pass in location for each field.
22383
22384         * ../errors/cs0592.cs : Add.
22385
22386 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22387
22388         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22389
22390         (InitCoreTypes): Update accordingly.
22391
22392         (RegisterAttrType, LookupAttr): Implement.
22393
22394         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22395         info about the same.
22396
22397         (Resolve): Update to populate the above as necessary.
22398
22399         (Error592): Helper.
22400
22401         (GetValidPlaces): Helper to the above.
22402
22403         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22404
22405         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22406
22407 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22408
22409         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22410
22411         * ../errors/cs0617.cs : Add.
22412
22413 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22414
22415         * enum.cs (Emit): Rename to Populate to be more consistent with what
22416         we expect it to do and when exactly it is called.
22417
22418         * class.cs, rootcontext.cs : Update accordingly.
22419
22420         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22421         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22422
22423         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22424
22425         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22426         of a fieldinfo using the above, when dealing with a FieldBuilder.
22427
22428 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22429
22430         * ../errors/cs0031.cs : Add.
22431
22432         * ../errors/cs1008.cs : Add.
22433
22434         * ../errrors/cs0543.cs : Add.
22435
22436         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22437         enum type.
22438
22439         (FindMembers): Implement.
22440
22441         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22442         enums and delegates too.
22443
22444         (enum_types): Rename to builder_to_enum.
22445
22446         (delegate_types): Rename to builder_to_delegate.
22447
22448         * delegate.cs (FindMembers): Implement.
22449
22450 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22451
22452         * typemanager.cs (IsEnumType): Implement.
22453
22454         * enum.cs (Emit): Re-write parts to account for the underlying type
22455         better and perform checking etc.
22456
22457         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22458         of the underlying type.
22459
22460         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22461         value
22462
22463         * enum.cs (error31): Helper to report error #31.
22464
22465         * cs-parser.jay (enum_declaration): Store location of each member too.
22466
22467         * enum.cs (member_to_location): New hashtable. 
22468
22469         (AddEnumMember): Update location hashtable.
22470
22471         (Emit): Use the location of each member while reporting errors.
22472
22473 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22474
22475         * cs-parser.jay: A for_initializer if is a
22476         local_variable_declaration really ammount to have an implicit
22477         block with the variable declaration and no initializer for for.
22478
22479         * statement.cs (For.Emit): Cope with null initializers.
22480
22481         This fixes the infinite loop on for initializers.
22482
22483 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22484
22485         * enum.cs: More cleanup.
22486
22487         * ecore.cs: Remove dead code.
22488
22489         * class.cs (Property.Emit): More simplification.
22490         (Event.Emit): ditto.
22491
22492         Reworked to have less levels of indentation.
22493
22494 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22495
22496         * class.cs (Property): Emit attributes.
22497
22498         (Field): Ditto.
22499
22500         (Event): Ditto.
22501
22502         (Indexer): Ditto.
22503
22504         (Operator): Ditto.
22505
22506         * enum.cs (Emit): Ditto.
22507
22508         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22509         Enums too.
22510
22511         * class.cs (Field, Event, etc.): Move attribute generation into the
22512         Emit method everywhere.
22513
22514         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22515         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22516         as we had no way of defining nested enums !
22517
22518         * rootcontext.cs : Adjust code accordingly.
22519
22520         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22521
22522 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22523
22524         * expression.cs (EvalConstantExpression): Move into ecore.cs
22525
22526         * enum.cs (Enum): Rename some members and make them public and readonly
22527         according to our convention.
22528
22529         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22530         nothing else.
22531
22532         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22533
22534         (Enum::Emit): Write a simple version for now which doesn't try to compute
22535         expressions. I shall modify this to be more robust in just a while.
22536
22537         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22538
22539         (TypeContainer::CloseType): Create the Enum types too.
22540
22541         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22542
22543         * expression.cs (EvalConstantExpression): Get rid of completely.
22544
22545         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22546         user-defined values and other cases.
22547
22548         (IsValidEnumLiteral): Helper function.
22549
22550         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22551         out there in the case we had a literal FieldExpr.
22552
22553         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22554
22555         (Literalize): Revamp a bit to take two arguments.
22556
22557         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22558
22559 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22560
22561         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22562
22563         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22564
22565         (Resolve): Use the above to ensure we have proper initializers.
22566
22567 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22568
22569         * expression.cs (Expression::EvalConstantExpression): New method to 
22570         evaluate constant expressions.
22571
22572         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22573
22574 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22575
22576         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22577         in an array.
22578
22579         (Binary.ResolveOperator): Handle operator != (object a, object b)
22580         and operator == (object a, object b);
22581
22582         (Binary.DoNumericPromotions): Indicate whether the numeric
22583         promotion was possible.
22584
22585         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22586         Implement.  
22587
22588         Made the ArrayAccess implement interface IAssignMethod instead of
22589         IStackStore as the order in which arguments are passed reflects
22590         this.
22591
22592         * assign.cs: Instead of using expr.ExprClass to select the way of
22593         assinging, probe for the IStackStore/IAssignMethod interfaces.
22594
22595         * typemanager.cs: Load InitializeArray definition.
22596
22597         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22598         static data that can be used to initialize arrays. 
22599
22600 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22601
22602         * expression.cs: Handle operator== and operator!= for booleans.
22603
22604         (Conditioal.Reduce): Implement reducer for the ?: operator.
22605
22606         (Conditional.Resolve): Implement dead code elimination.
22607
22608         (Binary.Resolve): Catch string literals and return a new
22609         concatenated string.
22610
22611         (Unary.Reduce): Implement reduction of unary expressions.
22612
22613         * ecore.cs: Split out the expression core handling here.
22614
22615         (Expression.Reduce): New method used to perform constant folding
22616         and CSE.  This is needed to support constant-expressions. 
22617
22618         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22619         targets, and optimize for !x.
22620
22621 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22622
22623         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22624         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22625         set custom atttributes.
22626
22627         * literal.cs (Literal::GetValue): New abstract method to return the actual
22628         value of the literal, cast as an object.
22629
22630         (*Literal): Implement GetValue method.
22631
22632         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22633         expressions to the arraylist but objects of type Argument.
22634
22635         * class.cs (TypeContainer::Emit): Emit our attributes too.
22636
22637         (Method::Emit, Constructor::Emit): Ditto.
22638
22639         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22640         to be ignoring earlier.
22641
22642 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22643
22644         * attribute.cs (AttributeSection::Define): Implement to do the business
22645         of constructing a CustomAttributeBuilder.
22646
22647         (Attribute): New trivial class. Increases readability of code.  
22648
22649         * cs-parser.jay : Update accordingly.
22650
22651         (positional_argument_list, named_argument_list, named_argument): New rules
22652
22653         (attribute_arguments): Use the above so that we are more correct.
22654
22655 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22656
22657         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22658         to perform all checks for a method with a params parameter.
22659
22660         (Invocation::OverloadResolve): Update to use the above method and therefore
22661         cope correctly with params method invocations.
22662
22663         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22664         params too.
22665
22666         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22667         constructors in our parent too because we can't afford to miss out on 
22668         protected ones ;-)
22669
22670         * attribute.cs (AttributeSection): New name for the class Attribute
22671
22672         Other trivial changes to improve readability.
22673
22674         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22675         use the new class names.
22676
22677 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22678
22679         * class.cs (Method::Define): Complete definition for params types too
22680
22681         (Indexer::Define): Ditto.
22682
22683         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22684         Cope everywhere with a request for info about the array parameter.
22685
22686 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22687
22688         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22689
22690         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22691         local_variable_type to extract the string corresponding to the type.
22692
22693         (local_variable_type): Fixup the action to use the new helper method.
22694
22695         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22696         go.
22697
22698         * expression.cs : Clean out code which uses the above.
22699
22700 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22701
22702         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22703         and bale out if necessary by returning a false.
22704
22705         (RegisterProperty): Ditto.
22706
22707         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22708         and print out appropriate error messages.
22709
22710         * interface.cs (everywhere): Ditto.
22711
22712         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22713         location to constructor.
22714
22715         * class.cs (Property, Event, Indexer): Update accordingly.
22716
22717         * ../errors/cs111.cs : Added.
22718
22719         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22720         of a method, as laid down by the spec.
22721
22722         (Invocation::OverloadResolve): Use the above method.
22723
22724 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22725
22726         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22727         now take a TypeContainer and a Parameters object.
22728
22729         (ParameterData): Modify return type of ParameterModifier method to be 
22730         Parameter.Modifier and not a string.
22731
22732         (ReflectionParameters, InternalParameters): Update accordingly.
22733
22734         * expression.cs (Argument::GetParameterModifier): Same here.
22735
22736         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22737         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22738         symbol in it at all so maybe this is only for now.
22739
22740 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22741
22742         * support.cs (InternalParameters): Constructor now takes an extra argument 
22743         which is the actual Parameters class.
22744
22745         (ParameterDesc): Update to provide info on ref/out modifiers.
22746
22747         * class.cs (everywhere): Update call to InternalParameters to pass in
22748         the second argument too.
22749
22750         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22751         to return the modifier info [ref/out etc]
22752
22753         (InternalParameters, ReflectionParameters): Implement the above.
22754
22755         * expression.cs (Argument::ParameterModifier): Similar function to return
22756         info about the argument's modifiers.
22757
22758         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22759         too.
22760
22761         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22762         a new SetFormalParameters object which we pass to InternalParameters.
22763
22764 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22765
22766         * expression.cs (NewArray): Merge into the ArrayCreation class.
22767
22768 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22769
22770         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22771         NewUserdefinedArray into one as there wasn't much of a use in having
22772         two separate ones.
22773
22774         * expression.cs (Argument): Change field's name to ArgType from Type.
22775
22776         (Type): New readonly property which returns the proper type, taking into 
22777         account ref/out modifiers.
22778
22779         (everywhere): Adjust code accordingly for the above.
22780
22781         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22782         whether we are emitting for a ref or out parameter.
22783
22784         * expression.cs (Argument::Emit): Use the above field to set the state.
22785
22786         (LocalVariableReference::Emit): Update to honour the flag and emit the
22787         right stuff.
22788
22789         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22790
22791         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22792
22793         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22794
22795         (ReflectionParameters, InternalParameters): Implement the above method.
22796
22797         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22798         reporting errors.
22799
22800         (Invocation::FullMethodDesc): Ditto. 
22801
22802 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22803
22804         * cs-parser.jay: Add extra production for the second form of array
22805         creation. 
22806
22807         * expression.cs (ArrayCreation): Update to reflect the above
22808         change. 
22809
22810         * Small changes to prepare for Array initialization.
22811
22812 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22813
22814         * typemanager.cs (ImplementsInterface): interface might be null;
22815         Deal with this problem;
22816
22817         Also, we do store negative hits on the cache (null values), so use
22818         this instead of calling t.GetInterfaces on the type everytime.
22819
22820 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22821
22822         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22823
22824         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22825         split functionality out into different classes.
22826
22827         (New::FormArrayType): Move into NewBuiltinArray.
22828
22829         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22830         quite useless.
22831
22832         (NewBuiltinArray): New class to handle creation of built-in arrays.
22833
22834         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22835         account creation of one-dimensional arrays.
22836
22837         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22838
22839         (NewUserdefinedArray::DoResolve): Implement.
22840
22841         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22842
22843         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22844         we maintain inside the TypeManager. This is necessary to perform lookups on the
22845         module builder.
22846
22847         (LookupType): Update to perform GetType on the module builders too.     
22848
22849         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22850
22851         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22852
22853 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22854
22855         * expression.cs (New::DoResolve): Implement guts of array creation.
22856
22857         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22858
22859 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22860
22861         * expression.cs: Fix bug I introduced lsat night that broke
22862         Delegates. 
22863
22864         (Expression.Resolve): Report a 246 error (can not resolve name)
22865         if we find a SimpleName in the stream.
22866
22867         (Expression.ResolveLValue): Ditto.
22868
22869         (Expression.ResolveWithSimpleName): This function is a variant of
22870         ResolveName, this one allows SimpleNames to be returned without a
22871         warning.  The only consumer of SimpleNames is MemberAccess
22872
22873 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22874
22875         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22876         might arrive here.  I have my doubts that this is correct.
22877
22878         * statement.cs (Lock): Implement lock statement.
22879
22880         * cs-parser.jay: Small fixes to support `lock' and `using'
22881
22882         * cs-tokenizer.cs: Remove extra space
22883
22884         * driver.cs: New flag --checked, allows to turn on integer math
22885         checking. 
22886
22887         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22888         Threading.Monitor.Exit 
22889
22890 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22891
22892         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22893         Expression Class to be IndexerAccess.
22894
22895         Notice that Indexer::DoResolve sets the eclass to Value.
22896
22897 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22898
22899         * class.cs (TypeContainer::Emit): Emit code for indexers.
22900
22901         * assign.cs (IAssignMethod): New interface implemented by Indexers
22902         and Properties for handling assignment.
22903
22904         (Assign::Emit): Simplify and reuse code. 
22905
22906         * expression.cs (IndexerAccess, PropertyExpr): Implement
22907         IAssignMethod, clean up old code. 
22908
22909 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22910
22911         * typemanager.cs (ImplementsInterface): New method to determine if a type
22912         implements a given interface. Provides a nice cache too.
22913
22914         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22915         method.
22916
22917         (ConvertReferenceExplicit): Ditto.
22918
22919         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22920         various methods, with correct names etc.
22921
22922         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22923         Operator.UnaryNegation.
22924
22925         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22926         we have a unary plus or minus operator.
22927
22928         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22929         UnaryMinus.
22930
22931         * everywhere : update accordingly.
22932
22933         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22934         respectively.
22935
22936         * class.cs (Method::Define): For the case where we are implementing a method
22937         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22938         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22939
22940 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22941
22942         * interface.cs (FindMembers): Implement to work around S.R.E
22943         lameness.
22944
22945         * typemanager.cs (IsInterfaceType): Implement.
22946
22947         (FindMembers): Update to handle interface types too.
22948
22949         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22950         use IsAssignableFrom as that is not correct - it doesn't work.
22951
22952         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22953         and accordingly override EmitStatement.
22954
22955         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22956         using the correct logic :-)
22957
22958 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22959
22960         * ../errors/cs-11.cs : Add to demonstrate error -11 
22961
22962 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22963
22964         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22965         then pass this as a hint to ResolveLValue.
22966
22967         * expression.cs (FieldExpr): Add Location information
22968
22969         (FieldExpr::LValueResolve): Report assignment to readonly
22970         variable. 
22971
22972         (Expression::ExprClassFromMemberInfo): Pass location information.
22973
22974         (Expression::ResolveLValue): Add new method that resolves an
22975         LValue. 
22976
22977         (Expression::DoResolveLValue): Default invocation calls
22978         DoResolve. 
22979
22980         (Indexers): New class used to keep track of indexers in a given
22981         Type. 
22982
22983         (IStackStore): Renamed from LValue, as it did not really describe
22984         what this did.  Also ResolveLValue is gone from this interface and
22985         now is part of Expression.
22986
22987         (ElementAccess): Depending on the element access type
22988
22989         * typemanager.cs: Add `indexer_name_type' as a Core type
22990         (System.Runtime.CompilerServices.IndexerNameAttribute)
22991
22992         * statement.cs (Goto): Take a location.
22993
22994 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22995
22996         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22997         if two delegates are compatible.
22998
22999         (NewDelegate::DoResolve): Update to take care of the case when
23000         we instantiate a delegate from another delegate.
23001
23002         * typemanager.cs (FindMembers): Don't even try to look up members
23003         of Delegate types for now.
23004
23005 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23006
23007         * delegate.cs (NewDelegate): New class to take care of delegate
23008         instantiation.
23009
23010         * expression.cs (New): Split the delegate related code out into 
23011         the NewDelegate class.
23012
23013         * delegate.cs (DelegateInvocation): New class to handle delegate 
23014         invocation.
23015
23016         * expression.cs (Invocation): Split out delegate related code into
23017         the DelegateInvocation class.
23018
23019 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23020
23021         * expression.cs (New::DoResolve): Implement delegate creation fully
23022         and according to the spec.
23023
23024         (New::DoEmit): Update to handle delegates differently.
23025
23026         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23027         because of which we were printing out arguments in reverse order !
23028
23029         * delegate.cs (VerifyMethod): Implement to check if the given method
23030         matches the delegate.
23031
23032         (FullDelegateDesc): Implement.
23033
23034         (VerifyApplicability): Implement.
23035
23036         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23037         delegate invocations too.
23038
23039         (Invocation::Emit): Ditto.
23040
23041         * ../errors/cs1593.cs : Added.
23042
23043         * ../errors/cs1594.cs : Added.
23044
23045         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23046
23047 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23048
23049         * typemanager.cs (intptr_type): Core type for System.IntPtr
23050
23051         (InitCoreTypes): Update for the same.
23052
23053         (iasyncresult_type, asynccallback_type): Ditto.
23054
23055         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23056         correct.
23057
23058         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23059         too.
23060
23061         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23062         the builders for the 4 members of a delegate type :-)
23063
23064         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23065         type.
23066
23067         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23068
23069         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23070
23071 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23072
23073         * statement.cs (Break::Emit): Implement.   
23074         (Continue::Emit): Implement.
23075
23076         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23077         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23078         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23079         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23080         end loop
23081
23082         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23083         properties that track the label for the current loop (begin of the
23084         loop and end of the loop).
23085
23086 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23087
23088         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23089         use of emitting anything at all.
23090
23091         * class.cs, rootcontext.cs : Get rid of calls to the same.
23092
23093         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23094
23095         (Populate): Define the constructor correctly and set the implementation
23096         attributes.
23097
23098         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23099         have been defined.
23100
23101         (AddDelegateType): Implement.
23102
23103         (IsDelegateType): Implement helper method.
23104
23105         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23106
23107         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23108         and accordingly handle it.
23109
23110         * delegate.cs (Populate): Take TypeContainer argument.
23111         Implement bits to define the Invoke method. However, I still haven't figured out
23112         how to take care of the native int bit :-(
23113
23114         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23115         Qualify the name of the delegate, not its return type !
23116
23117         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23118         conversion.
23119
23120         (StandardConversionExists): Checking for array types turns out to be recursive.
23121
23122         (ConvertReferenceExplicit): Implement array conversion.
23123
23124         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23125
23126 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23127
23128         * cs-parser.jay (delegate_declaration): Store the fully qualified
23129         name as it is a type declaration.
23130
23131         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23132         readonly.
23133
23134         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23135         as TypeContainer::DefineType.
23136
23137         (Populate): Method in which all the definition of the various methods (Invoke)
23138         etc is done.
23139
23140         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23141         see.
23142
23143         (CloseDelegate): Finally creates the delegate.
23144
23145         * class.cs (TypeContainer::DefineType): Update to define delegates.
23146         (Populate, Emit and CloseType): Do the same thing here too.
23147
23148         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23149         delegates in all these operations.
23150
23151 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23152
23153         * expression.cs: LocalTemporary: a new expression used to
23154         reference a temporary that has been created.
23155
23156         * assign.cs: Handle PropertyAccess back here, so that we can
23157         provide the proper semantic access to properties.
23158
23159         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23160         a few more explicit conversions. 
23161
23162         * modifiers.cs: `NEW' modifier maps to HideBySig.
23163
23164         * expression.cs (PropertyExpr): Make this into an
23165         ExpressionStatement, and support the EmitStatement code path. 
23166
23167         Perform get/set error checking, clean up the interface.
23168
23169         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23170         them into toplevel access objects.
23171
23172 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23173
23174         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23175         SRE.
23176
23177         * typemanager.cs: Keep track here of our PropertyBuilders again to
23178         work around lameness in SRE.
23179
23180 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23181
23182         * expression.cs (LValue::LValueResolve): New method in the
23183         interface, used to perform a second resolution pass for LValues. 
23184
23185         (This::DoResolve): Catch the use of this in static methods.
23186
23187         (This::LValueResolve): Implement.
23188
23189         (This::Store): Remove warning, assigning to `this' in structures
23190         is 
23191
23192         (Invocation::Emit): Deal with invocation of
23193         methods on value types.  We need to pass the address to structure
23194         methods rather than the object itself.  (The equivalent code to
23195         emit "this" for structures leaves the entire structure on the
23196         stack instead of a pointer to it). 
23197
23198         (ParameterReference::DoResolve): Compute the real index for the
23199         argument based on whether the method takes or not a `this' pointer
23200         (ie, the method is static).
23201
23202         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23203         value types returned from functions when we need to invoke a
23204         method on the sturcture.
23205
23206
23207 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23208
23209         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23210         defining the type in the Modulebuilder or Typebuilder. This is to take
23211         care of nested types which need to be defined on the TypeBuilder using
23212         DefineNestedMethod.
23213
23214         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23215         methods in RootContext, only ported to be part of TypeContainer.
23216
23217         (TypeContainer::GetInterfaceOrClass): Ditto.
23218
23219         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23220
23221         * interface.cs (Interface::DefineInterface): New method. Does exactly
23222         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23223         too.
23224
23225         (Interface::GetInterfaces): Move from RootContext here and port.
23226
23227         (Interface::GetInterfaceByName): Same here.
23228
23229         * rootcontext.cs (ResolveTree): Re-write.
23230
23231         (PopulateTypes): Re-write.
23232
23233         * class.cs (TypeContainer::Populate): Populate nested types too.
23234         (TypeContainer::Emit): Emit nested members too.
23235
23236         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23237         instead just use the name argument passed in as it is already fully
23238         qualified.
23239
23240         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23241         to TypeContainer mapping to see if a type is user-defined.
23242
23243         * class.cs (TypeContainer::CloseType): Implement. 
23244
23245         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23246         the default constructor.
23247
23248         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23249         twice.
23250
23251         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23252
23253         * interface.cs (CloseType): Create the type here.
23254
23255         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23256         the hierarchy.
23257
23258         Remove all the methods which are now in TypeContainer.
23259
23260 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23261
23262         * delegate.cs (Define): Re-write bits to define the delegate
23263         correctly.
23264
23265 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23266
23267         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23268
23269         * expression.cs (ImplicitReferenceConversion): handle null as well
23270         as a source to convert to any reference type.
23271
23272         * statement.cs (Return): Perform any implicit conversions to
23273         expected return type.  
23274
23275         Validate use of return statement.  
23276
23277         * codegen.cs (EmitContext): Pass the expected return type here.
23278
23279         * class.cs (Method, Constructor, Property): Pass expected return
23280         type to EmitContext.
23281
23282 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23283
23284         * expression.cs: Make DoResolve take an EmitContext instead of a
23285         TypeContainer.
23286
23287         Replaced `l' and `location' for `loc', for consistency.
23288
23289         (Error, Warning): Remove unneeded Tc argument.
23290
23291         * assign.cs, literal.cs, constant.cs: Update to new calling
23292         convention. 
23293
23294         * codegen.cs: EmitContext now contains a flag indicating whether
23295         code is being generated in a static method or not.
23296
23297         * cs-parser.jay: DecomposeQI, new function that replaces the old
23298         QualifiedIdentifier.  Now we always decompose the assembled
23299         strings from qualified_identifier productions into a group of
23300         memberaccesses.
23301
23302 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23303
23304         * rootcontext.cs: Deal with field-less struct types correctly now
23305         by passing the size option to Define Type.
23306
23307         * class.cs: Removed hack that created one static field. 
23308
23309 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23310
23311         * statement.cs: Moved most of the code generation here. 
23312
23313 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23314
23315         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23316         seem very right.
23317
23318         (ElementAccess): Remove useless bits for now - keep checks as the spec
23319         says.
23320
23321 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23322
23323         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23324         and start performing checks according to the spec.
23325
23326 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23327
23328         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23329         rank_specifiers instead.
23330
23331         (rank_specifiers): Change the order in which the rank specifiers are stored
23332
23333         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23334
23335         * expression.cs (ElementAccess): Implement the LValue interface too.
23336
23337 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23338
23339         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23340         except that user defined conversions are not included.
23341
23342         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23343         perform the conversion of the return type, if necessary.
23344
23345         (New::DoResolve): Check whether we are creating an array or an object
23346         and accordingly do the needful.
23347
23348         (New::Emit): Same here.
23349
23350         (New::DoResolve): Implement guts of array creation.
23351
23352         (New::FormLookupType): Helper function.
23353
23354 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * codegen.cs: Removed most of the code generation here, and move the
23357         corresponding code generation bits to the statement classes. 
23358
23359         Added support for try/catch/finalize and throw.
23360
23361         * cs-parser.jay: Added support for try/catch/finalize.
23362
23363         * class.cs: Catch static methods having the flags override,
23364         virtual or abstract.
23365
23366         * expression.cs (UserCast): This user cast was not really doing
23367         what it was supposed to do.  Which is to be born in fully resolved
23368         state.  Parts of the resolution were being performed at Emit time! 
23369
23370         Fixed this code.
23371
23372 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * expression.cs: Implicity convert the result from UserCast.
23375
23376 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23377
23378         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23379         prevented it from working correctly. 
23380
23381         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23382         merely ConvertImplicit.
23383
23384 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23385
23386         * typemanager.cs: Make the LookupTypeContainer function static,
23387         and not per-instance.  
23388
23389         * class.cs: Make static FindMembers (the one that takes a Type
23390         argument). 
23391
23392         * codegen.cs: Add EmitForeach here.
23393
23394         * cs-parser.jay: Make foreach a toplevel object instead of the
23395         inline expansion, as we need to perform semantic analysis on it. 
23396
23397 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23398
23399         * expression.cs (Expression::ImplicitUserConversion): Rename to
23400         UserDefinedConversion.
23401
23402         (Expression::UserDefinedConversion): Take an extra argument specifying 
23403         whether we look for explicit user conversions too.
23404
23405         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23406
23407         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23408
23409         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23410         with the appropriate arguments.
23411
23412         * cs-parser.jay (cast_expression): Record location too.
23413
23414         * expression.cs (Cast): Record location info.
23415
23416         (Expression::ConvertExplicit): Take location argument.
23417
23418         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23419         to determine if we are doing explicit conversions.
23420
23421         (UserCast::Emit): Update accordingly.
23422
23423         (Expression::ConvertExplicit): Report an error if everything fails.
23424
23425         * ../errors/cs0030.cs : Add.
23426
23427 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23428
23429         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23430         virtual and newslot bits. 
23431
23432         * class.cs (TypeContainer::RegisterRequiredImplementations):
23433         Record methods we need.
23434
23435         (TypeContainer::MakeKey): Helper function to make keys for
23436         MethodBases, since the Methodbase key is useless.
23437
23438         (TypeContainer::Populate): Call RegisterRequiredImplementations
23439         before defining the methods.   
23440
23441         Create a mapping for method_builders_to_methods ahead of time
23442         instead of inside a tight loop.
23443
23444         (::RequireMethods):  Accept an object as the data to set into the
23445         hashtable so we can report interface vs abstract method mismatch.
23446
23447 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23448
23449         * report.cs: Make all of it static.
23450
23451         * rootcontext.cs: Drop object_type and value_type computations, as
23452         we have those in the TypeManager anyways.
23453
23454         Drop report instance variable too, now it is a global.
23455
23456         * driver.cs: Use try/catch on command line handling.
23457
23458         Add --probe option to debug the error reporting system with a test
23459         suite. 
23460
23461         * report.cs: Add support for exiting program when a probe
23462         condition is reached.
23463
23464 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23465
23466         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23467         we do a forcible conversion regardless of type, to check if 
23468         ForceConversion returns a null.
23469
23470         (Binary::error19): Use location to report error.
23471
23472         (Unary::error23): Use location here too.
23473
23474         * ../errors/cs0019.cs : Check in.
23475
23476         * ../errors/cs0023.cs : Check in.
23477
23478         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23479         case of a non-null MethodInfo object with a length of 0 !
23480
23481         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23482         an applicable member - according to the spec :-)
23483         Also fix logic to find members in base types.
23484
23485         (Unary::ResolveOperator): Same here.
23486
23487         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23488         as I was getting thoroughly confused between this and error19 :-)
23489
23490         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23491         (::FindMostEncompassedType): Implement.
23492         (::FindMostEncompassingType): Implement.
23493         (::StandardConversionExists): Implement.
23494
23495         (UserImplicitCast): Re-vamp. We now need info about most specific
23496         source and target types so that we can do the necessary conversions.
23497
23498         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23499         mathematical union with no duplicates.
23500
23501 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23502
23503         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23504         in order from base classes to child classes, so that we can in
23505         child classes look up in our parent for method names and
23506         attributes (required for handling abstract, virtual, new, override
23507         constructs: we need to instrospect our base class, and if we dont
23508         populate the classes in order, the introspection might be
23509         incorrect.  For example, a method could query its parent before
23510         the parent has any methods and would determine that the parent has
23511         no abstract methods (while it could have had them)).
23512
23513         (RootContext::CreateType): Record the order in which we define the
23514         classes.
23515
23516 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23517
23518         * class.cs (TypeContainer::Populate): Also method definitions can
23519         fail now, keep track of this.
23520
23521         (TypeContainer::FindMembers): Implement support for
23522         DeclaredOnly/noDeclaredOnly flag.
23523
23524         (Constructor::Emit) Return the ConstructorBuilder.
23525
23526         (Method::Emit) Return the MethodBuilder. 
23527         Check for abstract or virtual methods to be public.
23528
23529         * rootcontext.cs (RootContext::CreateType): Register all the
23530         abstract methods required for the class to be complete and the
23531         interface methods that must be implemented. 
23532
23533         * cs-parser.jay: Report error 501 (method requires body if it is
23534         not marked abstract or extern).
23535
23536         * expression.cs (TypeOf::Emit): Implement.
23537
23538         * typemanager.cs: runtime_handle_type, new global type.
23539
23540         * class.cs (Property::Emit): Generate code for properties.
23541
23542 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23543
23544         * expression.cs (Unary::ResolveOperator): Find operators on base type
23545         too - we now conform exactly to the spec.
23546
23547         (Binary::ResolveOperator): Same here.
23548
23549         * class.cs (Operator::Define): Fix minor quirk in the tests.
23550
23551         * ../errors/cs0215.cs : Added.
23552
23553         * ../errors/cs0556.cs : Added.
23554
23555         * ../errors/cs0555.cs : Added.
23556
23557 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23558
23559         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23560         single integer which is really efficient
23561
23562 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23563
23564         *  expression.cs (Expression::ImplicitUserConversion): Use location
23565         even in the case when we are examining True operators.
23566  
23567         * class.cs (Operator::Define): Perform extensive checks to conform
23568         with the rules for operator overloading in the spec.
23569
23570         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23571         some of the other conversions mentioned in the spec.
23572
23573         * typemanager.cs (array_type): New static member for the System.Array built-in
23574         type.
23575
23576         (cloneable_interface): For System.ICloneable interface.
23577
23578         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23579         we start resolving the tree and populating types.
23580
23581         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23582  
23583 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23584
23585         * expression.cs (Expression::ExprClassFromMemberInfo,
23586         Expression::Literalize): Create literal expressions from
23587         FieldInfos which are literals.
23588
23589         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23590         type casts, because they were wrong.  The test suite in tests
23591         caught these ones.
23592
23593         (ImplicitNumericConversion): ushort to ulong requires a widening
23594         cast. 
23595
23596         Int32 constant to long requires widening cast as well.
23597
23598         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23599         for integers because the type on the stack is not i4.
23600
23601 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23602
23603         * expression.cs (report118): require location argument. 
23604
23605         * parameter.cs: Do not dereference potential null value.
23606
23607         * class.cs: Catch methods that lack the `new' keyword when
23608         overriding a name.  Report warnings when `new' is used without
23609         anything being there to override.
23610
23611         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23612
23613         * class.cs: Only add constructor to hashtable if it is non-null
23614         (as now constructors can fail on define).
23615
23616         (TypeManager, Class, Struct): Take location arguments.
23617
23618         Catch field instance initialization in structs as errors.
23619
23620         accepting_filter: a new filter for FindMembers that is static so
23621         that we dont create an instance per invocation.
23622
23623         (Constructor::Define): Catch errors where a struct constructor is
23624         parameterless 
23625
23626         * cs-parser.jay: Pass location information for various new
23627         constructs. 
23628
23629         * delegate.cs (Delegate): take a location argument.
23630
23631         * driver.cs: Do not call EmitCode if there were problesm in the
23632         Definition of the types, as many Builders wont be there. 
23633
23634         * decl.cs (Decl::Decl): Require a location argument.
23635
23636         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23637         into integers, and find the most appropiate integer for it.
23638
23639         * literal.cs: Implement ULongLiteral.
23640
23641         * rootcontext.cs: Provide better information about the location of
23642         failure when CreateType fails.
23643
23644 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23645
23646         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23647         as well.
23648
23649         * expression.cs (Binary::CheckShiftArguments): Add missing type
23650         computation.
23651         (Binary::ResolveOperator): Add type to the logical and and logical
23652         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23653         before.
23654
23655         (Binary::DoNumericPromotions): In the case where either argument
23656         is ulong (and most signed types combined with ulong cause an
23657         error) perform implicit integer constant conversions as well.
23658
23659 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23660
23661         * expression.cs (UserImplicitCast): Method should always be
23662         non-null. 
23663         (Invocation::BetterConversion): Simplified test for IntLiteral.
23664
23665         (Expression::ImplicitNumericConversion): Split this routine out.
23666         Put the code that performs implicit constant integer conversions
23667         here. 
23668
23669         (Expression::Resolve): Become a wrapper around DoResolve so we can
23670         check eclass and type being set after resolve.
23671
23672         (Invocation::Badness): Remove this dead function
23673
23674         (Binary::ResolveOperator): Do not compute the expensive argumnets
23675         unless we have a union for it.
23676
23677         (Probe::Emit): Is needs to do an isinst and then
23678         compare against null.
23679
23680         (::CanConvert): Added Location argument.  If the Location argument
23681         is null (Location.Null), then we do not report errors.  This is
23682         used by the `probe' mechanism of the Explicit conversion.  We do
23683         not want to generate an error for something that the user
23684         explicitly requested to be casted.  But the pipeline for an
23685         explicit cast first tests for potential implicit casts.
23686
23687         So for now, if the Location is null, it means `Probe only' to
23688         avoid adding another argument.   Might have to revise this
23689         strategy later.
23690
23691         (ClassCast): New class used to type cast objects into arbitrary
23692         classes (used in Explicit Reference Conversions).
23693
23694         Implement `as' as well.
23695
23696         Reverted all the patches from Ravi below: they were broken:
23697
23698                 * The use of `level' as a mechanism to stop recursive
23699                   invocations is wrong.  That was there just to catch the
23700                   bug with a strack trace but not as a way of addressing
23701                   the problem.
23702
23703                   To fix the problem we have to *understand* what is going
23704                   on and the interactions and come up with a plan, not
23705                   just get things going.
23706
23707                 * The use of the type conversion cache that I proposed
23708                   last night had an open topic: How does this work across
23709                   protection domains.  A user defined conversion might not
23710                   be public in the location where we are applying the
23711                   conversion, a different conversion might be selected
23712                   (ie, private A->B (better) but public B->A (worse),
23713                   inside A, A->B applies, but outside it, B->A will
23714                   apply).
23715
23716                 * On top of that (ie, even if the above is solved),
23717                   conversions in a cache need to be abstract.  Ie, `To
23718                   convert from an Int to a Short use an OpcodeCast', not
23719                   `To convert from an Int to a Short use the OpcodeCast on
23720                   the variable 5' (which is what this patch was doing).
23721
23722 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23723
23724         * expression.cs (Invocation::ConversionExists): Re-write to use
23725         the conversion cache
23726
23727         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23728         cache all conversions done, not just user-defined ones.
23729
23730         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23731         to determine if a conversion exists instead of acutually trying to 
23732         perform the conversion. It's faster too.
23733
23734         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23735         and only then attempt the implicit conversion.
23736
23737 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23738
23739         * expression.cs (ConvertImplicit): Use a cache for conversions
23740         already found. Check level of recursion and bail out if necessary.
23741
23742 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23743
23744         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23745         Export standard methods that we expect for string operations.
23746
23747         * statement.cs (Block::UsageWarning): Track usage of variables and
23748         report the errors for not used variables.
23749
23750         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23751         operator. 
23752
23753 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23754
23755         * codegen.cs: remove unnneded code 
23756
23757         * expression.cs: Removed BuiltinTypeAccess class
23758
23759         Fix the order in which implicit conversions are
23760         done.  
23761
23762         The previous fixed dropped support for boxed conversions (adding a
23763         test to the test suite now)
23764
23765         (UserImplicitCast::CanConvert): Remove test for source being null,
23766         that code is broken.  We should not feed a null to begin with, if
23767         we do, then we should track the bug where the problem originates
23768         and not try to cover it up here.
23769
23770         Return a resolved expression of type UserImplicitCast on success
23771         rather than true/false.  Ravi: this is what I was talking about,
23772         the pattern is to use a static method as a "constructor" for
23773         objects. 
23774
23775         Also, do not create arguments until the very last minute,
23776         otherwise we always create the arguments even for lookups that
23777         will never be performed. 
23778
23779         (UserImplicitCast::Resolve): Eliminate, objects of type
23780         UserImplicitCast are born in a fully resolved state. 
23781
23782         * typemanager.cs (InitCoreTypes): Init also value_type
23783         (System.ValueType). 
23784
23785         * expression.cs (Cast::Resolve): First resolve the child expression.
23786
23787         (LValue): Add new method AddressOf to be used by
23788         the `&' operator.  
23789
23790         Change the argument of Store to take an EmitContext instead of an
23791         ILGenerator, because things like FieldExpr need to be able to call
23792         their children expression to generate the instance code. 
23793
23794         (Expression::Error, Expression::Warning): Sugar functions for
23795         reporting errors.
23796
23797         (Expression::MemberLookup): Accept a TypeContainer instead of a
23798         Report as the first argument.
23799
23800         (Expression::ResolvePrimary): Killed.  I still want to improve
23801         this as currently the code is just not right.
23802
23803         (Expression::ResolveMemberAccess): Simplify, but it is still
23804         wrong. 
23805
23806         (Unary::Resolve): Catch errors in AddressOf operators.
23807
23808         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23809         index to a byte for the short-version, or the compiler will choose
23810         the wrong Emit call, which generates the wrong data.
23811
23812         (ParameterReference::Emit, ::Store): same.
23813
23814         (FieldExpr::AddressOf): Implement.
23815
23816         * typemanager.cs: TypeManager: made public variable instead of
23817         property.
23818
23819         * driver.cs: document --fatal.
23820
23821         * report.cs (ErrorMessage, WarningMessage): new names for the old
23822         Error and Warning classes.
23823
23824         * cs-parser.jay (member_access): Turn built-in access to types
23825         into a normal simplename
23826
23827 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23828
23829         * expression.cs (Invocation::BetterConversion): Fix to cope
23830         with q being null, since this was introducing a bug.
23831
23832         * expression.cs (ConvertImplicit): Do built-in conversions first.
23833
23834 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23835
23836         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23837
23838 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23839
23840         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23841         I had introduced long ago (what's new ?).
23842
23843         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23844         the work of all the checking. 
23845         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23846         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23847
23848         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23849         that is the right way. 
23850
23851         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23852         overloading resolution. Use everywhere instead of cutting and pasting code.
23853
23854         (Binary::ResolveOperator): Use MakeUnionSet.
23855
23856         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23857         we have to convert to bool types. Not complete yet.
23858
23859 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23860
23861         * typemanager.cs (TypeManager::CSharpName): support ushort.
23862
23863         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23864         to provide an expression that performsn an implicit constant int
23865         conversion (section 6.1.6).
23866         (Expression::ConvertImplicitRequired): Reworked to include
23867         implicit constant expression conversions.
23868
23869         (Expression::ConvertNumericExplicit): Finished.
23870
23871         (Invocation::Emit): If InstanceExpression is null, then it means
23872         that we perform a call on this.
23873
23874 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23875
23876         * expression.cs (Unary::Emit): Remove some dead code.
23877         (Probe): Implement Resolve and Emit for `is'.
23878         (Expression::ConvertImplicitRequired): Attempt to do constant
23879         expression conversions here.  Maybe should be moved to
23880         ConvertImplicit, but I am not sure.
23881         (Expression::ImplicitLongConstantConversionPossible,
23882         Expression::ImplicitIntConstantConversionPossible): New functions
23883         that tell whether is it possible to apply an implicit constant
23884         expression conversion.
23885
23886         (ConvertNumericExplicit): Started work on explicit numeric
23887         conversions.
23888
23889         * cs-parser.jay: Update operator constants.
23890
23891         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23892         (Parameters::GetSignature): Hook up VerifyArgs here.
23893         (Parameters::VerifyArgs): Verifies that no two arguments have the
23894         same name. 
23895
23896         * class.cs (Operator): Update the operator names to reflect the
23897         ones that the spec expects (as we are just stringizing the
23898         operator names).
23899
23900         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23901         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23902         previous usage did only work for our methods.
23903         (Expression::ConvertImplicit): Handle decimal implicit numeric
23904         conversions as well.
23905         (Expression::InternalTypeConstructor): Used to invoke constructors
23906         on internal types for default promotions.
23907
23908         (Unary::Emit): Implement special handling for the pre/post
23909         increment/decrement for overloaded operators, as they need to have
23910         the same semantics as the other operators.
23911
23912         (Binary::ResolveOperator): ditto.
23913         (Invocation::ConversionExists): ditto.
23914         (UserImplicitCast::Resolve): ditto.
23915
23916 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23917
23918         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23919         operator, return after emitting body. Regression tests pass again !
23920
23921         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23922         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23923         (Invocation::OverloadResolve): Ditto.
23924         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23925
23926         * everywhere : update calls to the above methods accordingly.
23927
23928 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23929
23930         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23931
23932         * expression.cs (ExpressionStatement): New base class used for
23933         expressions that can appear in statements, so that we can provide
23934         an alternate path to generate expression that do not leave a value
23935         on the stack.
23936
23937         (Expression::Emit, and all the derivatives): We no longer return
23938         whether a value is left on the stack or not.  Every expression
23939         after being emitted leaves a single value on the stack.
23940
23941         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23942         facilties of ExpressionStatement if possible.
23943
23944         * cs-parser.jay: Update statement_expression.
23945
23946 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23947
23948         * driver.cs: Change the wording of message
23949
23950 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23951
23952         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23953         the type of the expression to the return type of the method if
23954         we have an overloaded operator match ! The regression tests pass again !
23955         (Unary::ResolveOperator): Ditto.
23956
23957         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23958         to find "op_Implicit", not "implicit" ;-)
23959         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23960         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23961
23962         * everywhere : Correct calls to the above accordingly.
23963
23964         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23965         (ConvertImplicit): Do user-defined conversion if it exists.
23966
23967 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23968
23969         * assign.cs: track location.
23970         (Resolve): Use implicit conversions on assignment.
23971
23972         * literal.cs: Oops.  Not good, Emit of short access values should
23973         pass (Bytes) or the wrong argument will be selected.
23974
23975         * expression.cs (Unary::Emit): Emit code for -expr.
23976
23977         (Unary::ResolveOperator): Handle `Substract' for non-constants
23978         (substract from zero from the non-constants).
23979         Deal with Doubles as well. 
23980
23981         (Expression::ConvertImplicitRequired): New routine that reports an
23982         error if no implicit conversion exists. 
23983
23984         (Invocation::OverloadResolve): Store the converted implicit
23985         expressions if we make them
23986
23987 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23988
23989         * class.cs (ConstructorInitializer): Take a Location argument.
23990         (ConstructorBaseInitializer): Same here.
23991         (ConstructorThisInitializer): Same here.
23992
23993         * cs-parser.jay : Update all calls accordingly.
23994
23995         * expression.cs (Unary, Binary, New): Take location argument.
23996         Update accordingly everywhere.
23997
23998         * cs-parser.jay : Update all calls to the above to take a location
23999         argument.
24000
24001         * class.cs : Ditto.
24002
24003 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24004
24005         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24006         (Invocation::BetterConversion): Same here
24007         (Invocation::ConversionExists): Ditto.
24008
24009         (Invocation::ConversionExists): Implement.
24010
24011 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24012
24013         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24014         Also take an additional TypeContainer argument.
24015
24016         * All over : Pass in TypeContainer as argument to OverloadResolve.
24017
24018         * typemanager.cs (CSharpName): Update to check for the string type and return
24019         that too.
24020
24021         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24022         a given method.
24023
24024 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24025
24026         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24027         (Invocation::BetterFunction): Implement.
24028         (Invocation::BetterConversion): Implement.
24029         (Invocation::ConversionExists): Skeleton, no implementation yet.
24030
24031         Okay, things work fine !
24032
24033 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24034
24035         * typemanager.cs: declare and load enum_type, delegate_type and
24036         void_type. 
24037
24038         * expression.cs (Expression::Emit): Now emit returns a value that
24039         tells whether a value is left on the stack or not.  This strategy
24040         might be reveted tomorrow with a mechanism that would address
24041         multiple assignments.
24042         (Expression::report118): Utility routine to report mismatches on
24043         the ExprClass.
24044
24045         (Unary::Report23): Report impossible type/operator combination
24046         utility function.
24047
24048         (Unary::IsIncrementableNumber): Whether the type can be
24049         incremented or decremented with add.
24050         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24051         complemented. 
24052         (Unary::ResolveOperator): Implement ++, !, ~,
24053
24054         (Invocation::Emit): Deal with new Emit convetion.
24055
24056         * All Expression derivatives: Updated their Emit method to return
24057         whether they leave values on the stack or not.
24058
24059         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24060         stack for expressions that are statements. 
24061
24062 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24063
24064         * expression.cs (LValue): New interface.  Must be implemented by
24065         LValue objects.
24066         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24067         LValue interface.
24068
24069         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24070         interface for generating code, simplifies the code.
24071
24072 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24073
24074         * expression.cs (everywhere): Comment out return statements in ::Resolve
24075         methods to avoid the warnings.
24076
24077 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24078
24079         * driver.cs (parse): Report error 2001 if we can not open the
24080         source file.
24081
24082         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24083         not resolve it.
24084
24085         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24086         object. 
24087
24088         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24089         otherwise nested blocks end up with the same index.
24090
24091         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24092
24093         * expression.cs:  Instead of having FIXMEs in the Resolve
24094         functions, throw exceptions so it is obvious that we are facing a
24095         bug. 
24096
24097         * cs-parser.jay (invocation_expression): Pass Location information.
24098
24099         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24100         Use a basename for those routines because .NET does not like paths
24101         on them. 
24102
24103         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24104         already defined.
24105
24106 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24107
24108         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24109         are loading the correct data types (throws an exception if not).
24110         (TypeManager::InitCoreTypes): Use CoreLookupType
24111
24112         * expression.cs (Unary::ResolveOperator): return the child
24113         expression for expressions which are just +expr.
24114         (Unary::ResolveOperator): Return negative literals for -LITERAL
24115         expressions (otherwise they are Unary {Literal}).
24116         (Invocation::Badness): Take into account `Implicit constant
24117         expression conversions'.
24118
24119         * literal.cs (LongLiteral): Implement long literal class.
24120         (IntLiteral): export the `Value' of the intliteral. 
24121
24122 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24123
24124         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24125
24126         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24127         instead of 'Operator'
24128
24129         * expression.cs (Binary::ResolveOperator): Update accordingly.
24130         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24131         and 'Minus'
24132
24133         * cs-parser.jay (unary_expression): Update to use the new names.
24134
24135         * gen-treedump.cs (GetUnary): Same here.
24136
24137         * expression.cs (Unary::Resolve): Implement.
24138         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24139         operators are found instead of making noise ;-)
24140         (Unary::ResolveOperator): New method to do precisely the same thing which
24141         Binary::ResolveOperator does for Binary expressions.
24142         (Unary.method, .Arguments): Add.
24143         (Unary::OperName): Implement.   
24144         (Unary::ForceConversion): Copy and Paste !
24145
24146         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24147         a unary operator.
24148
24149         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24150         for the inbuilt operators. Only overloading works for now ;-)
24151
24152 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24153
24154         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24155         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24156
24157         * expression.cs (This::Emit): Implement. 
24158         (This::Resolve): Implement.
24159         (TypeOf:Resolve): Implement.
24160         (Expression::ResolveSimpleName): Add an implicit this to instance
24161         field references. 
24162         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24163         Bind instance variable to Field expressions.
24164         (FieldExpr::Instance): New field used to track the expression that
24165         represents the object instance.
24166         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24167         binding 
24168         (FieldExpr::Emit): Implement.
24169
24170         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24171         the last instruction contains a return opcode to avoid generating
24172         the last `ret' instruction (this generates correct code, and it is
24173         nice to pass the peverify output).
24174
24175         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24176         initializer for static and instance variables.
24177         (Constructor::Emit): Allow initializer to be null in the case of
24178         static constructors.  Only emit initializer for instance
24179         constructors. 
24180
24181         (TypeContainer::FindMembers): Return a null array if there are no
24182         matches.
24183
24184         Also fix the code for the MemberTypes.Method branch, as it was not
24185         scanning that for operators (or tried to access null variables before).
24186
24187         * assign.cs (Assign::Emit): Handle instance and static fields. 
24188
24189         * TODO: Updated.
24190
24191         * driver.cs: Stop compilation if there are parse errors.
24192
24193         * cs-parser.jay (constructor_declaration): Provide default base
24194         initializer for non-static constructors.
24195         (constructor_declarator): Do not provide a default base
24196         initializers if none was specified.
24197         Catch the fact that constructors should not have parameters.
24198
24199         * class.cs: Do not emit parent class initializers for static
24200         constructors, that should be flagged as an error.
24201
24202 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24203
24204         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24205         Move back code into TypeContainer::Populate.
24206
24207 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24208
24209         * class.cs (TypeContainer::AddConstructor): Fix the check to
24210         compare against Name, not Basename. 
24211         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24212
24213         * cs-parser.jay : Update accordingly.
24214
24215         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24216         for methods, don't forget to look into the operators too.
24217         (RegisterMethodBuilder): Helper method to take care of this for
24218         methods, constructors and operators.
24219         (Operator::Define): Completely revamp.
24220         (Operator.OperatorMethod, MethodName): New fields.
24221         (TypeContainer::Populate): Move the registering of builders into
24222         RegisterMethodBuilder.
24223         (Operator::Emit): Re-write.
24224
24225         * expression.cs (Binary::Emit): Comment out code path to emit method
24226         invocation stuff for the case when we have a user defined operator. I am
24227         just not able to get it right !
24228
24229 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24230
24231         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24232         argument. 
24233
24234         (Expression::MemberLookup): Provide a version that allows to
24235         specify the MemberTypes and BindingFlags. 
24236
24237         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24238         so it was not fetching variable information from outer blocks.
24239
24240         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24241         Beforefieldinit as it was buggy.
24242
24243         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24244         that Ravi put here.  
24245
24246         * class.cs (Constructor::Emit): Only emit if block is not null.
24247         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24248         deal with this by semantically definining it as if the user had
24249         done it.
24250
24251         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24252         constructors as we now "emit" them at a higher level.
24253
24254         (TypeContainer::DefineDefaultConstructor): Used to define the
24255         default constructors if none was provided.
24256
24257         (ConstructorInitializer): Add methods Resolve and Emit. 
24258
24259         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24260
24261 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24262
24263         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24264         the default constructor builder with our hashtable for methodbuilders
24265         to methodcores.
24266
24267         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24268         and argument_count is 0 in which case we have a match.
24269         (Binary::ResolveOperator): More null checking and miscellaneous coding
24270         style cleanup.
24271
24272 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24273
24274         * rootcontext.cs (IsNameSpace): Compare against null.
24275
24276         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24277
24278         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24279         and Unary::Operator.
24280
24281         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24282         accordingly.
24283
24284         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24285         we have overloaded operators.
24286         (Binary::ResolveOperator): Implement the part which does the operator overload
24287         resolution.
24288
24289         * class.cs (Operator::Emit): Implement.
24290         (TypeContainer::Emit): Emit the operators we have too.
24291
24292         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24293         the case when we have a user-defined operator.
24294
24295 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24296
24297         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24298
24299 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24300
24301         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24302         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24303         (Constructor::Emit): Implement.
24304         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24305         if we have no work to do. 
24306         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24307         Emit method.
24308
24309         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24310         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24311
24312         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24313         of parent.parent.
24314
24315 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24316
24317         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24318         in the source.
24319         (Tree::RecordNamespace): Method to do what the name says ;-)
24320         (Tree::Namespaces): Property to get at the namespaces hashtable.
24321
24322         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24323         keep track.
24324
24325         * rootcontext.cs (IsNamespace): Fixed it :-)
24326
24327 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24328
24329         * class.cs (TypeContainer::FindMembers): Add support for
24330         constructors. 
24331         (MethodCore): New class that encapsulates both the shared aspects
24332         of a Constructor and a Method.  
24333         (Method, Constructor): Factored pieces into MethodCore.
24334
24335         * driver.cs: Added --fatal which makes errors throw exceptions.
24336         Load System assembly as well as part of the standard library.
24337
24338         * report.cs: Allow throwing exceptions on errors for debugging.
24339
24340         * modifiers.cs: Do not use `parent', instead use the real type
24341         container to evaluate permission settings.
24342
24343         * class.cs: Put Ravi's patch back in.  He is right, and we will
24344         have to cope with the
24345
24346 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24347
24348         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24349         FamORAssem, not FamANDAssem.
24350
24351 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24352
24353         * driver.cs: Added --parse option that only parses its input files
24354         and terminates.
24355
24356         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24357         incorrect.  IsTopLevel is not used to tell whether an object is
24358         root_types or not (that can be achieved by testing this ==
24359         root_types).  But to see if this is a top-level *class* (not
24360         necessarly our "toplevel" container). 
24361
24362 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24363
24364         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24365         parent instead of a direct call to GetType.
24366
24367 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24368
24369         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24370         Modifiers.TypeAttr. This should just be a call to that method.
24371
24372         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24373         object so that we can determine if we are top-level or not.
24374
24375         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24376         TypeContainer too.
24377
24378         * enum.cs (Enum::Define): Ditto.
24379
24380         * modifiers.cs (FieldAttr): Re-write.
24381
24382         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24383         (TypeContainer::HaveStaticConstructor): New property to provide access
24384         to precisely that info.
24385
24386         * modifiers.cs (MethodAttr): Re-write.
24387         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24388
24389         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24390         of top-level types as claimed.
24391
24392 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24393
24394         * expression.cs (MemberLookup): Fruitless attempt to lookup
24395         constructors.  Maybe I need to emit default constructors?  That
24396         might be it (currently .NET emits this for me automatically).
24397         (Invocation::OverloadResolve): Cope with Arguments == null.
24398         (Invocation::EmitArguments): new function, shared by the new
24399         constructor and us.
24400         (Invocation::Emit): Handle static and instance methods.  Emit
24401         proper call instruction for virtual or non-virtual invocations.
24402         (New::Emit): Implement.
24403         (New::Resolve): Implement.
24404         (MemberAccess:Resolve): Implement.
24405         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24406         to track instances.
24407         (FieldExpr::Resolve): Set type.
24408
24409         * support.cs: Handle empty arguments.
24410                 
24411         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24412         SimpleLookup): Auxiliary routines to help parse a qualifier
24413         identifier.  
24414
24415         Update qualifier_identifier rule.
24416
24417         * codegen.cs: Removed debugging messages.
24418
24419         * class.cs: Make this a global thing, this acts just as a "key" to
24420         objects that we might have around.
24421
24422         (Populate): Only initialize method_builders_to_methods once.
24423
24424         * expression.cs (PropertyExpr): Initialize type from the
24425         PropertyType. 
24426
24427         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24428         Resolve pattern.  Attempt to implicitly convert value to boolean.
24429         Emit code.
24430
24431         * expression.cs: Set the type for the int32/int32 argument case.
24432         (Binary::ResolveOperator): Set the return type to boolean for
24433         comparission operators
24434
24435         * typemanager.cs: Remove debugging print code.
24436
24437         (Invocation::Resolve): resolve type.
24438
24439         * class.cs: Allocate a MemberInfo of the correct size, as the code
24440         elsewhere depends on the test to reflect the correct contents.
24441
24442         (Method::) Keep track of parameters, due to System.Reflection holes
24443
24444         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24445         mapping here.
24446
24447         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24448         of the exact size and return that.
24449
24450         (Class::LookupMethodByBuilder): New function that maps
24451         MethodBuilders to its methods.  Required to locate the information
24452         on methods because System.Reflection bit us again.
24453
24454         * support.cs: New file, contains an interface ParameterData and
24455         two implementations: ReflectionParameters and InternalParameters
24456         used to access Parameter information.  We will need to grow this
24457         as required.
24458
24459         * expression.cs (Invocation::GetParameterData): implement a cache
24460         and a wrapper around the ParameterData creation for methods. 
24461         (Invocation::OverloadResolve): Use new code.
24462
24463 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24464
24465         * class.cs (TypeContainer::EmitField): Remove and move into 
24466         (Field::Define): here and modify accordingly.
24467         (Field.FieldBuilder): New member.
24468         (TypeContainer::Populate): Update accordingly.
24469         (TypeContainer::FindMembers): Implement.
24470
24471 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24472
24473         * statement.cs: (VariableInfo::VariableType): New field to be
24474         initialized with the full type once it is resolved. 
24475
24476 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24477
24478         * parameter.cs (GetParameterInfo): Use a type cache to compute
24479         things only once, and to reuse this information
24480
24481         * expression.cs (LocalVariableReference::Emit): Implement.
24482         (OpcodeCast::Emit): fix.
24483
24484         (ParameterReference::Resolve): Implement.
24485         (ParameterReference::Emit): Implement.
24486
24487         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24488         that are expressions need to stay as Expressions.
24489
24490         * typemanager.cs (CSharpName): Returns the C# name of a type if
24491         possible. 
24492
24493         * expression.cs (Expression::ConvertImplicit): New function that
24494         implements implicit type conversions.
24495
24496         (Expression::ImplicitReferenceConversion): Implements implicit
24497         reference conversions.
24498
24499         (EmptyCast): New type for transparent casts.
24500
24501         (OpcodeCast): New type for casts of types that are performed with
24502         a sequence of bytecodes.
24503
24504         (BoxedCast): New type used for casting value types into reference
24505         types.  Emits a box opcode.
24506
24507         (Binary::DoNumericPromotions): Implements numeric promotions of
24508         and computation of the Binary::Type.
24509
24510         (Binary::EmitBranchable): Optimization.
24511
24512         (Binary::Emit): Implement code emission for expressions.
24513
24514         * typemanager.cs (TypeManager): Added two new core types: sbyte
24515         and byte.
24516
24517 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24518
24519         * class.cs (TypeContainer::FindMembers): Method which does exactly
24520         what Type.FindMembers does, only we don't have to use reflection. No
24521         implementation yet.
24522
24523         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24524         typecontainer objects as we need to get at them.
24525         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24526
24527         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24528         typecontainer object.
24529
24530         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24531         of just a Report object.
24532
24533 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24534
24535         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24536         "remove_"
24537         (TypeContainer::Populate): Now define the delegates of the type too.
24538         (TypeContainer.Delegates): Property to access the list of delegates defined
24539         in the type.
24540
24541         * delegates.cs (Delegate::Define): Implement partially.
24542
24543         * modifiers.cs (TypeAttr): Handle more flags.
24544
24545 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24546
24547         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24548         and not <=
24549         (Operator::Define): Re-write logic to get types by using the LookupType method
24550         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24551         (Indexer::Define): Ditto.
24552         (Event::Define): Ditto.
24553         (Property::Define): Ditto.
24554
24555 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24556
24557         * class.cs (TypeContainer::Populate): Now define operators too. 
24558         (TypeContainer.Operators): New property to access the list of operators
24559         in a type.
24560         (Operator.OperatorMethodBuilder): New member to hold the method builder
24561         for the operator we are defining.
24562         (Operator::Define): Implement.
24563
24564 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24565
24566         * class.cs (Event::Define): Make the prefixes of the accessor methods
24567         addOn_ and removeOn_ 
24568
24569         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24570         of the location being passed in too. Ideally, this should go later since all
24571         error reporting should be done through the Report object.
24572
24573         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24574         (Populate): Iterate thru the indexers we have and define them too.
24575         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24576         for the get and set accessors.
24577         (Indexer::Define): Implement.
24578
24579 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24580
24581         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24582         my previous implementation, did not work.
24583
24584         * typemanager.cs: Add a couple of missing types (the longs).
24585
24586         * literal.cs: Use TypeManager.bool_type instead of getting it.
24587
24588         * expression.cs (EventExpr): New kind of expressions.
24589         (Expressio::ExprClassFromMemberInfo): finish
24590
24591 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24592
24593         * assign.cs: Emit stores to static fields differently.
24594
24595 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24596
24597         * Merge in changes and adjust code to tackle conflicts. Backed out my
24598         code in Assign::Resolve ;-) 
24599
24600 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24601
24602         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24603         instead Report.Error and also pass in the location.
24604         (CSharpParser::Lexer): New readonly property to return the reference
24605         to the Tokenizer object.
24606         (declare_local_variables): Use Report.Error with location instead of plain 
24607         old error.
24608         (CheckDef): Ditto.
24609
24610         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24611         (Operator.CheckBinaryOperator): Ditto.
24612
24613         * cs-parser.jay (operator_declarator): Update accordingly.
24614
24615         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24616         (CheckBinaryOperator): Same here.
24617
24618         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24619         on the name without any prefixes of namespace names etc. This is because we
24620         already might have something already fully qualified like 
24621         'System.Console.WriteLine'
24622
24623         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24624
24625 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24626
24627         * cs-tokenizer.cs (location): Return a string which also contains
24628         the file name.
24629
24630         * expression.cs (ElementAccess): New class for expressions of the
24631         type 'element access.'
24632         (BaseAccess): New class for expressions of the type 'base access.'
24633         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24634         respectively.
24635
24636         * cs-parser.jay (element_access): Implement action.
24637         (base_access): Implement actions.
24638         (checked_expression, unchecked_expression): Implement.
24639
24640         * cs-parser.jay (local_variable_type): Correct and implement.
24641         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24642
24643         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24644
24645         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24646         name and the specifiers.
24647
24648         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24649
24650         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24651         making them all public ;-)
24652
24653         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24654         class anyways.
24655
24656 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24657
24658         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24659         PropertyExprs.
24660         (FieldExpr, PropertyExprs): New resolved expressions.
24661         (SimpleName::MemberStaticCheck): Perform static checks for access
24662         to non-static fields on static methods. Maybe this should be
24663         generalized for MemberAccesses. 
24664         (SimpleName::ResolveSimpleName): More work on simple name
24665         resolution. 
24666
24667         * cs-parser.jay (primary_expression/qualified_identifier): track
24668         the parameter index.
24669
24670         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24671         (EmitContext::EmitBoolExpression): Chain to expression generation
24672         instead of temporary hack.
24673         (::EmitStatementExpression): Put generic expression code generation.
24674
24675         * assign.cs (Assign::Emit): Implement variable assignments to
24676         local variables, parameters and fields.
24677
24678 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24679
24680         * statement.cs (Block::GetVariableInfo): New method, returns the
24681         VariableInfo for a variable name in a block.
24682         (Block::GetVariableType): Implement in terms of GetVariableInfo
24683
24684         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24685         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24686
24687 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24688
24689         * cs-parser.jay (operator_declaration): Continue on my quest : update
24690         to take attributes argument.
24691         (event_declaration): Ditto.
24692         (enum_declaration): Ditto.
24693         (indexer_declaration): Ditto.
24694
24695         * class.cs (Operator::Operator): Update constructor accordingly.
24696         (Event::Event): Ditto.
24697
24698         * delegate.cs (Delegate::Delegate): Same here.
24699
24700         * enum.cs (Enum::Enum): Same here.
24701
24702 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24703
24704         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24705
24706         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24707
24708         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24709         being passed around as an arraylist.
24710         (Attributes::AddAttribute): Method to add attribute sections.
24711
24712         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24713         (struct_declaration): Update accordingly.
24714         (constant_declaration): Update.
24715         (field_declaration): Update.
24716         (method_header): Update.
24717         (fixed_parameter): Update.
24718         (parameter_array): Ditto.
24719         (property_declaration): Ditto.
24720         (destructor_declaration): Ditto.
24721
24722         * class.cs (Struct::Struct): Update constructors accordingly.
24723         (Class::Class): Ditto.
24724         (Field::Field): Ditto.
24725         (Method::Method): Ditto.
24726         (Property::Property): Ditto.
24727         (TypeContainer::OptAttribute): update property's return type.
24728
24729         * interface.cs (Interface.opt_attributes): New member.
24730         (Interface::Interface): Update to take the extra Attributes argument.
24731
24732         * parameter.cs (Parameter::Parameter): Ditto.
24733
24734         * constant.cs (Constant::Constant): Ditto.
24735
24736         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24737         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24738         the attributes as a parameter.
24739         (InterfaceProperty): Update constructor call.
24740         (InterfaceEvent): Ditto.
24741         (InterfaceMethod): Ditto.
24742         (InterfaceIndexer): Ditto.
24743
24744         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24745         pass the attributes too.
24746         (interface_event_declaration): Ditto.
24747         (interface_property_declaration): Ditto.
24748         (interface_method_declaration): Ditto.
24749         (interface_declaration): Ditto.
24750
24751 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24752
24753         * class.cs (Method::Define): Track the "static Main" definition to
24754         create an entry point. 
24755
24756         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24757         EntryPoint if we find it. 
24758
24759         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24760         (EmitContext::ig): Make this variable public.
24761
24762         * driver.cs: Make the default output file be the first file name
24763         with the .exe extension.  
24764
24765         Detect empty compilations
24766
24767         Handle various kinds of output targets.  Handle --target and
24768         rename -t to --dumper.
24769
24770         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24771         methods inherited from Expression return now an Expression.  This
24772         will is used during the tree rewriting as we resolve them during
24773         semantic analysis.
24774
24775         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24776         the spec.  Missing entirely is the information about
24777         accessability of elements of it.
24778
24779         (Expression::ExprClassFromMemberInfo): New constructor for
24780         Expressions that creates a fully initialized Expression based on
24781         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24782         a Type.
24783
24784         (Invocation::Resolve): Begin implementing resolution of invocations.
24785
24786         * literal.cs (StringLiteral):  Implement Emit.
24787
24788 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24789
24790         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24791         member.
24792
24793 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24794
24795         * cs-parser.jay (attribute_arguments): Implement actions.
24796         (attribute): Fix bug in production. Implement action.
24797         (attribute_list): Implement.
24798         (attribute_target): Implement.
24799         (attribute_target_specifier, opt_target_specifier): Implement
24800         (CheckAttributeTarget): New method to check if the attribute target
24801         is valid.
24802         (attribute_section): Implement.
24803         (opt_attributes): Implement.
24804
24805         * attribute.cs : New file to handle attributes.
24806         (Attribute): Class to hold attribute info.
24807
24808         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24809         (attribute_section): Modify production to use 2 different rules to 
24810         achieve the same thing. 1 s/r conflict down !
24811         Clean out commented, useless, non-reducing dimension_separator rules.
24812
24813         * class.cs (TypeContainer.attributes): New member to hold list
24814         of attributes for a type.
24815         (Struct::Struct): Modify to take one more argument, the attribute list.
24816         (Class::Class): Ditto.
24817         (Field::Field): Ditto.
24818         (Method::Method): Ditto.
24819         (Property::Property): Ditto.
24820
24821         * cs-parser.jay (struct_declaration): Update constructor call to
24822         pass in the attributes too.
24823         (class_declaration): Ditto.
24824         (constant_declaration): Ditto.
24825         (field_declaration): Ditto.
24826         (method_header): Ditto.
24827         (fixed_parameter): Ditto.
24828         (parameter_array): Ditto.
24829         (property_declaration): Ditto.
24830
24831         * constant.cs (Constant::Constant): Update constructor similarly.
24832         Use System.Collections.
24833
24834         * parameter.cs (Parameter::Parameter): Update as above.
24835
24836 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24837
24838         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24839         (TypeContainer.delegates): New member to hold list of delegates.
24840
24841         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24842         this time as I seem to be on crack ;-)
24843
24844 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24845
24846         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24847         tell whether an identifier represents a namespace.
24848
24849         * expression.cs (NamespaceExpr): A namespace expression, used only
24850         temporarly during expression resolution.
24851         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24852         utility functions to resolve names on expressions.
24853
24854 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24855
24856         * codegen.cs: Add hook for StatementExpressions. 
24857
24858         * class.cs: Fix inverted test for static flag in methods.
24859
24860 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24861
24862         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24863         to make it coincide with MS' number.
24864         (Operator::CheckBinaryOperator): Ditto.
24865
24866         * ../errors/errors.txt : Remove error numbers added earlier.
24867
24868         * ../errors/cs1019.cs : Test case for error # 1019
24869
24870         * ../errros/cs1020.cs : Test case for error # 1020
24871
24872         * cs-parser.jay : Clean out commented cruft.
24873         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24874         used anywhere - non-reducing rule.
24875         (namespace_declarations): Non-reducing rule - comment out.
24876
24877         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24878         with TypeContainer::AddEnum.
24879
24880         * delegate.cs : New file for delegate handling classes.
24881         (Delegate): Class for declaring delegates.
24882
24883         * makefile : Update.
24884
24885         * cs-parser.jay (delegate_declaration): Implement.
24886
24887 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24888
24889         * class.cs (Event::Define): Implement.
24890         (Event.EventBuilder): New member.
24891
24892         * class.cs (TypeContainer::Populate): Update to define all enums and events
24893         we have.
24894         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24895         readonly fields for all these cases ?
24896
24897 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24898
24899         * class.cs (Property): Revamp to use the convention of making fields readonly.
24900         Accordingly modify code elsewhere.
24901
24902         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24903         the Define method of the Property class.
24904
24905         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24906         trivial bug.
24907         (TypeContainer::Populate): Update to define all the properties we have. Also
24908         define all enumerations.
24909
24910         * enum.cs (Define): Implement.
24911
24912 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24913
24914         * cs-parser.jay (overloadable_operator): The semantic value is an
24915         enum of the Operator class.
24916         (operator_declarator): Implement actions.
24917         (operator_declaration): Implement.
24918
24919         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24920         validity of definitions.
24921         (Operator::CheckBinaryOperator): Static method to check for binary operators
24922         (TypeContainer::AddOperator): New method to add an operator to a type.
24923
24924         * cs-parser.jay (indexer_declaration): Added line to actually call the
24925         AddIndexer method so it gets added ;-)
24926
24927         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24928         already taken care of by the MS compiler ?  
24929
24930 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24931
24932         * class.cs (Operator): New class for operator declarations.
24933         (Operator::OpType): Enum for the various operators.
24934
24935 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24936
24937         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24938         ostensibly handle this in semantic analysis.
24939
24940         * cs-parser.jay (general_catch_clause): Comment out
24941         (specific_catch_clauses, specific_catch_clause): Ditto.
24942         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24943         (catch_args, opt_catch_args): New productions.
24944         (catch_clause): Rewrite to use the new productions above
24945         (catch_clauses): Modify accordingly.
24946         (opt_catch_clauses): New production to use in try_statement
24947         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24948         and re-write the code in the actions to extract the specific and
24949         general catch clauses by being a little smart ;-)
24950
24951         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24952         Hooray, try and catch statements parse fine !
24953
24954 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24955
24956         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24957         string from the hashtable of variables.
24958
24959         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24960         I end up making that mistake ;-)
24961         (catch_clauses): Fixed gross error which made Key and Value of the 
24962         DictionaryEntry the same : $1 !!
24963
24964 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24965
24966         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24967
24968         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24969         when the add and remove accessors are specified. 
24970
24971 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24972
24973         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24974         information about indexer_declarator.
24975         (indexer_declarator): Implement actions.
24976         (parsing_indexer): New local boolean used to keep track of whether
24977         we are parsing indexers or properties. This is necessary because 
24978         implicit_parameters come into picture even for the get accessor in the 
24979         case of an indexer.
24980         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24981
24982         * class.cs (Indexer): New class for indexer declarations.
24983         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24984         (TypeContainer::indexers): New member to hold list of indexers for the
24985         type.
24986
24987 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24988
24989         * cs-parser.jay (add_accessor_declaration): Implement action.
24990         (remove_accessor_declaration): Implement action.
24991         (event_accessors_declaration): Implement
24992         (variable_declarators): swap statements for first rule - trivial.
24993
24994         * class.cs (Event): New class to hold information about event
24995         declarations.
24996         (TypeContainer::AddEvent): New method to add an event to a type
24997         (TypeContainer::events): New member to hold list of events.
24998
24999         * cs-parser.jay (event_declaration): Implement actions.
25000
25001 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25002
25003         * cs-parser.jay (dim_separators): Implement. Make it a string
25004         concatenating all the commas together, just as they appear.
25005         (opt_dim_separators): Modify accordingly
25006         (rank_specifiers): Update accordingly. Basically do the same
25007         thing - instead, collect the brackets here.
25008         (opt_rank_sepcifiers): Modify accordingly.
25009         (array_type): Modify to actually return the complete type string
25010         instead of ignoring the rank_specifiers.
25011         (expression_list): Implement to collect the expressions
25012         (variable_initializer): Implement. We make it a list of expressions
25013         essentially so that we can handle the array_initializer case neatly too.
25014         (variable_initializer_list): Implement.
25015         (array_initializer): Make it a list of variable_initializers
25016         (opt_array_initializer): Modify accordingly.
25017
25018         * expression.cs (New::NType): Add enumeration to help us
25019         keep track of whether we have an object/delegate creation
25020         or an array creation.
25021         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25022         members to hold data about array creation.
25023         (New:New): Modify to update NewType
25024         (New:New): New Overloaded contructor for the array creation
25025         case.
25026
25027         * cs-parser.jay (array_creation_expression): Implement to call
25028         the overloaded New constructor.
25029
25030 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25031
25032         * class.cs (TypeContainer::Constructors): Return member
25033         constructors instead of returning null.
25034
25035 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25036
25037         * typemanager.cs (InitCoreTypes): Initialize the various core
25038         types after we have populated the type manager with the user
25039         defined types (this distinction will be important later while
25040         compiling corlib.dll)
25041
25042         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25043         on Expression Classification.  Now all expressions have a method
25044         `Resolve' and a method `Emit'.
25045
25046         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25047         generation from working.     Also add some temporary debugging
25048         code. 
25049
25050 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25051
25052         * codegen.cs: Lots of code generation pieces.  This is only the
25053         beginning, will continue tomorrow with more touches of polish.  We
25054         handle the fundamentals of if, while, do, for, return.  Others are
25055         trickier and I need to start working on invocations soon.
25056
25057         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25058         s.InitStatement. 
25059
25060         * codegen.cs (EmitContext): New struct, used during code
25061         emission to keep a context.   Most of the code generation will be
25062         here. 
25063
25064         * cs-parser.jay: Add embedded blocks to the list of statements of
25065         this block.  So code generation proceeds in a top down fashion.
25066
25067 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25068
25069         * statement.cs: Add support for multiple child blocks.
25070
25071 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25072
25073         * codegen.cs (EmitCode): New function, will emit the code for a
25074         Block of code given a TypeContainer and its ILGenerator. 
25075
25076         * statement.cs (Block): Standard public readonly optimization.
25077         (Block::Block constructors): Link children. 
25078         (Block::Child): Child Linker.
25079         (Block::EmitVariables): Emits IL variable declarations.
25080
25081         * class.cs: Drop support for MethodGroups here, delay until
25082         Semantic Analysis.
25083         (Method::): Applied the same simplification that I did before, and
25084         move from Properties to public readonly fields.
25085         (Method::ParameterTypes): Returns the parameter types for the
25086         function, and implements a cache that will be useful later when I
25087         do error checking and the semantic analysis on the methods is
25088         performed.
25089         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25090         and made a method, optional argument tells whether this is a class
25091         or a structure to apply the `has-this' bit.
25092         (Method::GetCallingConvention): Implement, returns the calling
25093         convention. 
25094         (Method::Define): Defines the type, a second pass is performed
25095         later to populate the methods.
25096
25097         (Constructor::ParameterTypes): implement a cache similar to the
25098         one on Method::ParameterTypes, useful later when we do semantic
25099         analysis. 
25100
25101         (TypeContainer::EmitMethod):  New method.  Emits methods.
25102
25103         * expression.cs: Removed MethodGroup class from here.
25104
25105         * parameter.cs (Parameters::GetCallingConvention): new method.
25106
25107 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25108
25109         * class.cs (TypeContainer::Populate): Drop RootContext from the
25110         argument. 
25111
25112         (Constructor::CallingConvention): Returns the calling convention.
25113         (Constructor::ParameterTypes): Returns the constructor parameter
25114         types. 
25115
25116         (TypeContainer::AddConstructor): Keep track of default constructor
25117         and the default static constructor.
25118
25119         (Constructor::) Another class that starts using `public readonly'
25120         instead of properties. 
25121
25122         (Constructor::IsDefault): Whether this is a default constructor. 
25123
25124         (Field::) use readonly public fields instead of properties also.
25125
25126         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25127         track of static constructors;  If none is used, turn on
25128         BeforeFieldInit in the TypeAttributes. 
25129
25130         * cs-parser.jay (opt_argument_list): now the return can be null
25131         for the cases where there are no arguments. 
25132
25133         (constructor_declarator): If there is no implicit `base' or
25134         `this', then invoke the default parent constructor. 
25135
25136         * modifiers.cs (MethodAttr): New static function maps a set of
25137         modifiers flags into a MethodAttributes enum
25138         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25139         MethodAttr, TypeAttr to represent the various mappings where the
25140         modifiers are used.
25141         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25142
25143 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25144
25145         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25146         method arguments.
25147
25148         * interface.cs (PopulateIndexer): Implemented the code generator
25149         for interface indexers.
25150
25151 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25152
25153         * interface.cs (InterfaceMemberBase): Now we track the new status
25154         here.  
25155
25156         (PopulateProperty): Implement property population.  Woohoo!  Got
25157         Methods and Properties going today. 
25158
25159         Removed all the properties for interfaces, and replaced them with
25160         `public readonly' fields. 
25161
25162 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25163
25164         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25165         initialize their hashtables/arraylists only when they are needed
25166         instead of doing this always.
25167
25168         * parameter.cs: Handle refs and out parameters.
25169
25170         * cs-parser.jay: Use an ArrayList to construct the arguments
25171         instead of the ParameterCollection, and then cast that to a
25172         Parameter[] array.
25173
25174         * parameter.cs: Drop the use of ParameterCollection and use
25175         instead arrays of Parameters.
25176
25177         (GetParameterInfo): Use the Type, not the Name when resolving
25178         types. 
25179
25180 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25181
25182         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25183         and instead use public readonly fields.
25184
25185         * class.cs: Put back walking code for type containers.
25186
25187 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25188
25189         * class.cs (MakeConstant): Code to define constants.
25190
25191         * rootcontext.cs (LookupType): New function.  Used to locate types 
25192
25193
25194 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25195
25196         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25197         this System.Reflection code is.  Kudos to Microsoft
25198
25199         * typemanager.cs: Implement a type cache and avoid loading all
25200         types at boot time.  Wrap in LookupType the internals.  This made
25201         the compiler so much faster.  Wow.  I rule!
25202
25203         * driver.cs: Make sure we always load mscorlib first (for
25204         debugging purposes, nothing really important).
25205
25206         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25207         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25208
25209         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25210         on namespaces that have been imported using the `using' keyword.
25211
25212         * class.cs (TypeContainer::TypeAttr): Virtualize.
25213         (Class::TypeAttr): Return attributes suitable for this bad boy.
25214         (Struct::TypeAttr): ditto.
25215         Handle nested classes.
25216         (TypeContainer::) Remove all the type visiting code, it is now
25217         replaced with the rootcontext.cs code
25218
25219         * rootcontext.cs (GetClassBases): Added support for structs. 
25220
25221 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25222
25223         * interface.cs, statement.cs, class.cs, parameter.cs,
25224         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25225         Drop use of TypeRefs, and use strings instead.
25226
25227 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25228
25229         * rootcontext.cs: 
25230
25231         * class.cs (Struct::Struct): set the SEALED flags after
25232         checking the modifiers.
25233         (TypeContainer::TypeAttr): new property, returns the
25234         TypeAttributes for a class.  
25235
25236         * cs-parser.jay (type_list): Oops, list production was creating a
25237         new list of base types.
25238
25239         * rootcontext.cs (StdLib): New property.
25240         (GetInterfaceTypeByName): returns an interface by type name, and
25241         encapsulates error handling here.
25242         (GetInterfaces): simplified.
25243         (ResolveTree): Encapsulated all the tree resolution here.
25244         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25245         types. 
25246
25247         * driver.cs: Add support for --nostdlib, to avoid loading the
25248         default assemblies.
25249         (Main): Do not put tree resolution here. 
25250
25251         * rootcontext.cs: Beginning of the class resolution.
25252
25253 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25254
25255         * rootcontext.cs: Provide better error reporting. 
25256
25257         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25258
25259         * rootcontext.cs (CreateInterface): Handle the case where there
25260         are no parent interfaces.
25261
25262         (CloseTypes): Routine to flush types at the end.
25263         (CreateInterface): Track types.
25264         (GetInterfaces): Returns an array of Types from the list of
25265         defined interfaces.
25266
25267         * typemanager.c (AddUserType): Mechanism to track user types (puts
25268         the type on the global type hash, and allows us to close it at the
25269         end). 
25270
25271 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25272
25273         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25274         RecordInterface instead.
25275
25276         * cs-parser.jay: Updated to reflect changes above.
25277
25278         * decl.cs (Definition): Keep track of the TypeBuilder type that
25279         represents this type here.  Not sure we will use it in the long
25280         run, but wont hurt for now.
25281
25282         * driver.cs: Smaller changes to accomodate the new code.
25283
25284         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25285         when done. 
25286
25287         * rootcontext.cs (CreateInterface):  New method, used to create
25288         the System.TypeBuilder type for interfaces.
25289         (ResolveInterfaces): new entry point to resolve the interface
25290         hierarchy. 
25291         (CodeGen): Property, used to keep track of the code generator.
25292
25293 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25294
25295         * cs-parser.jay: Add a second production for delegate_declaration
25296         with `VOID'.
25297
25298         (enum_body): Put an opt_comma here instead of putting it on
25299         enum_body or enum_member_declarations so we can handle trailing
25300         commas on enumeration members.  Gets rid of a shift/reduce.
25301
25302         (type_list): Need a COMMA in the middle.
25303
25304         (indexer_declaration): Tell tokenizer to recognize get/set
25305
25306         * Remove old targets.
25307
25308         * Re-add the parser target.
25309
25310 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25311
25312         * cs-parser.jay: Add precendence rules for a number of operators
25313         ot reduce the number of shift/reduce conflicts in the grammar.
25314
25315 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25316
25317         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25318         and put it here.
25319
25320         Get rid of old crufty code.
25321
25322         * rootcontext.cs: Use this to keep track of the parsed
25323         representation and the defined types available to the program. 
25324
25325         * gen-treedump.cs: adjust for new convention.
25326
25327         * type.cs: Split out the type manager, and the assembly builder
25328         from here. 
25329
25330         * typemanager.cs: the type manager will live here now.
25331
25332         * cil-codegen.cs: And the code generator here. 
25333
25334 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25335
25336         * makefile: Fixed up for easy making.
25337
25338 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25339
25340         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25341         the 
25342
25343         (unary_expression): Expand pre_increment_expression and
25344         post_decrement_expression to reduce a shift/reduce.
25345
25346 2001-07-11  Simon Cozens
25347
25348         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25349
25350         Improve allow_keyword_as_indent name.
25351
25352 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25353
25354         * Adjustments for Beta2. 
25355
25356 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25357
25358         * decl.cs: Added `Define' abstract method.
25359         (InTransit): new property, used to catch recursive definitions. 
25360
25361         * interface.cs: Implement `Define'. 
25362
25363         * modifiers.cs: Map Modifiers.constants to
25364         System.Reflection.TypeAttribute flags.
25365
25366         * class.cs: Keep track of types and user-defined types.
25367         (BuilderInit): New method for creating an assembly
25368         (ResolveType): New function to launch the resolution process, only
25369         used by interfaces for now.
25370
25371         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25372         that are inserted into the name space. 
25373
25374 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25375
25376         * ARGH.  I have screwed up my tree so many times due to the use of
25377         rsync rather than using CVS.  Going to fix this at once. 
25378
25379         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25380         load types.
25381
25382 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25383
25384         * Experiment successful: Use System.Type rather that our own
25385         version of Type.  
25386
25387 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25388
25389         * cs-parser.jay: Removed nsAliases from here.
25390
25391         Use new namespaces, handle `using XXX;' 
25392
25393         * namespace.cs: Reimplemented namespace handling, use a recursive
25394         definition of the class.  Now we can keep track of using clauses
25395         and catch invalid using clauses.
25396
25397 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25398
25399         * gen-treedump.cs: Adapted for all the renaming.
25400
25401         * expression.cs (Expression): this class now has a Type property
25402         which returns an expression Type.
25403
25404         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25405         `Type', as this has a different meaning now in the base
25406
25407 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25408
25409         * interface.cs, class.cs: Removed from all the sources the
25410         references to signature computation, as we can not do method
25411         signature computation during the parsing time, as we are not
25412         trying to solve at that point distinguishing:
25413
25414         class X {
25415                 void a (Blah x) {}
25416                 void a (NS.Blah x) {}
25417         }
25418
25419         Which depending on the context might be valid or not, as we do not
25420         know if Blah is the same thing as NS.Blah at that point.
25421
25422         * Redid everything so the code uses TypeRefs now instead of
25423         Types.  TypeRefs are just temporary type placeholders, that need
25424         to be resolved.  They initially have a pointer to a string and the
25425         current scope in which they are used.  This is used later by the
25426         compiler to resolve the reference to an actual Type. 
25427
25428         * DeclSpace is no longer a CIR.Type, and neither are
25429         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25430         are all DeclSpaces, but no Types. 
25431
25432         * type.cs (TypeRefManager): This implements the TypeRef manager,
25433         which keeps track of all the types that need to be resolved after
25434         the parsing has finished. 
25435
25436 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25437
25438         * ARGH.  We are going to have to store `foreach' as a class rather
25439         than resolving it, as we need to verify error 1579 after name
25440         resolution.   *OR* we could keep a flag that says `This request to
25441         IEnumerator comes from a foreach statement' which we can then use
25442         to generate the error.
25443
25444 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25445
25446         * class.cs (TypeContainer.AddMethod): we now add methods to the
25447         MethodGroup instead of the method hashtable.  
25448
25449         * expression.cs: Add MethodGroup abstraction, which gets us one
25450         step closer to the specification in the way we handle method
25451         declarations.  
25452
25453         * cs-parser.jay (primary_expression): qualified_identifier now
25454         tried to match up an identifier to a local variable reference or
25455         to a parameter reference.
25456
25457         current_local_parameters is now a parser global variable that
25458         points to the current parameters for the block, used during name
25459         lookup.
25460
25461         (property_declaration): Now creates an implicit `value' argument to
25462         the set accessor.
25463
25464 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25465
25466         * parameter.cs: Do not use `param' arguments as part of the
25467         signature, per the spec.
25468
25469 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25470
25471         * decl.cs: Base class for classes, structs and interfaces.  This
25472         is the "Declaration Space" 
25473
25474         * cs-parser.jay: Use CheckDef for checking declaration errors
25475         instead of having one on each function.
25476
25477         * class.cs: Factor out some code for handling error handling in
25478         accordance to the "Declarations" section in the "Basic Concepts"
25479         chapter in the ECMA C# spec.
25480
25481         * interface.cs: Make all interface member classes derive from
25482         InterfaceMemberBase.
25483
25484 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25485
25486         * Many things: all interfaces are parsed and generated in
25487         gen-treedump.  Support for member variables, constructors,
25488         destructors, properties, constants is there.
25489
25490         Beginning of the IL backend, but very little done, just there for
25491         testing purposes. 
25492
25493 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25494
25495         * cs-parser.jay: Fix labeled statement.
25496
25497         * cs-tokenizer.cs (escape): Escape " and ' always.
25498         ref_line, ref_name: keep track of the line/filename as instructed
25499         by #line by the compiler.
25500         Parse #line.
25501
25502 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25503
25504         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25505         to match the values in System.CodeDOM.
25506
25507         Divid renamed to Divide.
25508
25509         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25510         statements. 
25511         (Statements.set): remove.
25512
25513         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25514         statements. 
25515
25516         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25517         falseStatements always have valid values. 
25518
25519         * cs-parser.jay: Use System.CodeDOM now.
25520