2006-04-01 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2
3         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
4         in an embedded statement too.
5
6 2006-04-01  Raja R Harinath  <rharinath@novell.com>
7
8         Fix #77929
9         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
10         testing.
11
12         Fix #77958
13         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
14
15         Fix #77962
16         * report.cs (SymbolRelatedToPreviousError): Drop generic type
17         arguments before checking whether a type is reflected or not.
18
19         Fix #77954
20         * expression.cs (Invocation.IsApplicable): Ensure a generic method
21         definition doesn't take part in overload resolution.
22         (Invocation.IsParamsMethodApplicable): Likewise.
23         (Invocation.OverloadResolve): When replacing a reflected override
24         method with its base definition, ensure that type arguments are
25         applied.
26
27 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
28
29         A fix for #77966.
30
31         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
32         was not specified.
33
34         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
35
36 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
37
38         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
39         phase.
40
41         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
42         LocalTemporary change.
43
44         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
45         TypeContainer.
46         (ClassOrStruct.DefineFieldInitializers): Implemented static field
47         initializers optimization.
48         (ClassOrStruct.TypeAttr): Moved from modifiers.
49         (Constructor.CheckBase): Don't crash when static ctor has parameters.
50         (FieldBase.ResolveInitializer): Resolves initializer.
51         (FieldBase.HasDefaultInitializer): New property.
52
53         * cs-parser.jay: Removed message.
54
55         * expression.cs (CompilerGeneratedThis): New specialization.
56
57         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
58
59 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
60
61         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
62
63 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
64
65         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
66         be now EnumConstants only.
67
68 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
69
70         * attribute.cs, driver.cs: Reset more caches.
71
72 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
73
74         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
75
76 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
77
78         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
79         for easier reuse. Updated all overrides.
80         (IntegralConstant): New base class for all integral constants.
81         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
82         of the constant range, report custom error.
83         (UIntConstant.Reduce): Fixed uint conversion.
84
85         * ecore.cs, literal.cs: Reduce updates.
86
87 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
88
89         A fix for #75813.
90
91         * class.cs (Constructor.Define): Removed extra if for default ctors.
92         A patch from Atsushi Enomoto.
93
94 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
95
96         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
97         GetAttributableValue.
98
99         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
100         when required.
101
102         * convert.cs (ImplicitConversionRequired): Error message moved to
103         DoubleLiteral.
104
105         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
106         automatic implicit conversion of an output value.
107         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
108
109         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
110         conversion.
111         (TypeOf.GetAttributableValue): Add extra handling for object type.
112
113         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
114         special error message.
115
116 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
117
118         * class.cs (Constructor.Emit): Don't crash when struct ctor is
119         InternalCall.
120         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
121         compatible with MS runtime.
122
123 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
124
125         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
126         attribute arguments here.
127
128         * class.cs (Indexer.Define): The check was moved to attribute class.
129
130 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
131
132         * expression.cs (StringConcat.Append): Reverted back to no warning state.
133
134 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
135
136         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
137
138         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
139         the blocks too.
140
141 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
142
143         * doc-bootstrap.cs : fix build.
144
145 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
146
147         * expression.cs (StringConcat.Append): Issue a warning when empty string
148         is going to append.
149
150 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
151
152         * assign.cs (CompoundAssign.ResolveSource): Removed.
153
154         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
155         clean up.
156
157         * class.cs (TypeContainer.FindMethods): Removed.
158         (TypeContainer.CheckMemberUsage): Made static.
159
160         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
161
162         * constant.cs (CheckRange): Removed unused type argument.
163         (CheckUnsigned): Removed unused type argument.
164
165         * cs-parser.jay: Updated after MemberAccess clean up.
166         Uses Length for empty string test.
167
168         * cs-tokenizer.cs: Uses Length for empty string test.
169         (IsCastToken): Made static.
170         (is_hex): Made static.
171         (real_type_suffix): Made static.
172
173         * decl.cs (SetupCache): Made static.
174         (OnGenerateDocComment): Removed unused ds argument.
175
176         * delegate.cs (VerifyDelegate): Removed unused argument.
177
178         * doc.cs: Uses Length for empty string test.
179
180         * driver.cs: Uses Length for empty string test.
181
182         * enum.cs (IsValidEnumType): Made static
183
184         * expression.cs (EnumLiftUp): Removed unused argument.
185         (ResolveMethodGroup): Ditto.
186         (BetterConversion): Ditto.
187         (GetVarargsTypes): Ditto.
188         (UpdateIndices): Ditto.
189         (ValidateInitializers): Ditto.
190         (MemberAccess.ctor): Ditto.
191         (GetIndexersForType): Ditto.
192
193         * flowanalysis.cs: (MergeFinally): Removed unused argument.
194
195         * iterators.cs: Updated after MemberAccess clean up.
196
197         * location.cs: Uses Length for empty string test.
198
199         * namespace.cs: Uses Length for empty string test.
200
201          * report.cs (CheckWarningCode): Made static.
202
203         * statement.cs (LabeledStatement): Removed unused argument.
204
205         * typemanager.cs (FilterNone): Removed.
206
207 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
208
209         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
210         obsolete.
211
212         * class.cs: Updated.
213
214 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
215
216         * cs-parser.jay.cs: __arglist is not allowed for delegates.
217
218 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
219
220         A fix for #77816.
221
222         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
223         host container.
224         (AnonymousMethod.ImplicitStandardConversionExists): New method.
225         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
226         Add more error reporting; Fixed issue with params.
227
228         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
229
230         * cs-parser.jay: AnonymousMethod requires host container.
231
232         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
233
234 2006-03-18  Raja R Harinath  <harinath@gmail.com>
235
236         * class.cs: Change 'TypeContainer ds' constructor argument to
237         'DeclSpace parent'.  Some classes were missed below due to
238         different naming convention.
239
240         * class.cs (MemberCore.Parent): Delete.  This makes the
241         ParentContainer changes below enforceable by the compiler.
242
243         Treat pointers to enclosing declaration space as 'DeclSpace', not
244         'TypeContainer'.
245         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
246         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
247
248         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
249         of TypeContainer.
250         (Block.AddThisVariable): Likewise.
251         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
252         (AbstractPropertyEventMethod.Emit): Likewise.
253         (AbstractPropertyEventMethod.EmitMethod): Likewise.
254         (GetMethod.Define, SetMethod.Define): Likewise.
255         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
256         (DelegateMethod.EmitMethod): Likewise.
257
258         Fix regression test-partial-13.cs.
259         Rationalize use of PartialContainer.  Ensure that the partial
260         class semantics can be tied to type-correctness, i.e., any
261         violation will cause a compile error.
262         * class.cs, const.cs: Access all fields that belong to class
263         TypeContainer via ParentContainer.  Arguments of EmitContexts and
264         Resolve()-like functions still use 'Parent'.
265
266         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
267         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
268         (PropertyMethod.CheckModifiers): Remove unused argument.
269         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
270         DeclSpace.
271
272 2006-03-28  Raja R Harinath  <rharinath@novell.com>
273
274         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
275
276 2006-03-17  Raja R Harinath  <harinath@gmail.com>
277
278         Make semantics of PartialContainer simpler.
279         * decl.cs (DeclSpace.IsPartial): Remove.
280         * class.cs (TypeContainer.IsPartial): Likewise.
281         (TypeContainer..ctor): Set PartialContainer to point to self.
282         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
283         (TypeContainer.FindNestedType): Likewise.
284         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
285
286 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
287
288         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
289
290 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
291
292         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
293         classes.
294
295 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
296
297         * class.cs (Operator.Define): An error for base conversion was not
298         reported correctly.
299
300 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
301
302         A fix for #77593, #77574.
303
304         * class.cs (MethodCore.CheckBase): Another if for operator.
305
306 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
307
308         A fix for #77822.
309
310         * expression.cs (VerifyArgumentsCompat): Reverted to double error
311         reporting, it's more tricky than I thought.
312
313 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
314
315         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
316         were not resolved
317
318         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
319         (DelegateCreation.ImplicitStandardConversionExists): New method for just
320         conversion test.
321         
322         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
323         not needed.
324
325 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
326
327         A fix for #77353.
328
329         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
330         (Event.Define): ditto
331         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
332
333         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
334         Removed redundant code and set NewSlot for Invoke method too.
335
336         * parameter.cs (Parameters.ctor): Add custom, type ctor.
337         (Parameters.MergeGenerated): New method. Use this method when you merge
338         compiler generated argument with user arguments.
339
340 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
341
342         * attribute.cs (ResolveAsTypeTerminal): Removed.
343
344         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
345         specialization for predefined types; 30% speed up.
346         Finally placed obsolete check to right place.
347         (Expression.ResolveType): Removed.
348
349         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
350         Updated after ResolveType was removed.
351
352         * expression.cs (Cast.ctor): Check void cast.
353         (Binary.ResolveAsTypeTerminal): Is never type.
354         (Conditional.ResolveAsTypeTerminal): Is never type.
355
356         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
357
358 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
359
360         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
361
362 2006-03-23  Martin Baulig  <martin@ximian.com>
363
364         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
365         type check if either of the types is an open generic type.
366
367 2006-03-23  Martin Baulig  <martin@ximian.com>
368
369         * convert.cs
370         (Convert.ExplicitTypeParameterConversion): New method; implement
371         explicit type parameter conversions.
372
373 2006-03-23  Martin Baulig  <martin@ximian.com>
374
375         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
376         blindly allow all conversions if we do not have any constraints.
377
378 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
379
380         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
381         these two separated members to simplify the code.
382         (Attribute.Resolve): Refactored to use new fields and methods.
383         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
384         implemented obsolete attribute checking.
385         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
386         implemented obsolete checking again. It look line never ending quest ;-)
387         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
388
389         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
390
391         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
392
393         *class.cs (Property.Define): Add RegisterProperty call.
394
395         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
396         argument groups (only 2).
397
398         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
399         encoding expression to arguments.
400         (Expression.ExprClassToResolveFlags): Just turned to property.
401
402         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
403         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
404         optimized as well as implemented support for zero-length attributes.
405
406         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
407         Add caching of PropertyInfo's.
408
409 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
410
411         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
412         error multiple times.
413
414 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
415
416         New partial class implementation.
417         A fix for #77027, #77029, #77403
418
419         * attribute.cs (Attributable): Made attributes protected.
420
421         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
422         the replacements of ClassPart and PartialContainer.
423         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
424         (TypeContainer.AddInterface): Ditto.
425         (TypeContainer.AddPartial): The main method for partial classes. It checks
426         for errors and merges ModFlags and attributes. At the end class is added to
427         partial_parts list.
428         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
429         required here.
430         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
431         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
432         from the rest of partial classes.
433         (TypeContainer.GetClassBases): Simplified.
434         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
435         DefineType.
436         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
437         (TypeContainer.HasExplicitLayout): Uses Flags now.
438         (PartialContainer): Removed.
439         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
440         (StaticClass): Was merged with Class.
441         (Class.GetClassBases): class and static class bases are verified here.
442         (Class.TypeAttr): Added static attributes when class is static.
443         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
444         (MemberBase): In some cases we need to call parent container for partial
445         class. It should be eliminated but it's not easy now.
446
447         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
448
449         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
450         partial classed to accumulate class comments.
451         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
452
453         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
454
455         * driver.cs (MainDriver): Tree.GetDecl was removed.
456
457         * modifiers.cs (Modifiers): Add partial modifier.
458
459         * tree.cs (Tree.decl): Removed.
460         (RootTypes): Started to use this class more often for root types
461         specializations.
462
463 2006-03-23  Raja R Harinath  <rharinath@novell.com>
464
465         * generic.cs (TypeParameter.UpdateConstraints): Update
466         'constraints' if null.
467
468 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
469
470         A fix for #77615
471
472         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
473         external interface does not have an attribute.
474
475 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
476
477         Another prerequisites for new partial classs implementation.
478         
479         * attribute.cs (Attribute.Equal): Implemented.
480         (Attribute.Emit): Changed as attributes can be applied more than twice.
481         (Attributes.Emit): Check for duplicate attributes here.
482
483         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
484         as a parameter, clean-up.
485
486 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
487
488         A fix for #77485
489
490         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
491         contains obsolete attribute check which can in some cases look for base
492         type of current class which is not initialized yet.
493         (TypeContainer.BaseType): Replacement of ptype.
494
495         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
496
497 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
498
499         First of prerequisites for new partial classs implemention.
500         
501         * attribute.cs (Attributable): Extended by ResolveContext;
502         Attributes finally have correct context for resolving in all cases.
503         (AttachTo): Attribute owner is assigned here.
504
505         * codegen.cs (IResolveContext): Introduce new interface to hold
506         all information needed in resolving phase.
507         (EmitContext): Implements IResolveContext; more clean-up needed here.
508         
509         * decl.cs (MemberCore): Implemented IResolveContext.
510
511         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
512         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
513         parameter.cs, statement.cs, tree.cs, typemanager.cs:
514         Refactored to use new IResolveContext instead of EmitContext; cleanup
515
516 2006-03-22  Raja R Harinath  <rharinath@novell.com>
517
518         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
519         mcs to keep code differences small.
520         * attribute.cs (Attribute.GetParameterDefaultValue): New.
521         * typemanager.cs (parameter_default_value_attribute_type): New.
522         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
523         CS1908 check.
524
525 2006-03-22  Martin Baulig  <martin@ximian.com>
526
527         * generic.cs
528         (Nullable.NullableLiteral): Derive from `NullLiteral'.
529
530         * convert.cs
531         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
532         instead of the normal `NullLiteral'.
533
534 2006-03-21  Martin Baulig  <martin@ximian.com>
535
536         Fix #77583.
537         * generic.cs (TypeManager.InferType): If `pt' is a generic
538         parameter, don't check whether `pt == at'.
539
540 2006-03-20  Raja R Harinath  <rharinath@novell.com>
541
542         Fix #77852
543         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
544         (TypeParameter.Resolve): Update to change.
545         (ConstraintChecker.CheckConstraints): Resolve type-argument
546         constraints before use.
547
548 2006-03-16  Martin Baulig  <martin@ximian.com>
549
550         * generic.cs
551         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
552         and don't have any instance constructors, also lookup in the base class.
553         (TypeManager.IsNullableValueType): New public method.
554
555         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
556         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
557         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
558
559         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
560         instead of just TypeManager.IsNullableType() to determine whether
561         a lifted operator exists.
562         (UnaryMutator.DoResolve): Likewise.
563         (Conditional.DoResolve): Likewise.
564         (Binary.DoResolve): A lifted operator only exists if both operands
565         are valuetypes and at least one of them is a nullable type.
566
567 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
568
569         * iterator.cs : yield break is allowed in try statement which has
570           catch clauses. Fixed bug #77767.
571
572 2006-03-12  Martin Baulig  <martin@ximian.com>
573
574         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
575         private IsSignatureEqual() to compare types; see the comment in
576         that method; fixes #77674.
577
578 2006-03-10  Raja R Harinath  <rharinath@novell.com>
579
580         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
581         (Expression.ResolveAsTypeTerminal): Likewise.
582         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
583         * expression.cs, generic.cs, iterators.cs: Likewise.
584         * parameter.cs, statement.cs, typemanager.cs: Likewise.
585
586 2006-03-09  Martin Baulig  <martin@ximian.com>
587
588         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
589         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
590
591 2006-03-09  Martin Baulig  <martin@ximian.com>
592
593         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
594         `prepared' flag is set.
595
596         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
597         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
598         issues; see gtest-254.cs.
599
600 2006-03-07  Martin Baulig  <martin@ximian.com>
601
602         * generic.cs (TypeManager.InferType): Allow infering
603         `IEnumerable<T>' with an array of T; see gtest-251.cs.
604
605 2006-03-06  Martin Baulig  <martin@ximian.com>
606
607         * generic.cs
608         (TypeManager.InferType): Fix gtest-250.cs.
609
610         * typemanager.cs
611         (TypeManager.IsSubclassOf): Also check the base class.
612
613         * expression.cs
614         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
615         fixes gtest-249.cs.
616
617 2006-03-01  Raja R Harinath  <rharinath@novell.com>
618
619         Fix #77679.
620         * expression.cs (ParameterReference.DoResolveBase): Change return
621         type to bool.
622         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
623         Update.
624
625         Fix #77628.
626         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
627
628         Fix #77642.
629         * typemanager.cs (GetFullNameSignature): Don't nullref on
630         protected accessors.
631
632 2006-02-16  Martin Baulig  <martin@ximian.com>
633
634         * generic.cs
635         (TypeManager.GetGenericFieldDefinition): New public method; use it
636         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
637
638 2006-02-14  Martin Baulig  <martin@ximian.com>
639
640         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
641
642 2006-02-14  Martin Baulig  <martin@ximian.com>
643
644         * generic.cs
645         (TypeManager.DropGenericMethodArguments): New public method; don't
646         use GetGenericMethodDefinition() on something which is not a
647         generic method.
648
649 2006-02-14  Martin Baulig  <martin@ximian.com>
650
651         * generic.cs
652         (ConstraintChecker.CheckConstraints): If a type parameter has the
653         `struct' constraint, the type must be a non-nullable valuetype.
654
655 2006-02-10  Martin Baulig  <martin@ximian.com>
656
657         * typemanager.cs
658         (TypeManager.IsOverride): Make this work for instantiated methods
659         in a generic class; fixes #77509.
660         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
661         rather than calling it directly; fixes #77488.  
662
663 2006-02-08  Martin Baulig  <martin@ximian.com>
664
665         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
666         reporting into CheckConstraint() so we can use the correctly
667         instantiated type.
668
669 2006-02-08  Martin Baulig  <martin@ximian.com>
670
671         * expression.cs (BaseAccess): Add support for generic methods.
672
673         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
674         the new MethodGroupExpr.
675
676 2006-02-07  Martin Baulig  <martin@ximian.com>
677
678         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
679         also reference types; fixes #77483.
680
681 2006-02-07  Martin Baulig  <martin@ximian.com>
682
683         * generic.cs
684         (TypeManager.IsGenericMethod): We now return whether something is
685         an instantiated generic method (and not a generic method def).
686         (TypeManager.IsGenericMethodDefinition): New public method.
687
688         * typemanager.cs
689         (TypeManager.CSharpSignature): Only include type arguments for
690         "real" generic methods, not for any instantiated method.
691         (TypeManager.GetMethodName): Likewise, but also allow generic
692         method definitions here.
693
694 2006-02-06  Miguel de Icaza  <miguel@novell.com>
695
696         * codegen.cs (EmitScopeInitFromBlock): check here the
697         capture_context, there is no need to make two calls to the
698         EmitContext. 
699
700         * anonymous.cs: Add some debugging messages that might help me
701         track other instances of this problem in the future (the
702         regression of test 467).
703
704         * cs-parser.jay: track the variable block, as we need to initalize
705         any captured variables declared in this block for the "catch"
706         portion of the "Try" statement.
707
708         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
709         scope initialization for captured variables. 
710
711         Also, move the emit for the variables after the block location has
712         been marked.
713
714 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
715
716        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
717         
718 2006-02-06  Martin Baulig  <martin@ximian.com>
719
720         * class.cs (TypeContainer.DefineType): If we're a struct, pass
721         `TypeManager.value_type' as parent type to
722         ModuleBuilder.DefineType().  Fixes #77358.      
723
724 2006-02-02  Miguel de Icaza  <miguel@novell.com>
725
726         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
727         commit yesterday, the initialization for the roots is necessary.
728         What is not necessary is the scope activation.
729
730 2006-02-02  Raja R Harinath  <rharinath@novell.com>
731
732         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
733         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
734         CS0206 checks.
735         (Argument.Resolve): Remove CS0206 checks.
736
737 2006-02-01  Miguel de Icaza  <miguel@novell.com>
738
739         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
740         scopes for all the roots, the scopes will now be emitted when the
741         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
742
743         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
744         code.  This reduces a lot of existing cruft.
745         
746         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
747         that the ScopeInfo is generated as we enter the scope, not at the
748         time of use, which is what we used to do before.
749
750         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
751         every time a Block is about to be emitted if we have a
752         CaptureContext. 
753
754 2006-02-01  Raja R Harinath  <rharinath@novell.com>
755
756         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
757         attribute for mscorlib too.
758
759         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
760         (Reset): Update.
761         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
762
763         * typemanager.cs (cons_param_array_attribute): Make private.
764         (Reset): Set it to null.
765         (InitCoreHelpers): Don't initialize it.
766         (ConsParamArrayAttribute): New.  Initialize it as needed.
767         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
768
769 2006-01-31  Miguel de Icaza  <miguel@novell.com>
770
771         * expression.cs: There might be errors reported during the
772         selection of applicable methods.  If there are errors, do not
773         continue execution as it will lead the compiler to crash.
774
775 2006-01-30  Miguel de Icaza  <miguel@novell.com>
776
777         * expression.cs: Member access is not allowed on anonymous
778         methods.  Fixes #77402.
779
780 2006-01-30  Raja R Harinath  <rharinath@novell.com>
781
782         Fix #77401
783         * cs-parser.jay (VariableDeclaration): Don't set
784         current_array_type to null.
785         (field_declaration, event_declaration, declaration_statement):
786         Set it to null here.
787
788 2006-01-29  Raja R Harinath  <harinath@gmail.com>
789
790         Fix part of #77397
791         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
792
793 2006-01-28  Raja R Harinath  <harinath@gmail.com>
794
795         * typemanager.cs (GenericParameterPosition): New.
796         * doc.cs: Use it.
797
798 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
799
800         * doc.cs : To process "include" elements, first we should create
801           another list than XmlNodeList, because it could result in node
802           removal, which could result in that the XmlNodeList gives up
803           yielding next node.
804
805 2006-01-25  Miguel de Icaza  <miguel@novell.com>
806
807         * expression.cs: Introduce an error report that we were not
808         catching before.   Gonzalo ran into it.
809
810 2006-01-23  Miguel de Icaza  <miguel@novell.com>
811
812         A fix for bug: #76957
813         
814         * iterators.cs (MoveNextMethod.CreateMethodHost): call
815         ComputeMethodHost before creating the method, this is a new
816         requirement. 
817
818         * anonymous.cs (AnonymousContainer): Now we track all the scopes
819         that this method references (RegisterScope).  The actual scope
820         where the method is hosted is computed with the ComputeMethodHost
821         before we create the method.
822
823         Moved the Deepest routine here.
824
825         (AnonymousContainer.ComputeMethodHost): New routine used to
826         compute the proper ScopeInfo that will host the anonymous method.
827
828         (ScopeInfo): Deal with multiple roots.  The problem was that we
829         did not have a unique root where all ScopeInfos could be hanged
830         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
831         of roots.  
832
833         Remove AdjustMethodScope which is now computed at the end.  Remove
834         LinkScope which did a partial link, instead link all ScopeInfos
835         before code generation from the new "LinkScopes" routine. 
836
837         Simplify all the Add* routines as they no longer need to maintain
838         the tree, they just need to record that they are using variables
839         from a ScopeInfo.
840
841         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
842         routines to produce the forest of ScopeInfo trees.
843
844         * class.cs (TypeContainer.AppendMethod): This is just like
845         AddMethod, but ensures that an interface implementation method
846         (IEnumerable.XXX) is not inserted at the beginning of the queue of
847         methods, but at the end.
848
849         We use this functionality to ensure that the generated MoveNext
850         method in the iterator class is resolved/emitted before the
851         enumerator methods created.   
852
853         This is required because the MoveNext method computes the right
854         ScopeInfo for the method.  And the other methods will eventually
855         need to resolve and fetch information computed from the anonymous
856         method. 
857
858         
859 2006-01-23  Raja R Harinath  <rharinath@novell.com>
860
861         Improve implementation of section 14.4.2.2 (Better function member).
862         * expression.cs (Invocation.MoreSpecific): Compare all type
863         arguments before deciding if one type is more specific than
864         another.  Handle array types too.  Return the more specific type.
865         (Invocation.BetterFunction): Add more tie-breaking rules from
866         section 14.4.2.2.  Perform "more specific" check after
867         other tie-breaking rules.  Compare all parameter types before
868         choosing the "more specific" method.
869
870 2006-01-21  Raja R Harinath  <harinath@gmail.com>
871             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
872
873         Fix rest of #76995.
874         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
875         the 'aliases' hash.
876         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
877         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
878
879 2006-01-18  Martin Baulig  <martin@ximian.com>
880
881         * class.cs (TypeContainer.AddToMemberContainer): Use
882         `symbol.MemberName.MethodName' instead of just `symbol.Name';
883         fixes #77124.
884
885 2006-01-18  Martin Baulig  <martin@ximian.com>
886
887         Fix #76417: a generic class may now have methods which may unify
888         for some type parameter substitutions.
889
890         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
891         for methods which may unify anymore.
892
893         * expression.cs (Invocation.MoreSpecific): New private static
894         method; checks whether one method is more specific than another
895         according to 14.4.2.2 of the spec.
896         (Invocation.BetterFunction): Implement the tie-breaking rules from
897         14.4.2.2 of the spec: if two methods unify for some type parameter
898         substitution, we need to pick the more specific one.
899
900 2006-01-18  Raja R Harinath  <rharinath@novell.com>
901
902         Fix #76656, cs0231-2.cs.
903         * cs-parser.jay (formal_parameter_list): Make error case catch
904         more issues.
905         (parenthesized_expression_0): Add CS1026 check.
906         (invocation_expression): Remove unused { $$ = lexer.Location }.
907
908 2006-01-17  Raja R Harinath  <rharinath@novell.com>
909
910         Fix #76824.
911         * cs-parser.jay (statement_expression): Don't list out the
912         individual statement-expressions.  Convert syntax error into
913         CS0201 check.
914
915 2006-01-16  Raja R Harinath  <rharinath@novell.com>
916
917         Fix #76874.
918         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
919         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
920         CheckIntermediateModification.
921         (FieldExpr.DoResolve): Add new two-argument version that
922         allows us to resolve the InstanceExpression as an lvalue.
923         The one-argument variant is now just a wrapper.
924         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
925         Resolve the lhs as an lvalue if the it has a value type.
926         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
927         from Assign.DoResolve.
928         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
929         resolved as an lvalue.
930         (PropertyExpr.DoResolve): Update.
931         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
932         has a value type.  Move CS1612 check here from
933         CheckIntermediateModification.
934         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
935         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
936         'right_side' of a ResolveLValue on an 'out' argument.
937         (EmptyExpression.LValueMemberAccess): New.  Used as the
938         'right_side' of a propagated ResolveLValue on a value type.
939         (LocalVariableReference.DoResolveBase): Recognize
940         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
941         Add CS1654 check.
942         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
943         EmptyExpression.Null.
944
945 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
946
947         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
948           Type.IsGenericParameter(). Fixed bug #77183.
949         * doc.cs : it is now identical to doc.cs in mcs.
950
951 2006-01-16  Martin Baulig  <martin@ximian.com>
952
953         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
954
955 2006-01-16  Martin Baulig  <martin@ximian.com>
956
957         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
958         ctors; fixes #77250.
959
960 2006-01-12  Miguel de Icaza  <miguel@novell.com>
961
962         This fixes the problem where we used ldfld instead of ldflda to
963         load the "THIS" pointer on captured parameters, when THIS is a
964         value type.  See bug #77205.
965         
966         * iterators.cs (CapturedThisReference.Emit): Pass false to
967         EmitThis (we do not need the address).
968
969         * codegen.cs (EmitThis): it needs to know whether we need the
970         address of `this' or not.  This is used by value types.  
971
972         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
973         every other call passes false.
974
975 2006-01-12  Raja R Harinath  <rharinath@novell.com>
976
977         Fix #77221.
978         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
979         GetOverride.
980         * expression.cs (Invocation.OverloadResolve): Update.
981         (Invocation.DoResolve): Avoid double resolution of invocation.
982
983 2006-01-11  Raja R Harinath  <rharinath@novell.com>
984
985         Fix #77180.
986         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
987         unary negation of floating point types as 0-expr; negation cannot
988         overflow in floating point types.
989
990         Fix #77204.
991         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
992         on operands of 'void' type.
993
994         Fix #77200.
995         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
996         and ExclusiveOr for boolean constants too.
997
998 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
999
1000         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1001
1002 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1003
1004         * cs-tokenizer.cs (Position): New class used to save and restore
1005         the position state in the tokenizer.  Before this patch the save
1006         and restore was not complete enough so the line and columns would
1007         start to drift and the debugger and stack traces will get the
1008         wrong data.
1009
1010 2006-01-10  Martin Baulig  <martin@ximian.com>
1011
1012         * generic.cs
1013         (TypeParameter.InflateConstraints): New public method.
1014
1015         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1016         constraints; fixes #77042.
1017
1018 2006-01-10  Martin Baulig  <martin@ximian.com>
1019
1020         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1021         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1022         #77061. 
1023
1024 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1025
1026         Fix #75636.
1027         * expression.cs (Invocation.OverloadResolve): Replace reflected
1028         override methods with their base virtual methods, rather than
1029         skipping over them.
1030         * typemanager.cs (TypeManager.GetOverride): New.
1031
1032 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1033
1034         * driver.cs: Report the case of no source files and no -out:
1035         argument provided.
1036
1037 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1038
1039         Fix #77035.
1040         * expression.cs (ComposedCast.GetSignatureForError): Define.
1041
1042 2006-01-05  Jb Evain  <jbevain@gmail.com>
1043
1044         * class.cs (Property.Define, Indexer.Define): do not tag the
1045         properties as SpecialName | RTSpecialName.
1046
1047 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1048
1049         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1050         doing a low-level comparission of parameter types.  It was lacking
1051         a check for __argslist. 
1052
1053 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1054
1055         * expression.cs (ParameterReference.DoResolveBase): Allow
1056         reference parameters if they are local to this block. 
1057
1058         This allows the ref and out parameters of a delegate to be used in
1059         an anonymous method, for example:
1060
1061         delegate void set (out int x);
1062
1063         set s = delegate (out int x){
1064                 x = 0;
1065         };
1066
1067         This is used by functionality introduced late in the C# language.
1068         
1069         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1070         method that take ref and out parameters. 
1071
1072         Fixes #77119 which was a late change in the spec.
1073
1074 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1075
1076         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1077         parent if its the same scope.  Fixes #77060.
1078
1079 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1080
1081         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1082
1083 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1084
1085         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1086         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1087         that doesn't contain the full public key. This is a update of the
1088         friend assemblies in .Net 2.0 release.
1089         
1090 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1091
1092         Fix #76995
1093
1094         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1095         ListDictionary, to contain the ExternAliasEntry entries (in
1096         addition to the NamespaceEntry.aliases hashtable). This field is
1097         shared between the original entry and its doppelganger (bodyless 
1098         copy of it).
1099         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1100         extern_aliases field.
1101         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1102         lookup in extern_aliases.
1103
1104 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1105
1106         Fix #77006.
1107         * class.cs (TypeContainer.Mark_HasEquals): New.
1108         (TypeContainer.Mark_HasGetHashCode): New.
1109         (ClassPart): Override them.
1110         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1111
1112         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1113         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1114         DeclSpace.
1115
1116         Fix #77008.
1117         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1118         'parent' argument to the base constructor.
1119
1120         Remove all mention of TypeContainer from decl.cs.
1121         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1122         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1123         (DeclSpace.DeclSpace): Likewise.
1124         (DeclSpace.DefineMembers): Remove unused argument.
1125         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1126         debugging check -- we don't care if the debug code throws an
1127         InvalidCastException instead of an InternalErrorException.
1128         * class.cs (TypeContainer.DefineMembers): Update to changes.
1129         (TypeContainer.DoDefineMembers): Likewise.
1130         (TypeContainer.GetMethods): Likewise.
1131         (PropertyMember.Define): Likewise.
1132         (MemberBase.Parent): New property that forwards to
1133         MemberCore.Parent, but ensures that we get a TypeContainer.
1134         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1135         (RootContext.PopulateTypes): Likewise.  Remove special case code
1136         for !RootContext.StdLib: DefineMembers is idempotent.
1137
1138 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1139
1140         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1141
1142 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1143
1144         * doc.cs : The search for referenced namespace was insufficient to
1145           get global one as it used to do. Fixed bug #76965.
1146
1147 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1148
1149         * doc.cs : check name in cref in the last phase that whether it is
1150           namespace or not.
1151
1152 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1153
1154         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1155           Mono.C5.
1156
1157 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1158
1159         * doc.cs : so it turned out that we cannot skip override check for 
1160           interface members. Fixed bug #76954.
1161
1162 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1163
1164         * cs-tokenizer.cs : fixed bug #75984:
1165           - #warning and #error should not be handled when the source line
1166             is disabled.
1167           - #line is not checked strictly when the source line is disabled.
1168           - #define and #undef is on the other hand checked strictly at any
1169             state.
1170
1171 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1172
1173         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1174           CS1027 report.
1175
1176 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1177
1178         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1179
1180         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1181         nested types.
1182
1183 2005-12-14  Martin Baulig  <martin@ximian.com>
1184
1185         * typemanager.cs (TypeManager.GetFullName): Make this public;
1186         `Type.Fullname' now never returns null.
1187
1188         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1189         explicit interface implementations; we're now using the same
1190         naming convention than csc does.
1191
1192 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1193
1194         * convert.cs (ExplicitConversionCore): Check the return value from
1195         ExplicitConversionCore which can return null on failure.  Fixes #76914
1196
1197 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1198
1199         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1200         instead of IsGenericInstance.
1201         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1202         code that's now covered by the more general test.
1203         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1204
1205         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1206         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1207         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1208         * generic.cs, report.cs, typemanager.cs: Likewise.
1209
1210 2005-12-08  Martin Baulig  <martin@ximian.com>
1211
1212         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1213
1214         * typemanager.cs (TypeManager.CSharpSignature): Include type
1215         arguments in the signature of a generic method.
1216
1217 2005-12-07  Martin Baulig  <martin@ximian.com>
1218
1219         Add support for custom attributes on type parameters.
1220
1221         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1222
1223         * generic.cs (TypeParameterName): New public class; we use this
1224         instead of a `string' to store the name of a type parameter, so we
1225         can also have `Attributes'.
1226         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1227         array instead of a `string[]' array.
1228         (TypeParameter.ctor): We now also take an `Attributes' argument.
1229         (TypeParameter.EmitAttributes): New public method; emit our
1230         `OptAttributes' here.
1231         (GenericMethod.EmitAttributes): New public method; emit the custom
1232         attributes on all our type parameters.
1233
1234         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1235         our type parameters.
1236         (MethodData.Define): If we're a generic method, call
1237         EmitAttributes() on it.
1238
1239 2005-12-07  Martin Baulig  <martin@ximian.com>
1240
1241         * generic.cs
1242         (ConstraintChecker): New public abstract class; move the
1243         constraint checking here from `ConstructedType' and also do
1244         constraint checking for generic methods here.
1245
1246         * expression.cs (Invocation.OverloadResolve): Use
1247         ConstraintChecker.CheckConstraints() if we resolved to a generic
1248         method.  Fix #76806.
1249
1250 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1251
1252         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1253
1254         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1255         event initializers.
1256         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1257         (FieldBase.Initializer): Initializer is now optional.
1258         (EventField.Define): Only event field can have initializer.
1259
1260         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1261
1262         * const.cs (Const): Reuse initializer.
1263
1264         * cs-parser.jay: Updated after FieldBase changes.
1265         Added current_array_type to simplify array initializers.
1266
1267         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1268
1269         * expression.cs, iterators.cs: Updated.
1270
1271         * namespace.cs (NamespaceEntry): Made UsingFound private.
1272
1273 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1274
1275         * parameterCollection.cs: Obsolete, removed.
1276         * parser.cs: Obsolete, removed.
1277
1278 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1279
1280         Fix #76849.
1281         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1282
1283         * enum.cs (Enum.Define): Set obsolete context here.
1284
1285 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1286
1287         * doc.cs :
1288           - FindDocumentedMember() now expects 1) paramList as null
1289             when "we don't have to check the number of parameters" and
1290             2) Type.EmptyTypes when "there is no arguments".
1291           - Introduced FoundMember struct to hold the exact type which was
1292             used to find the documented member (the above change broke
1293             test-xml-044; it might be better just to use DeclaringType than
1294             what MS does, like this change does, but it depends on usage.)
1295
1296 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1297
1298         * doc.cs : documented member might be from DeclaringType for nested
1299           types. Fixed bug #76782.
1300
1301 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1302
1303         * anonymous.cs: Have the param code handle leaving copies on the
1304         stack etc. Allows anonymous params to take part in the assignment
1305         code (++, +=, etc). Fixes bug #76550
1306
1307         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1308         it down to the anon code.
1309
1310         * iterators.cs: Use dummy var here
1311
1312         * codegen.cs: Handle new vars
1313
1314 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1315
1316         Fix #76849.
1317         * class.cs (MethodData.Define): Set proper Obsolete context.
1318
1319         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1320         obsolete context.
1321         (FieldExpr.DoResolve): Ditto.
1322
1323 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1324
1325         Fix #76849.
1326         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1327         parent is not obsolete.
1328
1329 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1330
1331         * doc.cs : (FindDocumentedMember) find parameterless members first
1332           and get CS0419 in the early stage. Fixed first case of bug #76727.
1333
1334 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1335
1336         Fix #76859.
1337         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1338         no error was reported.
1339
1340         *expression.cs (Binary.DoResolve): left can be null.
1341
1342 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1343
1344         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1345         abstract method and all overrides.
1346         * support.cs (ParameterData.GenericConstraints): Delete.
1347         (ReflectionParameters.type_params): Delete.
1348         (ReflectionParameters.ReflectionParameters): Make private.
1349         (ReflectionParameters.GetConstaints): New factory method.
1350         * generic.cs (TypeParameterDefineType): Use it.
1351         (TypeManager.GetTypeParameterConstraints): Likewise.
1352
1353 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1354
1355         Fix #76783.
1356         * class.cs (MethodData.Emit): Parameters should be labeled first.
1357
1358 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1359
1360         Fix #76761.
1361         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1362
1363 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1364
1365         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1366
1367         * class.cs (MethodCore): Parameter clean up.
1368         (IMethodData): Added ParameterInfo.
1369         (MethodData): Parameter clean up.
1370         (Indexer.Define): Parameter clean up.
1371
1372         * anonymous.cs,
1373         * codegen.cs,
1374         * cs-parser.jay,
1375         * decl.cs,
1376         * doc.cs,
1377         * ecore.cs,
1378         * flowanalysis.cs,
1379         * iterators.cs,
1380         * pending.cs,
1381         * statement.cs,
1382         * typemanager.cs: Parameter clean up.
1383
1384         * delegate.cs (Define): Get rid of duplicated code.
1385
1386         * expression.cs (ParameterReference): Removed useless parameters
1387         and simplified.
1388         (Invocation): Ditto.
1389
1390         * parameter.cs (ParamsParameter): New class, params specialization.
1391         (ArglistParameter): Attemp to separate arglist.
1392         (Parameter): Refactored to be reusable and faster.
1393         (Parameter.Modifier): Made understandable.
1394         (Parameters): Changed to be used as a class for `this' assembly
1395         parameters. Refactored to use new specialized classes.
1396
1397         * support.cs (ParameterData): Added Types property.
1398         (InternalParameters): Deleted.
1399
1400 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1401
1402         * doc.cs : the previous patch does not actually fix the bug.
1403           PropertyInfo override check is now implemented and really fixed it.
1404         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1405
1406 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1407
1408         * doc.cs : apply "override filter" also to properties.
1409           Fixed bug #76730.
1410
1411 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1412
1413         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1414           no need to check overrides. For classes, omit those results from 
1415           interfaces since they must exist in the class. Fixed bug #76726.
1416
1417 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1418
1419         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1420           with different parameters. Fixed the second problem in #76685.
1421
1422 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1423
1424         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1425           get expected 'protected' access in CheckValidFamilyAccess()).
1426           Fixed bug #76692.
1427
1428 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1429
1430         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1431           Fixed bug #76705.  CS1569 was incorrectly commented out.
1432
1433 2005-11-23  Martin Baulig  <martin@ximian.com>
1434
1435         * generic.cs (Constraints.Define): Removed.
1436         (TypeParameter.DefineConstraints): Removed.
1437         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1438         on the GenericTypeParameterBuilder here.
1439
1440 2005-11-23  Martin Baulig  <martin@ximian.com>
1441
1442         * typemanager.cs (TypeManager.GetProperty): Make this public.
1443
1444         * generic.cs (Nullable.NullableInfo.ctor): Use
1445         TypeManager.GetProperty() rather than using reflection directly.
1446
1447 2005-11-17  Martin Baulig  <martin@ximian.com>
1448
1449         * expression.cs (Indexers.GetIndexersForType): Added support for
1450         generic parameters; fixes #76587.
1451
1452 2005-11-17  Martin Baulig  <martin@ximian.com>
1453
1454         * anonymous.cs
1455         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1456         inherit the scope from our parent.  Fixes #76653.
1457
1458 2005-11-15  Martin Baulig  <martin@ximian.com>
1459
1460         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1461         instead of `ScopeTypeBuilder' to refer to the "current" type.
1462         (AnonymousMethod.CreateScopeType): Correctly create the helper
1463         class if we're inside a generic type definition.
1464
1465 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1466
1467         * doc.cs : use Invocation.IsOverride() to do real override check.
1468         * expression.cs : made Invocation.IsOverride() internal.
1469
1470 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1471
1472         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1473           TypeBuilder.FindMembers() and filter overriden base members out.
1474           Fixed bug #76990.
1475
1476 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1477
1478         * doc.cs : ref/out parameters are represented as '@' (instead of
1479           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1480
1481 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1482
1483         * doc.cs : when there was no '.' in cref to methods in doc comment,
1484           then parameters were missing in the output. Fixed bug #76691.
1485
1486 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1487
1488         * driver.cs : don't output docs when there is an error.
1489           Fixed bug #76693.
1490
1491 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1492
1493         * doc.cs :
1494           Now it should detect indexers. Fixed primary concern in bug #76685.
1495           Fixed CS0419 message to not show the identical member signature in
1496           the message.
1497
1498 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1499
1500         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1501           instead of Type.FindMembers() since it does not handle events.
1502           Fixed bug #71604.
1503
1504 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1505
1506         * codegen.cs: Fixed typo (speficied -> specified).
1507
1508 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1509
1510         Fix #76369.
1511         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1512
1513 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1514
1515         * attribute.cs: Changed error message.
1516
1517         * cs-tokenizer.cs: One more check.
1518
1519 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1520
1521         * statement.cs (Block.Resolve): Ignore empty statement.
1522
1523 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1524
1525         * report.cs: Made error/warning methods more strict to avoid
1526         their misuse.
1527
1528         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1529         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1530         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1531         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1532
1533 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1534
1535         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1536         Use the more explicit AssemblyName.FullName instead of 
1537         AssemblyName.Name to report errors.
1538         
1539 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1540
1541         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1542         with mcs.
1543
1544 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1545
1546         * class.cs,
1547         * convert.cs,
1548         * cs-parser.jay,
1549         * decl.cs,
1550         * enum.cs,
1551         * expression.cs,
1552         * generic.cs,
1553         * pending.cs,
1554         * report.cs: Fixed error reporting and typos.
1555
1556         * generic.cs (TypeParameter.GetSignatureForError): New method.
1557         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1558
1559         * typemanager.cs (GetFullName): Refactored.
1560
1561 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1562
1563         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1564         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1565
1566         * class.cs (TypeContainer.IsComImport): New property.
1567         (Constructor.Define): Create proper ctor for ComImport types.
1568
1569         * expression.cs (New.CheckComImport): Fixed.
1570
1571 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1572
1573         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1574         that a parameter has been captured does not mean that we do not
1575         have to do the rest of the processing.  This fixes the second part
1576         of #76592.  If there was another anonymous method capturing
1577         values in the past, the Scope would never be set for the second
1578         method that captured the same parameter.
1579
1580         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1581         properly manipulate the stack.   Second part of fix for #76592.
1582
1583         * expression.cs (New): Add support for invoking "new" on
1584         interfaces that have been flagged with the ComImport attribute and
1585         the CoClass.  Fixes #76637 
1586
1587         * statement.cs (Try.DoEmit): When a variable is captured, do not
1588         try to emit the vi.LocalBuilder variable as it has been captured.
1589         Create a temporary variable and store the results on the
1590         FieldBuilder.  Fixes #76642
1591
1592 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1593
1594         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1595
1596         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1597
1598         * expression.cs (Binary.DoResolve): Added && optimalization.
1599     
1600         * typemanager.cs (AddUserType): Removed useless argument.
1601
1602 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1603
1604         * statement.cs (Block.variables): Uses ListDictionary.
1605
1606 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1607
1608         Fix #75969.
1609         * class.cs (PartialContainer.EmitType): Customized to emit
1610         security attributes.
1611         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1612         for partial classes.
1613
1614 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1615
1616         Fix #76599.
1617         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1618         access has to be fixed.
1619         
1620         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1621
1622 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1623
1624         Fix #76590.
1625         * ecore.cs (NullCast.Reduce): Implemented.
1626
1627         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1628         constant type.
1629         
1630         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1631         properly.
1632         (Foreach.Resolve): Catch null properly.
1633
1634 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1635  
1636         * cs-tokenizer.cs: Warning text fix.
1637
1638         * driver.cs: AllWarningNumbers exposed on public interface.
1639
1640         * report.cs (): Reviewed warning numbers.
1641         (IsValidWarning): Use binary search.
1642
1643 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1644  
1645         * driver.cs: Implemeted resource visibility.
1646         (Resources): New class for code sharing between /res: and
1647         /linkres:
1648  
1649 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1650
1651         decl.cs (CurrentTypeParameters): Fixed to be public.
1652
1653 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1654
1655         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1656
1657 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1658
1659         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1660
1661 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1662
1663         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1664
1665 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1666
1667         Add friend assembly access support.
1668         * typemanager.cs: assembly_internals_vis_attrs
1669         cache for friend assembly access. 
1670         (TypeManager.IsFriendAssembly): New method for
1671         checking friend assembly access.
1672         (TypeManager.Error_FriendAccessNameNotMatching): New
1673         helper method.
1674         (TypeManager.CompareKeyTokens): Likewise.
1675         (TypeManager.Filter): Handle friend accessible
1676         members.
1677
1678         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1679         friend accessible types.
1680
1681         * ecore.cs (Expression.IsAccessorAccessible): Handle
1682         friend accessible properties.
1683
1684         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1685         accessible types.
1686         
1687 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1688
1689         Fix #76568.
1690         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1691         folding.
1692         
1693         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1694         contants only.
1695         
1696         * ecore.cs (NullCast): Child is contant only.
1697         
1698         * literal.cs (NullLiteral.Reduce): null can be converted to any
1699         reference type.
1700
1701 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1702
1703         * driver.cs: Use Encoding.Default as default code page instead
1704           of ISO-28591.
1705
1706 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1707
1708         Fix #76085.
1709         * expression.cs (Invocation.Error_InvalidArguments): Handle
1710         __arglist parameters.
1711         (Invocation.VerifyArgumentsCompat): Likewise.
1712         * support.cs (ReflectionParameters.GetSignatureForError): Print
1713         __arglist parameters.
1714         (InternalParamters.GetSignatureForError): Likewise.
1715         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1716
1717 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1718
1719         * attribute.cs (GetPropertyValue): Made public.
1720
1721         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1722         Resolve.
1723         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1724         attribute.
1725         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1726         is not defined.
1727         
1728         * driver.cs: Reflect method name change.
1729         
1730         * statement.cs (Try.Resolve): Warn when try has both general
1731         exception handlers.
1732         
1733         * typemanager.cs: runtime_compatibility_attr_type new predefined
1734         type.
1735
1736 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1737
1738         Fix #76419.
1739         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1740         treat it as an empty parameter list.
1741
1742 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1743
1744         Fix #76271.     
1745         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1746         ResolveAsTypeStep silent.
1747         * statement.cs (Block.AddConstant): Mark block as used.
1748         (Block.ResolveMeta): Avoid piling on error messages
1749         if a constant initializer resolution fails.
1750
1751 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1752
1753         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1754         Remove.
1755         (NamespaceEntry.VerifyAllUsing): New.
1756         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1757         behaviour.  Delegates actual resolution of alias to ...
1758         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1759         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1760         Update.
1761         * driver.cs (Driver.MainDriver): Update.
1762         
1763         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1764         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1765         property.
1766         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1767         Remove.
1768         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1769         RootNamespace.DefineNamespacesForAll.
1770
1771 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1772
1773         * typemanager.cs (assemblies, external_aliases, modules)
1774         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1775         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1776         overhead.  Move resposibility ...
1777         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1778         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1779
1780 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1781
1782         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1783         cached_namespaces.  Improve usage.
1784         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1785         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1786         Move from GlobalRootNamespace and simplify.
1787         (RootNamespace.Global): Make instance variable.
1788         (RootNamespace.RootNamespace): Add "alias name" parameter.
1789         (GlobalRootNamespace): Simplify drastically.
1790         (Namespace.Lookup): Don't use GetNamespace.
1791         * typemanager.cs (GetRootNamespace): Rename from
1792         ComputeNamespaceForAlias.
1793         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1794
1795 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1796
1797         * anonymous.cs (AnonymousContainer): Don't crash when container
1798         doesn't exist.
1799
1800 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1801
1802         * expression.cs (Binary.DoResolve): Warn when comparing same
1803         values.
1804
1805 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1806
1807         Fix #76486.
1808         * expression.cs (Binary.DoResolve): It looks like there are no
1809         convetsion rules in enum context.
1810
1811 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1812
1813         Add support for extern alias qualifiers.
1814         * typemanager.cs: Move some LookupTypeReflection code
1815         to namespace.cs, to have cleaner code. Added some methods
1816         to help us keep track of the extern aliased references.
1817         * driver.cs: Add suport for extern alias assemblies on command
1818         line and check for their warnings/errors. Also keep track of the
1819         extern aliased assemblies.
1820         * namespace.cs: Move the global functionality of Namespace
1821         to GlobalRootNamespace/RootNamespace. Now the global namespace
1822         is GlobalRootNamespace.Globa. Also the code moved from 
1823         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1824         Finally added LocalAliasEntry (AliasEntry before) and
1825         ExternAliasEntry, to handle alias statements.
1826         * cs-parser.jay: Add support in the grammar for extern alias
1827         statement.
1828         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1829         Update callings to Namespace (now in GlobalRootNamespace).
1830
1831 2005-10-25  Martin Baulig  <martin@ximian.com>
1832
1833         * convert.cs (ImplicitTypeParameterConversion): Make base
1834         interfaces actually work; fixes #76557.
1835
1836 2005-10-25  Martin Baulig  <martin@ximian.com>
1837
1838         * generic.cs
1839         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1840         all the type parameters; fixes #76551.
1841
1842 2005-10-25  Martin Baulig  <martin@ximian.com>
1843
1844         Fix #76472.
1845
1846         * generic.cs
1847         (GenericMethod.ctor): Added `Expression return_type' and
1848         `Parameters parameters' arguments.
1849         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1850         parameter and return types to check their constraints if they're
1851         generic types.
1852
1853         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1854         boolean field.
1855
1856         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1857         constraints of a generic type if `ec.ResolvingGenericMethod'.
1858
1859         * class.cs (MethodCore.DoDefineParameters): Set
1860         `ec.ResolvingGenericMethod' if we're a generic method.
1861         (MemberBase.MemberType): Likewise.
1862
1863 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1864
1865         * typemanager.cs (TypeManager): Added 
1866         TypeManager.internals_visible_attr_type to cache
1867         S.R.CompilerServices.InternalsVisibleToAttribute.
1868
1869         * codegen.cs (AssemblyClass): Added checks for 
1870         InternalsVisibleToAttribute in new method 
1871         CheckInternalsVisibleAttribute () and also cache the
1872         AssemblyName in AssemblyClass.Name.
1873         
1874 2005-10-24  Martin Baulig  <martin@ximian.com>
1875
1876         * typemanager.cs
1877         (TypeManager.ExpandInterfaces): Added overloaded version which
1878         just takes a `Type[]' array.
1879
1880         * generic.cs
1881         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1882         just use the interfaces which were explicitly specified and not
1883         the interfaces they inherit.  Fixes #76482.
1884         (TypeParameter.FindMembers): Expand the interfaces here.
1885
1886 2005-10-21  Martin Baulig  <martin@ximian.com>
1887
1888         * generic.cs
1889         (Constraints.Resolve): Also resolve the actual types here.
1890         (Constraints.ResolveTypes): Just check the constraints here.
1891         Fixes #76363; see gtest-218.cs.
1892
1893 2005-10-21  Martin Baulig  <martin@ximian.com>
1894
1895         * convert.cs
1896         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1897         instead of a `BoxedCast'; fixes gtest-217.cs.
1898
1899 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1900
1901         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1902           1) "new()" is specified as generic parameter constraint and 2) the
1903           type is TypeBuilder and 3) the type is abstract even if it has a
1904           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1905
1906 2005-10-20  Martin Baulig  <martin@ximian.com>
1907
1908         * generic.cs
1909         (GenericConstraints.TypeParameter): New public property.
1910         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1911         (TypeParameter.DeclSpace): New public property.
1912         (TypeParameter.DefineType): Inflate the constraints if our
1913         `DeclSpace' is an `Iterator'.   
1914
1915 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1916
1917         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1918           GenericMethod argument to compare methods' generic type arguments.
1919           Fixed bug #76382.
1920
1921 2005-10-19  Martin Baulig  <martin@ximian.com>
1922
1923         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1924         not ResolveType() when resolving the base type, so we're not
1925         checking the constraints here.
1926         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1927         if we have any.
1928
1929 2005-10-19  Martin Baulig  <martin@ximian.com>
1930
1931         * generic.cs (ConstructedType.CheckConstraints): Committing
1932         untested fix for #76441.
1933
1934 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1935
1936         Fix #76371.
1937         * class.cs (TypeContainer.DefineType): Move updating of
1938         topological sort earlier in the code.
1939         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1940
1941 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1942
1943         Fix #76273.
1944         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1945         
1946         * constant.cs (Constant.TryReduce): Moved from Cast class.
1947         (Reduce): Made little bit more OO and fixed missing conversions.
1948         
1949         * ecore.cs (Reduce): Implemented.
1950         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1951         
1952         * literal.cs (Reduce): Implemented.
1953         
1954         * class.cs: Reverted Miguel's wrong commit.
1955
1956 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1957
1958         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1959
1960 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1961
1962         * cs-parser.jay, expression.cs : CS0214 was missing error location
1963           for constants. Fixed bug #76404.
1964
1965 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1966
1967         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1968         InstanceExpression.
1969         (PropertyExpr.EmitCall): Likewise.
1970         * expression.cs (Invocation.EmitArguments): Handle case where
1971         arguments == null.
1972         (Invocation.EmitCall): Avoid allocating temporary variable if
1973         there are no arguments.
1974
1975 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1976
1977         Fix #76370.
1978         * convert.cs (ExplicitConversionCore): Fixed object->enum
1979         conversion.
1980
1981 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1982
1983         Fix #76323.
1984         * convert.cs (ImplicitConversionStandard): Move conversion of
1985         void* to arbitrary pointer types ...
1986         (ExplicitConversionStandard): .. here.
1987         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1988         error to always print typenames.
1989
1990 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1991
1992         * convert.cs (GetConversionOperator): Rename from
1993         GetConversionOperators.  Move operator selection code from ...
1994         (UserDefinedConversion): ... here.
1995
1996 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1997
1998         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1999         conversion.
2000
2001 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2002
2003         * assign.cs (Assign.DoResolve): Error method changed.
2004
2005         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2006         
2007         * const.cs (ResolveValue): Reset in_transit immediately.
2008         
2009         * constant.cs: Error method changed.
2010         
2011         * convert.cs: Removed useless location parameter.
2012         (ExplicitNumericConversion): Don't do double enum check.
2013         (ExplicitConversionCore): Renamed from ExplicitConversion.
2014         (ExplicitUnsafe): Extracted from ExplicitConversion.
2015         (ExplicitConversion): Uses for error reporting.
2016         
2017         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2018         error messages.
2019         (ResolveBoolean): Uses common error method.
2020         (CastToDecimal): Get rid of ec.
2021         (CastFromDecimal): Optimized.
2022         (ConvCast): Get rid of ec.
2023         
2024         * enum.cs (ResolveValue): Reset in_transit immediately.
2025         (Emit): Return after first error.
2026         
2027         * expression.cs: Convert changes.
2028         
2029         * literal.cs: Error method changed.
2030         
2031         * statement.cs: Error method changed.
2032
2033 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2034
2035         Fix gtest-131.cs and gtest-211.cs.
2036         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2037         Only emit code for a label if it is used.  Unreachable code can
2038         violate ECMA evaluation stack invariants.
2039
2040 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2041
2042         * anonymous.cs: Implemented ExprClassName.
2043         
2044         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2045         delegate.
2046         
2047         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2048         check.
2049         
2050         * class.cs (StaticClass.DefineContainerMembers): Report protected
2051         members as error.
2052         
2053         * codegen.cs: if(ed) PRODUCTION.
2054         
2055         * convert.cs (Error_CannotImplicitConversion): Better error
2056         distinction.
2057         
2058         * cs-parser.jay: More error checks.
2059         
2060         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2061         
2062         * driver.cs (CSCParseOption): Enabled wrong option check.
2063         
2064         * ecore.cs (Expression.ExprClassName): Turned to property.
2065         (MemberExpr.CheckIntermediateModification): For checking boxed
2066         value types     modification.
2067         
2068         * statement.cs (Fixed.Resolve): Expression type must be
2069         convertible to fixed type.
2070         (CollectionForeach.GetEnumeratorFilter,TryType):
2071         Small refactoring for easier error checking.
2072
2073 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2074
2075         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2076         attributes.
2077         
2078         * class.cs (GeneratedBaseInitializer): New class for customization
2079         compiler generated initializers.
2080         (MemberBase.DoDefine): Check Obsolete attribute here.
2081         (FieldMember.DoDefine): Ditto.
2082         
2083         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2084         constants.
2085         
2086         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2087         (MemberCore.GetObsoleteAttribute): Removed argument.
2088         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2089         (MemberCore.CheckObsoleteType): New helper.
2090         
2091         * delegate.cs,
2092         * enum.cs,
2093         * statement.cs: Updates after MemberCore changes.
2094         
2095         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2096         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2097         
2098         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2099         obsolete attribute for compiler construct.
2100         (As.DoResolve): Cache result.
2101         
2102         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2103
2104 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2105
2106         * expression.cs (Probe): instead of having a "Type probe_type"
2107         keep the extra information as a TypeExpr probe_type_expr since the
2108         "As" operator needs to perform some type checks.
2109
2110         * (As.DoResolve): If the type is a type parameter, ensure that it
2111         is constrained by a class.
2112
2113 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2114
2115         * statement.cs (Lock): Use the TemporaryVariable class instead of
2116         manually using local variables as those do not work when variables
2117         are captured.
2118
2119         * ecore.cs: Moved the TemporaryVariable class from being a nested
2120         class inside Foreach to be a public class that can be employed in
2121         other places. 
2122
2123 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2124
2125         * cs-parser.jay: interface_accessors replaced by
2126         accessor_declarations.
2127
2128         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2129         location.
2130         
2131         * statement.cs (GotoCase.Resolve): Convert null constant to
2132         null case.
2133         (SwitchLabel.ResolveAndReduce): Ditto.
2134         (SwitchLabel.NullStringCase): Custom null stamp.
2135         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2136         
2137         typemanager.cs (CSharpSignature): Don't skip first argument
2138         for full names.
2139
2140 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2141
2142         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2143         expression.cs, iterators.cs, literal.cs: Store constants and
2144         literals location.
2145         
2146         * class.cs (MemberBase.ShortName): Pass location.
2147         
2148         * cs-parser.jay: Some location fixes.
2149         
2150         * ecore.cs (Expression.Location): Made virtual.
2151
2152 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2153
2154         Fix #72930.
2155         * const.cs (Const.ResolveValue): Check for assigning non-null
2156         value to reference type.
2157
2158 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2159
2160         Fix #76133.
2161         * expression.cs (This.VerifyFixed): In a value type T, the type of
2162         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2163         value type R, 'this' is treated as a value parameter.
2164
2165 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2166
2167         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2168         if the underlying types are the same, otherwise we need to produce
2169         code that will do the proper cast.
2170
2171         This was exposed by Marek's constant rewrite which produced
2172         invalid code for the call site:
2173
2174         enum X : long { a }
2175         void Method (X v) {}
2176
2177         Method ((X) 5)
2178
2179         This fixes test-49.cs
2180
2181 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2182
2183         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2184           Type/Object should be allowed as well. Fixed bug #75968.
2185
2186 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2187
2188         * expression.cs : (Binary.DoResolve): when one is enum constant and
2189           another is constant 0, then return enum one *as enum type*.
2190           Fixed bug 74846.
2191
2192 2005-10-04  Martin Baulig  <martin@ximian.com>
2193
2194         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2195         `SetMemberIsUsed()' work for generics, too.
2196
2197 2005-10-04  Martin Baulig  <martin@ximian.com>
2198
2199         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2200         for corlib.  Fixes #75691.
2201
2202 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2203
2204         Fix #76255.
2205         * driver.cs: Fix compilation files with full root path.
2206
2207 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2208
2209         * report.cs (SymbolRelatedToPreviousError): Format the output so
2210         it does not use an open parenthesis that is never closed. 
2211
2212         * driver.cs: Follow coding guidelines
2213
2214 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2215
2216         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2217
2218         * location.cs (InEmacs): in this mode, do not report column
2219         location as it confuses Emacs.
2220
2221 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2222
2223         * support.cs (SeekableStreamReader.Position): Don't error out when
2224         the requested position is just beyond the end of the current
2225         buffered data.
2226
2227 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2228
2229         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2230         try to keep in sync with the byte count of the underlying Stream.
2231         However, this limits us to a window size of 2048 characters: i.e.,
2232         the maximum lookahead of our lexer/parser can be 2048 characters.
2233
2234 2005-09-22  Martin Baulig  <martin@ximian.com>
2235
2236         * driver.cs: Removed a debugging FIXME.
2237
2238 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2239
2240         * cs-parser.jay (type_arguments): Add CS1644 check.
2241         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2242
2243 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2244
2245         * Makefile (PROGRAM): Make profile specific.
2246         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2247         the current directory.
2248
2249         Fix test-455.cs.
2250         * expression.cs (Invocation.EmitCall): Remove optimization on
2251         this_call since it doesn't handle 'this' being a value type.
2252
2253 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2254
2255         * driver.cs: Ensure file handles are closed after parsing
2256
2257 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2258
2259         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2260         if the underlying types are the same, otherwise we need to produce
2261         code that will do the proper cast.
2262
2263         This was exposed by Marek's constant rewrite which produced
2264         invalid code for the call site:
2265
2266         enum X : long { a }
2267         void Method (X v) {}
2268
2269         Method ((X) 5)
2270
2271         This fixes test-49.cs
2272
2273 2005-09-05  Martin Baulig  <martin@ximian.com>
2274
2275         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2276         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2277
2278         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2279
2280 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2281
2282         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2283           to be a pointer type due to the spec 25.2, so check if declaring
2284           type is generic type definition. Fixed bug #75772.
2285
2286 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2287
2288         Fixed bug #75957.
2289         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2290           both types are not defined by methods.
2291         * expression.cs : (Invocation.IsApplicable): it should work when
2292           the argument type is equal to the parameter type, not only when
2293           ImplicitConversionExists() returns true.
2294
2295 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2296
2297         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2298         internal.
2299
2300         Fix #75941.
2301         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2302         flow-branching for LocalVariableReferences in case we were invoked
2303         from a MemberAccess.
2304         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2305         Carved out of ...
2306         (LocalVariableReference.DoResolveBase): ... this.
2307         (MemberAccess.Resolve): Do the check that was disabled during
2308         SimpleNameResolve.
2309
2310 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2311
2312         * class.cs :
2313           (PartialContainer.Create): check abstract/sealed/static strictly
2314           but abstract/sealed can exist only at one side. Fixed bug #75883.
2315
2316 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2317
2318         Fix #75945.
2319         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2320         specified, don't default to UnmanagedType.I4.
2321
2322 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2323
2324         * expression.cs : conditional operator should check possibly
2325           incorrect assign expression. Fixed bug #75946.
2326
2327 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2328
2329         Fix #75934.
2330         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2331         (ScopeInfo.EmitScopeType): Use it to construct field names from
2332         names of captured locals.
2333
2334         Fix #75929.
2335         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2336         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2337         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2338         (ExplicitConversion): Remove enum cases already handled by
2339         implicit conversion.  Move implicit conversion check to the beginning.
2340         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2341         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2342         Don't treat System.Enum as a struct.
2343
2344 2005-08-30  Jb Evain  <jbevain@gmail.com>
2345
2346         * attribute.cs: handles as expression in parameters.
2347
2348 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2349
2350         Fix #75802.
2351         * class.cs (TypeContainer.VerifyClsName): Don't use a
2352         PartialContainer when verifying CLS compliance.
2353         (AbstractPropertyEventMethod): Set Parent here, ...
2354         (PropertyMethod): ... not here.
2355
2356 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2357
2358         * attribute.cs : escaped attribute name should not be allowed to be
2359           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2360
2361 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2362
2363         Fix #75927.
2364         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2365         when converting a long constant to unsigned long.
2366         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2367         detect where IsApplicable and VerifyArgumentsCompat disagree.
2368
2369 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2370         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2371
2372         Fix #75848.
2373         * class.cs (TypeContainer.CanElideInitializer): New helper.
2374         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2375         can safely emitting the initializer of a field.
2376
2377 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2378
2379         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2380           allowed inside a switch (without loop). Fixed bug #75433.
2381
2382 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2383
2384         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2385         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2386
2387 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2388
2389         * driver.cs : kinda reverting the default encoding changes (not exact 
2390           revert since I noticed that "codepage:reset" might not work fine).
2391
2392 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2393
2394         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2395           Location. Now getter and setter store location correctly.
2396           (errors/cs0111-12.cs now reports the expected location.)
2397
2398 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2399
2400         * driver.cs : Use default encoding on the environment.
2401           Removed (now that) extra parameter for SeekableStreamReader.
2402         * support.cs : (SeekableStreamReader) third .ctor() argument for
2403           StreamReader is not required (always true). preamble size could
2404           be acquired in simpler and safe way.
2405
2406 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2407
2408         * cs-parser.jay: report CS0642 at warning level 3
2409           and report CS0642 for an if else statement also
2410           fixes bug #74745. Patch by John Luke (and a bit
2411           modified by me).
2412           Removed extra CS0642 warning check for "while",
2413           "for" and "fixed".
2414         * statement.cs: In Block.Resolve(), CS0642 check
2415           is reimplemented to check a sequence of an empty
2416           statement and a block.
2417
2418           Both fix bug #66777.
2419
2420 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2421
2422         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2423         detection until I fix it.
2424         
2425         * cs-tokenizer.cs: Changed error message.
2426         
2427         * cs-parser.jay: Fixed 2 error locations.
2428         
2429         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2430         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2431         properties.
2432         
2433         * enum.cs (GetSignatureForError): Fixed.
2434         
2435         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2436         method detection.
2437         
2438         * class.cs,
2439         * typemanager.cs (RegisterProperty): Removed.
2440         
2441         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2442
2443 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2444
2445         Fix #75874.
2446         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2447         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2448
2449 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2450
2451         * expression.cs : tiny fix is required for not warning positive ulong.
2452           See test-441.cs.
2453
2454 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2455
2456         * expression.cs : add CS0652 check for constant and integral
2457           expression. Fixed bug #53974.
2458
2459 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2460
2461         * expression.cs : in DoNumericPromotions(), check if there is implicit
2462           conversion overload for string (to check CS0034). Fixed bug #52492.
2463
2464 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2465
2466         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2467
2468 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2469
2470         * ecore.cs : report location when it is *not* Null.
2471
2472 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2473
2474         * codegen.cs,
2475           ecore.cs,
2476           flowanalysis.cs,
2477           expression.cs:
2478           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2479           correctly. Fixed bug #75721.
2480
2481 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2482
2483         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2484         loop that performs 'min (pos, char_count)'.
2485
2486         Fix #75862.
2487         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2488         converted value in Operator.OnesComplement.
2489
2490 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2491
2492         * anonymous.cs: If the anon method is pulled into a helper class,
2493         it needs to be `internal' not `private'. Fixes runtime behavior on
2494         msft. bug #75704
2495
2496 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2497
2498         Fix #75803
2499         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2500         is a partial class.
2501
2502 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2503
2504         The big constants rewrite
2505         Fix #75746, #75685 and more
2506         As a side effect saved 1MB for MWF ;-)
2507         
2508         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2509         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2510         enum based for corlib compilation.
2511         
2512         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2513         subtractions.
2514         
2515         * class.cs (FixedField.Define): Use ResolveAsConstant.
2516         
2517         * const.cs (IConstant): Interface constants and enums.
2518         (Const.ResolveValue): New method for constant resolvning.
2519         (ExternalConstant): Constants from imported assemblies.
2520         
2521         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2522         conversion; like enums.
2523         (Constant.ToType): Converts this constant to different type.
2524         (Constant.Increment): Adds 1.
2525         
2526         * convert.cs (ImplicitConversionRequired): Simplified.
2527         
2528         * cs-parser.jay: Create EnumMember directly.
2529         
2530         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2531         
2532         * doc.cs (GenerateEnumDocComment): Removed.
2533         
2534         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2535         (ConvertIntLiteral): Removed.
2536         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2537         
2538         * enum.cs (EnumMember): Implement IConstant.
2539         (Enum.IsValidEnumConstant): Removed.
2540         (Enum.GetNextDefaultValue): Removed.
2541         (Enum.FindMembers): Updated.
2542         (Enum.GenerateDocComment): Iterate enum members.
2543         
2544         * expression.cs (Cast.TryReduce): Handle enums correctly.
2545         (New.Constantify): Made public.
2546         (MemberAccess.DoResolve): Removed contant specific if(s).
2547         
2548         * literal.cs (NullLiteral): Implement new abstract methods.
2549         
2550         * statement.cs (GotoCase.Resolve): Use new constant methods.
2551         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2552         
2553         * typemanager.cs (LookupEnum): Removed.
2554         (IsEnumType): Fixed to work with corlib.
2555         (RegisterConstant): Removed.
2556         (LookupConstant): Removed.
2557         (GetConstant): Changed to work with IConstant.
2558
2559 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2560
2561         * location.cs : Fixed overflown (>255) column number.
2562
2563 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2564
2565         First cut of the qualified-alias-member feature.
2566         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2567         token.
2568         * cs-parser.jay (DOUBLE_COLON): New token.
2569         (namespace_or_type_name): Add rule for recognizing
2570         qualified-alias-members.
2571         (primary_expression): Likewise.
2572         (element_access): Allow QualifiedAliasMember as a possible
2573         type-bearing expression.
2574         (local_variable_type, local_variable_pointer_type): Likewise.
2575         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2576         aliases in the current and enclosing namespace declarations.
2577         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2578         * decl.cs (MemberName.is_double_colon): New.
2579         (MemberName.MemberName): Add new constructor for alias-member.
2580         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2581         * expression.cs (QualifiedAliasMember): New expression type.
2582
2583 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2584
2585         * location.cs : it borked when no argument was specified.
2586
2587 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2588
2589         * location.cs : tiny ToString() format fix.
2590
2591 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2592
2593         * statement.cs : oops, it was missing.
2594
2595 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2596
2597         A set of fixes for precise line/column location.
2598
2599         * location.cs :
2600           "token" field now holds a file/line "delta", a line number offset 
2601           from the segment, and a column number. See also:
2602           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2603           December/009508.html
2604           Removed static IsNull. Use instance IsNull property instead.
2605         * cs-tokenizer.cs :
2606           For some tokens it stores Location. For Identifier it stores
2607           LocatedToken which is a pair of string name and location.
2608           Column numbers are adjusted only at getChar().
2609         * report.cs :
2610           Use Location.ToString() for reporting (it now contains column).
2611         * cs-parser.jay :
2612           Largely modified to use LocatedToken instead of
2613           string (IDENTIFIER), and to acquire Location from some tokens.
2614         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2615           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2616           codegen.cs :
2617           Now MemberName holds Location. DeclSpace.ctor() receives Location
2618           as a parameter. Removed extra parameters to all derived classes.
2619           Replaced Location.IsNull() with instance property.
2620         * assign.cs, expression.cs :
2621           Added .ctor() overload that omits Location.
2622         * attribute.cs :
2623           Added "nameEscaped" flag that indicates the identifier was escaped
2624           in the source file. This fixes bug #57047.
2625
2626 2005-09-02  Martin Baulig  <martin@ximian.com>
2627
2628         * class.cs: Make CS3005 a warning, not an error.
2629
2630 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2631
2632         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2633         New method, looking for lo-case imported cls type.
2634
2635         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2636         here.
2637
2638         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2639
2640         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2641
2642         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2643         all_imported_types.
2644         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2645
2646         Optimized to save 3.5 MB for SWF compilation.
2647
2648 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2649
2650         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2651         (PartialContainer.Create): Moved logic AddToContainer.
2652         (PartialContainer.MarkForDuplicationCheck): Shares name.
2653         
2654         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2655         place.
2656         
2657         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2658         initialization.
2659         (Namespace.GetSignatureForError): New method.
2660         
2661         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2662         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2663
2664 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2665
2666         Fix #75669.
2667         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2668         member lookup rather than qualifier_type, since qualifier_type can
2669         be null.
2670
2671 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2672
2673         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2674         enum member.
2675
2676 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2677
2678         * statement.cs: Copy the local exception into the exception
2679         captured local.  Fixes 75674
2680
2681 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2682
2683         Fix #75658.
2684         * expression.cs (Invocation.OverloadResolve): Don't report error
2685         CS1501 if error CS1502 has been reported.
2686         (New.DoResolve): Delegate CS1501 reporting to
2687         Invocation.OverloadResolve.
2688
2689         Fix #75656.
2690         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2691         invariant-meaning-in-block property in an enclosing block if
2692         necessary.
2693
2694 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2695
2696         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2697         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2698         (Switch.CheckSwitch): Just save 50kb for SWF.
2699
2700 2005-07-27  Martin Baulig  <martin@ximian.com>
2701
2702         * anonymous.cs (CaptureContext.AddField): Added
2703         `AnonymousContainer am' argument; compute its toplevel scope if
2704         it's not already computed.  Fixes #75649.
2705
2706 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2707
2708         Fix #75628.
2709         * class.cs (Constructor.Emit): Reset block to null if the block
2710         resolve fails.
2711
2712 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2713
2714         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2715
2716 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2717
2718         * class.cs (MethodData.Define): Check whether accessor implementing
2719         interface is public.
2720
2721         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2722
2723 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2724
2725         Fix #57245
2726         * namespace.cs (LookupType): Moved same type check to...
2727         
2728         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2729         with the same name.
2730
2731 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2732
2733         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2734         already found a typebuilder.
2735         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2736         MemberNames, not strings.
2737
2738         * const.cs (Error_ExpressionMustBeConst): 
2739         Rename from Error_EpressionMustBeConst.
2740         * const.cs, class.cs, statement.cd: Update.
2741
2742 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2743
2744         Fix #65573
2745
2746         * const.cs (Const.LookupConstantValue): Report missing contant expression
2747         everytime.
2748         (Error_EpressionMustBeConstant): Only one error method.
2749
2750         * class.cs, statement.c: Updated.
2751
2752 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2753
2754         * statement.cs (Block.Flags): Add back HasVarargs.
2755         (Block.flags): Make protected.
2756         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2757
2758         * typemanager.cs (types, typecontainers, user_types): Remove.
2759         (UserTypes, TypeContainers): Likewise.
2760         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2761         (CleanUp, Reset): Update.
2762         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2763         (GetNestedType): Use Type.GetNestedType.
2764         (CoreLookupType): Take two arguments, the namespace and the
2765         basename of the type.  Update to use the Namespace.Lookup
2766         mechanism.
2767         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2768         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2769         string concatenation and substring matches.
2770         * class.cs, enum.cs, delegate.cs: Update to changes.
2771
2772 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2773
2774         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2775         Expression and made virtual.
2776
2777         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2778         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2779
2780         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2781
2782         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2783         error message.
2784
2785         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2786         change.
2787
2788 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2789
2790         Fix #57707
2791         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2792         AssemblyCultureAttribute is not used on executable.
2793
2794         * rootcontext.cs,
2795         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2796
2797 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2798
2799         Fix #60638.
2800         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2801         New.  Reports CS0252/CS0253.
2802         Mostly taken from preliminary patch by Duncak Mak.
2803         (Binary.DoResolveOperator): Store results of operator lookup.
2804         Use them to detect if we need to warn about unintended reference
2805         comparisons.
2806
2807 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2808
2809         Fix #72969.
2810         * namespace.cs (Namespace.Lookup): Add back location parameter.
2811         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2812         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2813
2814         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2815         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2816         (Namespace.LookupType): ... this.
2817         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2818         of namespaces.
2819         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2820         purported to handle pointers.
2821         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2822         CoreLookupType.
2823
2824 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2825
2826         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2827         type as namespace.
2828
2829 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2830
2831         * namespace.cs (Namespace.Lookup): Drop location parameter.
2832         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2833         (NamespaceEntry.Lookup): ... this.
2834         (NamespaceEntry.Error_AmbiguousTypeReference):
2835         Move here from DeclSpace.
2836         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2837         names ...
2838         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2839         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2840         Move to NamespaceEntry.
2841         * delegate.cs, expression.cs: Update to changes.
2842
2843 2005-08-31  Martin Baulig  <martin@ximian.com>
2844
2845         Committing a patch from Atsushi Enomoto for #75850.
2846
2847         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2848         Prefer a generic enumerator over a non-generic one.
2849
2850 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2851
2852         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2853         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2854
2855 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2856
2857         * driver.cs : reverting default encoding change as well as mcs.
2858
2859 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2860
2861         * driver.cs, support.cs : merged r48826.
2862           Marek Safer wrote:
2863           > could you integrate your mcs changes to gmcs otherwise
2864           > gmcs cannot compile some files.
2865
2866 2005-08-20  Martin Baulig  <martin@ximian.com>
2867
2868         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2869         scope if we don't already have it.
2870
2871         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2872         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2873         fixes #75867.
2874
2875 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2876
2877         * statement.cs: Copy the local exception into the exception
2878         captured local.  Fixes 75674
2879
2880 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2881
2882         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2883         type as namespace.
2884
2885 2005-08-12  Martin Baulig  <martin@ximian.com>
2886
2887         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2888         for nested types here to avoid hitting the cache too early.
2889
2890 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2891
2892         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2893         an error. 
2894
2895 2005-08-03  Martin Baulig  <martin@ximian.com>
2896
2897         Make iterators in generic methods work; see gtest-191.cs.
2898
2899         * generic.cs
2900         (Constraints.Resolve): Protect against being called twice.
2901
2902         * class.cs
2903         (TypeContainer.GetClassBases): Make this `protected virtual'.
2904
2905         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2906         (Iterator.GetClassBases): Override this and compute the base
2907         classes here.
2908         (Iterator.DefineNestedTypes): If we're a generic method, all our
2909         method type parameters become class type parameters on the proxy
2910         class.
2911
2912         * statement.cs
2913         (ToplevelBlock.Parameters): Make this a property, not a field.
2914         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2915
2916 2005-08-03  Martin Baulig  <martin@ximian.com>
2917
2918         * typemanager.cs (TypeManager.IsSubclassOf): Use
2919         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2920         (TypeManager.GetFullName_recursed): Improved.
2921
2922 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2923
2924         Fix #75417
2925         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2926         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2927         invocation_type == mi.DeclaringType, since the first one also checks
2928         other condition used by generic instances.
2929         
2930 2005-07-27  Martin Baulig  <martin@ximian.com>
2931
2932         * anonymous.cs (CaptureContext.AddField): Added
2933         `AnonymousContainer am' argument; compute its toplevel scope if
2934         it's not already computed.  Fixes #75649.
2935
2936 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2937
2938         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2939         CheckAttributeType and refactored.
2940         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2941         ResolveAsTypeTerminal error handling.
2942         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2943         handling.
2944         (GetSignatureForError): Print errors in same way.
2945
2946         * class.cs,
2947         * codegen.cs: Reflect attribute GetSignatureForError change.
2948
2949         * ecore.cs,
2950         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2951
2952         * namespace.cs (UsingEntry): Refactored to make fields private.
2953
2954         * assign.cs,
2955         statement.cs: Error_UnexpectedKind has extra parameter.
2956
2957 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2958
2959         * ecore.cs (IAlias): Remove.
2960         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2961         that implement the interface.
2962         * namespace.cs (Namespace): Likewise.
2963         (Namespace.declspaces): Renamed from 'defined_names'.
2964         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2965         DeclSpace instead of an IAlias.
2966         * tree.cs (Tree.AddDecl): Update.
2967
2968 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2969
2970         * statement.cs (Block.Flags); Remove HasVarargs.
2971         (Block.HasVarargs): Move to ToplevelBlock.
2972         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2973         (Block.Variables): Make protected.  Initialize variable hashtable
2974         if necessary.
2975         (Block.AddVariable): Update.
2976         (Block.Resolve): Update to changes.
2977         (ToplevelBlock.HasVarargs): New boolean.
2978         (ToplevelBlock.ThisVariable): Move here from Block.
2979         (ToplevelBlock.AddThisVariable): Likewise.
2980         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2981         * expression.cs (This.ResolveBase): Update to changes.
2982         (ArglistAccess.DoResolve): Likewise.
2983
2984 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2985
2986         Fix #75321
2987         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2988
2989         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2990         not used and not used & assigned.
2991         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2992
2993 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2994
2995         Fix #75053
2996         * expression.cs (Is.DoResolve): null is never provided type.
2997
2998 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2999
3000         Fix #52496
3001         * cs-parser.jay: Less strict event error rule to catch more errors.
3002
3003 2005-07-11  Martin Baulig  <martin@ximian.com>
3004
3005         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3006         for the constructor constraint: we do not only have to check
3007         whether the class has a public constructor, but also ensure that
3008         it's parameterless.  Fixes #75492.
3009
3010 2005-07-11  Martin Baulig  <martin@ximian.com>
3011
3012         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3013         between type parameters if they either have the reference type
3014         constraint or the class constraint.
3015
3016 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3017
3018         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3019
3020 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3021
3022         Fix #74975
3023         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3024         (ExtractSecurityPermissionSet): Cope with self referencing security
3025         attributes properly.
3026
3027         * driver.cs (SetOutputFile): Made public property OutputFile.
3028
3029 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3030
3031         Fix #75486.
3032         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3033         has_nonstatic_fields.  Make into a FieldBase pointer.
3034         (TypeContainer.AddField): Add CS0282 check.
3035         (TypeContainer.EmitType): Update.
3036
3037 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3038
3039         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3040         compare if they start with __.
3041
3042 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3043
3044         * statement.cs (Switch.SwitchGoverningType): Only look at
3045         UserCasts that don't need implicit standard conversions to one of
3046         the allowed switch types (Fixes test-322.cs).
3047         (LocalInfo.Resolve): Re-enable sanity-test.
3048
3049 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3050
3051         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3052         
3053         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3054         
3055         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3056
3057 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3058
3059         Fix #75472.
3060         * ecore.cs (SimpleName.GetSignatureForError): Add.
3061         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3062         (MemberAccess.GetSignatureForError): Add.
3063
3064 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3065  
3066         The big error and warning messages review.
3067         
3068         * anonymous.cs,
3069         * assign.cs,
3070         * attribute.cs,
3071         * class.cs,
3072         * codegen.cs,
3073         * convert.cs,
3074         * cs-parser.jay,
3075         * cs-tokenizer.cs,
3076         * decl.cs,
3077         * delegate.cs,
3078         * doc.cs,
3079         * driver.cs,
3080         * ecore.cs,
3081         * enum.cs,
3082         * expression.cs,
3083         * flowanalysis.cs,
3084         * iterators.cs,
3085         * literal.cs,
3086         * location.cs,
3087         * modifiers.cs,
3088         * namespace.cs,
3089         * parameter.cs,
3090         * pending.cs,
3091         * report.cs,
3092         * rootcontext.cs,
3093         * statement.cs,
3094         * support.cs,
3095         * tree.cs,
3096         * typemanager.cs: Updated.
3097         
3098         * class.cs: (MethodCore.SetYields): Moved here to share.
3099         (PropertyMethod.Define): Moved iterator setup here.
3100         
3101         * iterators.cs: Add orig_method to have full access to parent
3102         container.
3103
3104 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3105
3106         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3107         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3108         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3109         variable of struct type.
3110         * expression.cs (Unary.ResolveOperator): Update to change.
3111         (Indirection.VerifyFixed): Likewise.
3112         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3113         (ParameterReference.VerifyFixed): Value parameters are fixed.
3114         (This.VerifyFixed): Treat 'this' as a value parameter.
3115         * statement.cs (LocalInfo.IsFixed): Remove.
3116
3117 2005-07-01  Martin Baulig  <martin@ximian.com>
3118
3119         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3120         `ec.EmitThis ()' to get the correct scope.
3121
3122 2005-07-01  Martin Baulig  <martin@ximian.com>
3123
3124         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3125         instance is a ParameterReference; fixes #75299.
3126
3127 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3128
3129         Fix #75412.
3130         * expression.cs (Indexers.map): Remove.
3131         (Indexers.Append): Filter out inaccessible setters and getters.
3132         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3133
3134         Fix #75283.
3135         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3136         Refactored from ...
3137         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3138         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3139         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3140         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3141
3142 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3143
3144         Fix #75322
3145         * class.cs (FieldBase.GetInitializerExpression): One more field
3146         for backup.
3147
3148 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3149
3150         * pending.cs: Do not define a proxy if the base method is virtual,
3151         it will be picked up by the runtime (bug 75270).
3152
3153 2005-07-08  Martin Baulig  <martin@ximian.com>
3154
3155         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3156         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3157
3158 2005-07-07  Martin Baulig  <martin@ximian.com>
3159
3160         * generic.cs (ConstructedType.CheckConstraint): Use
3161         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3162         called recursively; fixes #75329.
3163
3164 2005-07-06  Martin Baulig  <martin@ximian.com>
3165
3166         * generic.cs (TypeManager.InferTypeArguments): Added support for
3167         anonymous methods; fixes #75461.
3168
3169 2005-07-01  Martin Baulig  <martin@ximian.com>
3170
3171         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3172         `ec.EmitThis ()' to get the correct scope.
3173
3174 2005-07-01  Martin Baulig  <martin@ximian.com>
3175
3176         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3177         instance is `This'; fixes #75299.
3178
3179 2005-06-30  Martin Baulig  <martin@ximian.com>
3180
3181         * class.cs (Indexer): Implement IIteratorContainer; added support
3182         for iterators in indexers.
3183
3184         * codegen.cs
3185         (EmitContext.CurrentIterator): Make this a property, not a field.
3186
3187         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3188
3189 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3190
3191         * pending.cs: Do not define a proxy if the base method is virtual,
3192         it will be picked up by the runtime (bug 75270).
3193
3194 2005-06-28  Martin Baulig  <martin@ximian.com>
3195
3196         * cs-parser.jay (interface_method_declaration): Avoid a
3197         reduce/reduce conflict by moving some of the code into a separate
3198         `interface_method_declaration_body' rule; fixes #75368.
3199
3200 2005-06-28  Martin Baulig  <martin@ximian.com>
3201
3202         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3203         array check after the check for TypeBuilder's.
3204
3205 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3206
3207         * convert.cs (FindMostEncompassedType): Add two trivial special
3208         cases (number_of_types == 0 || number_of_types == 1).
3209         (FindMostEncompasingType): Likewise.
3210
3211 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3212
3213         Some cleanups preparing for the fix of #75283.
3214         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3215         error testing.
3216         (EventExpr.InstanceResolve): Likewise.
3217         (EventExpr.DoResolve): Remove redundant checks.
3218
3219 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3220
3221         * class.cs: Small fix.
3222
3223 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3224
3225         Fix #75160.
3226         * class.cs (GetPartialBases): Fix return value check of
3227         part.GetClassBases.
3228
3229 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3230
3231         Ensure that partial classes are registered in their enclosing
3232         namespace.  Initial part of fix of #75160.
3233         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3234         Register declspace with namespace here, not in
3235         DeclSpace.RecordDecl.
3236         * cs-parser.jay: Pass namespace to RecordDecl.
3237         * class.cs (PartialContainer.Create): Likewise.
3238         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3239         called.
3240         * decl.cs (Declspace.RecordDecl): Remove.
3241         * namespace.cs (NamespaceEntry.DefineName): Remove.
3242
3243 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3244
3245         * rootcontext.cs: Reset TargetExt as well.
3246
3247 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3248
3249         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3250         -langversion:ISO-1.
3251
3252 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3253
3254         Fix #75080, cs0119.cs.
3255         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3256         of ...
3257         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3258         allowing ExprClass.Type and ExprClass.Namespace for
3259         ResolveFlags.VariableOrValue.
3260         (Expression.Resolve) [1-argument variant]: Change default resolve
3261         flags based on language version.
3262         (Expression.Error_UnexpectedKind): Use a simple string array
3263         rather than an ArrayList.
3264         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3265         not ExprClass.Type.
3266         (TypeOfVoid.DoResolve): Likewise.
3267         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3268         flags argument -- it always has the same value.
3269
3270 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3271
3272         Fix #75081.
3273         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3274         Use it in the error message.
3275         * assign.cs, expression.cs, statement.cs: Update.
3276
3277 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3278
3279         Fix #75088.
3280         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3281         the "almostMatchedMember" case too.
3282         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3283         that failed the accessibility checks to 'almost_match'.
3284
3285 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3286
3287         * attribute.cs: Use internal MethodBuilder methods to set
3288         ExactSpelling and SetLastError on PInvoke methods, instead
3289         of passing them via charset.  Fixes #75060.
3290
3291 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3292
3293         * parameter.cs (Parameter): Remove TODO comment.
3294         (Parameter.DefineParameter): Remove Location parameter.
3295         (Parameters.LabelParameters): Likewise.
3296         * class.cs (Constructor.Emit): Update to change.
3297         (MethodData.Emit): Likewise.
3298         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3299         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3300
3301 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3302
3303         * parameter.cs,
3304           Removed Parameters.Location and added Parameter.Location instead.
3305           Removed Location parameter from Emit() and GetSignature().
3306         * anonymous.cs,
3307           class.cs,
3308           cs-parser.jay,
3309           delegate.cs,
3310           iterators.cs,
3311           statement.cs :
3312           Modified all related calls.
3313
3314 2005-06-21  Martin Baulig  <martin@ximian.com>
3315
3316         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3317         left-hand side is not a nullable type; fixes #75328.
3318
3319 2005-06-21  Martin Baulig  <martin@ximian.com>
3320
3321         * typemanager.cs
3322         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3323         (TypeManager.GetFullNameSignature): Likewise.
3324
3325         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3326         `source.FullName' and `target.FullName' to check whether there are
3327         two conflicting definitions.
3328
3329 2005-06-21  Martin Baulig  <martin@ximian.com>
3330
3331         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3332         a BoxedCast - also for reference types - to be compatible with csc.
3333
3334 2005-06-21  Martin Baulig  <martin@ximian.com>
3335
3336         * expression.cs (MemberAccess.DoResolve): Add support for nested
3337         types in a generic instance; fixes #75320.
3338
3339 2005-06-20  Martin Baulig  <martin@ximian.com>
3340
3341         * generic.cs (TypeManager.InferType): Also walk the class
3342         hierarchy for generic instances; fixes #75261.
3343
3344 2005-06-17  Martin Baulig  <martin@ximian.com>
3345
3346         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3347         to make things work for corlib.
3348
3349 2005-06-15  Martin Baulig  <martin@ximian.com>
3350
3351         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3352         obsolete `SecurityAction' values.
3353
3354 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3355
3356         * rootcontext.cs: Reset TargetExt as well.
3357         
3358 2005-06-09  Martin Baulig  <martin@ximian.com>
3359
3360         * delegate.cs (Delegate.VerifyMethod): Added
3361         `MethodGroupExpr old_mg' argument; inherit its
3362         `HasTypeParameters'; fix #75085.
3363
3364 2005-06-09  Martin Baulig  <martin@ximian.com>
3365
3366         * expression.cs (Invocation.OverloadResolve): Correctly handle
3367         generic methods for the SetMemberIsUsed(); fix #75064.
3368
3369 2005-06-09  Martin Baulig  <martin@ximian.com>
3370
3371         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3372         fixes #75062.
3373
3374 2005-06-08  Martin Baulig  <martin@ximian.com>
3375
3376         * cs-parser.jay (nullable_type_or_conditional): If we put the
3377         nullable back and our `type' is a `ComposedCast', remove the
3378         nullable from it.  Fixes #75156.
3379
3380         * expression.cs (ComposedCast.RemoveNullable): New public method.
3381
3382 2005-06-08  Martin Baulig  <martin@ximian.com>
3383
3384         The big Iterators rewrite :-)
3385
3386         * iterators.cs: Rewrite this to use the anonymous methods framework.
3387
3388         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3389         before the TypeContainers; see 2test-21.cs.
3390
3391         * class.cs
3392         (TypeContainer.DefineType): Don't create a new EmitContext if we
3393         already have one (this only happens if we're an Iterator).
3394         (TypeContainer.Define): Also call Define() on all our iterators.
3395         (Method.CreateEmitContext): Added support for iterators.
3396
3397         * anonymous.cs
3398         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3399         (AnonymousContainer.CreateMethodHost): Moved here from
3400         AnonymousMethod and made abstract.
3401         (AnonymousContainer.CreateScopeType): New abstract method.
3402         (AnonymousContainer.IsIterator): New public property.
3403         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3404         get the ScopeTypeBuilder rather than manually defining it here. 
3405         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3406         iterators here.
3407
3408         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3409         before RootContext.DefineTypes().
3410
3411         * codegen.cs (EmitContext.RemapToProxy): Removed.
3412         (EmitContext.CurrentAnonymousMethod): Changed type from
3413         AnonymousMethod -> AnonymousContainer.
3414         (EmitContext.ResolveTopBlock): Protect from being called twice.
3415         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3416         (EmitContext.EmitThis): Removed the iterators hacks; use the
3417         anonymous methods framework for that.
3418
3419         * statement.cs
3420         (ToplevelBlock.Container): Make this a property, not a field.
3421         (ToplevelBlock.ReParent): New public method; move the
3422         ToplevelBlock into a new container.
3423         (Foreach.TemporaryVariable): Simplify.
3424
3425 2005-06-05  Martin Baulig  <martin@ximian.com>
3426
3427         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3428         (Block.AddTemporaryVariable): New public method; creates a new
3429         `LocalInfo' for a temporary variable.
3430         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3431         variables here.
3432         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3433         non-iterator variables.
3434
3435 2005-06-05  Martin Baulig  <martin@ximian.com>
3436
3437         * statement.cs (Foreach.TemporaryVariable): Create the
3438         LocalBuilder in the Emit phase and not in Resolve since in some
3439         situations, we don't have an ILGenerator during Resolve; see
3440         2test-19.cs for an example.
3441
3442 2005-06-04  Martin Baulig  <martin@ximian.com>
3443
3444         The big Foreach rewrite - Part II.
3445
3446         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3447         with `PropertyInfo ienumerator_getcurrent'.
3448
3449         * codegen.cs (VariableStorage): Removed.
3450
3451         * statement.cs
3452         (Foreach): Derive from Statement, not ExceptionStatement.
3453         (Foreach.CollectionForeach): New nested class.  Moved all the code
3454         dealing with collection foreach here.
3455         (Foreach.ForeachHelperMethods): Removed.
3456         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3457
3458 2005-05-23  Martin Baulig  <martin@ximian.com>
3459
3460         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3461         don't need to.  Fix #75014.
3462
3463 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3464
3465         Improve user-defined conversion handling.
3466         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3467         applicable operators.
3468         (AddConversionOperators): New.  Helper for GetConversionOperators.
3469         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3470         there is only one most encompassed/encompassing type.
3471         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3472         "applicable operator" handling.
3473         (UserConversion): Move cache here from GetConversionOperators.
3474         Directly cache the chosen operator, rather than the whole
3475         MethodGroup.
3476         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3477         case.  Allow conversion of decimal to sbyte and byte too.
3478         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3479         New static methods.  Used to avoid allocating EmptyExpressions in
3480         convert.cs.
3481
3482 2005-05-24  Duncan Mak  <duncan@novell.com>
3483
3484         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3485         another class, used in Convert.ExplicitNumericConversion.
3486         (CastToDecimal): New class, similar to above, but casts to
3487         System.Decimal, used in Convert.ImplicitNumericConversion and also
3488         in explicit convesion from double/float to decimal.
3489
3490         * convert.cs (ImplicitNumericConversion): Handle implicit
3491         conversions to System.Decimal.
3492         (ExplicitNumericConversion): handle explicit conversions to
3493         System.Decimal.
3494
3495         This fixes #68711.
3496         
3497 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3498
3499         * typemanager.cs: Do not throw an exception in the TypeBuilder
3500         case, we take care of it on the TypeCode.
3501
3502 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3503         
3504         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3505         is back.
3506         
3507         * cs-parser.jay: Catch more lexical errors.
3508         
3509         * report.cs: Add one more Error method.
3510         
3511         * rootcontext.cs,
3512         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3513
3514 2005-05-20  Martin Baulig  <martin@ximian.com>
3515
3516         * class.cs (TypeContainer.CircularDepException): Removed.
3517         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3518         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3519         (CS0146) and interface (CS0529) dependencies here.
3520
3521 2005-05-20  Martin Baulig  <martin@ximian.com>
3522
3523         * expression.cs (New.DoResolve): Move the CS0712 check above the
3524         CS0144 check; otherwise it can never be reached.
3525
3526 2005-05-20  Martin Baulig  <martin@ximian.com>
3527
3528         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3529
3530 2005-05-20  Martin Baulig  <martin@ximian.com>
3531
3532         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3533
3534         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3535
3536 2005-05-19  Martin Baulig  <martin@ximian.com>
3537
3538         * delegate.cs
3539         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3540         to disable error reporting.
3541
3542         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3543         here since we don't want to report an error; see the new test-336.cs.
3544
3545 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3546
3547         * statement.cs (ToplevelBlock.GetParameterReference)
3548         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3549         Move here from class Block.
3550         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3551         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3552
3553 2005-05-18  Martin Baulig  <martin@ximian.com>
3554
3555         Fix #74978.
3556
3557         * flowanalysis.cs
3558         (FlowBranching.Reachability): Add non-static public And() and Or()
3559         methods.
3560         (FlowBranchingSwitch): New class; do the `break_origins' thing
3561         like in FlowBranchingLoop.
3562         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3563         reachability, not just locals and parameters.
3564         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3565         switch; MergeBreakOrigins() now takes care of that.
3566
3567 2005-05-18  Martin Baulig  <martin@ximian.com>
3568
3569         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3570         a loop and may leave it, reset the barrier; fixes #74974.
3571
3572 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3573
3574         Fix test-382.cs.  Emit values of decimal constants.
3575         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3576         Carved out of ...
3577         (TypeContainer.AddField): ... this.
3578         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3579         with initializers to include 'Const's.
3580         (ClassPart.RegisterFieldForInitialization): Forward to
3581         PartialContainer.
3582         * const.cs (Const.Const): Pass initializer to base class.
3583         (Const.Define): In case of decimal constants, register them for
3584         initialization in a static constructor.
3585
3586 2005-05-14  Martin Baulig  <martin@ximian.com>
3587
3588         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3589         do not call ResolveUnreachable() on unreachable statements in
3590         here, see the comment in the source code.
3591
3592 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3593
3594         Fix #74934.
3595         * expression.cs (BinaryResolveOperator): If one of the operands of
3596         an equality comparison is 'null' and the other is a pointer type,
3597         convert the null to a NullPointer.
3598         * convert.cs (ImplicitReferenceConversion): If the expression is a
3599         NullLiteral and the target type is a pointer type, return a
3600         NullPointer instead.
3601         (ImplicitConversionStandard): Likewise.
3602
3603 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3604         
3605         * cs-parser.jay: Set readonly context based on special constructs.
3606         
3607         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3608         readonly variable error handling.
3609         
3610         * rootcontext.cs (EmitCode): Don't verify members when error
3611         occurred.
3612         
3613         * statement.cs (LocalInfo): Add reaodnly context information.
3614         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3615
3616 2005-05-17  Martin Baulig  <martin@ximian.com>
3617
3618         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3619         #70970. 
3620
3621 2005-05-13  Martin Baulig  <martin@ximian.com>
3622
3623         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3624         handle unreachable blocks.
3625
3626 2005-05-13  Martin Baulig  <martin@ximian.com>
3627
3628         * class.cs
3629         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3630         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3631         #74905. 
3632
3633 2005-05-13  Martin Baulig  <martin@ximian.com>
3634
3635         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3636         instance variable, not a local.  Fix #74873.
3637         (Block.ResolveUnreachable): Set it to true here.
3638
3639 2005-05-12  Martin Baulig  <martin@ximian.com>
3640
3641         * cs-parser.jay (property_declaration): Pass the `current_class',
3642         not the `current_container' to Property's .ctor.  Fixes #74912.
3643
3644 2005-05-11  Martin Baulig  <martin@ximian.com>
3645
3646         * typemanager.cs (Closure): Copy this from MCS and merge all the
3647         GMCS-specific changes into it.
3648
3649 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3650
3651         Fix #74920.
3652         * typemanager.cs (unmanaged_enclosing_types): New.
3653         (IsUnmanagedType): Avoid infloops by using
3654         'unmanaged_enclosing_types' to talk with recursive invocations.
3655
3656 2005-05-11  Duncan Mak  <duncan@novell.com>
3657
3658         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3659         continuing to process for 'arg'.
3660         (handle_preprocessing_directive): Check the argument of the #endif
3661         directive and report error CS1025 if there are any trailing
3662         characters.
3663
3664         According to the C# spec, having even whitespace after the #endif
3665         directive is illegal; however, because we call arg.TrimEnd ()
3666         beforehand, we have the same behavior as csc, allowing whitespace
3667         after the directive.
3668
3669         Fixes #74892.
3670
3671 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3672
3673         Fix #74863.
3674         
3675         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3676         (Constructor.GetObsoleteAttribute): Implemented correctly.
3677
3678 2005-05-10  Martin Baulig  <martin@ximian.com>
3679
3680         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3681         resolve the type; fixes #74864.
3682         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3683         in DoResolve(); fixes #74862.
3684
3685 2005-05-10  Martin Baulig  <martin@ximian.com>
3686
3687         * support.cs (ReflectionParameters.ParameterModifier): Use
3688         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3689         and `ParameterAttributes.In'.  Fixes #74884.
3690
3691 2005-05-10  Martin Baulig  <martin@ximian.com>
3692
3693         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3694         the cache if we're just looking for `MemberTypes.NestedType' in a
3695         generic instance.
3696
3697         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3698         constraints if we're still resolving the type tree.
3699         (Expression.MemberLookup): If we're resolving the type tree, only
3700         look for `MemberTypes.NestedType' since we're only interested in
3701         getting types.
3702
3703         * class.cs (TypeContainer.DefineType): Don't resolve the type
3704         parameters here; do this later in ResolveType() after the type
3705         tree has been resolved.
3706         (TypeContainer.ResolveType): New public method; this is called
3707         after the type tree is resolved and before the types are being
3708         populated.  We resolve the generic constraints here.
3709         (TypeContainer.DoDefineMember): Check the constraints on our base
3710         class and interfaces.
3711
3712         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3713         set the `ResolvingTypeTree' flag on the EmitContext.
3714
3715         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3716
3717 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3718
3719         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3720         
3721         * expression.cs (Argument.GetParameterModifier): Turned to property.
3722         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3723         
3724         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3725         its C# equivalent.
3726         
3727 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3728
3729         Fix #74852.
3730         * decl.cs (MemberCache.AddMethods): Register override methods,
3731         rather than non-override methods.
3732         * typemanager.cs (RegisterOverride): New.
3733         (IsOverride): Update.
3734
3735 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3736
3737         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3738
3739 2005-05-06  Martin Baulig  <martin@ximian.com>
3740
3741         * attribute.cs
3742         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3743         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3744
3745 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3746
3747         Fix #73105.
3748         
3749         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3750         recursive declaration.
3751         
3752         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3753         
3754 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3755
3756         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3757         
3758         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3759
3760 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3761
3762         Fix #74797.
3763         * decl.cs (DeclSpace.FamilyAccessible): 
3764         Use TypeManager.IsNestedFamilyAccessible.
3765
3766         Fix reopened #64812.
3767         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3768         internal'.
3769
3770 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3771             Abin Thomas  <projectmonokochi@rediffmail.com>
3772             Anoob V E  <projectmonokochi@rediffmail.com>
3773             Harilal P R  <projectmonokochi@rediffmail.com>
3774
3775         Fix #64812.
3776         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3777         allow access to all static members.
3778
3779 2005-05-04  Martin Baulig  <martin@ximian.com>
3780
3781         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3782
3783 2005-05-04  Martin Baulig  <martin@ximian.com>
3784
3785         Fix #74655.
3786
3787         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3788         section at the end; make things work if `default' is not the last
3789         section.        
3790
3791 2005-05-04  Martin Baulig  <martin@ximian.com>
3792
3793         Fix #70400.
3794
3795         * statement.cs (Switch): Replaced the `got_default' field with a
3796         `default_section' one.
3797         (Switch.CheckSwitch): Set `default_section' here.
3798         (Switch.Resolve): If we're a constant switch and the constant is
3799         not found, use the default section.
3800
3801 2005-05-03  Martin Baulig  <martin@ximian.com>
3802
3803         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3804
3805         * statement.cs (Foreach.ArrayForeach): New nested class.
3806         (Foreach.TemporaryVariable): New nested class.
3807         (Foreach.EmitArrayForeach): Removed; this is now in the new
3808         ArrayForeach class.
3809
3810 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3811
3812         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3813         more conservative.
3814         (VerifyPendingMethods): Revert change below.
3815
3816         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3817         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3818         that used to trigger warning -28.  Remove warning -28.
3819         * expression.cs (Invocation.OverloadResolve): Use
3820         TypeManager.IsOverride to distinguish override methods.
3821
3822         Fix #74773.
3823         * pending.cs (VerifyPendingMethods): If a base type implements the
3824         requested interface, don't bother checking individual methods of
3825         the base type.  As a side-effect, this prevents the creation of
3826         unnecessary proxies.
3827
3828 2005-05-02  Martin Baulig  <martin@ximian.com>
3829
3830         Fix #70182.
3831
3832         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3833         Also `And' the locals if the old vector is null.
3834         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3835         null; in this case we basically reset all the variables.        
3836
3837 2005-05-02  Martin Baulig  <martin@ximian.com>
3838
3839         Fix #74529.
3840
3841         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3842         Added `FlowBranching branching' argument; always `and' the
3843         variables instead of `or'ing them unless we're an infinite loop.
3844
3845         * statement.cs (While.Resolve): Create a new sibling unless we're
3846         infinite.       
3847
3848 2005-05-02  Martin Baulig  <martin@ximian.com>
3849
3850         Fix #70140.
3851
3852         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3853         arguments; use it instead of creating a new TopLevelBlock.
3854         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3855         our ConstructorInitializer.
3856
3857         * statement.cs
3858         (TopLevelBlock.TopLevelBranching): New public property.
3859         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3860         and create our `TopLevelBranching'.
3861
3862         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3863         anonymous method host, use `block.TopLevelBranching' rather than
3864         creating a new branching.
3865
3866 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3867
3868         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3869         a ScopeInfo, if any of the current children is a child of the new
3870         entry, move those children there.
3871
3872 2005-04-30  Martin Baulig  <martin@ximian.com>
3873
3874         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3875         at the beginning of a SwitchSection.  Fix #73335.
3876
3877 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3878
3879         Fix #74378
3880         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3881         
3882         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3883         (FieldExpr.DoResolve): Obsolete members are ignored for field
3884         initializers.
3885         
3886 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3887
3888         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3889         of arrays detection.
3890
3891         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3892         verification.
3893         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3894
3895         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3896         arrays report.
3897
3898 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3899
3900         * cs-parser.jay: Use the prefered version of -unsafe in error
3901         message.
3902
3903 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3904
3905         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3906         circumstances.
3907
3908 2005-04-20  John Luke  <john.luke@gmail.com>
3909
3910         * driver.cs: fix typo in error message, --outout to --output
3911
3912 2005-04-30  Martin Baulig  <martin@ximian.com>
3913
3914         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3915         handle the .NET 2.x security attributes.
3916
3917 2005-04-30  Martin Baulig  <martin@ximian.com>
3918
3919         * typemanager.cs
3920         (TypeManager.ExpandInterfaces): Don't add things twice.
3921
3922         * class.cs
3923         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3924
3925 2005-04-29  Martin Baulig  <martin@ximian.com>
3926
3927         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3928
3929         * anonymous.cs: Added support for anonymous generic methods.
3930
3931 2005-04-29  Martin Baulig  <martin@ximian.com>
3932
3933         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3934         generic instances.
3935
3936 2005-04-29  Martin Baulig  <martin@ximian.com>
3937
3938         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3939
3940         * expression.cs (New.DoResolve): Fix the CS0304 check.
3941
3942 2005-04-29  Martin Baulig  <martin@ximian.com>
3943
3944         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3945         naming schema.
3946
3947         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3948         explicit interface implementation, compare the interface types.
3949         (MethodData.Define): Use the new naming scheme from the latest
3950         .NET 2.x beta2.
3951         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3952
3953         * decl.cs (MemberName.GetMemberName): Removed.
3954         (MemberName.MethodName, FullName): New properties.
3955
3956 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3957
3958         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3959
3960 2005-04-22  Martin Baulig  <martin@ximian.com>
3961
3962         * generic.cs (GenericMethod): Create the EmitContext in the
3963         `Define()'; in `Define(MethodBuilder)', create the type parameters
3964         before calling `Define()'.  Fixes #73933.
3965
3966 2005-04-22  Martin Baulig  <martin@ximian.com>
3967
3968         * generic.cs
3969         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3970         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3971
3972         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3973         ConstructedType, check its constraints.
3974
3975 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3976
3977         * codegen.cs (InRefOutArgumentResolving): New field.
3978         
3979         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3980         fields outside contructor.
3981         
3982         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3983         
3984 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3985
3986         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3987         parameter code was not completed ever, so it was not as up-to-date
3988         as local variables.  Must finish it.
3989
3990         The bug fix was to compare the Toplevel of the block, not the
3991         current block.  Thanks for Ben for pointing this out. 
3992
3993 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3994
3995         * decl.cs (AddMethods): Use the declaring type of the problem
3996         method to determine if we want to squash a warning.
3997
3998 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * attribute.cs: Removed debug output.
4001
4002         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4003         
4004         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4005         Report.Stderr.
4006         
4007 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4008
4009         Fix #74481.
4010         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4011         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4012         all null comparisons against reference types.
4013
4014 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4015
4016         Fix# 74565
4017         * class.cs (TypeContainer.CircularDepException) New nested
4018         exception class.
4019         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4020         (TypeContainer.DefineType): Removed error, reset InTransit before
4021         exit.
4022         (Class.DefineType): Throw exception when is in Transit.
4023         Catch exception and report error.
4024         (Struct.DefineType): Throw exception when is in Transit.
4025         Catch exception and report error.
4026         (Interface.DefineType): Throw exception when is in Transit.
4027         Catch exception and report error.
4028
4029         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4030         handle nested exception handlers.
4031
4032         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4033         a catch.
4034
4035         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4036         InFinally and InCatch storage.
4037
4038         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4039         (Catch.Resolve): Set and Restore ec.InCatch.
4040         (Try.Resolve): Set and Restore ec.InFinally.
4041         (Try.HasCatch): True when try has catch.
4042
4043 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4044
4045         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4046           for the same event member, so exclude such cases from warning 419.
4047           Fixed bug #74633.
4048
4049 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4050
4051         * expression.cs (Binary.ResolveOperator): Apply patch from John
4052         Luke to fix bug 59864: operators &, | and ^ on enumerations
4053         require that the same enum type on both sides.
4054
4055         * driver.cs: Add warnings to old flag usage, this is to assist
4056         people who produce Makefiles and hope that the Makefiles will be
4057         used on Windows.
4058
4059         * class.cs (TypeContainer.EmitType): Moved the definition of the
4060         special $PRIVATE$ field from the resolve phase to the Emit phase.
4061         During resolve we do not know if we are a struct with
4062         HasExplicitLayout, we know this only after the attributes for the
4063         type are emitted.
4064
4065         Set the FieldOffset to zero on the dummy field that we create for
4066         the class.   Fixes 74590.
4067
4068 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4069
4070         Fix #73834.
4071         * ecore.cs (PropertyExpr.resolved): New.
4072         (DoResolve): Use it to handle a case of double resolution here.
4073         Handle a case of identical-name-and-type-name.
4074         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4075         resolution by storing the results of expression resolution back
4076         into the "probes" array.
4077
4078 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4079
4080         Fix cs0208-7.cs and cs0208-8.cs.
4081         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4082         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4083         error reporting to point out the reason a struct is not unmanaged.
4084
4085 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4086
4087         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4088           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4089
4090 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4091
4092         Fix #74528.
4093         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4094         IdenticalNameAndTypeName here.
4095         (EventExpr.InstanceResolve): Likewise.
4096
4097 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4098
4099         C# 2.0 DefaultCharSetAttribute implementation
4100         
4101         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4102         which allows us to set GlobalNamespace for every resolve.
4103         (Attribute.ResolveArguments): Cut from Resolve.
4104         (Attribute.GetCharSetValue): Returns CharSet named argument.
4105         (Attribute.DefinePInvokeMethod): Gets default charset from
4106         module settings.
4107         (GlobalAttribute.ResolveAsTypeStep): Override.
4108         (GlobalAttribute.ResolveArguments): Override.
4109         
4110         * class.cs (TypeAttr): Is protected.
4111         
4112         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4113         (ModuleClass.DefaultCharSetType): New memeber.
4114         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4115         
4116         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4117         charset from module.
4118         
4119         * delegate.cs (TypeAttr): Override.
4120         (Delegate.DefineType): Use this TypeAttr.
4121         
4122         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4123         at very early stage (before types are defined) to resolve model
4124         module attributes. It will probably not work with corlib but it
4125         should be ok.
4126         
4127         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4128         charset from module.
4129         
4130         * typemanager.cs (default_charset_type): New type.
4131
4132 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4133
4134         * decl.cs (MemberCache.AddMethods): Don't warn if
4135         System.Object.Finalize has buggy MethodAttributes.
4136
4137         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4138         removed below.
4139
4140 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4141
4142         * doc.cs : detect ambiguous reference to overloaded members.
4143           Fixed bug #71603. MS 1.1 csc does not detect it.
4144
4145 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4146
4147         * doc.cs : delegates must not be referenced with parameters.
4148           Fixed bug #71605.
4149
4150 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4151
4152         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4153
4154 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4155
4156         * driver.cs (MainDriver): Stop processing if the CLS stage found
4157         errors. 
4158
4159         (CompilerCallableEntryPoint.InvokeCompiler): Always
4160         reset after execution;   Take a TextWriter argument for the
4161         output.
4162
4163         * report.cs: Use the error stream instead of hardcoding stderr. 
4164
4165 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4166
4167         * class.cs: Reduce code paths to test, too small of an
4168         optimization to make it worth the extra testing.  Always perform
4169         it. 
4170
4171 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4172
4173         Fix #74510.
4174         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4175         operators that had errors reported on them.
4176
4177 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4178
4179         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4180         argument types.
4181         (Attribute.Resolve): Add named argument type checking.
4182         
4183         * class.cs (FixedField.Define): Use IsPrimitiveType
4184         
4185         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4186         
4187         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4188         unsafe parameter types.
4189         
4190         * statement.cs (Using.ResolveExpression): Add better error description.
4191         
4192         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4193         
4194 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4195
4196         Fix #74484.
4197         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4198         AttributeUsageAttribute in the emitcontext of the attribute class,
4199         not in the emitcontext of the attributable entity it was attached to.
4200         * cs-parser.jay: Use 'current_class', not 'current_container',
4201         when creating a GlobalAttribute.
4202
4203 2005-04-08  Alp Toker  <alp@atoker.com>
4204
4205         * pending.cs: The fix to #58413 failed to compile methods implementing
4206         interfaces with/without params modifiers and vice versa, even though
4207         params modifiers aren't part of the signature. Make the modifier check
4208         less strict as in csc.
4209
4210 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4211             Anoob V E  <projectmonokochi@rediffmail.com>
4212             Harilal P R  <projectmonokochi@rediffmail.com>
4213
4214         Fix #58413.
4215         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4216         modifiers of pending methods.
4217         (PendingImplementation.PendingImplementation): Initialize it.
4218         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4219         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4220         with ParameterData.  Add check for modifiers.
4221         * class.cs (MethodData.Define): Update to changes.
4222
4223 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4224
4225         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4226
4227 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4228
4229         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4230         property.
4231         
4232         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4233         
4234         * rootcontext.cs,
4235         * typemanager.cs: Registered RequiredAttributeAttribute.
4236         
4237 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4238
4239         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4240         Warning CS0169 is back at level 3.
4241         (IMethodData.SetMemberIsUsed): New method.
4242         
4243         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4244         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4245         
4246         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4247
4248         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4249         contants.
4250         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4251         is used.
4252         
4253         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4254         is used.
4255         
4256         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4257         to avoid the problems with nested types.
4258
4259 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4260             Anoob V.E  <projectmonokochi@rediffmail.com>
4261             Harilal P.R  <projectmonokochi@rediffmail.com>
4262             Raja R Harinath  <rharinath@novell.com>
4263
4264         Fix #73820.
4265         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4266         attribute.
4267         * typemanager (GetConstructor): Make public.
4268
4269 2005-04-05  John Luke  <john.luke@gmail.com>
4270             Raja R Harinath  <rharinath@novell.com>
4271
4272         Fix #62232.
4273         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4274         struct too.  Return false quicker in a few cases.
4275         (VerifyUnManaged): Use it.
4276
4277 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4278
4279         Fix #74041.
4280         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4281         not 'unreachable_seen'.
4282
4283 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4284
4285         * attribute.cs (Attribute.GetValue): Removed unused.
4286         
4287         * codegen.cs (CodeGen.TrimExt): Removed unused.
4288         
4289         * cs-parser.jay (output): Removed unused.
4290         
4291         * cs-tokenizer.cs (hex_digits): Removed unused.
4292         
4293         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4294         
4295         * expression.cs (Indirection.LoadExprValue): Removed unused.
4296         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4297         
4298         * iterators.cs (Iterator.param_types): Removed unused.
4299         
4300         * statement.cs (Goto.block): Removed unused.
4301         (ToplevelBlock.did): Removed unused.
4302         (Switch.ResolveConstantSwitch): Removed unused.
4303
4304 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4305
4306         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4307         resetting thingy.
4308
4309 2005-04-19  Martin Baulig  <martin@ximian.com>
4310
4311         Merged r42462 from MCS and made it work for GMCS.
4312
4313         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4314
4315         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4316
4317 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4318
4319         Fix #74232 and cs0208-3.cs.
4320         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4321         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4322         unmanaged type.  Don't use FieldBuilders when 't' is a
4323         TypeBuilder.  Use ModFlags and MemberType fields.
4324         * class.cs (MemberBase.member_type): Rename from MemberType.
4325         (MemberBase.MemberType): New property.  Determines member_type on
4326         demand.
4327         (MemberBase.DoDefine): Don't initialize MemberType here.
4328         (FieldMember.Define): Likewise.
4329
4330 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4331
4332         Fix #74241
4333         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4334         Attributes are emitted there.
4335         
4336 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4337
4338         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4339         keyword in 'partial enum' too.
4340         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4341         is not allowed).
4342         Report from Kamil Skalski <nazgul@omega.pl>.
4343
4344         Fix #74309.
4345         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4346         have partial containers too.
4347
4348         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4349         in block' checks to Block.CheckInvariantMeaningInBlock.
4350         * statement.cs (Block.GetKnownVariableInfo): Make private.
4351         (Block.IsVariableUsedInChildBlock): Remove.
4352         (Block.IsVariableUsedInBlock): Likewise.
4353         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4354         conflicting declaration.
4355         (Block.AddVariable): Make error messages less long-winded and more
4356         specific.  Show location of conflicting declaration.
4357         * parameter.cs (Parameters.Location): New readonly property.
4358
4359 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4360
4361         Clean up semantics of invoking ResolveMemberAccess.
4362         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4363         can have an instance, ensure that we pass in a non-TypeExpression
4364         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4365         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4366         argument.  Update to changes and simplify.
4367         (FieldExpr.Emitinstance): Remove CS0120 check.
4368         (PropertyExpr.EmitInstance): Likewise.
4369         * expression.cs (Argument.Resolve): Likewise.
4370         (Invocation.DoResolve): Update to changes in semantics of
4371         InstanceExpression.
4372
4373 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4374
4375         Fix #74241
4376         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4377         customization.
4378         
4379         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4380
4381 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4382
4383         Fix difference in behaviour with commandline invocation.
4384         * driver.cs (Driver.Reset): New.
4385         (CompilerCallableEntryPoint): Call it.
4386
4387         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4388         variable" warnings if the boolean expression failed to resolve.
4389
4390 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4391
4392         * attribute.cs: Fix the union of several permissions when some of them
4393         are unrestricted (so the result isn't an unrestricted permission set).
4394         Fix #74036.
4395
4396 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4397
4398         * ecore.cs (MemberExpr): New class.  Convert from interface
4399         IMemberExpr.
4400         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4401         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4402         error checks.
4403         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4404         (MethodGroupExpr.IsExplicitImpl): Remove.
4405         (Expression.GetFieldFromEvent): Remove.
4406         (SimpleName.MemberStaticCheck): Remove.
4407         (SimpleName.DoSimpleNameResolve): Update to changes.
4408         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4409         (MemberAccess.IdenticalNameAndTypeName): Remove.
4410         (MemberAccess.error176): Move to MemberExpr.
4411         (MemberAccess.DoResolve): Update to changes.
4412         (BaseAccess.DoResolve): Likewise.
4413
4414 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4415
4416         C# 2.0 Conditional attribute class implementation
4417         
4418         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4419         Analyzes class whether it has attribute which has ConditionalAttribute
4420         and its condition is not defined.
4421         
4422         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4423         (Class.IsExcluded): New method. Search for at least one defined
4424         condition in ConditionalAttribute of attribute class.
4425
4426 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4427
4428         * ecore.cs (PropertyExpr): Derive from Expression, not
4429         ExpressionStatement.
4430         (PropertyExpr.EmitStatement): Remove.
4431
4432 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4433
4434         Fix #74060.
4435         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4436         internal field "value__" of an enum be private.  The examples for
4437         "value__" that I found on MSDN all used FieldAttributes.Private.
4438
4439         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4440         Don't mention IL method attribute names.
4441
4442         Fix #47991.  Remove a TODO.
4443         * statement.cs (Block.Toplevel): Make into a field.
4444         (Block.Parameters): Move into ToplevelBlock.
4445         (Block.known_variables): Rename from child_variable_names.
4446         (Block.Block): Remove variants that take Parameters.  Initialize
4447         'Toplevel' with the immediately surrounding toplevel block.
4448         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4449         LocalInfo parameter.
4450         (Block.GetKnownVariableInfo): New.
4451         (Block.IsVariableNameUsedInChildBlock): Update.
4452         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4453         the block, even though it may not be in scope.
4454         (Block.AddVariable): Remove Parameters parameter.  Use
4455         Toplevel.Parameters instead.
4456         (Block.AddConstant): Remove Parameters parameter.
4457         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4458         (Block.IsParamaterReference): Likewise.
4459         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4460         (ToplevelBlock.Parameters): New.  Moved from Block.
4461         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4462         initialize Parameters to a non-null value.
4463         * cs-parser.jay: Update to changes.
4464         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4465         simple names that mean different things in the same block.  Use
4466         Block.IsVariableNameUsedInBlock.
4467
4468 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4469
4470         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4471
4472 2005-03-26  Raja R Harinath  <harinath@acm.org>
4473
4474         Fix #73038.
4475         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4476         fails to resolve, ensure that the LHS is still resolved as an
4477         lvalue.
4478
4479 2005-03-25  Raja R Harinath  <harinath@acm.org>
4480
4481         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4482         ec.ContainerType.
4483         (Enum.current_ec): Remove.
4484         (Enum.LookupEnumValue): Remove EmitContext argument.
4485         Just uses the one created during DefineType.
4486         (Enum.FindMembers): Update.
4487         * expression.cs (MemberAccess.DoResolve): Update.
4488
4489 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4490
4491         * assign.cs (Assign.DoResolve): Check for CS1717 when
4492         source and target are same (uses Equals).
4493
4494         * expression.cs (LocalVariableReference, ParameterReference,
4495         This): Implemented Equals, GetHashCode.
4496
4497         * statement.cs (Block.GetParameterReference): Removed useless
4498         local variable.
4499
4500 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4501
4502         Fix cs0128.cs
4503         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4504         blocks before deciding whether the error is cs0136 or cs0128.
4505
4506         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4507         (using_alias_directive, using_namespace_directive): Pass
4508         MemberName, not an expression to Namespace.UsingAlias and
4509         Namespace.Using.
4510         (MakeName): Use the MemberName of the namespace.
4511         * namespace.cs (Namespace.MemberName): New.
4512         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4513         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4514         Likewise.
4515         * decl.cs (MemberName.Name): Make readonly.
4516         (MemberName.FromDotted): New "constructor".
4517         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4518         (MemberCore.Name): Compute from MemberName on demand.
4519         (MemberCore.SetMemberName): Provide a way to change the
4520         MemberName.
4521         (MemberCore.AddToContainer): Don't take a fullname parameter.
4522         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4523         fully qualified name of the container to the member name.
4524         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4525         only if the type is a member of the root container.
4526         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4527         MemberName.Left rather than searching for an embedded ".".
4528         (PartialContainer.CreatePart): Update to changes in RootContext.
4529         (MemberBase.ShortName): Turn into a property.  Use
4530         MemberCore.SetMemberName.
4531         (MemberBase.ExplicitInterfaceName): Remove.
4532         (MemberBase.UpdateMemberName): Remove.
4533         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4534         (PropertyBase.SetMemberName): New override.
4535         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4536         (Tree.GetDecl): New.
4537         (Tree.AllDecls): Rename from Decls.
4538         * attribute.cs, enum.cs, report.cs: Update to changes.
4539         * driver.cs (MainDriver): Use MemberName.FromDotted on
4540         RootContext.MainClass.
4541
4542 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4543
4544         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4545         checks.
4546
4547         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4548
4549 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4550
4551         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4552         property accessor modifiers.
4553
4554         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4555         fixed buffer attribute (CS1716).
4556         (PropertyMethod.HasCustomAccessModifier): When property accessor
4557         has custom modifier.
4558
4559         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4560         modifiers.
4561         (PropertyExpr.DoResolveLValue): Add CS0272.
4562
4563 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4564
4565         * convert.cs: When converting to a pointer, use the proper Conv.U
4566         or Conv.I depending on the source data type.
4567
4568         * cs-tokenizer.cs: Make the size for large decimal constants,
4569         fixes #72957.
4570
4571 2005-03-17  Martin Baulig  <martin@ximian.com>
4572
4573         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4574         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4575
4576 2005-03-17  Martin Baulig  <martin@ximian.com>
4577
4578         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4579         to bool so we can return an error condition.
4580         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4581         returned an error.
4582
4583 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4584
4585         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4586         attributes.
4587
4588 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4589
4590         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4591         Refactor to avoid traversing the list of assemblies, and to avoid
4592         string concatenation.
4593         * typemanager.cs (guid_attr_type): Remove.
4594         (negative_hits, pointers, references): Remove hashes.
4595         (type_hash): New.
4596         (GetConstructedType): New.  Uses type_hash to handle constructed
4597         types (arrays, references, pointers).
4598         (GetReferenceType, GetPointerType): Use it.
4599         (GetNestedType): New.  Uses type_hash to handle nested types of
4600         reflected types.
4601         (LookupType, LookupTypeDirect): Remove.
4602         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4603         'types' hash and LookupTypeReflection directly.
4604         (params_string, params_object): Use GetConstructedType.
4605         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4606         top-level types.
4607         (Namespace.Lookup): Use cached_types.
4608         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4609         provided by old TypeManager.LookupType.
4610         * rootcontext.cs (MakeFQN): Remove.
4611         * decl.cs (DeclSpace.MakeFQN): Likewise.
4612         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4613         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4614         TypeManager.GetConstructedType.
4615         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4616
4617 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4618
4619         * cs-parser.jay: Fix build.
4620
4621 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4622
4623         * class.cs (TypeContainer.CircularDepException) New nested
4624         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4625
4626         * cs-parser.jay: Reports CS1527 for any namespace element.
4627
4628         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4629         Added CS0407.
4630
4631         * expression.cs (ParameterReference.IsAssigned): Changed error to
4632         CS0269.
4633         (Error_WrongNumArguments): Moved CS0245 detection here.
4634
4635         * statement.cs (Return.Resolve): Add CS1622 report.
4636
4637 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4638
4639         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4640
4641 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4642
4643         * attribute.cs expression.cs: Get rid of some allocations.
4644
4645 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4646
4647         * doc.cs : just eliminate the latest change.
4648
4649 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4650
4651         * doc.cs : commented out the latest change. It breaks xml-030.cs
4652
4653 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4654
4655         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4656           fail. So invoke CreateType() in FindDocumentedType().
4657
4658 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4659
4660         * cs-tokenizer.cs : added IsKeyword().
4661         * doc.cs : Detect keyword incorrectly used as identifier.
4662           Allow identifiers prefixed by @.
4663
4664 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4665
4666         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4667         It caused exception in namespace resolving (again!).
4668         
4669         * class.cs (Class.ctor): Removed exit.
4670         (PropertyMethod.ctor): ditto.
4671         
4672         * codegen.cs (Codegen.Reset): Reset static data.
4673         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4674         
4675         * cs-tokenizer.cs (Cleanup): Removed.
4676         
4677         * driver.cs (GetSystemDir): Rewrote to one line command.
4678         It caused problem with unloaded dynamic modules.
4679         (UnixParseOption): Removed Exit.
4680         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4681         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4682         Now can be mcs used as library.
4683         
4684         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4685         empty location.
4686         
4687         * location.cs (Reset): Reset static data.
4688         
4689         * namespace.cs (Reset): Reset static data.
4690         
4691         * report.cs (Report.Reset): Reset static data.
4692         
4693         * rootcontext.cs (RootContext.Reset): Reset static data.
4694         
4695         * tree.cs (RootTypes.ctor): Use Location.Null
4696         
4697         * typemanager.cs (TypeManager.Reset): Reset static data.
4698         (CoreLookupType): Removed Exit.
4699         (TypeHandle.Reset): Reset static data.
4700         
4701 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4702
4703         Fix #73516.
4704         * typemanager.cs (ComputeNamespaces): Import namespaces from
4705         referenced modules too.
4706
4707 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4708
4709         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4710         than '.'.
4711
4712 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4713
4714         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4715         enclosing DeclSpace.  This ensures that a name-lookup populates
4716         more caches and there are fewer 'TypeExpression's.  Carve out
4717         nested type lookup into ...
4718         (LookupNestedTypeInHierarchy): ... this.
4719
4720 2005-04-15  Martin Baulig  <martin@ximian.com>
4721
4722         Merged r41590 from MCS and make it work in the generics land.
4723
4724         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4725         `check' argument.
4726
4727         * class.cs (PartialContainer.UpdateConstraints): Removed.
4728         (PartialContainer.CheckConstraints): Removed.
4729         (PartialContainer.SetParameterInfo): Store the constraints here.
4730         (PartialContainer.DefineTypeParameters): New public method;
4731         resolve the type parameter's constraints here.  Note that the
4732         PartialContainer doesn't have an EmitContext anymore, so we must
4733         do this in the ClassPart.
4734
4735 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4736
4737         Clean up a few partial-class semantics.  
4738         Fixes test-357.cs and cs1618-2.cs.
4739         * cs-parser.jay (struct_declaration): Use 'current_class' as
4740         parent of newly-created struct.  Remove call to Register ().
4741         Use 'pop_current_class' to complete handing the current struct.
4742         (interface_declaration): Likewise.
4743         (class_declaration): Likewise.
4744         (enum_declaration): Use 'current_class' as parent of newly created
4745         enum.
4746         (delegate_declaration): Likewise.
4747         (pop_current_class): New function.  This is used to handle closing
4748         up the 'current_class' and 'current_container', and pointing them
4749         to the enclosing class/container.
4750         (CSharpParser): Initialize 'current_class' too.
4751         * decl.cs (MemberCore): Add check for invariant: a partial
4752         container is not a parsed entity, and thus does not enclose any
4753         parsed members.
4754         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4755         (DeclSpace.BaseTypeExpr): Use it.
4756         (DeclSpace.LookupType): Add check for invariant.
4757         * class.cs (TypeContainer): Add check for invariant: a nested
4758         class should have the same NamespaceEntry as its enclosing class.
4759         (TypeContainer.EmitFieldInitializers): Make virtual.
4760         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4761         MemberCore.
4762         (TypeContainer.Register): Remove.
4763         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4764         null.  Use TypeResolveEmitContext for resolving base types and
4765         interfaces.  Move initialization of Parts.TypeBuilder here from
4766         ...
4767         (TypeContainer.DefineNestedTypes): ... here.
4768         (PartialContainer): Take a Namespace not a NamespaceEntry.
4769         (PartialContainer.Create): Don't use Register.  Call the
4770         appropriate Add... function directly.
4771         (ClassPart): Take both the PartialContainer and the enclosing
4772         class as constructor arguments.
4773         (ClassPart.EmitFieldInitializers): Override.
4774         (ClassPart.PartFindNestedTypes): Remove.
4775         (FieldBase.GetInitializerExpression): Resolve the initializer
4776         expression in the emit context of the enclosing class.
4777         * tree.cs (RootTypes): Remove Register ().
4778         
4779 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4780
4781         * cs-parser.jay: Removed CS0134.
4782         
4783         * driver.cs: Removed CS1901.
4784         
4785         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4786         for predefined types.
4787
4788 2005-03-07  Duncan Mak  <duncan@novell.com>
4789
4790         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4791         well. Fixes bug #73454.
4792
4793 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4794
4795         * cs-tokenizer.cs (xtoken): Add CS1035.
4796         
4797         * class.cs (MethodData.Define): Add CS0683.
4798         (FieldMember.ctor): Add CS0681.
4799
4800 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4801
4802         * ecore.cs (SimpleName.DoResolve): Rename from
4803         SimpleName.DoResolveAllowStatic.
4804         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4805         Pass 'intermediate' flag to MemberStaticCheck.
4806         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4807         of "intermediate" lookups via MemberAccess.
4808         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4809         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4810
4811 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4812
4813         Fix #73394.
4814         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4815         slipped in because of variable names that are identical to a
4816         builtin type's BCL equivalent ('string String;', 'int Int32;').
4817         (PropertyExpr.EmitInstance): Likewise.
4818
4819 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4820
4821         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4822         
4823         * report.cs (warning_ignore_table): Made public.
4824
4825 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4826
4827         Fix #73282.
4828         * class.cs (MethodData.Emit): Pass 'container' to
4829         container.GetObsoleteAttribute instead of 'container.Parent'.
4830
4831 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4832
4833         * cs-parser.jay: Add 1534 error test.
4834
4835         * iterators.cs (Yield.CheckContext): Add error 1629.
4836         (Iterator.ctor): Save unsafe modifier.
4837         (MoveNextMethod.DoEmit): Restore unsafe context.
4838
4839         * namespace.cs (UsingAlias): Better error message.
4840
4841 2005-03-03  Dan Winship  <danw@novell.com>
4842
4843         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4844         the warning message [#73219]
4845
4846 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4847
4848         Fix compile with MCS 1.0.0.0.
4849         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4850         w_restore to not depend on string constant folding.
4851
4852 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4853
4854         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4855         CS0246 check to users who passed 'silent = false'.
4856         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4857         check.
4858         (SimpleName.SimpleNameResolve): Update.
4859         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4860         (MemberAccess.IdenticalNameAndTypeName): Update.
4861         * doc.cs (FindDocumentedTypeNonArray): Update.
4862
4863 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4864
4865         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4866         * parameters.cs (ComputeAndDefineParameters): Remove.
4867         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4868         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4869         Use GetParameterInfo.
4870
4871 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4872
4873         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4874
4875 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4876
4877         Unify DeclSpace.LookupType and DeclSpace.FindType.
4878         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4879         is in charge of defining nested types on demand.
4880         (DeclSpace.LookupType): Use it when the current_type is a
4881         TypeBuilder.  Use LookupTypeDirect for reflected types.
4882         (DeclSpace.FindType): Remove.
4883         (DeclSpace.LookupInterfaceOrClass): Likewise.
4884         (DeclSpace.DefineTypeAndParents): Likewise.
4885         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4886         DeclSpace.LookupType.
4887         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4888         * typemanager.cs (LookupType): Simplify.
4889         (AddUserType): Remove type from negative_hits.
4890         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4891         * class.cs (TypeContainer.FindMembers): Move handling of nested
4892         types ...
4893         (TypeContainer.FindMembers_NestedTypes): ... here.
4894         (TypeContainer.FindNestedType): Implement override.
4895         (ClassPart.FindNestedType): Delegate to PartialContainer.
4896         (ClassPart.PartFindNestedType): Looks up the nested types of the
4897         part alone.
4898
4899 2005-04-14  Martin Baulig  <martin@ximian.com>
4900
4901         * generic.cs (ConstructedType): Moved all the type lookup and
4902         nested class logic into SimpleName.
4903         (ConstructedType.ResolveConstructedType): Our underlying type is
4904         already fully resolved; all the type lookup stuff is in
4905         SimpleName.
4906
4907         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4908         constructed types here instead of in ConstructedType.
4909
4910         * decl.cs (MemberName.GetTypeExpression): Always create a
4911         SimpleName, not a ConstructedType.
4912         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4913
4914 2005-03-02  Martin Baulig  <martin@ximian.com>
4915
4916         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4917         static constructor in static classes.
4918
4919 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4920
4921         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4922         sizeParamIndex is not specified.
4923
4924 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4925
4926         Fix #73117
4927         * report.cs (WarningMessage.IsEnabled): Missing null check.
4928
4929 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4930
4931         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4932         in the fields and not in the properties.
4933
4934 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4935
4936         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4937         fields as well.
4938
4939 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4940
4941         * attribute.cs: Small refactoring (improved robustness).
4942         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4943         (ValidateGuid): Removed.
4944         (Resolve): Removed referenced to above mentioned.
4945         (GetAttributeUsage): Made private and changed to work without
4946         class assistance.
4947         (GetIndexerAttributeValue): Don't crash.
4948         (GetConditionalAttributeValue): Ditto.
4949         (GetClsCompliantAttributeValue): Ditto.
4950         (ExtractSecurityPermissionSet): All attributes exceptions are
4951         error 648.
4952         (GetPropertyValue): New helper.
4953         (GetMethodImplOptions): New method.
4954         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4955         some missing properties.
4956         
4957         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4958         (Method.ApplyAttributeBuilder): Updated.
4959         
4960         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4961         exception.
4962
4963 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4964
4965         Fix #73052.
4966         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4967         non-simple types (array, pointer, reference).
4968
4969 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4970
4971         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4972
4973         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4974         for operators.
4975         (Method.CheckBase): Catch wrong destructor here.
4976         (MethodData.Define): Add errors 550, 668.
4977
4978         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4979
4980         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4981
4982         * pending.cs (VerifyPendingMethods): Add error 551.
4983
4984         * typemanager.cs (CSharpName): Next error report helper.
4985
4986 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4987
4988         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4989         attributes. Removed useless attribute double check.
4990         It saves almost 2MBs for corlib.
4991
4992 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4993
4994         Fix #72924.
4995         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4996         called twice in case of error.
4997
4998 2005-02-23  Chris Toshok  <toshok@ximian.com>
4999
5000         Fix compiler portions of #72827.
5001         * statement.cs (Block.Emit): call Begin/EndScope on the
5002         EmitContext instead of the ILGenerator.
5003
5004         * codegen.cs (EmitContext.BeginScope): new method, call
5005         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5006         we have one.)
5007         (EmitContext.BeginScope): same, but EndScope and CloseScope
5008
5009         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5010         offset and call the superclass's OpenScope(int) with it.
5011         (SymbolWriter.CloseScope): get the current il
5012         offset and call superclass's CloseScope(int) with it.
5013
5014 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5015
5016         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5017         CS1677 for out and ref as well.
5018
5019         * class.cs (Method.Define): Add error CS1599 detection.
5020         
5021         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5022         
5023         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5024         
5025         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5026         
5027         * support.cs.cs (ModifierDesc): New helper method.
5028
5029 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5030             Abin Thomas  <projectmonokochi@rediffmail.com>
5031             Anoob V E  <projectmonokochi@rediffmail.com>
5032             Harilal P R  <projectmonokochi@rediffmail.com>
5033
5034         Fix #57851, #72718.
5035         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5036         MemberLookup (used for error reporting) actually returns a result.
5037         Fix error report number (122, not 112).
5038
5039 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5040             Anoob V E  <projectmonokochi@rediffmail.com>
5041             Harilal P R  <projectmonokochi@rediffmail.com>
5042
5043         Fix #71134.
5044         * pending.cs (PendingImplementation.GetAbstractMethods):
5045         Find NonPublic members too.
5046
5047 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5048
5049         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5050         Fixed error 217.
5051         
5052         * class.cs (MethodCore.CheckMethodAgainstBase):
5053         Add error 239 report.
5054
5055 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5056
5057         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5058         
5059         * class.cs (Operator.Define): Add error 217 report.
5060         
5061 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5062
5063         Fix #68955.
5064         * expression.cs (Invocation.IsApplicable): Make public.
5065         (Invocation.IsParamsMethodApplicable): Likewise.
5066         * delegate.cs (Delegate.VerifyApplicability): Don't use
5067         Invocation.VerifyArgumentCompat for parameter applicability
5068         testing.  Use Invocation.IsApplicable and
5069         Invocation.IsParamsMethodApplicable.
5070
5071 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5072
5073         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5074         
5075         * class.cs (Operator.Define): Add error 217 report.
5076         
5077 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5078
5079         * namespace.cs (UsingEntry.Resolve): Undo change below.
5080
5081 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5082
5083         Fix #72756.
5084         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5085         disable the error message when the extended MemberLookup also
5086         fails.
5087         (Expression.MemberLookupFinal): Update.
5088         (SimpleName.DoSimpleNameResolve): Update.
5089         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5090         Don't use MemberLookupFinal.
5091         (New.DoResolve): Update.
5092         (BaseAccess.CommonResolve): Update.
5093
5094 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5095
5096         Fix #72732.
5097         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5098         occured previously, don't resolve again.
5099
5100 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5101
5102         Fix #69949
5103         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5104         argument. Call ResolveAttributeUsage for unresolved.
5105         when types doesn't match ctor arguments.
5106         
5107         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5108         for nested attribute classes.
5109         (Class.attribute_usage): Removed.
5110         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5111         for attribute class.
5112         
5113         * ecore.cs (IsAttribute): Removed.
5114         
5115         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5116         
5117         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5118         now normal types.
5119         (attribute_types): Removed.
5120         (EmitCode): Global attributes are emited as the latest.
5121
5122 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5123
5124         * class.cs (EmitFieldInitializers): Don't emit field initializer
5125         for default values when optimilization is on.
5126         
5127         * constant.cs (Constant.IsDefaultValue): New property.
5128         
5129         * driver.cs: Add /optimize handling.
5130         
5131         * constant.cs,
5132         * ecore.cs,
5133         * literal.cs: Implement new IsDefaultValue property.
5134         
5135         * rootcontext.cs (Optimize): New field, holds /optimize option.
5136
5137 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5138
5139         Fix crasher in re-opened #72347.
5140         * namespace.cs (Namespace.Lookup): Return null if
5141         DeclSpace.DefineType returns null.
5142
5143         Fix #72678.
5144         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5145
5146 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5147
5148         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5149         now returns null if it cannot resolve to an lvalue.
5150         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5151         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5152         returned null.  Remove check for SimpleName.
5153         (EventExpr.DoResolveLValue): New.
5154         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5155         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5156         error from ...
5157         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5158         avoid CS0131 error.
5159         (Unary.ResolveOperator): Move CS0211 check ...
5160         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5161         CS0131 error.
5162         (Unary.DoResolveLValue): Simplify.
5163         (AddressOf.DoResolveLValue): New.
5164         (ArrayAccess.DoResolveLValue): New.
5165
5166 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5167
5168         * attribute.cs (Attribute.Resolve): Add arguments casting for
5169         when types doesn't match ctor arguments.
5170
5171 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5172
5173         Fix parts of #63202.
5174         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5175         lookup of operator in base type.  Ensure that all checks happen
5176         when the operator resolves to an "op_..." method.
5177
5178 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5179
5180         Fix #71992.
5181         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5182         'ignore_cs0104' parameter.  Pass it to ...
5183         (NamespaceEntry.Lookup): ... this.
5184         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5185         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5186         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5187         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5188         Update.  Request that cs0104 errors be ignored.
5189         (ComposedCast.ResolveAsTypeStep): Update.
5190
5191 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5192
5193         Fix #59209.
5194         * expression.cs (Invocation.BetterFunction): Remove support for
5195         comparing virtual functions and their overrides.
5196         (Invocation.IsOverride): New.
5197         (Invocation.OverloadResolve): Don't consider 'override' functions
5198         during candidate selection.  Store them in a lookaside list.
5199         If the selected method is a 'virtual' function, use the list to
5200         find any overrides that are closer to the LHS type.
5201
5202 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5203
5204         * expression.cs (New.DoResolve): Add complex core type reduction.
5205         (New.Constantify): Converts complex core type syntax like 'new int ()'
5206         to simple constant.
5207         
5208 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5209
5210         * decl.cs (EntryType.EntryType): New constructor to create an
5211         updated copy of a cache entry.
5212         (MemberCache.AddMethods): Use it.
5213         (MemberCache.ClearDeclaredOnly): Remove.
5214         (MemberCache.MemberCache): Update.
5215
5216 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5217
5218         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5219         variable.  This one is represents the actual low-level declaration
5220         of the method, as opposed to the semantic level `IsStatic'.   
5221
5222         An anonymous method which is hosted into a static method might be
5223         actually an instance method.  IsStatic would reflect the
5224         container, while MethodIsStatic represents the actual code
5225         generated.
5226
5227         * expression.cs (ParameterReference): Use the new MethodIsStatic
5228         instead of IsStatic.
5229
5230         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5231         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5232         set on the current EmitContext. 
5233
5234         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5235         resolve our casted expression as an LValue.  This triggers the
5236         proper LValue processing that is later required by Assign.
5237
5238         This fixes 72347.
5239
5240         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5241
5242 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5243
5244         C# 2.0 Fixed buffer implementation
5245
5246         * anonymous.cs: Update after RegisterHelperClass renaming.
5247
5248         * attribute.cs (AttributeTester.fixed_buffer_cache):
5249         Cache of external fixed buffers.
5250         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5251         implementation if field is fixed buffer else null.
5252
5253         * class.cs
5254         (TypeContainer.AddField): Accept FieldMember instead of Field.
5255         (FieldBase.IsFieldClsCompliant): Extracted code from
5256         VerifyClsCompliance descendant customization.
5257         (FixedField): New class handles fixed buffer fields.
5258         (FixedFieldExternal): Keeps information about imported fixed
5259         buffer.
5260         (IFixedField): Make access to internal or external fixed buffer
5261         same.
5262
5263         * cs-parser.jay: Add fixed buffer parsing.
5264
5265         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5266         buffer.
5267
5268         * expression.cs (Indirection): Extended implementation to accept
5269         fixed buffer field.
5270         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5271         (ElementAccess.MakePointerAccess): Get type as parameter.
5272         (DoResolve): Add fixed buffer field expression conversion.
5273         (DoResolveLValue): Ditto.
5274         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5275         (ArrayPtr): Derives from FixedBufferPtr.
5276         (ArrayPtr.Emit): Add extra emit for array elements.
5277
5278         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5279
5280         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5281         for compiler generated types.
5282         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5283
5284         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5285         and consume less memory.
5286         (Fixed.Resolve): Add fixed buffer case.
5287
5288         * typemanager.cs (compiler_generated_attr_ctor,
5289         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5290         (HasElementType): Add our own implementation to work on every
5291         runtime.
5292
5293 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5294
5295         * anonymous.cs (CaptureContext): Track whether `this' has been
5296         referenced.   
5297
5298         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5299         only captured `this' if it was implicitly done (instance
5300         methods/variables were used). 
5301
5302         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5303         `this' must be captured.
5304
5305 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5306  
5307         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5308         is null it means that there has been no need to capture anything,
5309         so we just create a sibling.
5310
5311         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5312
5313         Just a partial fix.  The other half is fairly elusive.
5314         
5315 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5316
5317         Fix #52586, cs0121-4.cs.
5318         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5319         and return a hashtable.
5320         (MemberCache.ClearDeclaredOnly): New.
5321         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5322         the method_hash of a base type too.
5323         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5324         type methods.  Overwrite entries with the same MethodHandle so
5325         that the ReflectedType is correct.  The process leaves in base
5326         virtual functions and their overrides as distinct entries.
5327         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5328         matters since it was boxed in a ArrayList before.
5329         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5330         modifier.
5331         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5332         case of a virtual function and its override (choose the overload
5333         as better).
5334         (Invocation.OverloadResolve): Avoid 'override' members during
5335         'applicable_type' calculation.
5336
5337 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5338
5339         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5340         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5341         GetTypeHandle.  It is possible for a reflected type to derive from
5342         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5343         System.Array during mscorlib compilation).
5344         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5345         contain a method_hash, don't create one either.  Don't create a
5346         deep copy of the base cache's method_hash.
5347         (MemberCache.SetupCache): Rename back from DeepCopy.
5348         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5349         already initialized.  If we see an override function, add its
5350         underlying base virtual function to the member_hash too.
5351
5352 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5353
5354         Combine two near-redundant caches.
5355         * typemanager.cs (method_params): Rename from method_internal_params.
5356         (TypeManager.GetParameterData): New.  Replace
5357         Invocation.GetParameterData.
5358         (TypeManager.LookupParametersByBuilder): Remove.
5359         * expression.cs (Invocation.method_parameter_cache): Remove.
5360         (Invocation.GetParameterData): Remove.
5361         Update to changes.
5362         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5363         Update to changes.
5364
5365 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5366
5367         Fix #72015.
5368         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5369         TypeManager.multicast_delegate_type is null, resolve it by looking
5370         up "System.MulticastDelegate".
5371         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5372
5373 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5374             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5375             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5376
5377         Fix cs0164.cs.
5378         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5379         (LabeledStatement.AddReference): New.  Set 'referenced'.
5380         (Goto.Resolve): Use it.
5381
5382 2005-02-05  John Luke  <john.luke@gmail.com>
5383
5384         * driver.cs: remove duplicate -doc line in Usage ()
5385
5386 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5387
5388         * location.cs (Location.AddFile): Fix CS2002 error report.
5389
5390 2005-02-02  Martin Baulig  <martin@ximian.com>
5391
5392         * delegate.cs (Delegate.DefineType): Report an internal error if
5393         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5394         details.        
5395
5396 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5397
5398         Fix a crasher in a variant of #31984.
5399         * const.cs (Constant.CheckBase): New override that defers the
5400         new-or-override check in case the base type hasn't been populated
5401         yet.
5402         (Constant.Define): Ensure the new-or-override check is performed.
5403
5404 2005-02-01  Duncan Mak  <duncan@ximian.com>
5405
5406         * const.cs (LookupConstantValue): Check that `ce' is not null
5407         before calling GetValue ().
5408
5409 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5410
5411         Fix test-334.cs (#69519).
5412         * cs-parser.jay (using_alias_directive): Pass in an expression to
5413         NamespaceEntry.UsingAlias.
5414         (using_namespace_directive): Pass in an expression to
5415         NamespaceEntry.Using.
5416         (namespace_name): Don't flatten to a string.
5417         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5418         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5419         ResolveAsTypeStep.
5420         (NamespaceEntry.UsingEntry): Likewise.
5421         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5422         changes.
5423         (NamespaceEntry.LookupForUsing): Remove.
5424         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5425         names.
5426         (NamespaceEntry.Lookup): Remove support for dotted names.
5427
5428 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5429
5430         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5431         split into two.
5432         (NamespaceEntry.ImplicitParent): Compute on demand.
5433         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5434         parallels the current.
5435         (NamespaceEntry.LookupForUsing): Use it.
5436         (NamespaceEntry.Lookup): If the current namespace-entry is
5437         implicit, don't search aliases and using tables.
5438
5439 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5440
5441         Fix #31984.
5442         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5443         BaseCache here.
5444         (TypeContainer.BaseCache): Compute on demand.
5445         (TypeContainer.FindMembers): Define constants and types if they're
5446         not already created.
5447         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5448         check.
5449         * const.cs (Constant.Define): Make idempotent.
5450
5451 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5452
5453         * pending.cs: Produce better code (no nops produced by using Ldarg
5454         + value).
5455         
5456         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5457         i - 1' it should be arg + 1.
5458
5459         Fixes bug #71819.
5460
5461 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5462
5463         * attribute.cs (Attribute.CheckAttributeType): Make private
5464         non-virtual.
5465         (Attribute.ResolveType): Make virtual.
5466         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5467         handling of RootContext.Tree.Types.
5468
5469 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5470
5471         Update attribute-handling to use the SimpleName/MemberAccess
5472         mechanisms.
5473         * cs-parser.jay (attribute): Pass in an expression to the
5474         constructors of Attribute and GlobalAttribute.
5475         * attribute.cs (Attribute): Take an expression for the name.
5476         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5477         passed in attribute name expression.
5478         (Attribute.CheckAttributeType): Use it.
5479         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5480         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5481         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5482         argument to prevent error messages if the lookup fails.
5483
5484 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5485
5486         * expression.cs (Indirection): Implemented IVariable interface
5487         to support indirection in AddressOf operator.
5488         (PointerArithmetic.Emit): Add optimalization for case where
5489         result can be precomputed.
5490
5491 2005-01-26  Martin Baulig  <martin@ximian.com>
5492
5493         * class.cs (TypeContainer.AttributeTargets): Return the correct
5494         AttributeTargets depending on our `Kind' instead of throwing an
5495         exception; fixes #71632.
5496
5497 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5498
5499         Fix #71257
5500         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5501         constant members.
5502
5503 2005-03-17  Martin Baulig  <martin@ximian.com>
5504
5505         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5506         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5507
5508 2005-03-17  Martin Baulig  <martin@ximian.com>
5509
5510         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5511         to bool so we can return an error condition.
5512         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5513         returned an error.
5514
5515 2005-03-17  Martin Baulig  <martin@ximian.com>
5516
5517         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5518
5519         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5520         converting from an array-type of T to `IEnumerable<T>'.
5521
5522 2005-03-16  Martin Baulig  <martin@ximian.com>
5523
5524         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5525         (Nullable.LiftedUnaryMutator): New public class.
5526
5527         * expression.cs (UnaryMutator.DoResolve): Added support for
5528         Nullable Types.
5529
5530 2005-03-14  Martin Baulig  <martin@ximian.com>
5531
5532         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5533
5534 2005-03-14  Martin Baulig  <martin@ximian.com>
5535
5536         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5537         the comparision operators `<', `>', `<=' and `>='.
5538
5539 2005-03-13  Martin Baulig  <martin@ximian.com>
5540
5541         * generic.cs
5542         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5543         avoid confusion with the `NullLiteral'.
5544         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5545
5546 2005-03-13  Martin Baulig  <martin@ximian.com>
5547
5548         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5549         comparing arbitrary types with the null literal.
5550
5551 2005-03-13  Martin Baulig  <martin@ximian.com>
5552
5553         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5554         boolean operators '&&', '||', '&' and '|'.
5555         (Nullable.OperatorTrueOrFalse): New public class.
5556
5557         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5558         instead of a `StaticCallExpr'; added support for nullables.
5559
5560 2005-03-10  Martin Baulig  <martin@ximian.com>
5561
5562         * expression.cs
5563         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5564         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5565
5566 2005-03-07  Martin Baulig  <martin@ximian.com>
5567
5568         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5569         it work if `expr' is not an IMemoryLocation.
5570         (Nullable.Lifted): Implement IMemoryLocation.
5571         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5572         target type.
5573
5574 2005-03-05  Martin Baulig  <martin@ximian.com>
5575
5576         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5577         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5578         (Nullable): Added support for lifted unary and binary operators.
5579
5580         * expression.cs (Unary.DoResolve): Added support for nullable types.
5581         (Binary.DoResolve): Likewise.
5582         (Conditional.DoResolve): Likewise.
5583
5584 2005-03-02  Martin Baulig  <martin@ximian.com>
5585
5586         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5587
5588         * class.cs (ClassPart.SetParameterInfo): Override this.
5589         (PartialContainer.SetParameterInfo): Override this.
5590         (TypeContainer.CheckConstraints): New protected method.
5591         (PartialContainer.CheckConstraints): Override this and check
5592         whether the same contraints were specified in all parts of a
5593         partial generic type definition.
5594         (PartialContainer.UpdateConstraints): New public method.
5595
5596         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5597
5598 2005-03-02  Martin Baulig  <martin@ximian.com>
5599
5600         Committing a patch from Carlos Alberto Cortez to fix #72887.
5601
5602         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5603         casts from `T []' to `int []'.
5604
5605 2005-03-02  Martin Baulig  <martin@ximian.com>
5606
5607         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5608
5609         * expression.cs (Binary.ResolveOperator): When resolving a
5610         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5611         `=='.  Fixes #71866.  See gen-127.cs.
5612
5613 2005-03-02  Martin Baulig  <martin@ximian.com>
5614
5615         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5616         static constructor in static classes.
5617
5618 2005-03-02  Martin Baulig  <martin@ximian.com>
5619
5620         * generic.cs
5621         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5622         (Nullable.LiftedConversion): Added support for user-defined
5623         conversions.
5624
5625         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5626
5627         * cs-parser.jay: Use ComposedCast everywhere instead of
5628         NullableType, so we don't need to check for NullableType
5629         everywhere.
5630         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5631         case where we'll be resolved into a `parenthesized_expression_0'
5632         afterwards.
5633
5634         * convert.cs
5635         (Convert.UserDefinedConversion): Added nullable conversions.
5636
5637 2005-02-28  Martin Baulig  <martin@ximian.com>
5638
5639         * generic.cs (TypeManager.IsNullableType): New static method.
5640         (Nullable): New abstract class.
5641         (Nullable.NullLiteral): New public class.
5642         (Nullable.LiftedConversion): New public class.
5643
5644         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5645         `builtin_types opt_nullable'.
5646
5647         * convert.cs
5648         (Convert.ImplicitConversionStandard): Added nullable conversions.
5649         (Convert.ExplicitConversionStandard): Likewise.
5650         (Convert.ExplicitConversion): Likewise.
5651
5652 2005-02-26  Martin Baulig  <martin@ximian.com>
5653
5654         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5655         begin with a "?", for instance "?[]".  Don't do a type lookup if
5656         `dim' is empty.
5657
5658 2005-02-25  Martin Baulig  <martin@ximian.com>
5659
5660         The first part of Nullable Types :-)
5661
5662         * generic.cs (NullableType): New public class.
5663         (NullCoalescingOperator): New public class.
5664         (TypeArguments.Resolve): Add a CS0306 check.
5665
5666         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5667         (opt_nullable): New rule.
5668         (type): Added `opt_nullable' to `namespace_or_type_name',
5669         `builtin_types' and `pointer_type'.
5670         (array_type): Added `opt_nullable'.
5671         (opt_rank_specifier_or_nullable): New rule; this is the
5672         combination of `opt_rank_specifier' and `opt_nullable'.
5673         (opt_error): New rule; catch errors here.
5674         (nullable_type_or_conditional): New rule; we use this to check for
5675         nullable and still detect the conditional operator.
5676         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5677         instead `opt_rank_specifier'.
5678
5679         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5680         for nullables.
5681
5682 2005-02-24  Martin Baulig  <martin@ximian.com>
5683
5684         * README, README.Changes: Removed; they're old and obsolete.
5685
5686 2005-02-22  Martin Baulig  <martin@ximian.com>
5687
5688         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5689         returned an error, set `constraints' to null to avoid a crash
5690         later on.
5691         (TypeParameter.ResolveType): Likewise.
5692
5693 2005-02-22  Martin Baulig  <martin@ximian.com>
5694
5695         * generic.cs
5696         (Constraints.ResolveTypes): Protect against being called twice.
5697         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5698         (TypeParameter.ResolveType): New public method; calls
5699         constraints.ResolveTypes().
5700         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5701         into the new ResolveType().
5702         (GenericMethod.Define): Call ResolveType() on all our
5703         TypeParameter's.        
5704
5705 2005-02-21  Martin Baulig  <martin@ximian.com>
5706
5707         * generic.cs
5708         (TypeManager.generic_nullable_type): New static public field.
5709         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5710
5711         * rootcontext.cs
5712         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5713
5714 2005-02-15  Martin Baulig  <martin@ximian.com>
5715
5716         * generic.cs (ConstructedType.Constraints): Correctly check
5717         constraints if the argument type is a type parameter; fixes
5718         #72326. 
5719
5720 2005-02-02  Martin Baulig  <martin@ximian.com>
5721
5722         * delegate.cs (Delegate.DefineType): Report an internal error if
5723         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5724         details.        
5725
5726 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5727
5728         * pending.cs: Produce better code (no nops produced by using Ldarg
5729         + value).
5730         
5731         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5732         i - 1' it should be arg + 1.
5733
5734         Fixes bug #71819.
5735         
5736 2005-01-26  Martin Baulig  <martin@ximian.com>
5737
5738         * cs-parser.jay (indexer_declarator): Don't report an error if we
5739         have type parameters since we can be an explicit interface
5740         implementation; fixes #71449.
5741
5742 2005-01-26  Martin Baulig  <martin@ximian.com>
5743
5744         * class.cs (TypeContainer.AttributeTargets): Return the correct
5745         AttributeTargets depending on our `Kind' instead of throwing an
5746         exception; fixes #71632.
5747
5748 2005-01-26  Martin Baulig  <martin@ximian.com>
5749
5750         * delegate.cs (Delegate.DefineType): Correctly define our type
5751         parameters.  Fixes #71483.
5752
5753 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5754
5755         Fix #71602.
5756         * expression.cs (MemberAccess.DoResolve): Don't complain with
5757         cs0572 when the LHS of a member access has identical name and type
5758         name.
5759
5760 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5761
5762         Fix #71651, #71675
5763         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5764         CreatePermission.
5765         Create custom PermissionSet only for PermissionSetAttribute.
5766
5767 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5768
5769         Fix #71649
5770         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5771         delegates in static class.
5772
5773 2005-01-24  Martin Baulig  <martin@ximian.com>
5774
5775         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5776         merging an implicit block, just use its reachability.
5777
5778         * statement.cs (Block.Resolve): Make the unreachable code check
5779         work wrt. implicit blocks; see test-337 from #63842.
5780
5781 2005-01-21  Alp Toker  <alp@atoker.com>
5782  
5783         * cs-parser.jay: destructor_declaration's container is PartialContainer
5784         not Class when partial types are used, so use Kind prop instead of
5785         'is'.
5786         
5787 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5788
5789         * cs-parser.jay: Improve error reporting when an interface
5790         declares new types.
5791
5792 2005-01-20  Dick Porter  <dick@ximian.com>
5793
5794         * support.cs: SeekableStreamReader fix from Sandor Dobos
5795         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5796         chars are read.  Fixes bug 70369.
5797
5798 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5799
5800         * cs-parser.jay (catch_clause): Simplify current_block handling
5801         somewhat.
5802
5803 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5804
5805         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5806         code with ImplicitStandardConversion to handle the implicit
5807         conversion of method groups into valid delegate invocations. 
5808
5809         The problem is that in parameter handling we were using this code
5810         path.  Fixes bug #64698
5811
5812 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5813
5814         * cs-parser.jay: Fix several infelicities.
5815         - Avoid assigning to the parser value stack.  Code like 
5816           '$3 = null' is unclean.  Synthesize a value for the code block
5817           instead. 
5818         - Avoid using oob_stack for storing location information.  Use ...
5819         (_mark_): ... this.  New (empty) rule.  Saves the current location
5820         in $$.
5821         (foreach_statement): Avoid using oob_stack for current_block
5822         handling.  Use technique used in for_statement and
5823         using_statement.  Synthesize a value for the code block to store
5824         additional intermediate information.
5825
5826 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5827
5828         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5829         of a different type is only allowed to private fields of a
5830         containing type, not on fields of a base class.
5831
5832         See test-174.cs and error cs0122-9.cs
5833
5834 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5835
5836         Fix test-335.cs (bug #58126).
5837         * cs-parser.jay (argument): Split out non-expression parts of the
5838         rule into 'non_simple_argument'.
5839         (invocation_expression): Support parenthesized invocations with
5840         multiple arguments, and with single non-simple arguments.
5841
5842 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5843
5844         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5845         places.
5846
5847 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5848
5849         Fix cs0038-1.cs, cs1640-6.cs.
5850         * ecore.cs (Expression.Resolve): Remove special-case for
5851         SimpleName in error-handling.
5852         (Expression.almostMatchedMembers): Relax access permission to
5853         protected.
5854         (Expression.MemberLookupFailed): Handle duplicates in
5855         almostMatchedMembers list.
5856         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5857         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5858         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5859         overload if the passed in MemberInfo is a MethodBase.
5860
5861 2005-01-25  Martin Baulig  <martin@ximian.com>
5862
5863         * doc.cs
5864         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5865
5866 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5867
5868         Fix #70749
5869         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5870         for non-CAS & merge permission sets properly.
5871
5872 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5873
5874         Improve standard-compliance of simple name and member access 
5875         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5876         * ecore.cs (FullNamedExpression): New abstract base class 
5877         for Namespaces and TypeExpressions.
5878         (ResolveFlags.SimpleName): Remove.
5879         (SimpleName): Remove support for dotted names.
5880         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5881         DeclSpace.FindType and DeclSpace.LookupType.
5882         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5883         (Expression.ExprClassName): Make member function.
5884         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5885         a namespace.  Remove creation of dotted "SimpleName"s.
5886         (MemberAccess.DoResolve): Likewise.
5887         * decl.cs (DeclSpace.Cache): Make private.
5888         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5889         (DeclSpace.FindType): Update.
5890         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5891         FullNamedExpression.
5892         * namespace.cs (Namespace): Derive from FullNamedExpression
5893         so that it can be part of expression resolution.
5894         (Namespace.Lookup): Return an FullNamedExpression.
5895         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5896         namespace.
5897         * rootcontext.cs (NamespaceLookup): Remove.
5898         (LookupType): Move to DeclSpace.
5899         * attribute.cs (CheckAttributeType): Update.
5900         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5901         (FindDocumentedTypeNonArray): Likewise.
5902
5903 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5904
5905         Fix cs0509.cs, cs1632.cs.
5906         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5907         is the same as IsInterface.
5908         (TypeContainer.GetClassBases): Likewise.
5909         * statement.cs (LabeledStatement.ig): New field.
5910         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5911         label.
5912         (LabeledStatement.DoEmit): Check that the label was created with
5913         the same ILGenerator.
5914
5915 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5916
5917         Fix #71058
5918         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5919         accessors to its properties.
5920
5921         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5922         from accessors to property.
5923         
5924 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5925
5926         Fix #70722
5927         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5928         only for overrides.
5929         
5930 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5931
5932         * attribute.cs: Check for null and empty strings.  
5933
5934         I have lost another battle to Paolo.
5935
5936 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5937
5938         Fix #70942
5939         * class.cs (PropertyMethod): Set Parent field in ctors.
5940         (SetMethod.InternalParameters): Add unsafe switch hack.
5941         Override MarkForDuplicationCheck where it is appropriate.
5942
5943         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5944         It says whether container allows members with the same name.
5945         Base default is no.
5946         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5947         Removed is_method parameter.
5948
5949 2005-01-06  Duncan Mak  <duncan@ximian.com>
5950
5951         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5952         because the previous change led to incorrect reporting of CS1032
5953         ("Cannot define/undefine preprocessor symbols after first token in
5954         file"). Instead of using `tokens_seen' as the only flag that
5955         triggers CS1040, introduce `comments_seen'. This new flag is used
5956         to signify having seen comments on the current line, so it is
5957         unset after a newline.
5958
5959 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5960
5961         * doc.cs : When searching for a type, find nested type too.
5962           This fixes bug #71040.
5963
5964 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5965
5966         * doc.cs :
5967           - Warn missing member comment on those classes which also does not
5968             have doc comments. Fixed bug #71041.
5969           - Don't warn missing doc comment on default constructor.
5970             Fixed bug #71042.
5971
5972 2005-01-06  Duncan Mak  <duncan@ximian.com>
5973
5974         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5975         comments, set `tokens_seen' to true. This allows us to detect
5976         misplaced preprocessor directives (i.e. not at the beginning of
5977         the a line, nor after whitespaces). In that case, report error
5978         CS1040. This fixes bug #56460.
5979
5980         * cs-parser.jay (interface_member_declaration): Add checks for
5981         IsExplicitImpl, and report CS0541 error if an interface member is
5982         defined as an explicit interface declaration.
5983
5984 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5985
5986         Fix #70817
5987         * class.cs (PropertyMethod): Set Parent field in ctors.
5988         (SetMethod.InternalParameters): Add unsafe switch hack.
5989         
5990         * decl.cs (MemberCore.Parent): Cannot be readonly.
5991
5992 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5993
5994         * decl.cs (DeclSpace.ResolveType): Remove.
5995         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5996         Merge in code from ...
5997         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5998         * class.cs, enum.cs: Update to changes.
5999
6000 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6001
6002         * anonymous.cs: Ensure that we init the scope of our parent if it
6003         has not been initialized yet.
6004
6005 2004-12-30  Duncan Mak  <duncan@ximian.com>
6006
6007         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6008         if field.FieldBuilder is null. Fixes #70758.
6009
6010         * convert.cs: Fixed some typos and updated some of the comments.
6011         (ImplicitStandardConversionExists):
6012         (TryImplicitIntConversion): If `target_type' is an interface and
6013         the type of `ic' implements this interface, return true or a new
6014         BoxedCast instead of null. This fixes #70468.
6015
6016 2004-12-29  Duncan Mak  <duncan@ximian.com>
6017
6018         * expression.cs (Argument.Emit): Check that Expr is
6019         IMemoryLocation before casting to it, and report CS1510 otherwise.
6020
6021         This fixes #70402.
6022
6023 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6024
6025         * statement.cs (Block.ThisVariable): remove the recursion here, to
6026         make the --profile more sane.
6027
6028 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6029
6030         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6031         assembly, by JB Evain.
6032
6033 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6034
6035         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6036           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6037         "parent" refers to enclosing type/class.  "base" refers to superclass.
6038
6039 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6040
6041         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6042         Ensure that we only have GlobalAttributes.
6043         * attribute.cs (Attribute.Emit): Make non-virtual.
6044         (GlobalAttribute.Emit): Remove.
6045         (Attribute.Resolve): Make virtual.
6046         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6047         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6048         the argument. Don't create one.
6049         (Attribute.GetObsoleteAttribute): Likewise.
6050         (Attribute.GetClsCompliantAttributeValue): Likewise.
6051         * class.cs, decl.cs: Update to changes.
6052
6053 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6054
6055         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6056         
6057         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6058         
6059         * statement.cs (Foreach.Resolve): Add error 186 report.
6060
6061 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6062
6063         * expression.cs (Conditional.DoResolve): Add warning 429.
6064         
6065         * statement.cs (If.Resolve): Add warning 665.
6066
6067 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6068
6069         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6070         except when in the parser, and in GlobalAttribute.
6071         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6072         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6073         RootContext.Tree.Types.NamespaceEntry once work is done.
6074         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6075         and resets RootContext.Tree.Types.NamespaceEntry.
6076
6077 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6078
6079         * cs-parser.jay: Don't create a block for every variable.
6080
6081 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6082
6083         * location.cs: Provide extra information.
6084
6085         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6086         variables from the captured environment, it is the ldarg_0.
6087
6088 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6089
6090         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6091         find a conclusion.
6092         
6093         * class.cs: Changed warning level for 169 to avoid developer
6094         displeasure from warning flooding. It will be changed back when they
6095         fix most of current BCL warnings.
6096         
6097         * RootContext.cs: Pushed default WarningLevel to 3.
6098         
6099         * statement.cs: Removed unused variable.
6100
6101 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6102
6103         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6104         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6105         Add error 502 report.
6106         (StaticClass.DefineType): Add error 441 report.
6107         (Class.AllowedModifiersProp): New virtual property as temporary
6108         extension to AllowedModifiers.
6109         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6110         to share implementation with StaticClass and don't call virtual
6111         methods from ctor.
6112         
6113         * driver.cs (MainDriver): Add error 1558 test.
6114
6115         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6116         report. Moved error 36 test here.
6117
6118         * statement.cs (Throw.Resolve): Add error 724 report.
6119
6120         * typemanager.cs: Add out_attribute_type core type.
6121         
6122 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6123
6124         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6125         3018 report.
6126         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6127
6128         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6129         3017 report.
6130         
6131         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6132
6133         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6134         Add error 3023 report.
6135         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6136
6137         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6138         implementation.
6139
6140 2004-12-12  John Luke  <john.luke@gmail.com>
6141
6142         * driver.cs (AddArgs): take -- into account when
6143         adding arguments, fixes bug 65710 
6144
6145 2004-12-12  Martin Baulig  <martin@ximian.com>
6146
6147         * expression.cs (Unary.TryReduceNegative): Added support for
6148         SByteConstant and ByteConstant.
6149         (Unary.Reduce): Check error values from TryReduceNegative().
6150
6151 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6152
6153         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6154         and report exception as error 182.
6155
6156 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6157
6158         * driver.cs (Main): Fix message when there are warnings.
6159
6160 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6161
6162         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6163
6164 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6165
6166         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6167         Reduced number of warnings.
6168         
6169         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6170
6171 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6172
6173         * driver.cs: Removed message.
6174
6175         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6176
6177 2004-12-08    <vargaz@freemail.hu>
6178
6179         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6180
6181 2004-12-08  Martin Baulig  <martin@ximian.com>
6182
6183         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6184         instead of a CS3002 for properties and indexer.
6185
6186 2004-12-08  Martin Baulig  <martin@ximian.com>
6187
6188         * decl.cs (MemberName.ToString): Make this work again.
6189
6190 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6191
6192         * attribute.cs (Resolve): Add error 591 detection.
6193
6194         * class.cs (FieldMember.Define): Add error 1547 detection.
6195         (Indexer.Define): Add error 620 detection.
6196         (Operator.Define): Add error 590 detection.
6197
6198         * ecore.cs: Missing argument for error 79.
6199
6200         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6201         detection.
6202
6203 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6204
6205         Fix #70106
6206         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6207         only.
6208
6209 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6210
6211         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6212           Some operator comments were suppressed.
6213         * doc.cs : Implicit/explicit operator name in doc comments are like
6214           "op_Explicit(type)~returnType", so added suffix handling.
6215
6216 2005-01-21  Alp Toker  <alp@atoker.com>
6217
6218         * cs-parser.jay: destructor_declaration's container is PartialContainer
6219         not Class when partial types are used, so use Kind prop instead of 'is'.
6220
6221 2004-12-12  Martin Baulig  <martin@ximian.com>
6222
6223         * expression.cs (Unary.TryReduceNegative): Added support for
6224         SByteConstant and ByteConstant.
6225         (Unary.Reduce): Check error values from TryReduceNegative().
6226
6227 2004-12-11  Martin Baulig  <martin@ximian.com>
6228
6229         * support.cs (ReflectionParameters.ParameterName): If we have a
6230         `gpd', call `ParameterName' on it.
6231
6232         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6233
6234         * pending.cs (PendingImplementation.DefineProxy): Call
6235         DefineParameter() for all of the MethodBuilder's arguments.
6236
6237 2004-12-09  Martin Baulig  <martin@ximian.com>
6238
6239         * doc.cs (DocUtil): Make this a static class.
6240
6241 2004-12-09  Martin Baulig  <martin@ximian.com>
6242
6243         * expression.cs (Invocation.InferType): Moved the type inference
6244         implementation into TypeManager.
6245
6246         * generics.cs (TypeManager): Moved the type inference
6247         implementation here.
6248
6249 2004-12-09  Martin Baulig  <martin@ximian.com>
6250
6251         * typemanager.cs (TypeManager): Make this a partial class.
6252
6253         * generics.cs
6254         (TypeManager): Move the generics part of `TypeManager' here.
6255
6256 2004-12-08  Martin Baulig  <martin@ximian.com>
6257
6258         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6259         instead of a CS3002 for properties and indexer.  Added CS3024
6260         check for generic interfaces.
6261
6262         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6263         instances are not CLS-compliant.
6264
6265 2004-12-08  Martin Baulig  <martin@ximian.com>
6266
6267         * cs-parser.jay
6268         (void_pointer_expression): New rule for `void*', `void**' etc.
6269         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6270
6271 2004-12-08  Martin Baulig  <martin@ximian.com>
6272
6273         * expression.cs (Invocation.InferType): Removed the hack for
6274         MethodCore.MayUnify().  
6275
6276         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6277         this actually work.
6278
6279         * class.cs (MethodCore.MayUnify): Use
6280         TypeManager.MayBecomeEqualGenericTypes().       
6281
6282 2004-12-08  Martin Baulig  <martin@ximian.com>
6283
6284         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6285         parameter, box it.  Fixes #69233.
6286
6287 2004-12-08  Martin Baulig  <martin@ximian.com>
6288
6289         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6290         have the ctor constraint.  Fixes #68326.
6291
6292 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6293
6294         * cs-parser.jay : interface comment was not consumed because of
6295           extra opt_semicolon before doc handling.
6296
6297 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6298
6299         Fix test-327.cs, test-328.cs, and put in early infrastructure
6300         for eventually fixing #52697.
6301         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6302         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6303         from other methods.
6304         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6305         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6306         (VerifyUsing, error246): Update.
6307         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6308         'NamespaceEntry.LookupNamespaceOrType'.
6309
6310 2004-12-07  Martin Baulig  <martin@ximian.com>
6311
6312         * driver.cs: Call it "BETA SOFTWARE" :-)
6313
6314 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6315
6316         Fix crash on cs0657-17.cs.
6317         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6318         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6319         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6320         the case where the NamespaceEntry gets overwritten.
6321
6322 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6323
6324         Fixed #69195, #56821
6325         * ecore.cs (ResolveBoolean): Tiny refactoring.
6326
6327         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6328         of right expression resolving when left is false constant and
6329         operator is LogicalAnd OR true constant and operator is LogicalOr.
6330
6331         * statement.cs (ResolveUnreachable): Always reports warning.
6332
6333 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * class.cs: Distinguish between 1721 and 1722 (just a little help
6336         for the programmer).
6337
6338 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6339
6340         * delegate.cs: Only allow this on new versions of the language. 
6341
6342 2004-12-02  Duncan Mak  <duncan@ximian.com>
6343
6344         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6345         Expression class.
6346         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6347         here as a static method. Take an additional bool out parameter
6348         `must_do_cs1540_check' for signaling to InstanceResolve.
6349         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6350         member field from PropertyExpr class and made it an argument of
6351         the method instead.
6352         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6353         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6354         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6355         and `remove_accessor' as well as InstanceResolve: report CS0122
6356         where applicable.
6357
6358         Fixes #70129.
6359
6360 2004-12-07  Martin Baulig  <martin@ximian.com>
6361
6362         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6363         and CS0692 where appropriate.
6364
6365 2004-12-06  Martin Baulig  <martin@ximian.com>
6366
6367         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6368         IsDuplicateImplementation() and improved it.
6369
6370         * expression.cs (Invocation.InferTypeArguments): Added
6371         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6372         and removed the "ref" modifier from `infered_types'.
6373
6374         * decl.cs (MemberName.ToString): Removed the exception.
6375
6376 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6377
6378         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6379           comments are allowed.
6380
6381 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6382
6383         * delegate.cs: Add checks for subtypes in paramaters and return values
6384         in VerifyMethod () to add support for Covariance/Contravariance
6385         in delegates.
6386         
6387 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6388
6389         * report.cs: Remove extra closing parenthesis.
6390
6391         * convert.cs (Error_CannotImplicitConversion): If the name of the
6392         types are the same, provide some extra information.
6393
6394 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6395
6396         Fix bug #70102
6397         * attribute.cs (Resolve): Improved implementation of params
6398         attribute arguments.
6399
6400         * support.cs (ParameterData): Add HasParams to be faster.
6401
6402 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6403
6404         all things are for /doc support:
6405
6406         * doc.cs: new file that supports XML documentation generation.
6407         * mcs.exe.sources: added doc.cs.
6408         * driver.cs:
6409           Handle /doc command line option.
6410           Report error 2006 instead of 5 for missing file name for /doc.
6411           Generate XML documentation when required, after type resolution.
6412         * cs-tokenizer.cs:
6413           Added support for picking up documentation (/// and /** ... */),
6414           including a new XmlCommentState enumeration.
6415         * cs-parser.jay:
6416           Added lines to fill Documentation element for field, constant,
6417           property, indexer, method, constructor, destructor, operator, event
6418           and class, struct, interface, delegate, enum.
6419           Added lines to warn incorrect comment.
6420         * rootcontext.cs :
6421           Added Documentation field (passed only when /doc was specified).
6422         * decl.cs:
6423           Added DocComment, DocCommentHeader, GenerateDocComment() and
6424           OnGenerateDocComment() and some supporting private members for
6425           /doc feature to MemberCore.
6426         * class.cs:
6427           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6428         * delegate.cs:
6429           Added overriden DocCommentHeader.
6430         * enum.cs:
6431           Added overriden DocCommentHeader and GenerateDocComment().
6432
6433 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6434
6435         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6436         unwrapping the enumeration values, chain to
6437         DoConstantNumericPromotions again, so we can promote things to the
6438         fundamental types (takes care of enums that are bytes, sbytes).
6439
6440         Fixes bug #62054.
6441
6442 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6443
6444         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6445         Fix long-standing bug in type-lookup.  Use FindType instead of
6446         LookupType when ec.ResolvingTypeTree.
6447         (Attribute.ResolveType, Attribute.Resolve)
6448         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6449         Update to changes.
6450         (Attributes.Search): Remove internal version.  Update.
6451         (Attributes.SearchMulti): Update.
6452         (Attributes.GetClsCompliantAttribute): Remove.
6453         (Attributes.GetIndexerNameAttribute): Remove.
6454         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6455         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6456         * class.cs (Indexer.Define): Likewise.
6457
6458 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6459
6460         Fix bug #68790
6461         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6462         MarshallByReference members access.
6463
6464         * expression.cs: Use CheckMarshallByRefAccess;
6465         Better error CS0197 message.
6466
6467         * report.cs: Print whole related error message.
6468
6469 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6470
6471         * class (GetClassBases): Better error 60 report.
6472         (EventProperty): Disabled warning 67 detection.
6473
6474 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6475
6476         Fix bug #60324
6477         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6478
6479         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6480         precise values.
6481
6482 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6483
6484         Fix bug #49488
6485         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6486
6487         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6488
6489 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6490
6491         * attribute.cs (Attribute.Resolve): Refine error reporting and
6492         report a cs0117 if the identifier does not exist, to distinguish
6493         from 0617 which is a miss-use of the actual identifier.
6494
6495         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6496         between cs0070 and cs0079.
6497
6498         * class.cs (MemberBase.DoDefine): When reporting a wrong
6499         accessibility level, we use MethodCore to compare instead of
6500         Method (this was a regression in some refactoring effort).
6501
6502         So now we correctly report cs0056 again.
6503
6504         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6505         testing the target_type (which was known to be object_type) and
6506         not the source type (which is anonymous_method).
6507
6508         Fixed reporting of error cs1660.
6509
6510         * expression.cs (UserCast.Source): Expose the underlying cast.
6511
6512         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6513         allowed types to find a match to int32 first (most common).
6514
6515         In addition, it ignores any ImplicitUserConversions that did an
6516         internal implicit conversion (as the switch statement allows only
6517         one integral conversion to exist).
6518
6519         * class.cs (PartialContainer.Create): rename `name' to
6520         `member_name' for clarity.  Then replace the string calls with a
6521         call to MemberName.GetPartialName, as now using
6522         MemberName.ToString is an error (this is due to the side effects
6523         it had, that were fixed in the past).
6524
6525         This will restore the error reporting on a number of partial class
6526         errors that were missusing this (and getting an exception as a
6527         results, which is now just a plain textual warning, because
6528         yyparse debug output would crash otherwise).
6529
6530 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6531
6532         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6533
6534 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6535
6536         * rootcontext.cs (LookupType): Make sure to cache lookups that
6537         don't give us a negative result. This saves about 5% of corlib
6538         compilation time.
6539
6540 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6541
6542         * report.cs (AbstractMessage.Print): messages are sent to stderr
6543
6544         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6545         non-interface in the list of interfaces (at this point, either
6546         parent was properly set, or a base class is being listed in the
6547         interfaces section).
6548
6549         This flags error 1722, and resolves the crash from bug 69259.
6550
6551 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6552
6553         * statement.cs (Using.EmitExpressionFinally): make this work right
6554         for valuetypes. Fixes 69926.
6555
6556 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6557
6558         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6559         converted to an enum" here, before we try to change the underlying
6560         type.  This code exists, but it is a different code path than the
6561         one used while encoding constants.
6562
6563         (ImplicitReferenceConversionExists): In addition, resynchronized
6564         the code here, so it matches the same code in
6565         ImplicitReferenceConversionExists for the `from any class-type S
6566         to any interface-type T'.       
6567
6568 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6569
6570         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6571
6572 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6573
6574         * cs-parser.jay: Use verbosity accordingly. 
6575
6576 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6577
6578         * expression.cs (Unary.ResolveOperator): Do not report warning;
6579         AddressOf reads from variable.
6580         
6581         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6582
6583 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6584
6585         Fix bug #69462
6586
6587         * attribute.cs (Attributable): Removed CheckTargets.
6588         (Attributes.Emit): Explicit attribute targets are tested here.
6589
6590         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6591         not enabled for interfaces.
6592
6593         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6594         (GetAssemblyName): Ouch next bug there.
6595
6596 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6597
6598         * expression.cs: Error 275 added.
6599         
6600 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6601
6602         Fix bug #69177 (Implemented decimal constant support)
6603
6604         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6605         (BinaryFold): Add DecimalConstant.
6606
6607         * const.cs (Define): Decimal constant 
6608         (is not constant.
6609         (ChangeType): Add decimal type handling.
6610         (LookupConstantValue): Don't set value for decimal type but
6611         emit DecimalConstantAttribute. Needed for constant optimization.
6612
6613         * constant.cs (ToDecimal): New method.
6614         (ConvertToDecimal): New method.
6615         (IntConstant): Implemented ConvertToDecimal.
6616         (DecimalConstant.Emit): Emit optimized version for decimals in
6617         int range.
6618
6619         * expression.cs (ResolveOperator): Changed order of constant
6620         reduction to work correctly with native types which have
6621         overloaded operators.
6622         (ResolveMemberAccess): Extract constant value from attribute
6623         for decimal type.
6624
6625         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6626
6627         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6628         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6629         (ChangeType): Decimal is special.
6630         (TypeToCoreType): Add decimal type.
6631
6632 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6633
6634         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6635         decimal types.
6636
6637 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6638
6639         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6640         test cs1667-5.cs.
6641
6642 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6643
6644         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6645
6646         * pending.cs (PendingImplementation): Grab only interfaces.
6647
6648 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6649
6650         * statement.cs (ForeachHelperMethods): Add location member and
6651         error 202 detection.
6652
6653 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6654
6655         * expression.cs (DoResolveBase): Fixed wrong warning for out
6656         variables.
6657
6658 2004-12-04  Martin Baulig  <martin@ximian.com>
6659
6660         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6661         to check whether the conversion is ok.
6662
6663         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6664         `Type.EmptyTypes' if we're not a generic TypeContainer.
6665
6666 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6667
6668         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6669         old bug: when converting from the null literal to a pointer,
6670         return an EmptyCast, not the NullLiteral.
6671
6672         This fixes #69921, the recent null_type changes probably made this
6673         bug more prominent.
6674
6675 2004-12-03  Martin Baulig  <martin@ximian.com>
6676
6677         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6678         method as our child, call AnonymousMethod.Compatible() on it.
6679
6680 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6681
6682         * class.cs (FieldBase): Use an unused bit field from the field to
6683         encode the `has_offset' property from the FieldMember.  This saves
6684         a couple of Ks on bootstrap compilation.
6685
6686         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6687         method as our child, return the AnonymousMethod resolved
6688         expression.
6689
6690         * expression.cs (New.DoResolve): Allow return values from
6691         NewDelegate to also include AnonymousMethods.
6692
6693         Fixes #70150.
6694
6695 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6696
6697         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6698         cs1648 report.
6699         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6700         System.Runtime.InteropServices._Exception, since it's a base
6701         interface of the core type System.Exception in the net_2_0 profile.
6702
6703 2004-11-27  Martin Baulig  <martin@ximian.com>
6704
6705         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6706
6707 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6708
6709         * Makefile: Convert to use executable.make.
6710         * gmcs.exe.sources: New.
6711
6712 2004-11-25  Martin Baulig  <martin@ximian.com>
6713
6714         * expression.cs (Invocation.InferType): Added support for byref types.
6715
6716 2004-11-25  Martin Baulig  <martin@ximian.com>
6717
6718         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6719         in TypeManager.TypeToCoreType().
6720
6721 2004-11-25  Martin Baulig  <martin@ximian.com>
6722
6723         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6724         "Dispose" method from the `current_type'.
6725         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6726         DoDefineMembers() instead of using the MethodBuilder; this is
6727         required for generic iterators.
6728
6729         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6730
6731 2004-11-24  Martin Baulig  <martin@ximian.com>
6732
6733         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6734
6735 2004-11-20  Martin Baulig  <martin@ximian.com>
6736
6737         * expression.cs (Invocation.InferType): Correctly infer generic
6738         instances; see gen-103.cs.
6739         (Invocation.InferTypeArguments): If a generic method doesn't have
6740         any unbound type parameters, we don't need to infer anything.
6741
6742 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6743
6744         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6745
6746 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6747
6748         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6749         (TypeHandle.GetMemberCache): New.
6750         (TypeHandle.TypeHandle): Update.
6751         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6752         (TypeManager.LookupParentInterfacesCache):
6753         Rename from LookupInterfaceCache.  Optimize slightly.
6754         (TypeManager.MemberLookup_FindMembers): Update.
6755         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6756         multi-type variant.
6757         (AddCacheContents): Rename from AddHashtable.
6758         * class.cs (TypeContainer.parent_container): Remove.
6759         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6760         (TypeContainer.DoDefineMembers): Don't initialize it.
6761         Update to name changes.
6762         
6763 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6764
6765         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6766         that factors the code to check access modifiers on override.  
6767
6768         (PropertyBase): Use the code here.
6769
6770         Patch from Lluis S'anchez, fixes bug #69361.
6771
6772 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6773
6774         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6775         routine that is used to report the use of a captured variable
6776         whose address has been taken.
6777
6778         There are two checks: one when variables are being captured and
6779         the other check is when the address of a variable is taken. 
6780         
6781         (because an anonymous methods might be resolved before *or* after
6782         the address has been taken) and 
6783
6784         * expression.cs (Conditional.DoResolve): Remove the special
6785         casing that Martin added to trueExpr and falseExpr being both
6786         NullLiteral.  We get the right behavior now just by introducing
6787         the null_type into the compiler. 
6788
6789         * convert.cs (ExplicitConversion): Change the code to use
6790         null_type instead of testing `expr is NullLiteral'.
6791         (ImplicitConversionStandard): use null_type too.
6792         (ImplicitReferenceConversionExists): use null_type too.
6793         (ImplicitReferenceConversion): use null_type too.
6794
6795         * literal.cs: The type of `NullLiteral' is now null_type instead
6796         of object_type. 
6797         (Resolve): Set the type here.
6798
6799         * typemanager.cs: Introduce null_type.
6800
6801 2004-11-18  Martin Baulig  <martin@ximian.com>
6802
6803         * rootcontext.cs
6804         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6805
6806 2004-11-18  Martin Baulig  <martin@ximian.com>
6807
6808         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6809
6810 2004-11-18  Martin Baulig  <martin@ximian.com>
6811
6812         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6813         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6814         call ResolveConstructedType() on it to resolve it without checking
6815         constraints.
6816         (Constraints.ResolveTypes): Check them here.
6817         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6818         but don't check constraints.
6819         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6820         check constraints here.
6821         (ConstructedType.ResolveConstructedType): New public method.  This
6822         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6823         resolve ourselves without checking constraints.
6824
6825         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6826
6827 2004-11-18  Martin Baulig  <martin@ximian.com>
6828
6829         * decl.cs
6830         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6831
6832         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6833
6834 2004-11-18  Martin Baulig  <martin@ximian.com>
6835
6836         * ecore.cs (TypeExpr.ResolveType): Removed.
6837         (Expression.ResolveAsTypeTerminal): We always return a fully
6838         resolved `TypeExpr', so we can just access its `Type'.
6839
6840         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6841
6842 2004-11-17  Martin Baulig  <martin@ximian.com>
6843
6844         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6845         sure we don't return any unresolved TypeExpr's.
6846         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6847         a `TypeExpr'.
6848         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6849
6850         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6851         unresolved `ConstructedType's.
6852
6853 2004-11-17  Martin Baulig  <martin@ximian.com>
6854
6855         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6856
6857 2004-11-17  Martin Baulig  <martin@ximian.com>
6858
6859         * ecore.cs
6860         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6861
6862         * decl.cs (DeclSpace.ResolveType): Removed.
6863         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6864
6865 2004-11-17  Martin Baulig  <martin@ximian.com>
6866
6867         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6868         direction, like FindMembers() does.  Fixes #69546, testcase is in
6869         test-315.cs.    
6870
6871 2004-11-16  Martin Baulig  <martin@ximian.com>
6872
6873         This is based on a patch from Marek Safar, see bug #69082.
6874         Fixes bugs #63705 and #67130.
6875
6876         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6877         method; create a MemberCache for an interface type and cache the
6878         result.
6879
6880         * decl.cs (IMemberContainer.ParentContainer): Removed.
6881         (IMemberContainer.ParentCache): New property.
6882         (MemberCache.SetupCacheForInterface): Removed.
6883         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6884         to create a cache for an interface's "parent".
6885
6886         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6887         interfaces too.
6888
6889 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6890
6891         * statement.cs: Avoid adding bools to a hashtable.
6892
6893 2004-11-15  Martin Baulig  <martin@ximian.com>
6894
6895         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6896
6897 2004-11-11  Martin Baulig  <martin@ximian.com>
6898
6899         * typemanager.cs (TypeManager.GetMethodName): New method.
6900
6901         * class.cs (MethodData.Define): Include the generic arity in the
6902         name of an explicit interface; also add it to the method name.
6903
6904         * pending.cs (PendingImplementation.InterfaceMethod): The method
6905         name now includes the generic arity.
6906
6907 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6908
6909         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6910         calling an unsafe method from a safe location.
6911
6912 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6913
6914         Fix #69167
6915         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6916
6917 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6918
6919         * namespace.cs (VerifyUsing): use GetPartialName instead of
6920         ToString. 
6921
6922 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6923
6924         * statement.cs (Return.Resolve): Fix regression in typo: if
6925         `in_exc', we have to request a NeedReturnLabel, this was a typo
6926         introduced in the anonymous method check-in.  Fixes #69131.
6927
6928         * Indexers were using the ShortName when defining themselves,
6929         causing a regression in the compiler bootstrap when applying the
6930         patch from 2004-11-02 (first part), now they use their full name
6931         and the bug is gone.
6932
6933 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6934
6935         * driver.cs: Strip the path from the names of embedded resources. Fixes
6936         #68519.
6937
6938 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6939
6940         Fix error message regression: cs0104-2.cs.
6941         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6942         (AliasEntry.Resolve): Update.
6943         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6944         'silent' flag.
6945         (RootContext.LookupType): Update.
6946
6947 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6948
6949         * cs-parser.jay: Add support for handling accessor modifiers
6950         * class: Add support port accessor modifiers and error checking,
6951         define PropertyMethod.Define as virtual (not abstract anymore)
6952         * ecore.cs: Add checking for proeprties access with access modifiers
6953         * iterators.cs: Modify Accessor constructor call based in the modified
6954         constructor
6955 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6956
6957         * expression.cs (StringConcat): Handle being called twice,
6958         as when we have a concat in a field init with more than two
6959         ctors in the class
6960
6961 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6962
6963         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6964         special case explicit implementations, we should always produce
6965         the .property or .event declaration.
6966         
6967         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6968         since it will not return correct data if people use this
6969         unresolved in the presence of using statements (see test-313).
6970
6971         * class.cs (MethodData.Define): If we are an explicit interface
6972         implementation, set the method name to the full name of the
6973         interface plus the name of the method.  
6974
6975         Notice that using the method.MethodName.GetFullName() does not
6976         work, as it will only contain the name as declared on the source
6977         file (it can be a shorthand in the presence of using statements)
6978         and not the fully qualifed type name, for example:
6979
6980         using System;
6981
6982         class D : ICloneable {
6983                 object ICloneable.Clone ()  {
6984                 }
6985         }
6986
6987         Would produce a method called `ICloneable.Clone' instead of
6988         `System.ICloneable.Clone'.
6989
6990         * namespace.cs (Alias.Resolve): Use GetPartialName.
6991         
6992 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6993
6994         * cs-parser.jay: Add error 1055 report.
6995
6996 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6997
6998         * assign.cs (Assign.DoResolve): Only do the transform of
6999         assignment into a New if the types are compatible, if not, fall
7000         through and let the implicit code deal with the errors and with
7001         the necessary conversions. 
7002
7003 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7004
7005         * cs-parser.jay: Add error 1031 report.
7006
7007         * cs-tokenizer.cs: Add location for error 1038.
7008
7009 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7010
7011         * cs-parser.jay: Add error 1016 report.
7012
7013 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7014
7015         * cs-parser.jay: Add errors 1575,1611 report.
7016
7017 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7018
7019         * cs-parser.jay: Add error 1001 report.
7020
7021 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7022
7023         Fix #68850
7024         * attribute.cs (GetMarshal): Add method argument for
7025         caller identification.
7026
7027         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7028         agument for GetMarshal and RuntimeMissingSupport.
7029
7030 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7031
7032         * attribute.cs (ExtractSecurityPermissionSet): Removed
7033         TypeManager.code_access_permission_type.
7034
7035         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7036
7037 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7038
7039         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7040         for obsolete use of a variable here.   Fixes regression on errors
7041         cs0619-25 and cs0619-26.
7042
7043 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7044
7045         Fix #62358, implemented security attribute encoding.
7046
7047         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7048         Tests permitted SecurityAction for assembly or other types.
7049         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7050         data from SecurityPermissionAttribute to PermisionSet class.
7051
7052         * class.cs (ApplyAttributeBuilder): Added special handling
7053         for System.Security.Permissions.SecurityAttribute based types.
7054
7055         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7056         special handling for System.Security.Permissions.SecurityAttribute
7057         based types.
7058
7059         * enum.cs (ApplyAttributeBuilder): Added special handling
7060         for System.Security.Permissions.SecurityAttribute based types.
7061
7062         * parameter.cs (ApplyAttributeBuilder): Added special handling
7063         for System.Security.Permissions.SecurityAttribute based types.
7064
7065         * rootcontext.cs: Next 2 core types.
7066
7067         * typemanager.cs (TypeManager.security_permission_attr_type):
7068         Built in type for the SecurityPermission Attribute.
7069         (code_access_permission_type): Build in type.
7070
7071 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7072
7073         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7074         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7075         all of this information into
7076         EmitContext.EmitCapturedVariableInstance.
7077         
7078         * codegen.cs (EmitCapturedVariableInstance): move here the
7079         funcionality of emitting an ldarg.0 in the presence of a
7080         remapping.   This centralizes the instance emit code.
7081
7082         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7083         then emit a load of this: it means that we have reached the
7084         topmost ScopeInfo: the one that contains the pointer to the
7085         instance of the class hosting the anonymous method.
7086
7087         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7088         captures to the topmost CaptureContext.
7089
7090 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7091
7092         * expression.cs (LocalVariableReference): Move the knowledge about
7093         the iterators into codegen's EmitCapturedVariableInstance.
7094
7095 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7096
7097         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7098         all code paths return a value from an anonymous method (it is the
7099         same as the 161 error, but for anonymous methods).
7100
7101 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7102
7103         The introduction of anonymous methods in the compiler changed
7104         various ways of doing things in the compiler.  The most
7105         significant one is the hard split between the resolution phase
7106         and the emission phases of the compiler.
7107
7108         For instance, routines that referenced local variables no
7109         longer can safely create temporary variables during the
7110         resolution phase: they must do so from the emission phase,
7111         since the variable might have been "captured", hence access to
7112         it can not be done with the local-variable operations from the runtime.
7113         
7114         * statement.cs 
7115
7116         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7117         is a toplevel block.
7118
7119         (ToplevelBlock): A new kind of Block, these are the blocks that
7120         are created by the parser for all toplevel method bodies.  These
7121         include methods, accessors and anonymous methods.
7122
7123         These contain some extra information not found in regular blocks:
7124         A pointer to an optional CaptureContext (for tracking captured
7125         local variables and parameters).  A pointer to the parent
7126         ToplevelBlock.
7127         
7128         (Return.Resolve): Catch missmatches when returning a value from an
7129         anonymous method (error 1662).
7130         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7131         phase.
7132
7133         (Break.Resolve): ditto.
7134
7135         (SwitchLabel): instead of defining the labels during the
7136         resolution phase, we now turned the public ILLabel and ILLabelCode
7137         labels into methods called GetILLabelCode() and GetILLabel() that
7138         only define the label during the Emit phase.
7139
7140         (GotoCase): Track the SwitchLabel instead of the computed label
7141         (its contained therein).  Emit the code by using
7142         SwitchLabel.GetILLabelCode ().
7143
7144         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7145         whether the Local has been captured or not.
7146
7147         (LocalInfo.IsCaptured): New property, used to tell whether the
7148         local has been captured.
7149         
7150         * anonymous.cs: Vastly updated to contain the anonymous method
7151         support.
7152
7153         The main classes here are: CaptureContext which tracks any
7154         captured information for a toplevel block and ScopeInfo used to
7155         track the activation frames for various local variables.   
7156
7157         Each toplevel block has an optional capture context associated
7158         with it.  When a method contains an anonymous method both the
7159         toplevel method and the anonymous method will create a capture
7160         context.   When variables or parameters are captured, they are
7161         recorded on the CaptureContext that owns them, for example:
7162
7163         void Demo () {
7164              int a;
7165              MyDelegate d = delegate {
7166                  a = 1;
7167              }
7168         }
7169
7170         Here `a' will be recorded as captured on the toplevel
7171         CapturedContext, the inner captured context will not have anything
7172         (it will only have data if local variables or parameters from it
7173         are captured in a nested anonymous method.
7174
7175         The ScopeInfo is used to track the activation frames for local
7176         variables, for example:
7177
7178         for (int i = 0; i < 10; i++)
7179                 for (int j = 0; j < 10; j++){
7180                    MyDelegate d = delegate {
7181                         call (i, j);
7182                    }
7183                 }
7184
7185         At runtime this captures a single captured variable `i', but it
7186         captures 10 different versions of the variable `j'.  The variable
7187         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7188         recorded on a child.  
7189
7190         The toplevel ScopeInfo will also track information like the `this'
7191         pointer if instance variables were referenced (this is necessary
7192         as the anonymous method lives inside a nested class in the host
7193         type of the method). 
7194
7195         (AnonymousMethod): Expanded to track the Toplevel, implement
7196         `AnonymousMethod.Compatible' to tell whether an anonymous method
7197         can be converted to a target delegate type. 
7198
7199         The routine now also produces the anonymous method content
7200
7201         (AnonymousDelegate): A helper class that derives from
7202         DelegateCreation, this is used to generate the code necessary to
7203         produce the delegate for the anonymous method that was created. 
7204
7205         * assign.cs: API adjustments for new changes in
7206         Convert.ImplicitStandardConversionExists.
7207
7208         * class.cs: Adjustments to cope with the fact that now toplevel
7209         blocks are of type `ToplevelBlock'. 
7210
7211         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7212         insteda of standard blocks.
7213
7214         Flag errors if params arguments are passed to anonymous methods.
7215
7216         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7217         `CurrentAnonymousMethod' which points to the current Anonymous
7218         Method.  The variable points to the AnonymousMethod class that
7219         holds the code being compiled.  It is set in the new EmitContext
7220         created for the anonymous method.
7221
7222         (EmitContext.Phase): Introduce a variable and an enumeration to
7223         assist in enforcing some rules about when and where we are allowed
7224         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7225         only one that enfonces this right now).
7226
7227         (EmitContext.HaveCaptureInfo): new helper method that returns
7228         whether we have a CapturedContext initialized.
7229
7230         (EmitContext.CaptureVariable): New method used to register that a
7231         LocalInfo must be flagged for capturing. 
7232
7233         (EmitContext.CapturedParameter): New method used to register that a
7234         parameters must be flagged for capturing. 
7235         
7236         (EmitContext.CapturedField): New method used to register that a
7237         field must be flagged for capturing. 
7238
7239         (EmitContext.HaveCapturedVariables,
7240         EmitContext.HaveCapturedFields): Return whether there are captured
7241         variables or fields. 
7242
7243         (EmitContext.EmitMethodHostInstance): This is used to emit the
7244         instance for the anonymous method.  The instance might be null
7245         (static methods), this (for anonymous methods that capture nothing
7246         and happen to live side-by-side with the current method body) or a
7247         more complicated expression if the method has a CaptureContext.
7248
7249         (EmitContext.EmitTopBlock): Routine that drives the emission of
7250         code: it will first resolve the top block, then emit any metadata
7251         and then emit the code.  The split is done so that we can extract
7252         any anonymous methods and flag any captured variables/parameters.
7253         
7254         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7255         during this phase, the ILGenerator should not be used as labels
7256         and local variables declared here might not be accessible to any
7257         code that is part of an anonymous method.  
7258
7259         Exceptions to this include the temporary variables that are
7260         created by some statements internally for holding temporary
7261         variables. 
7262         
7263         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7264         metadata for a cb
7265
7266         (EmitContext.TemporaryReturn): This method is typically called
7267         from the Emit phase, and its the only place where we allow the
7268         ReturnLabel to be defined other than the EmitMeta.  The reason is
7269         that otherwise we would have to duplicate a lot of logic in the
7270         Resolve phases of various methods that today is on the Emit
7271         phase. 
7272
7273         (EmitContext.NeedReturnLabel): This no longer creates the label,
7274         as the ILGenerator is not valid during the resolve phase.
7275
7276         (EmitContext.EmitThis): Extended the knowledge in this class to
7277         work in anonymous methods in addition to iterators. 
7278
7279         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7280         code is necessary on the stack to access the instance to a local
7281         variable (the variable will be accessed as a field).
7282
7283         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7284         EmitContext.EmitAddressOfParameter): Routines to support
7285         parameters (not completed at this point). 
7286         
7287         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7288         will also remove the parameters.
7289
7290         * convert.cs (Convert): Define a `ConstantEC' which points to a
7291         null.  This is just to prefity some code that uses
7292         ImplicitStandardConversion code and do not have an EmitContext
7293         handy.
7294
7295         The idea is to flag explicitly that at that point in time, it is
7296         known that the conversion will not trigger the delegate checking
7297         code in implicit conversions (which requires a valid
7298         EmitContext). 
7299
7300         Everywhere: pass new EmitContext parameter since
7301         ImplicitStandardConversionExists now requires it to check for
7302         anonymous method conversions. 
7303
7304         (Convert.ImplicitStandardConversionExists): If the type of an
7305         expression is the anonymous_method_type, and the type is a
7306         delegate, we invoke the AnonymousMethod.Compatible method to check
7307         whether an implicit conversion is possible. 
7308
7309         (Convert.ImplicitConversionStandard): Only do implicit method
7310         group conversions if the language level is not ISO_1.
7311
7312         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7313         MethodInfo for the Invoke method.  used by Delegate and
7314         AnonymousDelegate.
7315
7316         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7317         method conversions if the target type is a delegate.
7318
7319         Removed extra debugging nops.
7320
7321         (LocalVariableReference): Turn the `local_info' into a public
7322         field. 
7323
7324         Add `prepared' field, the same hack used for FieldExprs to cope
7325         with composed assignments, as Local variables do not necessarily
7326         operate purely on the stack as they used to: they can be captured
7327         fields. 
7328
7329         Add `temp' for a temporary result, like fields.
7330
7331         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7332
7333         It now copes with Local variables that are captured and emits the
7334         proper instance variable to load it from a field in the captured
7335         case. 
7336
7337         (ParameterReference.DoResolveBase): During the resolve phase,
7338         capture parameters if we are in an anonymous method.
7339
7340         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7341         anonymous method, use the EmitContext helper routines to emit the
7342         parameter reference.
7343
7344         * iterators.cs: Set RemapToProxy to true/false during the
7345         EmitDispose class.
7346
7347         * parameters.cs (GetParameterByName): New helper method. 
7348
7349         * typemanager.cs (anonymous_method_type) a new type that
7350         represents an anonyous method.  This is always an internal type,
7351         used as a fencepost to test against the anonymous-methodness of an
7352         expression. 
7353         
7354 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7355
7356         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7357         561 report.
7358         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7359
7360 2004-11-10  Martin Baulig  <martin@ximian.com>
7361
7362         * expression.cs (Invocation.BetterFunction): If two methods have
7363         equal parameter types, but only one of them is generic, the
7364         non-generic one wins.
7365         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7366         instance; just use `Type.IsValueType' to determine whether
7367         something is a struct or not.
7368         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7369         so we can be called multiple times.
7370
7371 2004-11-10  Martin Baulig  <martin@ximian.com>
7372
7373         * generic.cs (TypeParameter.DefineConstraints): New public method.
7374         (TypeParameter.CheckAccessLevel): Override this and return true.
7375         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7376         override ResolveType() anymore.
7377         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7378
7379 2004-11-10  Martin Baulig  <martin@ximian.com>
7380
7381         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7382         call DeclSpace.ResolveNestedType() on it.
7383
7384 2004-11-10  Martin Baulig  <martin@ximian.com>
7385
7386         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7387         non-null, call ParameterModifier() on it.
7388
7389 2004-11-10  Martin Baulig  <martin@ximian.com>
7390
7391         * iterators.cs
7392         (Iterators): Added `current_type' and `this_type' fields.
7393         (Iterators.DefineIterator): Create a new EmitContext and store it
7394         in `ec'; compute `this_type'.
7395
7396 2004-11-10  Martin Baulig  <martin@ximian.com>
7397
7398         * typemanager.cs
7399         (TypeManager.IsPrivateAccessible): New public method.
7400         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7401
7402 2004-11-10  Martin Baulig  <martin@ximian.com>
7403
7404         * class.cs (TypeContainer.DefineType): Call
7405         TypeBuilder.DefineGenericParameters() before resolving the type
7406         parameters.
7407         (MethodData.parent_method): New protected field.
7408         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7409         (MethodData.Define): Compute `parent_method'.
7410
7411         * decl.cs
7412         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7413         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7414         (DeclSpace.ec): New protected field; store the EmitContext here.
7415         (DeclSpace.EmitContext): New public property.
7416         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7417         (DeclSpace.ResolveNestedType): New public method.
7418         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7419         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7420         (DeclSpace.FamilyAccessible): Likewise.
7421         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7422         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7423         EmitContext.
7424
7425         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7426         field.
7427
7428         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7429         (Enum.Emit): Don't create a new EmitContext.
7430
7431 2004-10-18  Martin Baulig  <martin@ximian.com>
7432
7433         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7434         `Type' directly, but call ResolveType() on it.
7435         (Catch.Resolve): Likewise.
7436         (Foreach.Resolve): Likewise.
7437
7438 2004-10-18  Martin Baulig  <martin@ximian.com>
7439
7440         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7441         `Type' directly, but call ResolveType() on it.
7442         (Probe.DoResolve): Likewise.
7443         (ArrayCreation.LookupType): Likewise.
7444         (TypeOf.DoResolve): Likewise.
7445         (SizeOf.DoResolve): Likewise.
7446
7447 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7448
7449         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7450         the ResolveType.
7451
7452 2004-10-17  John Luke  <john.luke@gmail.com>
7453
7454         * class.cs (Operator.GetSignatureForError): use CSharpName
7455
7456         * parameter.cs (Parameter.GetSignatureForError): Returns
7457         correct name even if was not defined.
7458
7459 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7460
7461         Fix #65816.
7462         * class.cs (TypeContainer.EmitContext): New property.
7463         (DefineNestedTypes): Create an emitcontext for each part.
7464         (MethodCore.DoDefineParameters): Use container's emitcontext.
7465         Pass type array to InternalParameters.
7466         (MemberBase.DoDefine): Use container's emitcontext.
7467         (FieldMember.Define): Likewise.
7468         (Event.Define): Likewise.
7469         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7470         Pass type array to InternalParameters.
7471         (SetIndexerMethod.GetParameterInfo): Likewise.
7472         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7473         * delegate.cs (Define): Pass emitcontext to
7474         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7475         array to InternalParameters.
7476         * expression.cs (ParameterReference.DoResolveBase): Pass
7477         emitcontext to GetParameterInfo.
7478         (ComposedCast.DoResolveAsTypeStep): Remove check on
7479         ec.ResolvingTypeTree.
7480         * parameter.cs (Parameter.Resolve): Change argument to
7481         EmitContext.  Use ResolveAsTypeTerminal.
7482         (Parameter.GetSignature): Change argument to EmitContext.
7483         (Parameters.ComputeSignature): Likewise.
7484         (Parameters.ComputeParameterTypes): Likewise.
7485         (Parameters.GetParameterInfo): Likewise.
7486         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7487         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7488         * support.cs (InternalParameters..ctor): Remove variant that takes
7489         a DeclSpace.
7490         * typemanager.cs (system_intptr_expr): New.
7491         (InitExpressionTypes): Initialize it.
7492
7493 2004-10-12  Chris Toshok  <toshok@ximian.com>
7494
7495         * cs-parser.jay: fix location for try_statement and catch_clause.
7496
7497 2004-10-18  Martin Baulig  <martin@ximian.com>
7498
7499         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7500         `Type' directly, but call ResolveType() on it.
7501         (MemberBase.DoDefine): Likewise.
7502
7503         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7504         `Type' directly, but call ResolveType() on it.
7505         (ComposedCast.DoResolveAsTypeStep): Likewise.
7506
7507         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7508         `Type' directly, but call ResolveType() on it.
7509
7510 2004-10-17  John Luke  <john.luke@gmail.com>
7511
7512         * class.cs (Operator.GetSignatureForError): use CSharpName
7513
7514         * parameter.cs (Parameter.GetSignatureForError): Returns
7515         correct name even if was not defined.
7516
7517 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7518
7519         Fix #65816.
7520         * class.cs (TypeContainer.EmitContext): New property.
7521         (DefineNestedTypes): Create an emitcontext for each part.
7522         (MethodCore.DoDefineParameters): Use container's emitcontext.
7523         Pass type array to InternalParameters.
7524         (MemberBase.DoDefine): Use container's emitcontext.
7525         (FieldMember.Define): Likewise.
7526         (Event.Define): Likewise.
7527         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7528         Pass type array to InternalParameters.
7529         (SetIndexerMethod.GetParameterInfo): Likewise.
7530         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7531         * delegate.cs (Define): Pass emitcontext to
7532         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7533         array to InternalParameters.
7534         * expression.cs (ParameterReference.DoResolveBase): Pass
7535         emitcontext to GetParameterInfo.
7536         (ComposedCast.DoResolveAsTypeStep): Remove check on
7537         ec.ResolvingTypeTree.
7538         * parameter.cs (Parameter.Resolve): Change argument to
7539         EmitContext.  Use ResolveAsTypeTerminal.
7540         (Parameter.GetSignature): Change argument to EmitContext.
7541         (Parameters.ComputeSignature): Likewise.
7542         (Parameters.ComputeParameterTypes): Likewise.
7543         (Parameters.GetParameterInfo): Likewise.
7544         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7545         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7546         * support.cs (InternalParameters..ctor): Remove variant that takes
7547         a DeclSpace.
7548         * typemanager.cs (system_intptr_expr): New.
7549         (InitExpressionTypes): Initialize it.
7550
7551 2004-10-12  Chris Toshok  <toshok@ximian.com>
7552
7553         * cs-parser.jay: fix location for try_statement and catch_clause.
7554
7555 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7556
7557         More DeclSpace.ResolveType avoidance.
7558         * decl.cs (MemberCore.InUnsafe): New property.
7559         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7560         with newly created EmitContext.
7561         (FieldMember.Define): Likewise.
7562         * delegate.cs (Delegate.Define): Likewise.
7563         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7564         only if normal name-lookup fails.
7565         (TypeExpr.DoResolve): Enable error-checking.
7566         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7567         (SizeOf.DoResolve): Likewise.
7568         (ComposedCast.DoResolveAsTypeStep): Likewise.
7569         (StackAlloc.DoResolve): Likewise.
7570         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7571         (Block.Unsafe): New property.
7572         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7573         (Unsafe): Set 'unsafe' flag of contained block.
7574         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7575         (Fixed.Resolve): Likewise.
7576         (Catch.Resolve): Likewise.
7577         (Using.ResolveLocalVariableDecls): Likewise.
7578         (Foreach.Resolve): Likewise.
7579
7580 2004-10-05  John Luke <john.luke@gmail.com>
7581
7582         * cs-parser.jay: add location to error CS0175
7583
7584 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7585
7586         * ecore.cs (Expression.Constantity): Add support for turning null
7587         into a constant.
7588
7589         * const.cs (Const.Define): Allow constants to be reference types
7590         as long as the value is Null.
7591
7592 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7593
7594         * namespace.cs (NamespaceEntry.Using): No matter which warning
7595         level is set, check if this namespace name has already been added.
7596
7597 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7598
7599         * expression.cs: reftype [!=]= null should always use br[true,false].
7600         # 67410
7601
7602 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7603
7604         Fix #67108
7605         * attribute.cs: Enum conversion moved to 
7606         GetAttributeArgumentExpression to be applied to the all
7607         expressions.
7608
7609 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7610
7611         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7612         * class.c (TypeContainer.DefineType): Flag error if
7613         base types aren't accessible due to access permissions.
7614         * decl.cs (DeclSpace.ResolveType): Move logic to
7615         Expression.ResolveAsTypeTerminal.
7616         (DeclSpace.ResolveTypeExpr): Thin layer over
7617         Expression.ResolveAsTypeTerminal.
7618         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7619         Refactor code into NestedAccess.  Use it.
7620         (DeclSpace.NestedAccess): New.
7621         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7622         argument to silence errors.  Check access permissions.
7623         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7624         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7625         (Cast.DoResolve): Likewise.
7626         (New.DoResolve): Likewise.
7627         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7628         (TypeOf.DoResolve): Likewise.
7629
7630         * expression.cs (Invocation.BetterConversion): Return the Type of
7631         the better conversion.  Implement section 14.4.2.3 more faithfully.
7632         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7633         section 14.4.2.2 explicit.
7634         (Invocation.OverloadResolve): Update.
7635         (Invocation): Remove is_base field.
7636         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7637         (Invocation.Emit): Likewise.
7638
7639 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7640
7641         * cs-parser.jay: Reverted 642 warning fix.
7642
7643 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7644
7645         Fix bug #66615
7646         * decl.cs (FindMemberWithSameName): Indexer can have more than
7647         1 argument.
7648
7649 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7650
7651         * expression.cs (LocalVariableReference.DoResolveLValue):
7652         Do not report warning 219 for out values.
7653         (EmptyExpression.Null): New member to avoid extra allocations.
7654
7655 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7656
7657         * cs-parser.jay: Fix wrong warning 642 report.
7658
7659         * cs-tokenizer.cs (CheckNextToken): New helper;
7660         Inspect next character if is same as expected.
7661
7662 2004-09-23  Martin Baulig  <martin@ximian.com>
7663
7664         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7665         (Convert.ImplicitReferenceConversionExists): Likewise.
7666
7667 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7668
7669         * Makefile (DISTFILES): Comment out a few missing files.
7670
7671 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7672
7673         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7674         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7675         (gmcs.exe): Invoke bootstrap-libs.
7676         (clean-local): Clean the net_2_0_bootstrap profile too.
7677         (PROGRAM_INSTALL_DIR): New.
7678         (install-local): Use it.
7679
7680 2004-10-13  Martin Baulig  <martin@ximian.com>
7681
7682         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7683         (TypeParameter.DefineType): If we're a method type parameter and
7684         that method is overriding something, "inflate" its constraints.
7685
7686 2004-10-12  Martin Baulig  <martin@ximian.com>
7687
7688         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7689         and have type arguments, create and resolve a ConstructedType.
7690
7691 2004-10-12  Martin Baulig  <martin@ximian.com>
7692
7693         * decl.cs (MemberCache.FindMemberToOverride): Use
7694         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7695         to compare the invocationType.
7696
7697         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7698         When comparing two type parameters, only do the signature-only
7699         comparision for method type parameters.
7700
7701 2004-10-11  Martin Baulig  <martin@ximian.com>
7702
7703         * report.cs: Don't make --fatal abort on warnings, we have
7704         -warnaserror for that.
7705
7706 2004-10-11  Martin Baulig  <martin@ximian.com>
7707
7708         * typemanager.cs
7709         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7710         (TypeManager.IsEqual): Call ourself recursively instead of using
7711         Type.IsEqual(). 
7712
7713 2004-10-11  Martin Baulig  <martin@ximian.com>
7714
7715         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7716         on our own type parameters, not on the ones we inherit from a containing
7717         class.
7718
7719         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7720         the comparision.
7721
7722         * generic.cs (TypeParameter.Define): We may only be called once.
7723
7724         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7725         instead of TypeManager.IsEqual().
7726
7727 2004-09-28  Martin Baulig  <martin@ximian.com>
7728
7729         * generic.cs
7730         (GenericConstraints.EffectiveBaseClass): New public property.
7731         (TypeParameter.GenericConstraints): New public property.
7732         (ConstructedType.CheckConstraints): Improved.
7733
7734         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7735         (Convert.TypeParameterConversion): New private method; use this in
7736         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7737         for all conversions related to type parameters.
7738
7739 2004-09-24  Martin Baulig  <martin@ximian.com>
7740
7741         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7742         type parameter conversions for type parameters which are known to
7743         be reference types.
7744
7745 2004-09-24  Martin Baulig  <martin@ximian.com>
7746
7747         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7748         `IsValueType' properties.
7749
7750         * support.cs (ReflectionConstraints): Use
7751         Type.GetGenericParameterConstraints() instead of the old hack.
7752
7753 2004-09-24  Martin Baulig  <martin@ximian.com>
7754
7755         * generic.cs (GenericConstraints): Moved here and made it an
7756         abstract class.
7757
7758         * support.cs (GenericConstraints): Moved to generic.cs.
7759
7760 2004-09-24  Martin Baulig  <martin@ximian.com>
7761
7762         * support.cs
7763         (ReflectionConstraints): Un-nested this class and made it public.
7764
7765         * typemanager.cs
7766         (TypeManager.GetTypeParameterConstraints): New public method.
7767         (TypeManager.HasConstructorConstraint): Use the attributes.
7768
7769 2004-09-24  Martin Baulig  <martin@ximian.com>
7770
7771         * support.cs (GenericConstraints): Replaced `HasConstructor',
7772         `IsReferenceType' and `IsValueType' with `Attributes'.
7773         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7774         method and made the .ctor public.
7775
7776         * generic.cs (Constraints.Attributes): New public property.
7777         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7778         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7779         `IsValueType' -> `HasValueTypeConstraint'.
7780
7781 2004-09-23  Martin Baulig  <martin@ximian.com>
7782
7783         * generic.cs (Constraints): Reflect latest runtime changes.
7784
7785 2004-09-23  Martin Baulig  <martin@ximian.com>
7786
7787         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7788         (Convert.ImplicitReferenceConversionExists): Likewise.
7789
7790 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7791
7792         * class.cs (Operator.Define): Add error 448 and 559 report.
7793         
7794 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7795
7796         * class.cs (MemberBase.IsTypePermitted): New protected
7797         method for checking error CS0610.
7798
7799 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7800
7801         * class.cs (TypeContainer.HasExplicitLayout): New property
7802         Returns whether container has StructLayout attribute set Explicit.
7803         (FieldMember): New abstract class for consts and fields.
7804         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7805         (Field): Reuse FieldMember.
7806
7807         * const.cs (Const): Reuse FieldMember.
7808
7809         * rootcontext.cs: EmitConstants call moved to class.
7810
7811 2004-09-22  Martin Baulig  <martin@ximian.com>
7812
7813         Marek and me just fixed one of our oldest bugs: #28562 :-)
7814
7815         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7816
7817         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7818         we're an EnumConstant, just return that.
7819         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7820         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7821         to get the value which'll actually be written into the attribute.
7822         However, we have to use GetValue() to access the attribute's value
7823         in the compiler.        
7824
7825 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7826
7827         * constant.cs (Constant.IsNegative): New abstract property
7828         IsNegative.
7829
7830         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7831         (StackAlloc.DoResolve): Reused IsNegative.
7832
7833 2004-09-22  Martin Baulig  <martin@ximian.com>
7834
7835         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7836         public method; like LookupTypeContainer, but also works for
7837         generic instances.
7838
7839         * report.cs (Report.SymbolRelatedToPreviousError): Use
7840         TypeManager.LookupGenericTypeContainer().       
7841
7842 2004-09-22  Martin Baulig  <martin@ximian.com>
7843
7844         Thanks to Peter Sestoft for this bug report.
7845
7846         * expression.cs (Conditional): If both the `trueExpr' and the
7847         `falseExpr' is a NullLiteral, return a NullLiteral.
7848
7849 2004-09-22  Martin Baulig  <martin@ximian.com>
7850
7851         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7852         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7853         for the "get_Current" call.
7854
7855 2004-09-21  Martin Baulig  <martin@ximian.com>
7856
7857         * convert.cs (Convert.ImplicitReferenceConversion): When
7858         converting to an interface type, first check whether we're
7859         converting from a reference type.
7860
7861 2004-09-14  Martin Baulig  <martin@ximian.com>
7862
7863         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7864
7865 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7866
7867         Fixed bug #61902
7868         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7869         called and is obsolete then this member suppress message
7870         when call is inside next [Obsolete] method or type.
7871
7872         * expression.cs: Use TestObsoleteMethodUsage member.
7873
7874 2004-09-14  Martin Baulig  <martin@ximian.com>
7875
7876         * genericparser.cs: Removed.
7877
7878 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7879
7880         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7881
7882 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7883
7884         * attribute.cs (Attribute.Resolve): Add error 653 report.
7885
7886         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7887         report.
7888         (Method.ApplyAttributeBuilder): Add error 685 report.
7889         (Operator.Define): Add error 564 report.
7890
7891         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7892
7893         * expression.cs (Invocation.DoResolve): Add error
7894         245 and 250 report.
7895
7896         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7897         error 674 report.
7898
7899 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7900
7901         * class.cs (ConstructorInitializer.Resolve):
7902         Wrong error number (515->516).
7903
7904 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7905
7906         * class.cs (Indexer.Define): Add error 631 report.
7907
7908 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7909
7910         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7911
7912 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7913
7914         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7915
7916 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7917
7918         * cs-parser.jay: Added error CS0241 report.
7919
7920 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7921
7922         * cs-parser.jay (fixed_statement): Introduce a scope for the
7923         declaration in the 'fixed' statement.
7924
7925 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7926
7927         * cs-parser.jay: Added CS0230 error report.
7928
7929 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7930
7931         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7932
7933 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7934
7935         * expression.cs (Argument.Resolve): Added error CS0192 and
7936         CS0199 report.
7937
7938 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7939
7940         C# 2.0 #pragma warning feature
7941
7942         * cs-tokenizer.cs (PreProcessPragma): New method; 
7943         Handles #pragma directive.
7944
7945         * report.cs (WarningRegions): New class; Support
7946         class for #pragma warning directive. It tests whether
7947         warning is enabled for a given line.
7948
7949 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7950
7951         * const.cs: Add more descriptive error report, tahnks to
7952         Sebastien. 
7953
7954 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7955
7956         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7957
7958 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7959
7960         * expression.cs: Apply patch from Ben: Remove dead code from
7961         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7962         as that code just threw an exception anwyays.
7963
7964         * const.cs: Remove the call to the turnintoconstant, for details
7965         see bug: #63144
7966         
7967         * literal.cs: The type of the null-literal is the null type;  So
7968         we use a placeholder type (literal.cs:System.Null, defined here)
7969         for it.
7970
7971         * expression.cs (Conditional.DoResolve): Remove some old code that
7972         is no longer needed, conversions have been fixed.
7973
7974         (ArrayCreationExpression.DoResolve): Return false if we fail to
7975         resolve the inner expression.
7976
7977 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7978
7979         Fix test-290.cs.
7980         * cs-parser.jay (delegate_declaration): Record a delegate
7981         declaration as a type declaration.
7982         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7983
7984 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7985
7986         * parameter.cs: Do not crash if the type can not be resolved. 
7987
7988         * expression.cs: Report errors with unsafe pointers, fixes #64896
7989
7990 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7991
7992         * expression.cs: Pointer arith always needs to do a conv.i
7993         if the operand is a long. fix 65320
7994
7995 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7996
7997         Fixed cs0619-37.cs, cs0619-38.cs
7998
7999         * enum.cs (GetObsoleteAttribute): Removed.
8000
8001         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8002         on Enum member is double staged. The first is tested member
8003         and then enum.
8004
8005 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8006
8007         Fixed #56986, #63631, #65231
8008
8009         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8010         adds member to name container.
8011         (TypeContainer.AddToTypeContainer): New method, adds type to
8012         name container.
8013         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8014         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8015         AddOperator): Simplified by reusing AddToMemberContainer.
8016         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8017         instead of field.
8018         (Method.CheckForDuplications): Fixed implementation to test all
8019         possibilities.
8020         (MemberBase): Detection whether member is explicit interface
8021         implementation is now in constructor.
8022         (MemberBase.UpdateMemberName): Handles IndexerName.
8023         (Accessor): Changed to keep also location information.
8024         (AbstractPropertyEventMethod): Is derived from MemberCore.
8025         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8026         will be emited or not.
8027         (PropertyBase.AreAccessorsDuplicateImplementation):
8028         Tests whether accessors are not in collision with some method.
8029         (Operator): Is derived from MethodCore to simplify common
8030         operations.
8031
8032         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8033         must be performed.
8034         (DeclSpace.AddToContainer): Adds the member to defined_names
8035         table. It tests for duplications and enclosing name conflicts.
8036
8037         * enum.cs (EnumMember): Clean up to reuse the base structures
8038
8039 2004-09-03  Martin Baulig  <martin@ximian.com>
8040
8041         Merged latest changes into gmcs.  Please keep this comment in
8042         here, it makes it easier for me to see what changed in MCS since
8043         the last time I merged.
8044
8045 2004-09-03  Martin Baulig  <martin@ximian.com>
8046
8047         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8048         into TypeContainer, to make partial classes work again.
8049
8050 2004-09-03  Martin Baulig  <martin@ximian.com>
8051
8052         * rootcontext.cs (RootContext.V2): Removed.
8053
8054 2004-03-23  Martin Baulig  <martin@ximian.com>
8055
8056         * expression.cs (Invocation.OverloadResolve): Added `bool
8057         may_fail' argument and use it instead of the Location.IsNull() hack.
8058
8059 2004-09-09  Martin Baulig  <martin@ximian.com>
8060
8061         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8062
8063 2004-09-09  Martin Baulig  <martin@ximian.com>
8064
8065         * generic.cs (TypeParameter.DefineType): Added support for
8066         explicit interface methods.
8067
8068 2004-09-09  Martin Baulig  <martin@ximian.com>
8069
8070         * README.Changes: New document.  Started to list important changes
8071         between MCS and GMCS here.
8072
8073 2004-09-08  Martin Baulig  <martin@ximian.com>
8074
8075         * class.cs
8076         (TypeContainer.CheckRecursiveDefinition): New protected method.
8077         (TypeContainer.DefineType): Move the CS0146 check into
8078         CheckRecursiveDefinition().     
8079
8080 2004-09-06  Martin Baulig  <martin@ximian.com>
8081
8082         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8083         types for the constructor constraint.
8084
8085 2004-09-03  Martin Baulig  <martin@ximian.com>
8086
8087         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8088         into TypeContainer, to make partial classes work again.
8089
8090 2004-09-03  Martin Baulig  <martin@ximian.com>
8091
8092         * rootcontext.cs (RootContext.V2): Removed.
8093
8094 2004-03-23  Martin Baulig  <martin@ximian.com>
8095
8096         * expression.cs (Invocation.OverloadResolve): Added `bool
8097         may_fail' argument and use it instead of the Location.IsNull() hack.
8098
8099 2004-09-03  Martin Baulig  <martin@ximian.com>
8100
8101         Merged latest changes into gmcs.  Please keep this comment in
8102         here, it makes it easier for me to see what changed in MCS since
8103         the last time I merged.
8104
8105 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8106
8107         Fix #61128.
8108         * expression.cs (BetterConversion): Don't allow either conversion 
8109         to be null.  Remove redundant implicit conversion test when 'q ==
8110         null' -- when this function is invoked, we already know that the
8111         implicit conversion exists.
8112         (BetterFunction): Assume that 'best' is non-null.  Remove
8113         redundant reimplementation of IsApplicable when 'best' is null.
8114         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8115         number of arguments.
8116         (IsAncestralType): Extract from OverloadResolve.
8117         (OverloadResolve): Make robust to the MethodGroupExpr being
8118         unsorted.  Implement all the logic of Section 14.5.5.1, and
8119         support overloading of methods from multiple applicable types.
8120         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8121
8122         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8123         (RealError, Warning): Append type of report to related symbol.
8124
8125 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8126
8127         * enum.cs: Fixed CLS-Compliance checks for enum members.
8128         Error tests cs3008-8.cs, cs3014-8.cs
8129
8130 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8131
8132         Fixed bug #62342, #63102
8133         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8134         like ImplementMethod.
8135
8136 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8137
8138         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8139         Fixed bug #65170.
8140
8141 2004-09-02  Martin Baulig  <martin@ximian.com>
8142
8143         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8144         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8145         on the MethodBase.
8146
8147 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8148
8149         C# 2.0 Static classes implemented
8150
8151         * class.cs (TypeContainer): instance_constructors,
8152         initialized_fields, initialized_static_fields,
8153         default_constructor, base_inteface_types are protected to be
8154         accessible from StaticClass.
8155         (TypeContainer.DefineDefaultConstructor): New virtual method
8156         for custom default constructor generating
8157         (StaticClass): New class to handle "Static classes" feature.
8158
8159         * cs-parser.jay: Handle static keyword on class like instance
8160         of StaticClass.
8161
8162         * driver.cs: Added "/langversion" command line switch with two
8163         options (iso-1, default).
8164
8165 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8166
8167         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8168
8169 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8170
8171         * delegate.cs: Style.
8172
8173 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8174
8175         * delegate.cs: Add seperate instance expr field for miguel.
8176
8177 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8178
8179         * PointerArithmetic (Resolve): make sure we are not doing
8180         pointer arith on void*. Also, make sure we are resolved
8181         by not setting eclass until resolve.
8182
8183         All callers: Make sure that PointerArithmetic gets resolved.
8184
8185 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8186
8187         * ArrayCreation (LookupType): If the type does not resolve 
8188         to an array, give an error.
8189
8190 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8191
8192         * statement.cs (Try.Resolve): Fixed bug #64222
8193
8194 2004-08-27  Martin Baulig  <martin@ximian.com>
8195
8196         * class.cs
8197         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8198         crash here.     
8199
8200 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8201
8202         * ecore.cs (Constantify): Get underlying type via
8203         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8204         Windows in special cases.
8205
8206 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8207
8208         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8209         for obtaining also private methods.
8210         (GetRemoveMethod): Used GetRemoveMethod (true)
8211         for obtaining also private methods.
8212
8213 2004-09-02  Martin Baulig  <martin@ximian.com>
8214
8215         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8216         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8217         on the MethodBase.
8218
8219 2004-08-27  Martin Baulig  <martin@ximian.com>
8220
8221         * class.cs
8222         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8223         crash here.     
8224
8225 2004-08-25  Martin Baulig  <martin@ximian.com>
8226
8227         * support.cs (ReflectionParameters..ctor): If this is a generic
8228         method, retrieve and store its type parameters.
8229         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8230         (ReflectionParameters.GenericConstraints): The argument specifies
8231         the type parameter, not the method parameter.
8232         (InternalParameters.GenericConstraints): Likewise.
8233
8234         * generic.cs (TypeParameter.DefineType): Correctly handle
8235         constraints wrt. generic methods in interfaces and their
8236         implementations.        
8237
8238 2004-08-24  Martin Baulig  <martin@ximian.com>
8239
8240         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8241         (Constraints.IsSubclassOf): New internal method.
8242
8243         * typemanager.cs (TypeManager.FindMembers): Added special support
8244         for GenericTypeParameterBuilder's.      
8245         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8246         type parameters.
8247
8248 2004-08-24  Martin Baulig  <martin@ximian.com>
8249
8250         * typemanager.cs
8251         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8252         this for accessibility checks.
8253         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8254         IsNestedFamilyAccessible.
8255         (TypeManager.IsSubclassOf): New method, do what the name actually
8256         says.   
8257
8258 2004-08-24  Martin Baulig  <martin@ximian.com>
8259
8260         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8261         as a SimpleName, include the generic arity.
8262
8263 2004-08-24  Martin Baulig  <martin@ximian.com>
8264
8265         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8266         MethodAttributes.HideBySig for operators.
8267
8268 2004-08-23  Martin Baulig  <martin@ximian.com>
8269
8270         Back to the old error reporting system :-)
8271
8272         * report.cs (Message): Removed.
8273         (Report.MessageData, ErrorData, WarningData): Removed.
8274         (Report.Error, Warning): Back to the old system.
8275
8276 2004-08-23  Martin Baulig  <martin@ximian.com>
8277
8278         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8279
8280         * class.cs (TypeContainer.ParentContainer): New public virtual
8281         method; replaces the explicit interface implementation.
8282         (ClassPart.ParentContainer): Override.
8283
8284 2004-08-23  Martin Baulig  <martin@ximian.com>
8285
8286         * statement.cs (Switch): Added support for constant switches; see
8287         #59428 or test-285.cs.
8288
8289 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8290
8291         Fixed bug #62740.
8292         * statement.cs (GetEnumeratorFilter): Removed useless
8293         logic because C# specs is strict. GetEnumerator must be
8294         public.
8295
8296 2004-08-22  Martin Baulig  <martin@ximian.com>
8297
8298         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8299         a switch and may break, reset the barrier.  Fixes #59867.
8300
8301 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8302
8303         CLS-Compliance speed up (~5% for corlib)
8304
8305         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8306         New method. Tests container for CLS-Compliant names
8307
8308         * class.cs (TypeContainer.VerifyClsName): New method.
8309         Checks whether container name is CLS Compliant.
8310         (Constructor): Implements IMethodData.
8311
8312         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8313         low-case table for CLS Compliance test.
8314         (MemberCache.VerifyClsParameterConflict): New method.
8315         Checks method parameters for CS3006 error.
8316
8317         * enum.cs (EnumMember): Is derived from MemberCore.
8318         (Enum.VerifyClsName): Optimized for better performance.
8319
8320 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8321
8322         * report.cs: Renamed Error_T to Error and changed all
8323         references.
8324
8325 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8326
8327         * class.cs (TypeContainer.IndexerArrayList): New inner class
8328         container for indexers.
8329         (TypeContainer.DefaultIndexerName): New constant for default
8330         indexer name. Replaced all "Item" with this constant.
8331         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8332
8333         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8334         DefaultMemberAttribute constructor.
8335
8336 2004-08-05  Martin Baulig  <martin@ximian.com>
8337
8338         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8339         Fix bug #59429.
8340
8341 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8342
8343         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8344         multi platforms problem.
8345
8346         * compiler.csproj: Included shared files.
8347
8348 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8349
8350         Fix bug 60333, 55971 in the more general way
8351         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8352         Added arg_type argument for constant conversion.
8353         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8354
8355 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8356
8357         Fix bug #59760
8358         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8359         OperatorArrayList, MethodCoreArrayList for typecontainer
8360         containers. Changed class member types to these new types.
8361         (MethodArrayList.DefineMembers): Added test for CS0659.
8362
8363 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8364
8365         * cfold.cs: Synchronize the folding with the code in expression.cs
8366         Binary.DoNumericPromotions for uint operands.
8367
8368         * attribute.cs: Revert patch from Raja, it introduced a regression
8369         while building Blam-1.2.1 (hard to isolate a test case).
8370
8371 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8372
8373         Fix for #55382
8374         * class.cs:
8375         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8376         name collision.
8377         (MethodCore.parent_method): New member. The method we're overriding
8378         if this is an override method.
8379         (MethodCore.CheckBase): Moved from Method class and made common.
8380         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8381         private.
8382         (MethodCore.CheckForDuplications): New abstract method. For custom
8383         member duplication search in a container
8384         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8385         method and its return type.
8386         (Event.conflict_symbol): New member. Symbol with same name in the
8387         parent class.
8388
8389         * decl.cs:
8390         (MemberCache.FindMemberWithSameName): New method. The method
8391         is looking for conflict with inherited symbols.
8392
8393 2004-08-04  Martin Baulig  <martin@ximian.com>
8394
8395         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8396
8397         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8398
8399 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8400
8401         * report.cs (Message): New enum for better error, warning reference in
8402         the code.
8403         (MessageData): New inner abstract class. It generally handles printing of
8404         error and warning messages.
8405         Removed unused Error, Warning, Message methods.
8406
8407 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8408
8409         Fix for cs0592-8.cs test
8410         * attribute.cs
8411         (Attributable.ValidAttributeTargets): Made public.
8412         (Attribute.ExplicitTarget): New member for explicit target value.
8413         (Attribute.CheckTargets): Now we translate explicit attribute
8414         target to Target here.
8415
8416 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8417
8418         * ecore.cs (MethodGroupExpr): new IsBase property.
8419
8420         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8421
8422         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8423         rather than an instance expr.
8424
8425         (DelegateCreation.Emit): Use the method group rather than
8426         the instance expression. Also, if you have base.Foo as the
8427         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8428
8429         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8430
8431         (NewDelegate.DoResolve): Only check for the existance of Invoke
8432         if the method is going to be needed. Use MethodGroupExpr.
8433
8434         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8435
8436         * expression.cs: For pointer arith., make sure to use
8437         the size of the type, not the size of the pointer to
8438         the type.
8439
8440 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8441
8442         Fix for #60722
8443         * class.cs (Class): Added error CS0502 test.
8444
8445 2004-08-03  John Luke  <jluke@cfl.rr.com>
8446             Raja R Harinath  <rharinath@novell.com>
8447
8448         Fix for #60997.
8449         * attribute.cs (Attribute.complained_before): New flag.
8450         (Attribute.ResolveType, Attribute.Resolve),
8451         (Attribute.DefinePInvokeMethod): Set it.
8452         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8453         
8454 2004-08-03  Martin Baulig  <martin@ximian.com>
8455
8456         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8457         use a user-defined operator; we still need to do numeric
8458         promotions in case one argument is a builtin type and the other
8459         one has an implicit conversion to that type.  Fixes #62322.
8460
8461 2004-08-18  Martin Baulig  <martin@ximian.com>
8462
8463         * class.cs (Method.Define): Use the correct method name when
8464         creating the MethodBuilder for a generic method.
8465
8466 2004-08-17  Martin Baulig  <martin@ximian.com>
8467
8468         * generic.cs (Constraints): Support type parameter constraints.
8469
8470 2004-08-16  Martin Baulig  <martin@ximian.com>
8471
8472         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8473         (Token.GENERIC_DIMENSION): New token; this is returned if we
8474         encounter an unbound generic type in a typeof() expression.
8475
8476         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8477         this token is only generated while parsing a typeof() expression.
8478         (typeof_expression): Removed the old unbound_type hack.
8479
8480         * generic.cs (TypeArguments.IsUnbound): New public property.
8481
8482         * decl.cs (MemberName): Added support for unbound types.
8483
8484 2004-08-14  Martin Baulig  <martin@ximian.com>
8485
8486         * typemanager.cs
8487         (TypeManager.IsEqualGenericInstance): New static method.
8488         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8489         just used to check accessibility, so follow the rules of 26.1.6.        
8490
8491         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8492         ConstructedType instead of a TypeExpression if we have type arguments.
8493
8494         * cs-parser.jay (typeof_expression): Support unbound generic types.
8495
8496         * ecore.cs (UnboundTypeExpression): New public class.
8497
8498 2004-08-12  Martin Baulig  <martin@ximian.com>
8499
8500         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8501         TypeManager.IsEqual() rather than `=='.
8502
8503         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8504         generic instances as well.
8505
8506 2004-08-12  Martin Baulig  <martin@ximian.com>
8507
8508         * expression.cs (Invocation.InferType): We can only infer method
8509         type parameters.  Fixes #62647.
8510
8511 2004-08-11  Martin Baulig  <martin@ximian.com>
8512
8513         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8514         before resolving the base classes.
8515
8516 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8517
8518         * Makefile: install .mdb file too.
8519
8520 2004-08-05  Martin Baulig  <martin@ximian.com>
8521
8522         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8523         initializer, the current type is just the TypeBuilder, not the
8524         instantiated generic type.
8525         (FieldExpr.IsFieldInitializer): New public property.
8526
8527 2004-08-04  Martin Baulig  <martin@ximian.com>
8528
8529         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8530
8531         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8532
8533 2004-08-03  Martin Baulig  <martin@ximian.com>
8534
8535         * class.cs (MethodData.Define): If we're an explicit
8536         implementation, remove the generic arity from the type name.
8537
8538 2004-08-03  Martin Baulig  <martin@ximian.com>
8539
8540         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8541         use a user-defined operator; we still need to do numeric
8542         promotions in case one argument is a builtin type and the other
8543         one has an implicit conversion to that type.  Fixes #62322.
8544
8545 2004-08-02  Martin Baulig  <martin@ximian.com>
8546
8547         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8548         `TypeExpr[]' array.
8549         (TypeContainer.GetClassBases): Return the unexpanded list of
8550         interfaces; we expand them later.
8551         (TypeContainer.DefineType): After creating the TypeBuilder, call
8552         TypeManager.ExpandInterfaces() to get an expanded and resolved
8553         list of interfaces.
8554
8555         * ecore.cs (TypeExpr.GetInterfaces): Removed
8556
8557         * generics.cs (Constraints.InterfaceConstraints): Remove.
8558         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8559         register the interface constraints.
8560
8561         * typemanager.cs
8562         (TypeManager.AddUserType): Removed the `ifaces' argument.
8563         (TypeManager.AddTypeParameter): Likewise.
8564         (TypeManager.AddUserInterface): Removed, was unused.
8565         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8566         `TypeExpr[]' array for the interfaces.
8567         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8568         has been defined, returns a list of the resolved interfaces types.
8569         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8570         (TypeManager.GetExplicitInterfaces): Likewise.  
8571
8572 2004-08-02  Martin Baulig  <martin@ximian.com>
8573
8574         * expression.cs (Invocation.EmitCall): If we're invoking a method
8575         on a type parameter, use the new `Constrained' prefix opcode.
8576
8577 2004-08-02  Martin Baulig  <martin@ximian.com>
8578
8579         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8580         (LocalInfo.IsThis): New public property.
8581         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8582
8583 2004-08-01  Martin Baulig  <martin@ximian.com>
8584
8585         * class.cs (TypeContainer.GetClassBases): Don't set the default
8586         here since we may get called from GetPartialBases().
8587         (TypeContainer.DefineType): If GetClassBases() didn't return a
8588         parent, use the default one.
8589
8590 2004-07-30  Martin Baulig  <martin@ximian.com>
8591
8592         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8593
8594         * class.cs (SourceMethod): New public class, derive from the
8595         symbol writer's ISourceMethod.
8596         (Method): Use the new symbol writer API.
8597
8598         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8599         as argument and use the new symbol writer.
8600
8601         * location.cs
8602         (SourceFile): Implement the symbol writer's ISourceFile.
8603         (Location.SymbolDocument): Removed.
8604         (Location.SourceFile): New public property.
8605
8606         * symbolwriter.cs: Use the new symbol writer API.
8607
8608 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8609
8610         * Makefile (install-local): Remove.  Functionality moved to
8611         executable.make.
8612
8613 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8614
8615         * Makefile: Install mcs.exe.config file together with mcs.exe.
8616         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8617         correct runtime version.
8618         
8619 2004-07-25  Martin Baulig  <martin@ximian.com>
8620
8621         * class.cs
8622         (TypeContainer.RegisterOrder): Removed, this was unused.
8623         (TypeContainer, interface_order): Removed.
8624         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8625         TypeContainer as argument since we can also be called with a
8626         `PartialContainer' for a partial class/struct/interface.
8627         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8628         of checking whether we're an `Interface' - we could be a
8629         `PartialContainer'.
8630         (PartialContainer.Register): Override; call
8631         AddClass()/AddStruct()/AddInterface() on our parent.
8632
8633         * cs-parser.jay (interface_member_declaration): Add things to the
8634         `current_container', not the `current_class'.
8635
8636         * rootcontext.cs (RegisterOrder): The overloaded version which
8637         takes an `Interface' was unused, removed.
8638
8639         * typemanager.cs (TypeManager.LookupInterface): Return a
8640         `TypeContainer', not an `Interface'.
8641         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8642         contain a `PartialContainer' for an interface, so check it's
8643         `Kind' to figure out what it is.
8644
8645 2004-07-25  Martin Baulig  <martin@ximian.com>
8646
8647         * class.cs (Class.DefaultTypeAttributes): New public constant.
8648         (Struct.DefaultTypeAttributes): Likewise.
8649         (Interface.DefaultTypeAttributes): Likewise.
8650         (PartialContainer.TypeAttr): Override this and add the
8651         DefaultTypeAttributes.
8652
8653 2004-07-25  Martin Baulig  <martin@ximian.com>
8654
8655         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8656         we can just use the `Parent' field instead.
8657
8658 2004-07-25  Martin Baulig  <martin@ximian.com>
8659
8660         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8661
8662 2004-07-25  Martin Baulig  <martin@ximian.com>
8663
8664         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8665         our parts before defining any methods.
8666         (TypeContainer.VerifyImplements): Make this virtual.
8667         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8668         on our PartialContainer.
8669
8670 2004-07-25  Martin Baulig  <martin@ximian.com>
8671
8672         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8673
8674         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8675         argument, we can just use the `Parent' field instead.
8676
8677         * class.cs
8678         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8679         (MemberBase.DoDefine): Likewise.
8680
8681 2004-07-24  Martin Baulig  <martin@ximian.com>
8682
8683         * decl.cs (MemberCore.Parent): New public field.
8684         (DeclSpace.Parent): Moved to MemberCore.
8685
8686         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8687         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8688         parent's .ctor.
8689         (FieldBase, Field, Operator): Likewise.
8690         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8691         (EventField, Event): Likewise.
8692
8693 2004-07-23  Martin Baulig  <martin@ximian.com>
8694
8695         * class.cs (PartialContainer): New public class.
8696         (ClassPart): New public class.
8697         (TypeContainer): Added support for partial classes.
8698         (TypeContainer.GetClassBases): Splitted some of the functionality
8699         out into GetNormalBases() and GetPartialBases().
8700
8701         * cs-tokenizer.cs (Token.PARTIAL): New token.
8702         (Tokenizer.consume_identifier): Added some hacks to recognize
8703         `partial', but only if it's immediately followed by `class',
8704         `struct' or `interface'.
8705
8706         * cs-parser.jay: Added support for partial clases.
8707
8708 2004-07-23  Martin Baulig  <martin@ximian.com>
8709
8710         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8711         a `DeclSpace' and also made it readonly.
8712         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8713         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8714         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8715
8716         * cs-parser.jay: Pass the `current_class', not the
8717         `current_container' (at the moment, this is still the same thing)
8718         to a new Method, Property, Event, Indexer or Constructor.
8719
8720 2004-07-23  Martin Baulig  <martin@ximian.com>
8721
8722         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8723         and removed the `current_interface' one.
8724         (struct_declaration, class_declaration, interface_declaration):
8725         Set `current_class' to the newly created class/struct/interface;
8726         set their `Bases' and call Register() before parsing their body.
8727
8728 2004-07-23  Martin Baulig  <martin@ximian.com>
8729
8730         * class.cs (Kind): New public enum.
8731         (TypeContainer): Made this class abstract.
8732         (TypeContainer.Kind): New public readonly field.
8733         (TypeContainer.CheckDef): New public method; moved here from
8734         cs-parser.jay.
8735         (TypeContainer.Register): New public abstract method.
8736         (TypeContainer.GetPendingImplementations): New public abstract
8737         method.
8738         (TypeContainer.GetClassBases): Removed the `is_class' and
8739         `is_iface' parameters.
8740         (TypeContainer.DefineNestedTypes): Formerly known as
8741         DoDefineType().
8742         (ClassOrStruct): Made this class abstract.
8743
8744         * tree.cs (RootTypes): New public type. 
8745
8746 2004-07-20  Martin Baulig  <martin@ximian.com>
8747
8748         * tree.cs (Tree.RecordNamespace): Removed.
8749         (Tree.Namespaces): Removed.
8750
8751         * rootcontext.cs (RootContext.IsNamespace): Removed.
8752
8753         * cs-parser.jay (namespace_declaration): Just create a new
8754         NamespaceEntry here.
8755
8756 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8757
8758         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8759         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8760         entry to make sure it runs in the correct runtime version.
8761         
8762 2004-07-18  Martin Baulig  <martin@ximian.com>
8763
8764         * generic.cs (ConstructedType.CheckConstraints): Improved
8765         constraints checking.
8766
8767 2004-07-18  Martin Baulig  <martin@ximian.com>
8768
8769         * expression.cs (Invocation.BetterMethod): Call
8770         TypeManager.TypeToCoreType() on all types and removed my previous
8771         hack; we're already doig the right thing here.
8772
8773 2004-07-17  Martin Baulig  <martin@ximian.com>
8774
8775         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8776
8777 2004-07-16  Martin Baulig  <martin@ximian.com>
8778
8779         * iterators.cs: Added generics support.
8780
8781 2004-07-16  Martin Baulig  <martin@ximian.com>
8782
8783         * iterators.cs: Rewrote this.  We're now using one single Proxy
8784         class for both the IEnumerable and the IEnumerator interface and
8785         `Iterator' derives from Class so we can use the high-level API.
8786
8787         * class.cs (TypeContainer.AddIterator): New method.
8788         (TypeContainer.DoDefineType): New protected virtual method, which
8789         is called from DefineType().
8790         (TypeContainer.DoDefineMembers): Call DefineType() and
8791         DefineMembers() on all our iterators.
8792         (TypeContainer.Emit): Call Emit() on all our iterators.
8793         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8794
8795         * codegen.cs (EmitContext.CurrentIterator): New public field.
8796
8797 2004-07-15  Martin Baulig  <martin@ximian.com>
8798
8799         * typemanager.cs
8800         (TypeManager.not_supported_exception_type): New type.   
8801
8802 2004-07-14  Martin Baulig  <martin@ximian.com>
8803
8804         * typemanager.cs
8805         (TypeManager.generic_ienumerable_type): New type.
8806         (TypeManager.generic_ienumerator_type): New type.
8807
8808         * rootcontext.cs
8809         (RootContext.interfaces_first_stage): Added
8810         "System.Collections.Generic.IEnumerator`1" and
8811         "System.Collections.Generic.IEnumerable`1".     
8812
8813 2004-07-14  Martin Baulig  <martin@ximian.com>
8814
8815         * iterators.cs: Use real error numbers.
8816
8817 2004-07-14  Martin Baulig  <martin@ximian.com>
8818
8819         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8820         requires this to be a System.Collection.IEnumerable and not a
8821         class implementing that interface.
8822         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8823
8824 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8825
8826         * class.cs: Fixed previous fix, it broke some error tests.
8827
8828 2004-07-12  Martin Baulig  <martin@ximian.com>
8829
8830         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8831         Fixes #61293.
8832
8833 2004-07-14  Martin Baulig  <martin@ximian.com>
8834
8835         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8836         an exclamation mark (!) for the generic arity to reflect the
8837         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8838
8839 2004-07-13  Martin Baulig  <martin@ximian.com>
8840
8841         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8842         specifiers being part of a type argument.
8843
8844 2004-07-13  Martin Baulig  <martin@ximian.com>
8845
8846         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8847         name for generic types.
8848
8849 2004-07-13  Martin Baulig  <martin@ximian.com>
8850
8851         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8852         bit to fix #60119.
8853
8854 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8855
8856         * assign.cs (LocalTemporary): Add new argument: is_address,If
8857         `is_address' is true, then the value that we store is the address
8858         to the real value, and not the value itself.
8859         
8860         * ecore.cs (PropertyExpr): use the new local temporary
8861         stuff to allow us to handle X.Y += z (where X is a struct)
8862
8863 2004-07-08  Martin Baulig  <martin@ximian.com>
8864
8865         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8866         not always return, just like we're doing in Using.Resolve().
8867
8868 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8869
8870         * cs-parser.jay (fixed_statement): flag this as Pinned.
8871
8872 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8873
8874         * typemanager.cs (TypeManager): Removed MakePinned method, this
8875         mechanism is replaced with the .NET 2.x compatible mechanism of
8876         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8877
8878         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8879         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8880         `IsFixed' property which has a different meaning.
8881
8882 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8883
8884         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8885         visible from inside a nested class, not just the names of the
8886         immediately enclosing class.
8887         Fix for bug #60730.
8888
8889 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8890
8891         * expression.cs (BetterConversion): Remove buggy special-case
8892         handling of "implicit constant expression conversions".  At this
8893         point, we already know that the conversion is possible -- we're
8894         only checking to see which is better.
8895
8896 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8897
8898         * cs-parser.jay: Added error CS0210 test.
8899
8900 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8901
8902         * cs-parser.jay: Added error CS0134 test.
8903
8904 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8905
8906         Fix bug #52507
8907         * cs-parser.jay: Added error CS0145 test.
8908
8909 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8910
8911         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8912
8913 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8914         
8915         * expression.cs (StackAlloc.Resolve): The argument may not
8916         be a constant; deal with this case.
8917         
8918 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8919
8920         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8921         GetIndexerAttributeValue.
8922         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8923
8924         * class.cs (Indexer.Define): Added error tests for CS0415,
8925         CS0609.
8926
8927 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8930         property code.
8931
8932 2004-06-23  Martin Baulig  <martin@ximian.com>
8933
8934         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8935         neither return nor throw, reset the barrier as well.  Fixes #60457.
8936
8937 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8938
8939         * class.cs : EventAttributes is now set to None by default.
8940           This fixes bug #60459.
8941
8942 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8943
8944         Fix bug #60219
8945         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8946         Don't throw exception but return null (it's sufficient now).
8947
8948 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8949
8950         * typemanager.cs (GetArgumentTypes): Faster implementation.
8951
8952 2004-06-18  Martin Baulig  <martin@ximian.com>
8953
8954         * attribute.cs (Attribute.Resolve): Check whether we're an
8955         EmptyCast which a Constant child.  Fixes #60333.
8956
8957 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8958
8959         * statement.cs (EmitCollectionForeach): Account for the fact that
8960         not all valuetypes are in areas which we can take the address of.
8961         For these variables, we store to a temporary variable. Also, make
8962         sure that we dont emit a `callvirt' on a valuetype method.
8963
8964 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8965
8966         * expression.cs (StackAlloc.DoReSolve): Added test for
8967         negative parameter (CS0247).
8968
8969 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8970
8971         Fix bug #59792
8972         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8973
8974 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8975
8976         Fix bug #59781
8977         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8978         ulong.
8979
8980 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8981
8982         Fix bug #58254 & cs1555.cs, cs1556.cs
8983         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8984
8985 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8986
8987         * cs-parser.jay: Added error CS1669 test for indexers.
8988
8989 2004-06-18  Martin Baulig  <martin@ximian.com>
8990
8991         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8992         argument.  Fixes #60441.
8993
8994 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8995         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8996         The name needs to have the actual name of the method in order
8997         for other tests (such as the one in OverloadResolve for Invoke
8998         on a delegate) to work. As well, it does not really help
8999         error reporting because the method group had multiple methods.
9000         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9001         Make profiling work.
9002         
9003 2004-06-13  Martin Baulig  <martin@ximian.com>
9004
9005         * cs-parser.jay: Don't allow generic attributes.
9006
9007 2004-06-13  Martin Baulig  <martin@ximian.com>
9008
9009         * class.cs (MemberBase.DoDefineBase): New protected method.
9010         (MemberBase.DoDefine): Compute the `flags' in the new
9011         DoDefineBase() which must be called first.
9012         (Method.Define): Call DoDefineBase() first so we have the flags
9013         when defining the generic method.
9014
9015         * cs-parser.jay (interface_method_declaration): Support generic methods.
9016
9017 2004-06-13  Martin Baulig  <martin@ximian.com>
9018
9019         * decl.cs (TypeName): Removed.
9020         (MemberName): Removed TypeName and MemberNow; now we just have
9021         MemberName.
9022
9023         * cs-parser.jay: Don't distinguish between type arguments and type
9024         parameters in the grammar and simplified the rules a bit.  The
9025         reduce/reduce conflicts are now gone (except the one we inherited
9026         from mcs).
9027
9028 2004-06-11  Martin Baulig  <martin@ximian.com>
9029
9030         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9031         call this twice: for params and varargs methods.
9032
9033 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9034
9035         * class.cs:
9036         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9037
9038 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9039
9040         * attribute.cs (Attribute.GetValidTargets): Made public.
9041
9042         * class.cs: 
9043         (AbstractPropertyEventMethod): New class for better code sharing.
9044         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9045         CS1667 report.
9046         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9047
9048 2004-06-09  Martin Baulig  <martin@ximian.com>
9049
9050         * cs-parser.jay: Removed a reduce/reduce conflict.
9051
9052 2004-06-03  Martin Baulig  <martin@ximian.com>
9053
9054         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9055         GetSimpleName() and return a SimpleName.
9056
9057         * ecore.cs (SimpleName.Arguments): New public field.
9058         (SimpleName): Added overloaded ctor which takes an additional
9059         TypeArguments argument.
9060         (SimpleName.SimpleNameResolve): Added support for generic methods.
9061         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9062         formerly in MemberAccess.DoResolve(), but we also need it in
9063         SimpleNameResolve().
9064
9065         * expression.cs (MemberAccess.DoResolve): Use the new
9066         MethodGroupExpr.ResolveGeneric().       
9067
9068 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9069
9070         * decl.cs: If possible, use lookuptypedirect here. We can only do
9071         this if there is no `.' after the namespace. Avoids using
9072         LookupType, which does lots of slow processing.
9073         (FindNestedType) New method, does what it says :-).
9074         * namespace.cs: use LookupTypeDirect.
9075         * rootcontext.cs: use membercache, if possible.
9076         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9077
9078 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9079
9080         * expression.cs:
9081         According to the spec, 
9082
9083         In a member access of the form E.I, if E is a single identifier,
9084         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9085         field, property, localvariable, or parameter with the same type as
9086         the meaning of E as a type-name (§3.8), then both possible
9087         meanings of E are permitted.
9088
9089         We did not check that E as a simple-name had the same type as E as
9090         a type name.
9091
9092         This trivial check gives us 5-7% on bootstrap time.
9093
9094 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9095
9096         * expression.cs (Invocation.OverloadResolve): Avoid the
9097         use of hashtables and boxing here by allocating on demand.
9098
9099 2004-05-30  Martin Baulig  <martin@ximian.com>
9100
9101         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9102         we're doing a silent lookup.  Don't try to lookup nested types in
9103         TypeManager.object_type (thanks to Ben Maurer).
9104
9105 2004-05-30  Martin Baulig  <martin@ximian.com>
9106
9107         Committing a patch from Ben Maurer.
9108
9109         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9110
9111 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9112
9113         * convert.cs: add a trivial cache for overload operator resolution.
9114
9115 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9116
9117         * attribute.cs
9118         (AttributeTester.GetObsoleteAttribute): Returns instance of
9119         ObsoleteAttribute when type is obsolete.
9120
9121         * class.cs
9122         (TypeContainer.VerifyObsoleteAttribute): Override.
9123         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9124         (MethodCode.VerifyObsoleteAttribute): Override.
9125         (MemberBase.VerifyObsoleteAttribute): Override.
9126
9127         * decl.cs
9128         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9129         and report proper error.
9130
9131         *delegate.cs
9132         (Delegate.VerifyObsoleteAttribute): Override.
9133
9134         * ecore.cs
9135         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9136         and report proper error.
9137         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9138
9139         * enum.cs
9140         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9141         and enum member.
9142
9143         * expression.cs
9144         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9145         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9146         Added test for ObsoleteAttribute.
9147
9148         * statement.cs
9149         (Catch): Derived from Statement.
9150
9151 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9152
9153         * decl.cs: If possible, use lookuptypedirect here. We can only do
9154         this if there is no `.' after the namespace. Avoids using
9155         LookupType, which does lots of slow processing.
9156         (FindNestedType) New method, does what it says :-).
9157         * namespace.cs: use LookupTypeDirect.
9158         * rootcontext.cs: use membercache, if possible.
9159         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9160
9161 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9162
9163         * expression.cs:
9164         According to the spec, 
9165
9166         In a member access of the form E.I, if E is a single identifier,
9167         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9168         field, property, localvariable, or parameter with the same type as
9169         the meaning of E as a type-name (§3.8), then both possible
9170         meanings of E are permitted.
9171
9172         We did not check that E as a simple-name had the same type as E as
9173         a type name.
9174
9175         This trivial check gives us 5-7% on bootstrap time.
9176
9177 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9178
9179         Fixed bug #59071 & cs0160.cs
9180         * statement.cs (Try.Resolve): Check here whether order of catch
9181         clauses matches their dependencies.
9182
9183 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9184
9185         Fixed bug #58624
9186         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9187         unsafe type.
9188
9189 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9190
9191         * expression.cs (Invocation.OverloadResolve): Avoid the
9192         use of hashtables and boxing here by allocating on demand.
9193
9194 2004-05-30  Martin Baulig  <martin@ximian.com>
9195
9196         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9197         we're doing a silent lookup.  Don't try to lookup nested types in
9198         TypeManager.object_type (thanks to Ben Maurer).
9199
9200 2004-05-30  Martin Baulig  <martin@ximian.com>
9201
9202         Committing a patch from Ben Maurer.
9203
9204         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9205
9206 2004-05-29  Martin Baulig  <martin@ximian.com>
9207
9208         * class.cs (IMethodData.ShouldIgnore): New method.
9209
9210         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9211         `Location' argument, we don't need it anywhere.  Use
9212         `IMethodData.ShouldIgnore ()' instead of
9213         `MethodData.GetMethodFlags ()'.
9214         (TypeManager.AddMethod): Removed.
9215         (TypeManager.AddMethod2): Renamed to AddMethod.
9216
9217 2004-05-29  Martin Baulig  <martin@ximian.com>
9218
9219         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9220
9221         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9222         converting from a class type S to an interface type and we already
9223         have an object on the stack, don't box it again.  Fixes #52578.
9224
9225 2004-05-29  Martin Baulig  <martin@ximian.com>
9226
9227         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9228         Added support for `params' parameters.  Fixes #59267.
9229
9230 2004-05-29  Martin Baulig  <martin@ximian.com>
9231
9232         * literal.cs (NullPointer): Provide a private .ctor which sets
9233         `type' to TypeManager.object_type.  Fixes #59048.
9234
9235 2004-05-29  Martin Baulig  <martin@ximian.com>
9236
9237         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9238         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9239
9240         * ecore.cs (EventExpr.instance_expr): Make the field private.
9241
9242 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9243
9244         Fixed bug #50080 & cs0214-2.cs
9245         * expression.cs (Cast.DoResolve): Check unsafe context here.
9246         
9247         * statement.cs (Resolve.DoResolve): Likewise.
9248
9249 2004-05-26  Martin Baulig  <martin@ximian.com>
9250
9251         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9252
9253         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9254         (RootContext.LookupType): Pass down the `silent' flag.
9255
9256 2004-05-25  Martin Baulig  <martin@ximian.com>
9257
9258         * expression.cs
9259         (MethodGroupExpr.IdenticalTypeName): New public property.
9260         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9261         expression actually refers to a type.
9262
9263 2004-05-25  Martin Baulig  <martin@ximian.com>
9264
9265         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9266         for #56176 and made it actually work.
9267
9268 2004-05-25  Martin Baulig  <martin@ximian.com>
9269
9270         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9271         (FieldExpr, PropertyExpr): Override and implement
9272         CacheTemporaries.  Fixes #52279.
9273
9274 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9275
9276         * location.cs: In the new compiler listing a file twice is a
9277         warning, not an error.
9278
9279 2004-05-24  Martin Baulig  <martin@ximian.com>
9280
9281         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9282         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9283
9284 2004-05-24  Martin Baulig  <martin@ximian.com>
9285
9286         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9287         walking the `using' list.  Fixes #53921.
9288
9289 2004-05-24  Martin Baulig  <martin@ximian.com>
9290
9291         * const.cs (Const.LookupConstantValue): Added support for
9292         EmptyCast's; fixes #55251.
9293
9294 2004-05-24  Martin Baulig  <martin@ximian.com>
9295
9296         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9297         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9298         which does the CS0135 check.  The reason is that we first need to
9299         check whether the variable actually exists.
9300
9301 2004-05-24  Martin Baulig  <martin@ximian.com>
9302
9303         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9304         than RootContext.LookupType() to find the explicit interface
9305         type.  Fixes #58584.
9306
9307 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9308
9309         * Makefile: Simplify.  Use executable.make.
9310         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9311
9312 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9313
9314         * decl.cs:
9315         * enum.cs:
9316         Use the invariant culture when doing String.Compare for CLS case
9317         sensitivity.
9318         
9319 2004-05-23  Martin Baulig  <martin@ximian.com>
9320
9321         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9322         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9323
9324         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9325
9326 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9327
9328         * class.cs (MemberBase.Define): Reuse MemberType member for 
9329         resolved type. Other methods can use it too.
9330
9331 2004-05-23  Martin Baulig  <martin@ximian.com>
9332
9333         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9334         the variable also exists in the current block (otherwise, we need
9335         to report a CS0103).  Fixes #58670.
9336
9337 2004-05-23  Martin Baulig  <martin@ximian.com>
9338
9339         * flowanalysis.cs (Reachability.Reachable): Compute this
9340         on-the-fly rather than storing it as a field.
9341
9342 2004-05-23  Martin Baulig  <martin@ximian.com>
9343
9344         * flowanalysis.cs (Reachability.And): Manually compute the
9345         resulting `barrier' from the reachability.      
9346        
9347 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9348
9349         Fix bug #57835
9350         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9351         instance of ObsoleteAttribute when symbol is obsolete.
9352
9353         * class.cs
9354         (IMethodData): Extended interface for ObsoleteAttribute support.
9355
9356 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9357
9358         * attribute.cs: Fix bug #55970
9359
9360 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9361
9362         Fix bug #52705
9363         * attribute.cs
9364         (GetObsoleteAttribute): New method. Creates the instance of
9365         ObsoleteAttribute.
9366         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9367         ObsoleteAttribute when member is obsolete.
9368         (AttributeTester.Report_ObsoleteMessage): Common method for
9369         Obsolete error/warning reporting.
9370
9371         * class.cs
9372         (TypeContainer.base_classs_type): New member for storing parent type.
9373
9374         * decl.cs
9375         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9376         for this MemberCore.
9377
9378 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9379
9380         * attribute.cs, const.cs: Fix bug #58590
9381
9382 2004-05-21  Martin Baulig  <martin@ximian.com>
9383
9384         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9385         out parameters if the end of the method is unreachable.  Fixes
9386         #58098. 
9387
9388 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9389
9390         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9391         Hari was right, why extra method.
9392
9393 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9394
9395         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9396
9397 2004-05-20  Martin Baulig  <martin@ximian.com>
9398
9399         * delegate.cs: Convert this file to Unix mode - like the original
9400         version in mcs is.
9401
9402 2004-05-20  Martin Baulig  <martin@ximian.com>
9403
9404         * attribute.cs: Convert this file to Unix mode - like the original
9405         version in mcs is.
9406
9407 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9408
9409        Fix bug #58688 (MCS does not report error when the same attribute
9410        is assigned twice)
9411
9412        * attribute.cs (Attribute.Emit): Distinction between null and default.
9413
9414 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9415
9416        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9417        of a top-level attribute without an attribute target.
9418        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9419        Make non-static.
9420        (Attribute.Conditional_GetConditionName), 
9421        (Attribute.Obsolete_GetObsoleteMessage): Update.
9422        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9423        part of ScanForIndexerName.
9424        (Attribute.CanIgnoreInvalidAttribute): New function.
9425        (Attribute.ScanForIndexerName): Move to ...
9426        (Attributes.ScanForIndexerName): ... here.
9427        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9428        (Attributes.Search): New internal variant that can choose not to
9429        complain if types aren't resolved.  The original signature now
9430        complains.
9431        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9432        complaints suppressed.
9433        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9434        only if it not useful.
9435        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9436        top-level for attributes that are shared between the assembly
9437        and a top-level class.
9438        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9439        * class.cs: Update to reflect changes.
9440        (DefineIndexers): Fuse loops.
9441        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9442        a couple more variants of attribute names.
9443
9444 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9445
9446         Fix bug #52585 (Implemented explicit attribute declaration)
9447
9448         * attribute.cs:
9449         (Attributable.ValidAttributeTargets): New abstract method. It gets
9450         list of valid attribute targets for explicit target declaration.
9451         (Attribute.Target): It holds target itself.
9452         (AttributeSection): Removed.
9453         (Attribute.CheckTargets): New method. It checks whether attribute
9454         target is valid for the current element.
9455
9456         * class.cs:
9457         (EventProperty): New class. For events that are declared like
9458         property (with add and remove accessors).
9459         (EventField): New class. For events that are declared like field.
9460         class.cs
9461
9462         * cs-parser.jay: Implemented explicit attribute target declaration.
9463
9464         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9465         Override ValidAttributeTargets.
9466
9467         * parameter.cs:
9468         (ReturnParameter): Class for applying custom attributes on 
9469         the return type.
9470         (ParameterAtribute): New class. Class for applying custom
9471         attributes on the parameter type.
9472
9473 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9474
9475         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9476         definitions. 
9477
9478         (Method): Allow UNSAFE here.
9479
9480         * modifiers.cs: Support unsafe reporting.
9481
9482 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9483
9484         * decl.cs: Fix bug #58478.
9485
9486 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9487
9488         * statement.cs: When checking for unreachable code on an EmptyStatement,
9489         set the location. Fixes bug #58488.
9490
9491 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9492
9493         * driver.cs: Add -pkg handling.
9494
9495         From Gonzalo: UseShelLExecute=false
9496
9497 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9498
9499         * attribute.cs:
9500         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9501         for attribute.
9502         (Attribute.IsClsCompliaceRequired): Moved to base for better
9503         accesibility.
9504         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9505         when attribute is AttributeUsageAttribute.
9506         (Attribute.GetValidTargets): Simplified.
9507         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9508         attribute for this type.
9509         (Attribute.ApplyAttributes): Method renamed to Emit and make
9510         non-static.
9511         (GlobalAttributeSection): New class for special handling of global
9512         attributes (assembly, module).
9513         (AttributeSection.Emit): New method.
9514
9515         * class.cs: Implemented Attributable abstract methods.
9516         (MethodCore.LabelParameters): Moved to Parameter class.
9517         (Accessor): Is back simple class.
9518         (PropertyMethod): Implemented Attributable abstract class.
9519         (DelegateMethod): Implemented Attributable abstract class.
9520         (Event): New constructor for disctintion between normal Event
9521         and Event with accessors.
9522
9523         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9524
9525         * codegen.cs, const.cs, decl.cs, delegate.cs:
9526         (CommonAssemblyModulClass): Implemented Attributable abstract class
9527         and simplified.
9528
9529         * enum.cs: Implement IAttributeSupport interface.
9530         (EnumMember): New class for emum members. Implemented Attributable
9531         abstract class
9532
9533         * parameter.cs:
9534         (ParameterBase): Is abstract.
9535         (ReturnParameter): New class for easier [return:] attribute handling.
9536
9537         * typemanager.cs: Removed builder_to_attr.
9538
9539 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9540
9541         Fix bug #57151.
9542         * attribute.cs (Attribute.GetPositionalValue): New function.
9543         * class.cs (TypeContainer.VerifyMembers): New function.
9544         (TypeContainer.Emit): Use it.
9545         (ClassOrStruct): New base class for Class and Struct.
9546         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9547         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9548         class.
9549         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9550         then each non-static field should have a FieldOffset attribute.
9551         Otherwise, none of the fields should have a FieldOffset attribute.
9552         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9553         and FieldOffset attributes.
9554         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9555         (TypeManager.field_offset_attribute_type): New core types.
9556         (TypeManager.InitCoreTypes): Initialize them.
9557
9558 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9559
9560         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9561         Return correct type.
9562         From bug #58270.
9563
9564 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9567         be implicitly converted to ulong.
9568         
9569         * expression.cs: The logic for allowing operator &, | and ^ worked
9570         was wrong, it worked before because we did not report an error in
9571         an else branch.  Fixes 57895.
9572
9573         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9574         allow volatile fields to be reference types.
9575
9576 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * driver.cs: Add support for /debug-
9579
9580 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9581
9582         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9583         Add a 'complain' parameter to silence errors.
9584         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9585         silently overlooked type-resolutions.
9586         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9587         to reflect changes.
9588         (Attributes.Search): New function.
9589         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9590         (Attributes.GetAttributeFullName): Remove hack.
9591         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9592         Update to reflect changes.
9593         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9594         Use Attributes.Search instead of nested loops.
9595
9596 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9597
9598         * decl.cs:
9599         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9600         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9601         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9602
9603         * report.cs: (Report.Warning): Renamed to Warning_T because of
9604         parameter collision.
9605
9606 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9607
9608         * expression.cs (MemberAccess.ResolveMemberAccess):
9609         Exit with non-zero status after Report.Error.
9610         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9611         Likewise.
9612         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9613
9614 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9615
9616         * support.cs: Don't hang when the file is empty.
9617
9618 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9619
9620         * support.cs: In SeekableStreamReader, compute the preamble size of the
9621           underlying stream. Position changes should take into account that initial
9622           count of bytes.
9623
9624 2004-05-03  Todd Berman  <tberman@sevenl.net>
9625
9626         * driver.cs: remove unused GetSysVersion function.
9627
9628 2004-05-03  Todd Berman  <tberman@sevenl.net>
9629
9630         * driver.cs: Remove the hack from saturday, as well as the hack
9631         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9632         link_paths to get that bit proper.
9633
9634 2004-05-01  Todd Berman  <tberman@sevenl.net>
9635
9636         * driver.cs: Try a LoadFrom before a Load, this checks the current
9637         path. This is currently a bug in mono that is be fixed, however, this
9638         provides a workaround for now. This will be removed when the bug
9639         is fixed.
9640
9641 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9642
9643         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9644         incomplete key pairs (#57941).
9645
9646 2004-05-01  Todd Berman  <tberman@sevenl.net>
9647
9648         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9649         from the GAC
9650
9651 2004-04-30  Jackson Harper  <jackson@ximian.com>
9652
9653         * codegen.cs: Open keys readonly.
9654         
9655 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9656
9657         * typemanager.cs: don't report cyclic struct layout when a struct
9658         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9659         which has 2 Pango.Rectangle fields.
9660
9661 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9662
9663         * expression.cs: Handle IntPtr comparisons with IL code
9664         rather than a method call.
9665
9666 2004-04-29  Martin Baulig  <martin@ximian.com>
9667
9668         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9669         the list of PropertyInfo's in class hierarchy and find the
9670         accessor.  Fixes #56013.
9671
9672 2004-04-29  Martin Baulig  <martin@ximian.com>
9673
9674         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9675
9676 2004-04-29  Martin Baulig  <martin@ximian.com>
9677
9678         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9679
9680         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9681
9682 2004-04-29  Martin Baulig  <martin@ximian.com>
9683
9684         * class.cs (ConstructorInitializer.Resolve): Check whether the
9685         parent .ctor is accessible.  Fixes #52146.
9686
9687 2004-04-29  Martin Baulig  <martin@ximian.com>
9688
9689         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9690
9691         * statement.cs (Using.EmitLocalVariableDecls): Use
9692         TypeManager.idisposable_type, not typeof (IDisposable).
9693         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9694
9695 2004-04-29  Martin Baulig  <martin@ximian.com>
9696
9697         * class.cs (Event.Define): Don't emit the field and don't set
9698         RTSpecialName and SpecialName for events on interfaces.  Fixes
9699         #57703. 
9700
9701 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9702
9703         Refactor Attribute.ApplyAttributes.
9704         * attribute.cs (Attributable): New base class for objects that can
9705         have Attributes applied on them.
9706         (Attribute): Make AttributeUsage fields public.
9707         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9708         (Attribute.IsInternalCall): New property.
9709         (Attribute.UsageAttr): Convert to a public read-only property.
9710         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9711         (Attribute.ResolveType, Attribute.Resolve)
9712         (Attribute.ScanForIndexerName): Update to reflect changes.
9713         (Attribute.CheckAttributeTarget): Re-format.
9714         (Attribute.ApplyAttributes): Refactor, to various
9715         Attributable.ApplyAttributeBuilder methods.
9716         * decl.cs (MemberCore): Make Attributable.
9717         * class.cs (Accessor): Make Attributable.
9718         (MethodData.ApplyAttributes): Use proper attribute types, not
9719         attribute names.
9720         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9721         (TypeContainer.ApplyAttributeBuilder)
9722         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9723         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9724         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9725         (Operator.ApplyAttributeBuilder): New factored-out methods.
9726         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9727         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9728         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9729         * parameter.cs (ParameterBase): New Attributable base class
9730         that can also represent Return types.
9731         (Parameter): Update to the changes.
9732
9733 2004-04-29  Jackson Harper  <jackson@ximian.com>
9734
9735         * driver.cs: Prefer the corlib system version when looking for
9736         assemblies in the GAC. This is still a hack, but its a better hack
9737         now.
9738         
9739 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9740
9741         * decl.cs, enum.cs: Improved error 3005 reporting.
9742   
9743         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9744         (related_symbols): New private member for list of symbols
9745         related to reported error/warning.
9746         
9747         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9748
9749 2004-04-29  Martin Baulig  <martin@ximian.com>
9750
9751         * ecore.cs (Expression.Constantify): If we're an enum and
9752         TypeManager.TypeToCoreType() doesn't give us another type, use
9753         t.UnderlyingSystemType.  Fixes #56178.  
9754
9755 2004-04-29  Martin Baulig  <martin@ximian.com>
9756
9757         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9758         interfaces and for each interface, only add members directly
9759         declared in that interface.  Fixes #53255.
9760
9761 2004-04-28  Martin Baulig  <martin@ximian.com>
9762
9763         * expression.cs (ConditionalLogicalOperator): Use a temporary
9764         variable for `left' to avoid that we evaluate it more than once;
9765         bug #52588.
9766
9767 2004-04-28  Martin Baulig  <martin@ximian.com>
9768
9769         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9770         `void[]' (CS1547).
9771
9772 2004-04-28  Martin Baulig  <martin@ximian.com>
9773
9774         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9775         void (CS1547).
9776
9777         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9778         whether the type is not void (CS1547).
9779
9780 2004-04-28  Martin Baulig  <martin@ximian.com>
9781
9782         * expression.cs (Unary.DoResolveLValue): Override this and report
9783         CS0131 for anything but Operator.Indirection.
9784
9785 2004-04-28  Martin Baulig  <martin@ximian.com>
9786
9787         Committing a patch from Ben Maurer; see bug #50820.
9788
9789         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9790         check for classes.
9791
9792         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9793         classes.        
9794
9795 2004-04-28  Martin Baulig  <martin@ximian.com>
9796
9797         Committing a patch from Ben Maurer; see bug #50820.
9798
9799         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9800         check for classes.
9801
9802         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9803         classes.        
9804
9805 2004-04-28  Martin Baulig  <martin@ximian.com>
9806
9807         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9808         (Block.AddLabel): Call DoLookupLabel() to only search in the
9809         current block.
9810
9811 2004-04-28  Martin Baulig  <martin@ximian.com>
9812
9813         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9814         comparing StringConstants and NullLiterals in Equality and Inequality.
9815
9816 2004-04-28  Jackson Harper  <jackson@ximian.com>
9817
9818         * driver.cs: Attempt to load referenced assemblies from the
9819         GAC. This is the quick and dirty version of this method that
9820         doesnt take into account versions and just takes the first
9821         canidate found. Will be good enough for now as we will not have more
9822         then one version installed into the GAC until I update this method.
9823
9824 2004-04-28  Martin Baulig  <martin@ximian.com>
9825
9826         * typemanager.cs (TypeManager.CheckStructCycles): New public
9827         static method to check for cycles in the struct layout.
9828
9829         * rootcontext.cs (RootContext.PopulateTypes): Call
9830         TypeManager.CheckStructCycles() for each TypeContainer.
9831         [Note: We only need to visit each type once.]
9832
9833 2004-04-28  Martin Baulig  <martin@ximian.com>
9834
9835         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9836
9837         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9838         success and added `out object value'.  Use a `bool resolved' field
9839         to check whether we've already been called rather than
9840         `ConstantValue != null' since this breaks for NullLiterals.
9841
9842 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9843
9844         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9845         setting of this flag, since the 'set' method may be non-public.
9846
9847 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9848
9849         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9850         check on current_vector.Block.
9851
9852 2004-04-27  Martin Baulig  <martin@ximian.com>
9853
9854         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9855         a field initializer.  Fixes #56459.
9856
9857 2004-04-27  Martin Baulig  <martin@ximian.com>
9858
9859         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9860         we're not attempting to use an indexer.  Fixes #52154.
9861
9862 2004-04-27  Martin Baulig  <martin@ximian.com>
9863
9864         * statement.cs (Return): Don't create a return label if we don't
9865         need it; reverts my change from January 20th.  Thanks to Ben
9866         Maurer for this.
9867
9868 2004-04-27  Martin Baulig  <martin@ximian.com>
9869
9870         According to the spec, `goto' can only leave a nested scope, but
9871         never enter it.
9872
9873         * statement.cs (Block.LookupLabel): Only lookup in the current
9874         block, don't recurse into parent or child blocks.
9875         (Block.AddLabel): Check in parent and child blocks, report
9876         CS0140/CS0158 if we find a duplicate.
9877         (Block): Removed this indexer for label lookups.
9878         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9879         this already does the error reporting for us.
9880
9881         * flowanalysis.cs
9882         (FlowBranching.UsageVector.Block): New public variable; may be null.
9883         (FlowBranching.CreateSibling): Added `Block' argument.
9884         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9885         label for the target of a `goto' and check whether we're not
9886         leaving a `finally'.
9887
9888 2004-04-27  Martin Baulig  <martin@ximian.com>
9889
9890         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9891         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9892         just for returns).
9893
9894 2004-04-27  Martin Baulig  <martin@ximian.com>
9895
9896         * statement.cs (Block.AddLabel): Also check for implicit blocks
9897         and added a CS0158 check.
9898
9899 2004-04-27  Martin Baulig  <martin@ximian.com>
9900
9901         * flowanalysis.cs (FlowBranchingLoop): New class.
9902         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9903         UsageVector's instead of an ArrayList.
9904         (FlowBranching.Label): Likewise.
9905         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9906         (FlowBranching.AddBreakVector): New method.
9907
9908 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9909
9910         * attribute.cs: Small regression fix: only convert the type if we
9911         the type is different, fixes System.Drawing build.
9912
9913 2004-04-27  Martin Baulig  <martin@ximian.com>
9914
9915         * attribute.cs (Attribute.Resolve): If we have a constant value
9916         for a named field or property, implicity convert it to the correct
9917         type.
9918
9919 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9920
9921         * statement.cs (Block.Block): Implicit blocks share
9922         'child_variable_names' fields with parent blocks.
9923         (Block.AddChildVariableNames): Remove.
9924         (Block.AddVariable): Mark variable as "used by a child block" in
9925         every surrounding block.
9926         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9927         been used in a child block, complain about violation of "Invariant
9928         meaning in blocks" rule.
9929         * cs-parser.jay (declare_local_variables): Don't use
9930         AddChildVariableNames.
9931         (foreach_statement): Don't create an implicit block: 'foreach'
9932         introduces a scope.
9933
9934 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9935
9936         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9937         converting from 0L to ulong.  Fixes 57522.
9938
9939 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9940
9941         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9942         derived class hides via 'new' keyword field from base class (test-242.cs).
9943         TODO: Handle this in the more general way.
9944         
9945         * class.cs (CheckBase): Ditto.
9946
9947 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9948
9949         * decl.cs (caching_flags): New member for storing cached values
9950         as bit flags.
9951         (MemberCore.Flags): New enum where bit flags for caching_flags
9952         are defined.
9953         (MemberCore.cls_compliance): Moved to caching_flags.
9954         (DeclSpace.Created): Moved to caching_flags.
9955
9956         * class.cs: Use caching_flags instead of DeclSpace.Created
9957         
9958 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9959
9960         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9961         if we are only a derived class, not a nested class.
9962
9963         * typemanager.cs: Same as above, but do this at the MemberLookup
9964         level (used by field and methods, properties are handled in
9965         PropertyExpr).   Allow for the qualified access if we are a nested
9966         method. 
9967
9968 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9969
9970         * class.cs: Refactoring.
9971         (IMethodData): New inteface; Holds links to parent members
9972         to avoid member duplication (reduced memory allocation).
9973         (Method): Implemented IMethodData interface.
9974         (PropertyBase): New inner classes for get/set methods.
9975         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9976         (Event): New inner classes for add/remove methods.
9977         (Event.DelegateMethod): Implemented IMethodData interface.
9978
9979         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9980         EmitContext (related to class.cs refactoring).
9981
9982 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9983
9984         * delegate.cs (Delegate.VerifyApplicability): If the number of
9985         arguments are the same as the number of parameters, first try to
9986         verify applicability ignoring  any 'params' modifier on the last
9987         parameter.
9988         Fixes #56442.
9989
9990 2004-04-08  Martin Baulig  <martin@ximian.com>
9991
9992         Merged latest changes into gmcs.  Please keep this comment in
9993         here, it makes it easier for me to see what changed in MCS since
9994         the last time I merged.
9995
9996 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9997
9998         * class.cs (TypeContainer.AddIndexer): Use
9999         'ExplicitInterfaceName' to determine if interface name was
10000         explicitly specified.  'InterfaceType' is not initialized at this time.
10001         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10002         Indexers array is already in the required order.  Initialize
10003         'IndexerName' only if there are normal indexers.
10004         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10005         (TypeContainer.Emit): Emit DefaultMember attribute only if
10006         IndexerName is initialized.
10007         Fixes #56300.
10008
10009 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10010
10011         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10012         Fixes #57007
10013
10014 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10015
10016         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10017         attributes.
10018         Fix for #56456.
10019
10020         * attribute.cs (Attribute.Resolve): Check for duplicate named
10021         attributes.
10022         Fix for #56463.
10023
10024 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10025
10026         * iterators.cs (MarkYield): track whether we are in an exception,
10027         and generate code accordingly.  Use a temporary value to store the
10028         result for our state.
10029
10030         I had ignored a bit the interaction of try/catch with iterators
10031         since their behavior was not entirely obvious, but now it is
10032         possible to verify that our behavior is the same as MS .NET 2.0
10033
10034         Fixes 54814
10035
10036 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10037
10038         * iterators.cs: Avoid creating temporaries if there is no work to
10039         do. 
10040
10041         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10042         Enumerations, use TypeManager.EnumToUnderlying and call
10043         recursively. 
10044
10045         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10046         bug #57013
10047
10048         (This.Emit): Use EmitContext.EmitThis to emit our
10049         instance variable.
10050
10051         (This.EmitAssign): Ditto.
10052
10053         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10054         codepaths, we will move all the functionality into
10055         Mono.CSharp.This 
10056
10057         (FieldExpr.EmitAssign): Ditto.
10058
10059         This fixes several hidden bugs that I uncovered while doing a code
10060         review of this today.
10061
10062         * codegen.cs (EmitThis): reworked so the semantics are more clear
10063         and also support value types "this" instances.
10064
10065         * iterators.cs: Changed so that for iterators in value types, we
10066         do not pass the value type as a parameter.  
10067
10068         Initialization of the enumerator helpers is now done in the caller
10069         instead of passing the parameters to the constructors and having
10070         the constructor set the fields.
10071
10072         The fields have now `assembly' visibility instead of private.
10073
10074 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10075
10076         * expression.cs (Argument.Resolve): Check if fields passed as ref
10077         or out are contained in a MarshalByRefObject.
10078
10079         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10080         another compiler type.
10081
10082 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10083
10084         * class.cs (Indexer.Define): use the new name checking method.
10085         Also, return false on an error.
10086         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10087         (is_identifier_[start/part]_character): make static.
10088
10089 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10090
10091         * expression.cs (Binary.ResolveOperator): Do no append strings
10092         twice: since we can be invoked more than once (array evaluation)
10093         on the same concatenation, take care of this here.  Based on a fix
10094         from Ben (bug #56454)
10095
10096 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10097
10098         * codegen.cs: Fix another case where CS1548 must be reported (when 
10099         delay-sign isn't specified and no private is available #56564). Fix
10100         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10101         error when MCS is used on the MS runtime and we need to delay-sign 
10102         (which seems unsupported by AssemblyBuilder - see #56621).
10103
10104 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10105
10106         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10107         (TypeManager.ComputeNamespaces): Faster implementation for
10108         Microsoft runtime.
10109
10110         * compiler.csproj: Updated AssemblyName to mcs.
10111
10112 2004-05-11  Jackson Harper  <jackson@ximian.com>
10113
10114         * Makefile: Preserve MONO_PATH
10115         
10116 2004-05-11  Jackson Harper  <jackson@ximian.com>
10117
10118         * Makefile: Use mono and mcs to build gmcs
10119         
10120 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10121
10122         * codegen.cs: Add patch from Robert Shade
10123         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10124         sync with mcs.
10125
10126 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10127
10128         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10129         incomplete key pairs (#57941).
10130
10131 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10132
10133         * codegen.cs: Fix another case where CS1548 must be reported (when 
10134         delay-sign isn't specified and no private is available #56564). Fix
10135         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10136         error when MCS is used on the MS runtime and we need to delay-sign 
10137         (which seems unsupported by AssemblyBuilder - see #56621).
10138
10139 2004-04-29  Jackson Harper  <jackson@ximian.com>
10140
10141         * Makefile: Set MONO_PATH to use the bootstrap corlib
10142         * driver.cs: Check the GAC for referenced assemblies.
10143                 
10144 2004-04-29  Martin Baulig  <martin@ximian.com>
10145
10146         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10147
10148 2004-04-07  Martin Baulig  <martin@ximian.com>
10149
10150         * expression.cs (Binary.ResolveOperator): Added special case for
10151         Equality/Inequality between a type parameter and a null literal.
10152
10153 2004-04-07  Martin Baulig  <martin@ximian.com>
10154
10155         * convert.cs: Check null literal -> type parameter conversions.
10156
10157 2004-04-07  Martin Baulig  <martin@ximian.com>
10158
10159         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10160         `class' and `struct' constraints.
10161
10162 2004-04-07  Martin Baulig  <martin@ximian.com>
10163
10164         * generic.cs (SpecialConstraint): New public enum.
10165         (Constraints.Resolve): Added support for the `class' and `struct'
10166         constraints.
10167
10168         * cs-parser.jay (type_parameter_constraint): Added support for the
10169         `class' and `struct' constraints.
10170
10171 2004-04-07  Martin Baulig  <martin@ximian.com>
10172
10173         * support.cs (GenericConstraints): Replaced `Types' by
10174         `ClassConstraint' and `InterfaceConstraints'; added
10175         `HasClassConstraint'.   
10176
10177 2004-04-07  Martin Baulig  <martin@ximian.com>
10178
10179         * generic.cs
10180         (Constraints.InterfaceConstraints): New public property.
10181         (Constraints.Types): Make this property public
10182         (TypeParameter): Implement IMemberContainer.
10183         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10184         instead of a TypeBuilder/MethodBuilder; pass the interface
10185         constraints to TypeManager.AddTypeParameter().
10186         (TypeParameter.DefineType): Just take an EmitContext and no
10187         TypeBuilder/MethodBuilder.  Use the new public API.
10188
10189         * typemanager.cs (TypeManager.AddTypeParameter): Added
10190         `TypeExpr[]' argument; add the interfaces to the
10191         `builder_to_ifaces' hash.
10192         (TypeManager.LookupMemberContainer): For
10193         GenericTypeParameterBuilders, get the TypeParameter from the
10194         `builder_to_type_param'.
10195         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10196         the TypeParameter and call FindMembers on it.
10197
10198 2004-04-07  Martin Baulig  <martin@ximian.com>
10199
10200         * class.cs
10201         (MethodCore.GenericMethod): Moved this field here from Method.
10202         (MethodCore.IsDuplicateImplementation): Take the number of type
10203         parameters into account if we're a generic method.
10204
10205         * expression.cs (Invocation.InferTypeArguments): Don't return true
10206         if `arguments' is null; we still need to check whether we actually
10207         don't need to infer anything in this case.
10208         (MemberAccess): Merged the functionality from GenericMemberAccess
10209         into this class.
10210
10211         * generic.cs (GenericMemberAccess): Removed.
10212
10213 2004-04-05  Martin Baulig  <martin@ximian.com>
10214
10215         * decl.cs (MemberCore): For generic classes, interfaces and
10216         structs, `Name' now includes the number of type parameters
10217         ("Stack!1.Node!1").
10218         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10219         encode the number of type arguments in the type name.
10220
10221         * expression.cs (Expression.MemberLookup): Removed the
10222         `num_type_args' argument; we now encode the number of type
10223         arguments in the type name.
10224
10225         * ecore.cs (SimpleName): Encode the number of type arguments in
10226         the type name itself.
10227
10228         * generic.cs (ConstructedType): Likewise.
10229
10230         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10231         `MemberName'; we now include the number of type parameters in the
10232         type name.
10233
10234         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10235         (TypeManager.MemberLookup): Removed the
10236         `num_type_args' argument; we now encode the number of type
10237         arguments in the type name.     
10238
10239 2004-04-03  Martin Baulig  <martin@ximian.com>
10240
10241         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10242         (MemberCore.MemberName): Moved here from MemberBase.
10243         (DeclSpace.SetParameterInfo): Just take the constraints as an
10244         ArrayList; we already have the type parameters in our
10245         `MemberName'; also do the CS0080 reporting here.
10246
10247         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10248         `IDENTIFIER opt_type_parameter_list'; when constructing our
10249         `MemberName', it'll already include our type parameters.
10250         (class_declaration, interface_declaration): Likewise.
10251         (delegate_declaration): Likewise.
10252         (MakeName): Take a MemberName and return a MemberName.
10253         The following two changes are required to avoid shift/reduce conflicts:
10254         (member_name): Don't include a TypeName anymore; ie. this is now
10255         just 'IDENTIFIER opt_type_parameter_list'.
10256         (property_declaration, event_declaration): Use a
10257         `namespace_or_type_name' instead of a `member_name'.            
10258
10259 2004-04-03  Martin Baulig  <martin@ximian.com>
10260
10261         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10262         `MemberName' class.
10263         (TypeName): Formerly known as MemberName.
10264
10265         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10266         instead of a `MemberName'.
10267
10268         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10269         (member_name): New rule; create a MemberName.
10270
10271 2004-04-02  Martin Baulig  <martin@ximian.com>
10272
10273         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10274         (CS0305 and CS0308).
10275
10276 2004-04-02  Martin Baulig  <martin@ximian.com>
10277
10278         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10279         support for nested types.
10280
10281 2004-04-02  Martin Baulig  <martin@ximian.com>
10282
10283         * ecore.cs (IAlias): New public interface.
10284         (TypeExpr, TypeExpression): Implement IAlias.
10285         (TypeAliasExpression): New public class.
10286
10287         * namespace.cs (Namespace): Implement IAlias.
10288         (Namespace.Lookup): Return an IAlias instead on an object.
10289         (Namespace.DefineName): Take an IAlias instead of an object.
10290         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10291         an object.
10292         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10293         Expression.
10294         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10295         object.
10296         (NamespaceEntry.Lookup): Likewise.
10297
10298         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10299         instead of a Type.      
10300
10301         * decl.cs (DeclSpace): Implement IAlias.
10302         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10303
10304         * generic.cs (ConstructedType): Improved error checking.
10305
10306 2004-04-02  Martin Baulig  <martin@ximian.com>
10307
10308         * convert.cs: Added type parameter conversions.
10309
10310         * ecore.cs
10311         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10312         (ClassCast.Emit): If the source type is a type parameter, box it.
10313         If the target type is a type parameter, emit an `unbox.any'
10314         instead of a `classcast'.1      
10315
10316 2004-04-01  Martin Baulig  <martin@ximian.com>
10317
10318         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10319
10320 2004-04-01  Martin Baulig  <martin@ximian.com>
10321
10322         * generic.cs (ConstructedType.CheckConstraints): Use
10323         Convert.ImplicitStandardConversionExists(); user-defined implicit
10324         conversions are not allowed according to the spec.
10325
10326 2004-03-30  Martin Baulig  <martin@ximian.com>
10327
10328         * expression.cs (New): Added support for type parameters.
10329
10330         * typemanager.cs
10331         (TypeManager.activator_type): New public static field.
10332         (TypeManager.activator_create_instance): Likewise.
10333
10334 2004-03-30  Martin Baulig  <martin@ximian.com>
10335
10336         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10337         public method.
10338
10339 2004-03-30  Martin Baulig  <martin@ximian.com>
10340
10341         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10342         the spec here: the argument type must be convertible to the
10343         constraints.
10344
10345 2004-03-30  Martin Baulig  <martin@ximian.com>
10346
10347         * generic.cs
10348         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10349         TypeManager.AddTypeParameter().
10350         (ConstructedType.CheckConstraints): Re-enable this and actually
10351         check whether we have a constructor constraint.
10352
10353         * typemanager.cs
10354         (TypeManager.builder_to_type_param): New static field.
10355         (TypeManager.AddTypeParameter): New static method.
10356         (TypeManager.LookupTypeParameter): New public method.
10357
10358 2004-03-30  Martin Baulig  <martin@ximian.com>
10359
10360         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10361         the new API to actually define the constructor constraint.
10362
10363         * typemanager.cs
10364         (TypeManager.new_constraint_attr_type): New static field.
10365         (TypeManager.InitCoreTypes): Initialize it.
10366
10367 2004-03-30  Martin Baulig  <martin@ximian.com>
10368
10369         * generic.cs (Constraints): Completed error checking, use correct
10370         error numbers.
10371
10372 2004-03-29  Martin Baulig  <martin@ximian.com>
10373
10374         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10375
10376         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10377         public version which takes a `ParameterData pd' instead of an
10378         `ArrayList args'.
10379
10380 2004-03-29  Martin Baulig  <martin@ximian.com>
10381
10382         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10383         not a MethodInfo.       
10384
10385 2004-03-29  Martin Baulig  <martin@ximian.com>
10386
10387         * expression.cs (Argument.ResolveMethodGroup): If we're a
10388         ConstructedType, call GetMemberAccess() on it.  
10389
10390 2004-03-29  Martin Baulig  <martin@ximian.com>
10391
10392         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10393         (MethodCore.CheckGenericOverride): When overriding a generic
10394         method, check whether the constraints match.
10395
10396         * support.cs (GenericConstraints): New public interface.
10397         (ParameterData.GenericConstraints): New public method.
10398
10399         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10400         method parameter and compute our constraints if appropriate.
10401         (Parameter.GenericConstraints): New public property.
10402
10403         * generic.cs (Constraints): Implement GenericConstraints.
10404
10405 2004-03-29  Martin Baulig  <martin@ximian.com>
10406
10407         * decl.cs (MemberCache.FindMemberToOverride): Use
10408         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10409
10410 2004-03-29  Martin Baulig  <martin@ximian.com>
10411
10412         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10413
10414 2004-03-29  Martin Baulig  <martin@ximian.com>
10415
10416         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10417         not allowed on non-generic declarations").
10418
10419 2004-03-29  Martin Baulig  <martin@ximian.com>
10420
10421         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10422         public version of this method.
10423
10424         * class.cs (MethodCore.IsDuplicateImplementation): Use
10425         Invocation.InferTypeArguments() to check this.
10426
10427 2004-03-29  Martin Baulig  <martin@ximian.com>
10428
10429         * convert.cs: Use TypeManager.IsDelegateType() instead of
10430         comparing types correctly.
10431
10432 2004-03-29  Martin Baulig  <martin@ximian.com>
10433
10434         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10435         types directly to make it work for generic instances.
10436
10437         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10438
10439 2004-03-29  Martin Baulig  <martin@ximian.com>
10440
10441         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10442         support for arrays.     
10443
10444 2004-03-24  Martin Baulig  <martin@ximian.com>
10445
10446         * decl.cs (DeclSpace.FindType): Also use
10447         TypeManager.CheckGeneric() for types from the using clauses.
10448
10449 2004-03-23  Martin Baulig  <martin@ximian.com>
10450
10451         * expression.cs (Invocation.OverloadResolve): Added `bool
10452         may_fail' argument and use it instead of the Location.IsNull() hack.
10453
10454 2004-03-23  Martin Baulig  <martin@ximian.com>
10455
10456         * expression.cs (Invocation.InferType): Use correct type inference
10457         rules here.     
10458
10459 2004-03-23  Martin Baulig  <martin@ximian.com>
10460
10461         * ecore.cs (MethodGroupExpr.Name): Use
10462         TypeManager.CSharpSignature() instead of just the name.
10463
10464         * expression.cs (Invocation.OverloadResolve): Provide better error
10465         reporting.
10466         (Invocation.DoResolve): OverloadResolve() never returns null
10467         without reporting an error, so removed the error -6 reporting here.
10468
10469 2004-03-23  Martin Baulig  <martin@ximian.com>
10470
10471         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10472         generic methods.
10473
10474         * cs-parser.jay (delegate_declaration): Support generic delegates.
10475
10476         * delegate.cs: Support generic delegates.
10477
10478 2004-03-22  Martin Baulig  <martin@ximian.com>
10479
10480         * expression.cs (Invocation.InferParamsTypeArguments): New static
10481         method; does type inference for params arguments.
10482
10483 2004-03-21  Martin Baulig  <martin@ximian.com>
10484
10485         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10486         method; checks whether a method is a generic method.    
10487
10488         * expression.cs (Invocation.InferTypeArguments): New static method;
10489         infer type arguments for generic method invocation.
10490
10491         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10492         property; we set this to true if we're resolving a generic method
10493         invocation and the user specified type arguments, ie. we're not
10494         doing type inference.
10495
10496 2004-03-20  Martin Baulig  <martin@ximian.com>
10497
10498         * class.cs (MethodData.DeclaringType): New public property.
10499         (MethodData.Define): Set DeclaringType here.
10500         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10501         instead of OperatorMethodBuilder.DeclaringType.
10502
10503 2004-03-20  Martin Baulig  <martin@ximian.com>
10504
10505         * cs-tokenizer.cs (xtoken): Return a special
10506         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10507
10508         * cs-parser.jay (default_value_expression): Switch to the new
10509         syntax (14.5.13).
10510
10511 2004-03-19  Martin Baulig  <martin@ximian.com>
10512
10513         * decl.cs (MemberName): New class.  We use this to "construct"
10514         namespace_or_type_name's.
10515
10516         * generics.cs (TypeArguments.GetDeclarations): New public method;
10517         returns the type arguments as a string[] and reports a CS0081 if
10518         one of them is not an identifier.
10519
10520         * class.cs (MemberBase): The .ctor now takes the name as a
10521         MemberName instead of a string.
10522         (MemberBase.ExplicitInterfaceName): Changed type from string to
10523         Expression.
10524         (MemberBase.DoDefine): If we're an explicit implementation, the
10525         InterfaceType may be a generic instance.
10526
10527         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10528         (namespace_name): Call MemberName.GetName () to transform the
10529         MemberName into a string and ensure we don't have any type
10530         arguments.
10531         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10532         MemberName into an expression.
10533         (method_header): Use namespace_or_type_name instead of member_name.     
10534
10535 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10536
10537         * rootcontext.cs: Add new types to the boot resolution.
10538
10539         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10540         MulticastDelegate is not allowed.
10541
10542         * typemanager.cs: Add new types to lookup: System.TypedReference
10543         and ArgIterator.
10544
10545         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10546         check for TypedReference or ArgIterator, they are not allowed. 
10547
10548         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10549         makes us properly catch 1510 in some conditions (see bug 56016 for
10550         details). 
10551
10552 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10553
10554         * CryptoConvert.cs: update from corlib version
10555         with endian fixes.
10556
10557 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10558
10559         * class.cs (Indexer.Define): Check indexername declaration
10560
10561 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10562
10563         * attribute.cs (IsClsCompliant): Fixed problem with handling
10564         all three states (compliant, not-compliant, undetected).
10565
10566 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10567
10568         * attribute.cs (Attribute): Location is now public.
10569         (Resolve): Store resolved arguments (pos_values) in attribute class.
10570         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10571         (GetClsCompliantAttributeValue): New method that gets
10572         CLSCompliantAttribute value.
10573         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10574         if exists else null.
10575         (AttributeTester): New class for CLS-Compliant verification routines.
10576
10577         * class.cs (Emit): Add CLS-Compliant verification.
10578         (Method.GetSignatureForError): Implemented.
10579         (Constructor.GetSignatureForError): Implemented
10580         (Constructor.HasCompliantArgs): Returns if constructor has
10581         CLS-Compliant arguments.
10582         (Constructor.Emit): Override.
10583         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10584         is needed to test only parameters.
10585         (FieldBase.GetSignatureForError): Implemented.
10586         (TypeContainer): New member for storing base interfaces.
10587         (TypeContainer.FindMembers): Search in base interfaces too.
10588
10589         * codegen.cs (GetClsComplianceAttribute): New method that gets
10590         assembly or module CLSCompliantAttribute value.
10591         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10592         for assembly.
10593         (ModuleClass.Emit): Add error 3012 test.
10594
10595         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10596
10597         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10598         state for all decl types.
10599         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10600         if CLS-Compliant tests are required.
10601         (IsClsCompliaceRequired): New method. Analyze whether code
10602         must be CLS-Compliant.
10603         (IsExposedFromAssembly): New method. Returns true when MemberCore
10604         is exposed from assembly.
10605         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10606         value or gets cached value.
10607         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10608         is explicitly marked with CLSCompliantAttribute.
10609         (IsIdentifierClsCompliant): New abstract method. This method is
10610         used to testing error 3005.
10611         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10612         for identifier and parameters CLS-Compliant testing.
10613         (VerifyClsCompliance): New method. The main virtual method for
10614         CLS-Compliant verifications.
10615         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10616         null. I don't know why is null (too many public members !).
10617         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10618         and get value of first CLSCompliantAttribute that found.
10619
10620         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10621         (VerifyClsCompliance): Override and add extra tests.
10622
10623         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10624         clscheck- disable CLS-Compliant verification event if assembly is has
10625         CLSCompliantAttribute(true).
10626
10627         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10628         ApllyAttribute is now called in emit section as in the other cases.
10629         Possible future Emit integration.
10630         (IsIdentifierClsCompliant): New override.
10631         (VerifyClsCompliance): New override.
10632         (GetEnumeratorName): Returns full enum name.
10633
10634         * parameter.cs (GetSignatureForError): Implemented.
10635
10636         * report.cs (WarningData): New struct for Warning message information.
10637         (LocationOfPreviousError): New method.
10638         (Warning): New method. Reports warning based on the warning table.
10639         (Error_T): New method. Reports error based on the error table.
10640
10641         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10642         verifications are done here.
10643
10644         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10645
10646         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10647         CLSCompliantAttribute.
10648         (all_imported_types): New member holds all imported types from other
10649         assemblies.
10650         (LoadAllImportedTypes): New method fills static table with exported types
10651         from all referenced assemblies.
10652         (Modules): New property returns all assembly modules.
10653
10654 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10655
10656         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10657         throwing a parser error.
10658
10659         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10660         which removes the hardcoded get_/set_ prefixes for properties, as
10661         IL allows for the properties to be named something else.  
10662
10663         Bug #56013
10664
10665         * expression.cs: Do not override operand before we know if it is
10666         non-null.  Fix 56207
10667
10668 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10669
10670         * typemanager.cs: support for pinned variables.
10671
10672 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10673
10674         * decl.cs, typemanager.cs: Avoid using an arraylist
10675         as a buffer if there is only one result set.
10676
10677 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10678
10679         * expression.cs: Make sure you cant call a static method
10680         with an instance expression, bug #56174.
10681
10682 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * class.cs (IsDuplicateImplementation): Improve error reporting to
10685         flag 663 (method only differs in parameter modifier).
10686
10687         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10688         in preprocessor directives.
10689
10690         * location.cs (LookupFile): Allow for the empty path.
10691
10692         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10693         better approach for some of that patch, but its failing with the
10694         CharSet enumeration.  For now try/catch will do.
10695
10696         * typemanager.cs: Do not crash if a struct does not have fields.
10697         Fixes 56150.
10698
10699 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10700
10701         * expression.cs: cs0213, cant fix a fixed expression.
10702         fixes 50231.
10703
10704 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10705
10706         * cs-parser.jay: detect invalid embeded statements gracefully.
10707         bug #51113.
10708
10709 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10710
10711         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10712         As a regex:
10713         s/
10714         the invocation type may not be a subclass of the tye of the item/
10715         The type of the item must be a subclass of the invocation item.
10716         /g
10717
10718         Fixes bug #50820.
10719
10720 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10721
10722         * attribute.cs: Added methods to get a string and a bool from an
10723         attribute. Required to information from AssemblyKeyFileAttribute,
10724         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10725         * codegen.cs: Modified AssemblyName creation to include support for
10726         strongnames. Catch additional exceptions to report them as CS1548.
10727         * compiler.csproj: Updated include CryptoConvert.cs.
10728         * compiler.csproj.user: Removed file - user specific configuration.
10729         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10730         Mono.Security assembly. The original class is maintained and tested in
10731         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10732         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10733         like CSC 8.0 (C# v2) supports.
10734         * Makefile: Added CryptoConvert.cs to mcs sources.
10735         * rootcontext.cs: Added new options for strongnames.
10736
10737 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10738
10739         * driver.cs: For --expect-error, report error code `2'
10740         if the program compiled with no errors, error code `1' if
10741         it compiled with an error other than the one expected.
10742
10743 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10744
10745         * compiler.csproj: Updated for Visual Studio .NET 2003.
10746         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10747         * compiler.sln: Updated for Visual Studio .NET 2003.
10748
10749 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10750
10751         * expression.cs: Fix bug #47234. We basically need to apply the
10752         rule that we prefer the conversion of null to a reference type
10753         when faced with a conversion to 'object' (csc behaviour).
10754
10755 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10756
10757         * statement.cs: Shorter form for foreach, eliminates
10758         a local variable. r=Martin.
10759
10760 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10761
10762         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10763         checks if we can use brtrue/brfalse to test for 0.
10764         * expression.cs: use the above in the test for using brtrue/brfalse.
10765         cleanup code a bit.
10766
10767 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10768
10769         * expression.cs: Rewrite string concat stuff. Benefits:
10770
10771         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10772         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10773         rather than a concat chain.
10774
10775         * typemanager.cs: Add lookups for more concat overloads.
10776
10777 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10778
10779         * expression.cs: Emit shorter il code for array init.
10780
10781         newarr
10782         dup
10783         // set 1
10784
10785         // set 2
10786
10787         newarr
10788         stloc.x
10789
10790         ldloc.x
10791         // set 1
10792
10793         ldloc.x
10794         // set 2
10795
10796 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10797
10798         * statement.cs: Before, two switch blocks would be merged if the
10799         total size of the blocks (end_item - begin_item + 1) was less than
10800         two times the combined sizes of the blocks.
10801
10802         Now, it will only merge if after the merge at least half of the
10803         slots are filled.
10804
10805         fixes 55885.
10806
10807 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10808
10809         * class.cs : csc build fix for GetMethods(). See bug #52503.
10810
10811 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10812
10813         * expression.cs: Make sure fp comparisons work with NaN.
10814         This fixes bug #54303. Mig approved this patch a long
10815         time ago, but we were not able to test b/c the runtime
10816         had a related bug.
10817
10818 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10819
10820         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10821
10822 2004-03-19  Martin Baulig  <martin@ximian.com>
10823
10824         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10825         two overloads may unify for some type parameter substitutions and
10826         report a CS0408 if appropriate.
10827
10828 2004-03-19  Martin Baulig  <martin@ximian.com>
10829
10830         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10831         error here and not in our caller.
10832
10833 2004-03-19  Martin Baulig  <martin@ximian.com>
10834
10835         * interface.cs: Completely killed this file.
10836         (Interface): We're now a TypeContainer and live in class.cs.
10837
10838         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10839         argument; we're now also called for interfaces.
10840         (TypeContainer.DefineMembers): Allow this method being called
10841         multiple times.
10842         (TypeContainer.GetMethods): New public method; formerly known as
10843         Interface.GetMethod().  This is used by PendingImplementation.
10844         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10845         it's now private and non-static.
10846         (Interface): Moved this here; it's now implemented similar to
10847         Class and Struct.
10848         (Method, Property, Event, Indexer): Added `bool is_interface'
10849         argument to their .ctor's.
10850         (MemberBase.IsInterface): New public field.
10851
10852         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10853         instances instead of InterfaceMethod, InterfaceProperty, etc.
10854         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10855         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10856
10857 2004-03-19  Martin Baulig  <martin@ximian.com>
10858
10859         * class.cs (MethodCore.IsDuplicateImplementation): New private
10860         method which does the CS0111 checking.
10861         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10862         Use IsDuplicateImplementation().
10863
10864 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10865
10866         * decl.cs (FindMemberToOverride): New method to find the correct
10867         method or property to override in the base class.
10868         * class.cs
10869             - Make Method/Property use the above method to find the
10870               version in the base class.
10871             - Remove the InheritableMemberSignatureCompare as it is now
10872               dead code.
10873
10874         This patch makes large code bases much faster to compile, as it is
10875         O(n) rather than O(n^2) to do this validation.
10876
10877         Also, it fixes bug 52458 which is that nested classes are not
10878         taken into account when finding the base class member.
10879
10880         Reviewed/Approved by Martin.
10881
10882 2004-03-17  Martin Baulig  <martin@ximian.com>
10883
10884         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10885         of type arguments into account; use the `real_num_type_args'
10886         approach like in DoResolveAsTypeStep().
10887
10888         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10889         nested types.
10890
10891 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10892
10893         * interface.cs: In all interface classes removed redundant
10894         member initialization.
10895
10896 2004-03-16  Martin Baulig  <martin@ximian.com>
10897
10898         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10899
10900 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10901
10902         * decl.cs (DefineTypeAndParents): New helper method to define a
10903         type's containers before the type itself is defined;  This is a
10904         bug exposed by the recent changes to Windows.Forms when an
10905         implemented interface was defined inside a class that had not been
10906         built yet.   
10907
10908         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10909
10910         (Check): Loop correctly to report errors modifiers
10911         (UNSAFE was not in the loop, since it was the same as TOP).
10912
10913         * interface.cs: Every interface member now takes a ModFlags,
10914         instead of a "is_new" bool, which we set on the base MemberCore. 
10915
10916         Every place where we called "UnsafeOk" in the interface, now we
10917         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10918         the unsafe settings from the member declaration instead of the
10919         container interface. 
10920
10921         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10922
10923         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10924         `set_indexer_name' to the pending bits (one per type).
10925
10926         We fixed a bug today that was picking the wrong method to
10927         override, since for properties the existing InterfaceMethod code
10928         basically ignored the method name.  Now we make sure that the
10929         method name is one of the valid indexer names.
10930
10931 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10932  
10933         * support.cs (SeekableStreamReader): Keep track of stream byte
10934         positions and don't mix them with character offsets to the buffer.
10935
10936         Patch from Gustavo Giráldez
10937
10938 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10939
10940         * interface.cs (InterfaceSetGetBase): Removed double member
10941         initialization, base class does it as well.
10942
10943 2004-03-13  Martin Baulig  <martin@ximian.com>
10944
10945         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10946         when compiling corlib.
10947
10948 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10949
10950         * convert.cs (ExplicitConversion): We were reporting an error on
10951         certain conversions (object_type source to a value type, when the
10952         expression was `null') before we had a chance to pass it through
10953         the user defined conversions.
10954
10955         * driver.cs: Replace / and \ in resource specifications to dots.
10956         Fixes 50752
10957
10958         * class.cs: Add check for duplicate operators.  Fixes 52477
10959
10960 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10961
10962         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10963         that are in the middle of the statements, not only at the end.
10964         Fixes #54987
10965
10966         * class.cs (TypeContainer.AddField): No longer set the
10967         `HaveStaticConstructor' flag, now we call it
10968         `UserDefineStaticConstructor' to diferentiate the slightly
10969         semantic difference.
10970
10971         The situation is that we were not adding BeforeFieldInit (from
10972         Modifiers.TypeAttr) to classes that could have it.
10973         BeforeFieldInit should be set to classes that have no static
10974         constructor. 
10975
10976         See:
10977
10978         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10979
10980         And most importantly Zoltan's comment:
10981
10982         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10983
10984         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10985          before its static fields are used', i.e. initialization does not need
10986          to be triggered by the first access to the type. Setting this flag
10987          helps the JIT to compile better code, since it can run the static
10988          constructor at JIT time, and does not need to generate code to call it
10989          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10990          this flag for lots of classes like String. 
10991          
10992          csc sets this flag if the type does not have an explicit static 
10993          constructor. The reasoning seems to be that if there are only static
10994          initalizers for a type, and no static constructor, then the programmer
10995          does not care when this initialization happens, so beforefieldinit
10996          can be used.
10997          
10998          This bug prevents the AOT compiler from being usable, since it 
10999          generates so many calls to mono_runtime_class_init that the AOT code
11000          is much slower than the JITted code. The JITted code is faster, 
11001          because it does not generate these calls if the vtable is type is
11002          already initialized, which is true in the majority of cases. But the
11003          AOT compiler can't do this."
11004
11005 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11006
11007         * class.cs (MethodData.Emit): Refactor the code so symbolic
11008         information is generated for destructors;  For some reasons we
11009         were taking a code path that did not generate symbolic information
11010         before. 
11011
11012 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11013
11014         * class.cs: Create a Constructor.CheckBase method that
11015         takes care of all validation type code. The method
11016         contains some code that was moved from Define.
11017
11018         It also includes new code that checks for duplicate ctors.
11019         This fixes bug #55148.
11020
11021 2004-03-09  Joshua Tauberer <tauberer@for.net>
11022
11023         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11024         a { ... }-style array creation invokes EmitStaticInitializers
11025         which is not good for reference-type arrays.  String, decimal
11026         and now null constants (NullCast) are not counted toward
11027         static initializers.
11028
11029 2004-03-05  Martin Baulig  <martin@ximian.com>
11030
11031         * location.cs (SourceFile.HasLineDirective): New public field;
11032         specifies whether the file contains or is referenced by a "#line"
11033         directive.
11034         (Location.DefineSymbolDocuments): Ignore source files which
11035         either contain or are referenced by a "#line" directive.        
11036
11037 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11038
11039         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11040         direct access to our parent, so check the method inline there.
11041
11042 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11043
11044         * expression.cs (Invocation.EmitCall): Miguel's last commit
11045         caused a regression. If you had:
11046
11047             T t = null;
11048             t.Foo ();
11049
11050         In Foo the implict this would be null.
11051
11052 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * expression.cs (Invocation.EmitCall): If the method is not
11055         virtual, do not emit a CallVirt to it, use Call.
11056
11057         * typemanager.cs (GetFullNameSignature): Improve the method to
11058         cope with ".ctor" and replace it with the type name.
11059
11060         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11061         as an argument the ConstructorBuilder where it is being defined,
11062         to catch the recursive constructor invocations.
11063
11064 2004-03-16  Martin Baulig  <martin@ximian.com>
11065
11066         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11067         ConstructedType, call ResolveType() on it to get the type rather
11068         than just using `expr.Type'.
11069
11070 2004-03-16  Martin Baulig  <martin@ximian.com>
11071
11072         * generics.cs (ConstructedType.GetMemberAccess): Take the
11073         EmitContext instead on the TypeExpr and use
11074         ec.TypeContainer.CurrentType/ec.ContainerType.
11075
11076 2004-03-16  Martin Baulig  <martin@ximian.com>
11077
11078         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11079         parameters before aliases.
11080
11081 2004-03-16  Martin Baulig  <martin@ximian.com>
11082
11083         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11084         New oublic function; checks whether two generic instances may become
11085         equal under some instantiations (26.3.1).
11086
11087         * class.cs (TypeContainer.Define): Call
11088         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11089         error.
11090
11091 2004-03-16  Martin Baulig  <martin@ximian.com>
11092
11093         * class.cs (TypeContainer.GetClassBases): Moved
11094         Error_TypeParameterAsBase() here and also check whether the base
11095         class is not an attribute.
11096
11097 2004-03-16  Martin Baulig  <martin@ximian.com>
11098
11099         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11100
11101 2004-03-16  Martin Baulig  <martin@ximian.com>
11102
11103         * class.cs (Error_TypeParameterAsBase): Use correct error number
11104         here (CS0689).  
11105
11106 2004-03-16  Martin Baulig  <martin@ximian.com>
11107
11108         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11109         for generics.
11110
11111         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11112         error reporting.
11113
11114 2004-03-15  Martin Baulig  <martin@ximian.com>
11115
11116         * typemanager.cs (TypeManager.GetFullName): New public method.
11117         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11118         argument; only return members with the correct number of type
11119         arguments.
11120         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11121         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11122         whether the number of type arguments matches.
11123
11124         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11125         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11126
11127         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11128         field; it's set by the protected .ctor when we're actually a
11129         GenericMemberAccess.
11130         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11131         arguments and pass it to MemberLookupFinal ().
11132
11133         * ecore.cs (Expression.MemberLookup): Added `int
11134         num_type_arguments' argument; only return members with the correct
11135         number of type arguments.
11136         (Expression.MemberLookupFailed): Check whether the MemberLookup
11137         failed because we did not have the correct number of type
11138         arguments; report CS0305 in this case.
11139
11140         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11141         `e.ResolveAsTypeTerminal()' already did so.
11142
11143 2004-03-15  Martin Baulig  <martin@ximian.com>
11144
11145         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11146         we're a ConstructedType; in this case, the caller must report an
11147         error (for instance CS0131).
11148
11149         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11150         (TypeArguments.Resolve): Actually report errors here.
11151
11152 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11153
11154         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11155         `set_indexer_name' to the pending bits (one per type).
11156
11157         We fixed a bug today that was picking the wrong method to
11158         override, since for properties the existing InterfaceMethod code
11159         basically ignored the method name.  Now we make sure that the
11160         method name is one of the valid indexer names.
11161
11162 2004-03-15  Martin Baulig  <martin@ximian.com>
11163
11164         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11165         for generic instances.
11166
11167 2004-03-13  Martin Baulig  <martin@ximian.com>
11168
11169         * class.cs (TypeContainer.DefineType): Call
11170         TypeManager.AddUserType() immediately after creating the
11171         TypeBuilder; pass all type parameters when creating the
11172         CurrentType.
11173
11174         * decl.cs (DeclSpace.FindNestedType): New public method.
11175         (DeclSpace.FindType): Added `int num_type_args' argument; only
11176         return types with the correct number of type parameters.
11177         (DeclSpace.CountTypeParams): New public property.
11178
11179         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11180         the number of type parameters; defaults to zero.
11181
11182         * generic.cs (TypeArguments.Count): New public property.
11183         (ConstructedType.DoResolveAsTypeStep): First call
11184         ds.FindNestedType() to find out whether we're nested in the
11185         current generic type; in this case, we inherit all type parameters
11186         from the current class.
11187
11188         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11189         num_type_args' argument.
11190         (RootContext.LookupType): Added overloaded version which takes the
11191         number of type arguments; only return types with the correct
11192         number of type arguments.
11193
11194         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11195         checks whether `Type t' has `int num_type_args'.
11196
11197 2004-03-13  Martin Baulig  <martin@ximian.com>
11198
11199         * generic.cs (GenericMethod.DefineType): New method; calls
11200         DefineType() on all the type parameters.
11201
11202         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11203         (MethodData.Define): If we're a generic method, call
11204         GenericMethod.DefineType() to define the type parameters.       
11205
11206 2004-03-10  Martin Baulig  <martin@ximian.com>
11207
11208         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11209         instead of IsAssignableFrom.    
11210
11211 2004-03-10  Martin Baulig  <martin@ximian.com>
11212
11213         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11214
11215         * support.cs (ParameterData.HasArrayParameter): New property.
11216         (ReflectionParameters.ctor): Take a MethodBase instead of a
11217         ParameterInfo[].  If we have any type parameters, get the generic
11218         method definition and ask it whether we have variable arguments.
11219
11220 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11221
11222         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11223         routines to check if a type is an enumerable/enumerator allow
11224         classes that implement the IEnumerable or IEnumerator interfaces.
11225
11226         * class.cs (Property, Operator): Implement IIteratorContainer, and
11227         implement SetYields.
11228
11229         (Property.Define): Do the block swapping for get_methods in the
11230         context of iterators.   We need to check if Properties also
11231         include indexers or not.
11232
11233         (Operator): Assign the Block before invoking the
11234         OperatorMethod.Define, so we can trigger the Iterator code
11235         replacement. 
11236
11237         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11238         Property and Operator classes are not created when we parse the
11239         declarator but until we have the block completed, so we use a
11240         singleton SimpleIteratorContainer.Simple to flag whether the
11241         SetYields has been invoked.
11242
11243         We propagate this setting then to the Property or the Operator to
11244         allow the `yield' to function.
11245
11246 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11247
11248         * codegen.cs: Implemented attribute support for modules.
11249         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11250         Assembly/Module functionality.
11251
11252         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11253         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11254         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11255
11256 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11257
11258         * interface.cs (FindMembers): The operation is performed on all base
11259         interfaces and not only on the first. It is required for future CLS Compliance patch.
11260
11261 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11262
11263         * statement.cs, codegen.cs:
11264         This patch deals with patterns such as:
11265
11266         public class List : IEnumerable {
11267
11268                 public MyEnumerator GetEnumerator () {
11269                         return new MyEnumerator(this);
11270                 }
11271
11272                 IEnumerator IEnumerable.GetEnumerator () {
11273                         ...
11274                 }
11275                 
11276                 public struct MyEnumerator : IEnumerator {
11277                         ...
11278                 }
11279         }
11280
11281         Before, there were a few things we did wrong:
11282         1) we would emit callvirt on a struct, which is illegal
11283         2) we emited ldarg when we needed to emit ldarga
11284         3) we would mistakenly call the interface methods on an enumerator
11285         type that derived from IEnumerator and was in another assembly. For example:
11286
11287         public class MyEnumerator : IEnumerator
11288
11289         Would have the interface methods called, even if there were public impls of the
11290         method. In a struct, this lead to invalid IL code.
11291
11292 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11293
11294         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11295           renamed to Emit.
11296
11297         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11298
11299 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11300
11301         * cs-parser.jay: Fix small regression: we were not testing V2
11302         compiler features correctly.
11303
11304         * interface.cs: If the emit context is null, then create one
11305
11306 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11307
11308         * decl.cs (GetSignatureForError): New virtual method to get full name
11309           for error messages.
11310
11311         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11312           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11313
11314         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11315           Duplicated members and code in these classes has been removed.
11316           Better encapsulation in these classes.
11317
11318 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11319
11320         * assign.cs (Assign.DoResolve): When dealing with compound
11321         assignments, there is a new rule in ECMA C# 2.4 (might have been
11322         there before, but it is documented here) that states that in:
11323
11324         a op= b;
11325
11326         If b is of type int, and the `op' is a shift-operator, then the
11327         above is evaluated as:
11328
11329         a = (int) a op b 
11330
11331         * expression.cs (Binary.ResolveOperator): Instead of testing for
11332         int/uint/long/ulong, try to implicitly convert to any of those
11333         types and use that in pointer arithmetic.
11334
11335         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11336         method to print information for from the type, not from the
11337         null-method we were given.
11338
11339 2004-02-01  Duncan Mak  <duncan@ximian.com>
11340
11341         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11342         parsing for cmd, fixes bug #53694.
11343
11344 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11345
11346         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11347         in the member name duplication tests. Property and operator name duplication
11348         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11349
11350 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11351
11352         * interface.cs (PopulateMethod): Fixed crash when interface method
11353         returns not existing type (error test cs0246-3.cs).
11354
11355 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11356
11357         * cs-parser.jay (interface_accessors): Re-write actions to also
11358         store attributes attached to get and set methods. Fix spelling
11359         while at it.
11360
11361         (inteface_property_declaration): Modify accordingly.
11362
11363         (InterfaceAccessorInfo): New helper class to store information to pass
11364         around between rules that use interface_accessors.
11365
11366         * interface.cs (Emit): Apply attributes on the get and set
11367         accessors of properties and indexers too.
11368
11369         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11370         right MethodBuilder when applying attributes to the get and set accessors.
11371
11372 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11373
11374         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11375
11376 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11379
11380 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11381
11382         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11383         changes that treat `yield' specially when present before `break'
11384         or `return' tokens.
11385
11386         * cs-tokenizer.cs: yield is no longer a keyword.
11387
11388 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11389
11390         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11391         setting for default constructors.
11392         For default constructors are almost every time set wrong Modifier. The
11393         generated IL code has been alright. But inside mcs this values was
11394         wrong and this was reason why several of my CLS Compliance tests
11395         failed.
11396
11397 2004-02-27  Martin Baulig  <martin@ximian.com>
11398
11399         * generics.cs (ConstructedType.ResolveType): Make the nested type
11400         stuff actually work.
11401
11402 2004-02-25  Martin Baulig  <martin@ximian.com>
11403
11404         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11405         property; returns the type parameters just from the current type,
11406         ie. with the ones from outer classes.
11407         (DeclSpace.LookupGeneric): First search in the current class, then
11408         in outer classes.
11409         (DeclSpace.initialize_type_params): When hiding a type parameter
11410         from an outer class, put it into the `type_param_list' anyways.
11411
11412         * expression.cs (MemberAccess.expr): Made this field protected.
11413
11414         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11415         the type parameters from the current class.
11416
11417         * generic.cs (ConstructedType.ResolveType): Support nested generic
11418         types by taking the type parameters which we inherit from outer
11419         classes into account.
11420         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11421         support for nested generic types.
11422
11423 2004-02-23  Martin Baulig  <martin@ximian.com>
11424
11425         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11426         field and check whether we're nested inside a generic type.
11427         (DeclSpace.ResolveType): If we're resolving to a generic type
11428         definition, create a ConstructedType and return its resolved type.
11429         (DeclSpace.initialize_type_params): New private method;
11430         initializes the `type_param_list' field from the type parameters
11431         from this and all enclosing classes.
11432         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11433         we're already initialized.
11434
11435 2004-02-23  Martin Baulig  <martin@ximian.com>
11436
11437         * class.cs (Method.Define): Create the generic method before
11438         calling DoDefine().
11439         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11440         the TypeContainer one); we use this for generic methods.
11441
11442         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11443         parent's TypeBuilder.
11444
11445 2004-02-18  Martin Baulig  <martin@ximian.com>
11446
11447         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11448         to check for equality.
11449
11450 2004-02-05  Martin Baulig  <martin@ximian.com>
11451
11452         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11453         `ec.TypeContainer.CurrentType', use it instead of
11454         `ec.ContainerType' to check whether we're in the type's ctor.
11455
11456 2004-01-29  Martin Baulig  <martin@ximian.com>
11457
11458         * expression.cs (Invocation.DoResolve): If we're a
11459         `ConstructedType', then we're actually a generic method, so
11460         rewrite the expr as a GenericMemberAccess.
11461
11462         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11463         here; manually parse it into a string.
11464
11465 2004-01-28  Martin Baulig  <martin@ximian.com>
11466
11467         * typemanager.cs (TypeManager.IsEqual): New static method.
11468         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11469         check for equality instead of using `=='.
11470
11471 2004-01-26  Martin Baulig  <martin@ximian.com>
11472
11473         * decl.cs (DeclSpace.CurrentType): New public field.
11474
11475         * expression.cs (This.ResolveBase): If we have an
11476         `ec.TypeContainer.CurrentType', use it instead of
11477         `ec.ContainerType'.
11478
11479         * class.cs (TypeContainer.DefineType): If we're a generic type,
11480         create the `CurrentType' (unresolved).
11481         (TypeContainer.GenericType): New private field.
11482         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11483         it and store it in `GenericType' before creating the MemberCache.
11484         (TypeContainer.GetMembers): If we have a `GenericType', call
11485         TypeManager.FindMembers() on it.
11486
11487         * interface.cs (Interface.GenericType): New private field.
11488         (Interface.DefineType): If we're a generic type, create the
11489         `CurrentType' (unresolved).
11490         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11491         and store it in `GenericType' before creating the MemberCache.
11492         (Interface.GetMembers): If we have a `GenericType', call
11493         TypeManager.FindMembers() on it.
11494
11495 2004-01-22  Martin Baulig  <martin@ximian.com>
11496
11497         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11498         not a QualifiedIdentifier.  This is what `type_name_expression'
11499         was previously doing.
11500         (type_name_expression): Removed; the code is now in
11501         `namespace_or_type_name'.
11502         (qualified_identifier): Removed, use `namespace_or_type_name'
11503         instead.
11504         (QualifiedIdentifier): Removed this class.      
11505
11506 2004-01-22  Martin Baulig  <martin@ximian.com>
11507
11508         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11509         not a string as alias name.
11510
11511 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11512
11513         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11514         #52730 bug, and instead compute correctly the need to use a
11515         temporary variable when requesting an address based on the
11516         static/instace modified of the field and the constructor.
11517  
11518 2004-01-21  Martin Baulig  <martin@ximian.com>
11519
11520         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11521         class and namespace before looking up aliases.  Fixes #52517.
11522
11523 2004-01-21  Martin Baulig  <martin@ximian.com>
11524
11525         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11526         assinged in a 'try'; fixes exception4.cs.
11527
11528 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11529         * class.cs : Implemented parameter-less constructor for TypeContainer
11530
11531         * decl.cs: Attributes are now stored here. New property OptAttributes
11532
11533         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11534
11535         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11536
11537 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11538
11539         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11540           (CSharpSignature): New method for indexer and property signature.
11541
11542 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11543
11544         * pending.cs (IsVirtualFilter): Faster implementation.
11545
11546 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11547
11548         * typemanager.cs: Avoid inclusion of same assembly more than once.
11549
11550 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11551
11552         * cs-parser.jay: Fixed problem where the last assembly attribute
11553           has been applied also to following declaration (class, struct, etc.)
11554           
11555 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11556
11557         * class.cs: Added error CS0538, CS0539 reporting.
11558         Fixed crash on Microsoft runtime when field type is void.
11559
11560         * cs-parser.jay: Added error CS0537 reporting.
11561
11562         * pending.cs: Added error CS0535 reporting.
11563         Improved error report for errors CS0536, CS0534.
11564
11565 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11566
11567         Merge a few bits from the Anonymous Method MCS tree.
11568
11569         * statement.cs (ToplevelBlock): New class for toplevel methods,
11570         will hold anonymous methods, lifted variables.
11571
11572         * cs-parser.jay: Create toplevel blocks for delegates and for
11573         regular blocks of code. 
11574
11575 2004-01-20  Martin Baulig  <martin@ximian.com>
11576
11577         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11578         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11579         and `NeedExplicitReturn'; added `IsLastStatement'.
11580         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11581         have a `ReturnLabel' or we're not unreachable.
11582
11583         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11584         child's reachability; don't just override ours with it.  Fixes
11585         #58058 (lluis's example).
11586         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11587         InFinally(), InLoop(), InSwitch() and
11588         BreakCrossesTryCatchBoundary() methods.
11589
11590         * statement.cs (Return): Do all error checking in Resolve().
11591         Unless we are the last statement in a top-level block, always
11592         create a return label and jump to it.
11593         (Break, Continue): Do all error checking in Resolve(); also make
11594         sure we aren't leaving a `finally'.
11595         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11596         statement in a top-level block.
11597         (Block.Flags): Added `IsDestructor'.
11598         (Block.IsDestructor): New public property.
11599
11600 2004-01-20  Martin Baulig  <martin@ximian.com>
11601
11602         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11603
11604 2004-01-20  Martin Baulig  <martin@ximian.com>
11605
11606         * statement.cs (Statement.ResolveUnreachable): New public method.
11607         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11608         (Block.Resolve): Resolve unreachable statements.
11609
11610 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11611
11612         * expression.cs: We need to fix the case where we do
11613         not have a temp variable here.
11614
11615         * assign.cs: Only expression compound assignments need
11616         temporary variables.
11617
11618 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11619
11620         * flowanalysis.cs: Reduce memory allocation in a few ways:
11621           - A block with no variables should not allocate a bit
11622             vector for itself.
11623           - A method with no out parameters does not need any tracking
11624             for assignment of the parameters, so we need not allocate
11625             any data for it.
11626           - The arrays:
11627                 public readonly Type[] VariableTypes;
11628                 public readonly string[] VariableNames;
11629             Are redundant. The data is already stored in the variable
11630             map, so we need not allocate another array for it.
11631           - We need to add alot of checks for if (params | locals) == null
11632             due to the first two changes.
11633
11634 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11635
11636         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11637         implement IMemoryLocation, we store a copy on a local variable and
11638         take the address of it.  Patch from Benjamin Jemlich
11639
11640         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11641         to use a special "type_name_expression" rule which reduces the
11642         number of "QualifiedIdentifier" classes created, and instead
11643         directly creates MemberAccess expressions.
11644
11645 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11646
11647         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11648         that fixes #52853.  Null literal assignment to ValueType
11649
11650         * class.cs (MethodData.Emit): Instead of checking the name of the
11651         method to determine if its a destructor, create a new derived
11652         class from Method called Destructor, and test for that.  
11653
11654         * cs-parser.jay: Create a Destructor object instead of a Method.  
11655
11656         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11657
11658         Fixes: 52933
11659
11660 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * expression.cs (Binary.ResolveOperator): Perform an implicit
11663         conversion from MethodGroups to their delegate types on the
11664         Addition operation.
11665
11666         * delegate.cs: Introduce a new class DelegateCreation that is the
11667         base class for `NewDelegate' and `ImplicitDelegateCreation',
11668         factor some code in here.
11669
11670         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11671         conversion from MethodGroups to compatible delegate types. 
11672
11673         * ecore.cs (Expression.Resolve): Do not flag error 654
11674         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11675         we allow conversions from MethodGroups to delegate types now.
11676
11677         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11678         assignments in v2 either.
11679
11680 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11681
11682         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11683         static read-only fields in ctors.
11684
11685         Applied patch from Benjamin Jemlich 
11686
11687         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11688
11689 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11690
11691         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11692         here to return true, as they can be used like this:
11693
11694                 (XXX) int.MEMBER ()
11695
11696         Fixed 49836 and all the other dups
11697
11698 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11699
11700         * driver.cs: Implement /win32res and /win32icon.
11701
11702 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11703
11704         * cs-parser.jay: Add a rule to improve error handling for the
11705         common mistake of placing modifiers after the type.
11706
11707 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11708
11709         * cs-parser.jay (interface_event_declaration): Catch
11710         initialization of events on interfaces, and report cs0068
11711
11712         * cs-parser.jay (interface_event_declaration): Catch
11713         initialization of events. 
11714
11715         * ecore.cs: Better report missing constructors.
11716
11717         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11718         the error reporting done in the wrong place.  Fix.
11719
11720         * expression.cs (Binary.ResolveOperator): Catch the 
11721         operator + (E x, E y) error earlier, and later allow for implicit
11722         conversions in operator +/- (E e, U x) from U to the underlying
11723         type of E.
11724
11725         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11726         52596, if the container class is abstract, the default constructor
11727         is protected otherwise its public (before, we were always public).
11728
11729         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11730         fixed statement.
11731
11732         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11733         Jemlich that fixes bug #52597, MCS was generating invalid code for
11734         idisposable structs.   Thanks to Ben for following up with this
11735         bug as well.
11736
11737 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11738
11739         * driver.cs: Allow assemblies without code to be generated, fixes
11740         52230.
11741
11742 2004-01-07  Nick Drochak <ndrochak@gol.com>
11743
11744         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11745
11746 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11747
11748         * cs-parser.jay: Add rules to improve error reporting if fields or
11749         methods are declared at the namespace level (error 116)
11750
11751         * Add rules to catch event add/remove
11752
11753 2004-01-04  David Sheldon <dave-mono@earth.li>
11754
11755   * expression.cs: Added matching ")" to error message for 
11756   CS0077
11757
11758 2004-01-03 Todd Berman <tberman@gentoo.org>
11759
11760         * ecore.cs, attribute.cs:
11761         Applying fix from #52429.
11762
11763 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11764
11765         * ecore.cs, expression.cs, statement.cs:
11766         Total rewrite of how we handle branching. We
11767         now handle complex boolean expressions with fewer
11768         jumps. As well if (x == 0) no longer emits a ceq.
11769
11770         if (x is Foo) is much faster now, because we generate
11771         better code.
11772
11773         Overall, we get a pretty big improvement on our benchmark
11774         tests. The code we generate is smaller and more readable.
11775
11776         I did a full two-stage bootstrap. The patch was reviewed
11777         by Martin and Miguel.
11778
11779 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11780
11781         * cs-parser.jay: Make primary_expression not take a QI.
11782         we dont need this because the member_access rule covers
11783         us here. So we replace the rule with just IDENTIFIER.
11784
11785         This has two good effects. First, we remove a s/r conflict.
11786         Second, we allocate many fewer QualifiedIdentifier objects.
11787
11788 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11789
11790         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11791         set the correct information via SRE. This prevents
11792         hanging on the MS runtime. Fixes #29374.
11793
11794 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11795
11796         * convert.cs: correctly handle conversions to value types
11797         from Enum and ValueType as unboxing conversions.
11798
11799         Fixes bug #52569. Patch by Benjamin Jemlich.
11800
11801 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11802
11803         * expression.cs (BetterConversion): Prefer int -> uint
11804         over int -> ulong (csc's behaviour). This fixed bug #52046.
11805
11806 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11807
11808         * decl.cs (MemberCache.FindMembers): now returns a
11809         MemberInfo [].
11810
11811         * typemanager.cs: In general, go with with ^^.
11812         (CopyNewMethods): take an IList.
11813         (RealMemberLookup): Only allocate an arraylist
11814         if we copy from two sets of methods.
11815
11816         This change basically does two things:
11817         1) Fewer array lists allocated due to CopyNewMethods.
11818         2) the explicit cast in MemberList costed ALOT.
11819
11820 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11821
11822         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11823         a hashtable to avoid needless string allocations when an identifier is
11824         used more than once (the common case).
11825
11826 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11827
11828         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11829         is broken, it will not return anything. So, we
11830         have to use the information we have in mcs to
11831         do the task.
11832
11833         * typemanager.cs: Add a cache for GetInterfaces,
11834         since this will now be used more often (due to ^^)
11835
11836         (GetExplicitInterfaces) New method that gets the
11837         declared, not effective, interfaces on a type
11838         builder (eg, if you have interface IFoo, interface
11839         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11840         { IBar }.
11841
11842         This patch makes MCS able to bootstrap itself on
11843         Windows again.
11844
11845 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11846
11847         * expression.cs: Remove the Nop's that Miguel put
11848         in by mistake.
11849
11850 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11851
11852         * report.cs, codegen.cs: Give the real stack trace to
11853         the error when an exception is thrown.
11854
11855 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11856
11857         * decl.cs: only allocate hashtables for ifaces if 
11858         it is an iface!
11859
11860 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11861
11862         * expression.cs: fix the error from cs0121-2.cs
11863         (a parent interface has two child interfaces that
11864         have a function with the same name and 0 params
11865         and the function is called through the parent).
11866
11867 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11868
11869         * class.cs, rootcontext.cs, typmanager.cs: do not
11870         leak pointers.
11871
11872 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11873
11874         * codegen.cs: remove stack for the ec flow branching.
11875         It is already a linked list, so no need.
11876
11877 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11878
11879         * Makefile: Allow custom profiler here.
11880
11881 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11882
11883         * typemanager.cs (LookupType):
11884           - Use a static char [], because split takes
11885             a param array for args, so it was allocating
11886             every time.
11887           - Do not store true in a hashtable, it boxes.
11888
11889 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11890
11891         * flowanalysis.cs: bytify common enums.
11892
11893 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11894
11895         * modifiers.cs: Add a new set of flags for the
11896         flags allowed on explicit interface impls.
11897         * cs-parser.jay: catch the use of modifiers in
11898         interfaces correctly.
11899         * class.cs: catch private void IFoo.Blah ().
11900
11901         All related to bug #50572.
11902
11903 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11904
11905         * decl.cs: Rewrite the consistant accessability checking.
11906         Accessability is not linear, it must be implemented in
11907         a tableish way. Fixes #49704.
11908
11909 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11910
11911         * expression.cs: Handle negation in a checked context.
11912         We must use subtraction from zero. Fixes #38674.
11913
11914 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11915
11916         * class.cs: Ignore static void main in DLLs.
11917         * rootcontext.cs: Handle the target type here,
11918         since we are have to access it from class.cs
11919         * driver.cs: account for the above.
11920
11921 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11922
11923         * report.cs: Give line numbers and files if available.
11924
11925 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11926
11927         * driver.cs: Implement /addmodule.
11928
11929         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11930         ModuleBuilders.
11931
11932 2003-12-20  Martin Baulig  <martin@ximian.com>
11933
11934         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11935         (FieldBase.IsAssigned): Removed this field.
11936         (FieldBase.SetAssigned): New public method.
11937         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11938
11939 2003-12-20  Martin Baulig  <martin@ximian.com>
11940
11941         * expression.cs (LocalVariableReference.DoResolve): Don't set
11942         `vi.Used' if we're called from DoResolveLValue().
11943
11944         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11945         returns the usage vector it just merged into the current one -
11946         pass this one to UsageWarning().
11947         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11948         of the `EmitContext', don't call this recursively on our children.
11949
11950 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11951
11952         * driver.cs: Implement /target:module.
11953
11954 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11955
11956         * support.cs (CharArrayHashtable): New helper class.
11957
11958         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11959         char arrays, not strings, so we can avoid creating a string in
11960         consume_identifier if the identifier is a keyword.
11961
11962 2003-12-16  Martin Baulig  <martin@ximian.com>
11963
11964         * statement.cs (LocalInfo.Assigned): Removed this property.
11965         (LocalInfo.Flags): Removed `Assigned'.
11966         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11967         and uses flow analysis.
11968         (Block.UsageWarning): Made this method private.
11969         (Block.Resolve): Call UsageWarning() if appropriate.
11970
11971         * expression.cs (LocalVariableReference.DoResolve): Always set
11972         LocalInfo.Used here.
11973
11974 2003-12-13  Martin Baulig  <martin@ximian.com>
11975
11976         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11977         any value here; we're now using flow analysis to figure out
11978         whether a statement/block returns a value.
11979
11980 2003-12-13  Martin Baulig  <martin@ximian.com>
11981
11982         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11983         working again.
11984         (FlowBranching.MergeFinally): Don't call
11985         `branching.CheckOutParameters()' here, this is called in
11986         MergeTopBlock().
11987         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11988         when adding the `finally' vector.       
11989
11990 2003-12-13  Martin Baulig  <martin@ximian.com>
11991
11992         * flowanalysis.cs
11993         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11994         actually work and also fix #48962.
11995
11996 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11997
11998         * decl.cs: Do not check System.Object for nested types,
11999         since we know it does not have any. Big bang for buck:
12000
12001         BEFORE:
12002            Run 1:   8.35 seconds
12003            Run 2:   8.32 seconds
12004            corlib:  17.99 seconds
12005         AFTER:
12006            Run 1:   8.17 seconds
12007            Run 2:   8.17 seconds
12008            corlib:  17.39 seconds
12009
12010 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12011
12012         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12013         time we are returning 0 members, so we save alot here.
12014
12015 2003-12-11  Martin Baulig  <martin@ximian.com>
12016
12017         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12018         `MergeChild()', also just take the `FlowBranching' as argument;
12019         call Merge() on it and return the result.
12020         (FlowBranching.Merge): We don't need to do anything if we just
12021         have one sibling.
12022
12023 2003-12-11  Martin Baulig  <martin@ximian.com>
12024
12025         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12026         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12027         Maurer for this idea.
12028
12029 2003-12-11  Martin Baulig  <martin@ximian.com>
12030
12031         * flowanalysis.cs (MergeResult): This class is now gone; we now
12032         use the `UsageVector' for this.  The reason for this is that if a
12033         branching just has one sibling, we don't need to "merge" them at
12034         all - that's the next step to do.
12035         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12036         `MergeResult'.
12037
12038 2003-12-11  Martin Baulig  <martin@ximian.com>
12039
12040         Reworked flow analyis and made it more precise and bug-free.  The
12041         most important change is that we're now using a special `Reachability'
12042         class instead of having "magic" meanings of `FlowReturns'.  I'll
12043         do some more cleanups and optimizations and also add some more
12044         documentation this week.
12045
12046         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12047         largely reworked this class.
12048         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12049         the new `Reachability' class instead of having "magic" values here.
12050         (FlowBranching): We're now using an instance of `Reachability'
12051         instead of having separate `Returns', `Breaks' etc. fields.
12052
12053         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12054         based on flow analysis; ignore the return value of block.Emit ().
12055
12056 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12057
12058         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12059         if they are private.
12060
12061 2003-12-09  Martin Baulig  <martin@ximian.com>
12062
12063         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12064         call them directly on the UsageVector.
12065
12066 2003-12-09  Martin Baulig  <martin@ximian.com>
12067
12068         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12069         Changed return type from `FlowReturns' to `Reachability'.
12070
12071 2003-12-09  Martin Baulig  <martin@ximian.com>
12072
12073         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12074         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12075         `Reachable' fields with a single `Reachability' one.
12076
12077 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12078
12079         * class.cs (FindMembers): Remove foreach's.
12080
12081         Bootstrap times:
12082
12083         BEFORE
12084                 Run 1:   8.74 seconds
12085                 Run 2:   8.71 seconds
12086
12087         AFTER
12088                 Run 1:   8.64 seconds
12089                 Run 2:   8.58 seconds
12090
12091
12092 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12093
12094         * cs-parser.jay:
12095         * gen-treedump.cs:
12096         * statement.cs:
12097         This patch does a few things:
12098                 1. EmptyStatement is now a singleton, so it is never reallocated.
12099                 2. All blah is EmptyStatement constructs have been changed to
12100                    blah == EmptyStatement.Value, which is much faster and valid
12101                    now that EmptyStatement is a singleton.
12102                 3. When resolving a block, rather than allocating a new array for
12103                    the non-empty statements, empty statements are replaced with
12104                    EmptyStatement.Value
12105                 4. Some recursive functions have been made non-recursive.
12106         Mainly the performance impact is from (3), however (1) and (2) are needed for
12107         this to work. (4) does not make a big difference in normal situations, however
12108         it makes the profile look saner.
12109
12110         Bootstrap times:
12111
12112         BEFORE
12113         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12114         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12115         Total memory allocated: 56397 KB
12116
12117         AFTER
12118         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12119         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12120         Total memory allocated: 55666 KB
12121
12122 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12123
12124         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12125         than the hashtable in a hashtable version
12126
12127         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12128         we always end up concating a string. This results in a huge perf
12129         loss, because many strings have to be tracked by the GC. In this
12130         patch, we first use a hashtable that works with two keys, so that
12131         the strings do not need to be concat'ed.
12132
12133         Bootstrap times:
12134         BEFORE
12135                 Run 1:   8.74 seconds
12136                 Run 2:   8.71 seconds
12137
12138         AFTER
12139                 Run 1:   8.65 seconds
12140                 Run 2:   8.56 seconds
12141
12142 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12143
12144         * Makefile: Add a new target `do-time' that does a quick and simple
12145         profile, leaving easy to parse output.
12146
12147 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12148
12149         * codegen.cs (Init): Create the dynamic assembly with 
12150         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12151
12152 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12153
12154         * support.cs: Make the PtrHashtable use only one
12155         instance of its comparer.
12156
12157 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12158
12159         * typemanager.cs: Fix lookup of GetNamespaces.
12160
12161 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * expression.cs: Removed redundant line.
12164
12165         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12166         ArrayLists, use for loops with bounds.  
12167
12168         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12169         arraylist.
12170
12171         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12172         arraylists, use for loop with bounds.
12173
12174         The above three changes give us a 0.071 second performance
12175         improvement out of 3.294 seconds down to 3.223.  On my machine
12176         the above changes reduced the memory usage by 1,387 KB during
12177         compiler bootstrap.
12178
12179         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12180         QualifiedIdentifiers.  Before we created a new string through
12181         concatenation, and mostly later on, the result would be
12182         manipulated by DecomposeQI through string manipulation.
12183
12184         This reduced the compiler memory usage for bootstrapping from
12185         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12186         compile times in 0.05 seconds.
12187
12188 2003-11-28  Dick Porter  <dick@ximian.com>
12189
12190         * support.cs: Do string compares with the Invariant culture.
12191
12192         * rootcontext.cs: 
12193         * gen-treedump.cs: 
12194         * expression.cs: 
12195         * driver.cs: 
12196         * decl.cs: 
12197         * codegen.cs: 
12198         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12199         the comparison is done with the Invariant culture.
12200
12201 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12202
12203         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12204         GetEnumerator method.
12205
12206         (ProbeCollectionType): Iterate starting at the most specific type
12207         upwards looking for a GetEnumerator
12208
12209         * expression.cs: Shift count can be up to 31 for int/uint and 63
12210         for long/ulong.
12211
12212 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12213
12214         * statement.cs (Block.LookupLabel): Also look for the label on the
12215         children blocks.  Use a hash table to keep track of visited
12216         nodes. 
12217
12218         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12219         we actually did transform the other operand, otherwise fall back
12220         to the common codepath that casts to long.
12221
12222         * cs-tokenizer.cs: Use the same code pattern as the int case.
12223         Maybe I should do the parsing myself, and avoid depending on the
12224         Parse routines to get this done.
12225
12226 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12227
12228         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12229         which fixes bug 51347.  This time test it.
12230
12231         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12232         attributes for example can not tell the difference between these.
12233         The difference was only a syntax feature of the language. 
12234
12235         * attribute.cs: Apply attributes to delegates.
12236
12237         * delegate.cs: Call the apply attributes method.
12238
12239 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12242         comparing 0 vs Byte.MinValue, not the value
12243
12244         (ImplicitConversionRequired): When reporting a conversion error,
12245         use error 31 to print out the constant error instead of the
12246         simpler 29.
12247
12248         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12249         which fixes bug 51347.
12250
12251 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12252
12253         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12254         which fixes the -warnaserror command line option.
12255
12256 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12257
12258         * cfold.cs (DoNumericPromotions): During constant folding of
12259         additions on UIntConstant, special case intconstants with
12260         IntConstants like we do on the expression binary operator. 
12261
12262 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12263
12264         * convert.cs (ImplicitReferenceConversion): We were missing a case
12265         (System.Enum are not value types or class types, so we need to
12266         classify them separatedly).
12267
12268         * driver.cs: We do not support error 2007.
12269
12270 2003-11-12 Jackson Harper <jackson@ximian.com>
12271
12272         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12273         system directory. Also use the full file name so users can
12274         libraries names mscorlib-o-tron.dll in a non system dir.
12275         
12276 2004-01-04  David Sheldon <dave-mono@earth.li>
12277
12278         * expression.cs: Added matching ")" to error message for CS0077.
12279
12280 2003-12-19  Martin Baulig  <martin@ximian.com>
12281
12282         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12283         static method; see documentation in the method.
12284         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12285
12286         * convert.cs (Convert.ImplicitReferenceConversion,
12287         Convert.ImplicitReferenceConversionExists): Add support for
12288         generic type declarations; see gen-36.cs.
12289
12290 2003-12-19  Martin Baulig  <martin@ximian.com>
12291
12292         * pending.cs (Pending.InterfaceMethod): Use
12293         `Type.IsAssignableFrom()' instead of `=='.
12294
12295 2003-12-18  Martin Baulig  <martin@ximian.com>
12296
12297         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12298         byref types first.
12299
12300         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12301         `expr_type.Equals (target_type)' instead of `=='.
12302
12303 2003-12-08  Martin Baulig  <martin@ximian.com>
12304
12305         * generics.cs (Constraints.Types): Removed.
12306         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12307         to Type's.
12308         (Constraints.ResolveTypes): New public method; resolves the
12309         TypeExpr's to Type's.
12310         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12311         longer takes the constraints.
12312         (TypeParameter.DefineMethod): Likewise.
12313         (TypeParameter.DefineType): New public method.  Calls
12314         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12315         the constraints.
12316
12317 2003-12-08  Martin Baulig  <martin@ximian.com>
12318
12319         * convert.cs (Convert.ImplicitConversionStandard): Use
12320         `expr_type.Equals (target_type)' instead of `=='.
12321
12322 2003-12-08  Martin Baulig  <martin@ximian.com>
12323
12324         * typemanager.cs (TypeManager.GetReferenceType): Call
12325         `Type.MakeByRefType ()'.
12326
12327 2003-12-08  Martin Baulig  <martin@ximian.com>
12328
12329         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12330         just has some special meaning in some situations.  For instance,
12331         it is allowed to use `where' as the name of a variable etc.
12332
12333 2003-12-04  Martin Baulig  <martin@ximian.com>
12334
12335         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12336         `Type.MakeArrayType()' for array types.
12337
12338 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12339
12340         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12341         debugging message.
12342
12343         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12344         corlib to compile.
12345
12346 2003-11-16  Martin Baulig  <martin@ximian.com>
12347
12348         * codegen.cs (EmitContext.IsGeneric): Removed.
12349
12350         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12351         ResolveGeneric() on the DeclSpace.
12352
12353 2003-11-16  Martin Baulig  <martin@ximian.com>
12354
12355         * generic.cs (TypeArguments.Resolve):
12356         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12357         `ResolveType()' on it to get the Type.
12358
12359 2003-11-15  Martin Baulig  <martin@ximian.com>
12360
12361         * generic.cs (ConstructedType.GetInterfaces): Override this.
12362
12363 2003-11-14  Martin Baulig  <martin@ximian.com>
12364
12365         * interface.cs (Interface.DefineType): Define all type parameters
12366         before adding the interfaces we inherit.
12367
12368 2003-11-11  Martin Baulig  <martin@ximian.com>
12369
12370         * generic.cs (ConstructedType.ResolveType): Always call
12371         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12372
12373 2003-11-10  Martin Baulig  <martin@ximian.com>
12374
12375         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12376         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12377         calling `ResolveType()' on them, directly assign their `Type'.
12378
12379 2003-11-08  Martin Baulig  <martin@ximian.com>
12380
12381         * generic.cs (ConstructedType): Override `IsClass' etc.
12382
12383 2003-11-08  Martin Baulig  <martin@ximian.com>
12384
12385         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12386         return value and the `out parent' parameter.
12387         (TypeContainer.DefineType): Moved the CS0644 check into
12388         GetClassBases().  Don't pass the interface types to the
12389         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12390         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12391
12392         * ecore.cs (TypeExpr.IsAttribute): New property.
12393         (TypeExpr.GetInterfaces): New method.
12394
12395         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12396         TypeExpr instead of a Type.
12397         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12398         (Interface.DefineType): Don't pass the interface types to the
12399         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12400         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12401
12402         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12403         instead of a `Type[]'.
12404         (TypeManager.RegisterBuilder): Likewise.
12405         (TypeManager.AddUserInterface): Likewise.
12406         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12407         `Type[]' and also return a `TypeExpr[]'.
12408         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12409
12410 2003-11-08  Martin Baulig  <martin@ximian.com>
12411
12412         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12413         Expression.     
12414
12415 2003-11-08  Martin Baulig  <martin@ximian.com>
12416
12417         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12418         TypeManager.ResolveExpressionTypes().
12419
12420         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12421         instead of an Expression.
12422         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12423         (TypeExpression): New public class; formerly known as `TypeExpr'.
12424
12425         * expression.cs (ComposedCast): Derive from TypeExpr.
12426
12427         * typemanager.cs (TypeManager.system_*_expr): These are now
12428         TypExpr's instead of Expression's.
12429         (TypeManager.ResolveExpressionTypes): New public static function;
12430         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12431         of them.        
12432
12433 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12434
12435         * expression.cs (New.DoResolve): Do not dereference value that
12436         might be a null return.
12437
12438         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12439         sure that the constant value has the right type.  Fixes an
12440         unreported bug, similar to 50425.
12441
12442         * const.cs (Const.LookupConstantValue): Call
12443         ImplicitStandardConversionExists before doing a conversion to
12444         avoid havng the TypeManager.ChangeType do conversions.
12445
12446         Reduced the number of casts used
12447
12448         (Const.ChangeType): New routine to enable reuse of the constant
12449         type changing code from statement.
12450
12451         * typemanager.cs (ChangeType): Move common initialization to
12452         static global variables.
12453
12454         Fixes #50425.
12455
12456         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12457         every value type to go through, even if it was void.  Fix that. 
12458
12459         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12460         character of the define, and the is_identifier_part_character for
12461         the rest of the string.
12462
12463 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12464
12465         * expression.cs (UnaryMutator.EmitCode): When I updated
12466         LocalVariableReference.DoResolve, I overdid it, and dropped an
12467         optimization done on local variable references.
12468
12469 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12470
12471         * ecore.cs: Convert the return from Ldlen into an int.
12472
12473 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12476         the accessibility, this is a special case for toplevel non-public
12477         classes (internal for instance).
12478
12479 2003-10-20  Nick Drochak <ndrochak@gol.com>
12480
12481         * ecore.cs: Fix typo and build.  Needed another right paren.
12482
12483 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12484
12485         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12486         `internal' case regular and protected, but not allowing protected
12487         to be evaluated later.  Bug 49840
12488
12489 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12492         to kb.Nlast, and not the kb.nFirst to isolate the switch
12493         statement.
12494
12495         Extract the underlying type, so enumerations of long/ulong are
12496         treated like long/ulong.
12497
12498 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12499
12500         * expression.cs (New): Overload the meaning of RequestedType to
12501         track the possible creation of the NewDelegate type, since
12502         DoResolve is invoked more than once for new constructors on field
12503         initialization.
12504
12505         See bugs: #48800 and #37014
12506
12507         * cs-parser.jay (declare_local_constants): Take an arraylist
12508         instead of a single constant.
12509
12510         (local_constant_declaration): It should take a
12511         constant_declarators, not a constant_declarator.  Fixes 49487
12512
12513         * convert.cs: Fix error report.
12514
12515 2003-10-13 Jackson Harper <jackson@ximian.com>
12516
12517         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12518         bug #49611
12519         
12520 2003-11-03  Martin Baulig  <martin@ximian.com>
12521
12522         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12523         `out bool has_type_arg'; if set, we need to pass the type to
12524         ig.Emit().
12525         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12526         Stelem_Any/Ldelem_Any for generic parameters.   
12527
12528 2003-11-02  Martin Baulig  <martin@ximian.com>
12529
12530         * expression.cs (Invocation.EmitCall): Use
12531         `TypeManager.IsValueType()' to check whether it's a value type.
12532         Don't set `struct_call' when calling a method on a type parameter.
12533
12534 2003-11-02  Martin Baulig  <martin@ximian.com>
12535
12536         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12537         and removed the TypeBuilder argument.
12538
12539         * typemanager.cs (TypeManager.IsValueType): Return
12540         `t.IsGenericParameter || t.IsValueType'.
12541
12542 2003-10-25  Martin Baulig  <martin@ximian.com>
12543
12544         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12545         call ConstructedType.Resolve() on it.
12546
12547         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12548
12549 2003-10-25  Martin Baulig  <martin@ximian.com>
12550
12551         * class.cs (TypeContainer.GetClassBases): Changed
12552         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12553         CS8214 reporting here.
12554         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12555         instead of a `Type' for our parent.  In case of a recursive
12556         declaration (see tests/gen-23.cs for an example), our parent is a
12557         ConstructedType and it doesn't have its type set.  So, first
12558         create our own TypeBuilder, then call constructed.Resolve() to get
12559         the parent's type and finally TypeBuilder.SetParent() it.
12560
12561         * ecore.cs (TypeExpr.Name): New public virtual property.
12562
12563         * generic.cs
12564         (ConstructedType): We're now a TypeExpr and not just an Expression.
12565         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12566         arguments here; this is done later.
12567         (ConstructedType.Resolve): New public method to resolve the type
12568         arguments and bind them.
12569
12570 2003-10-21  Martin Baulig  <martin@ximian.com>
12571
12572         * convert.cs: Use `TypeManager.IsValueType' instead of
12573         'type.IsValueType' everywhere.
12574
12575         * typemanager.cs (TypeManager.IsValueType): Return true for type
12576         parameters.  The reason for this is that we need to box a type
12577         parameter when converting it to a reference type.
12578
12579         * cs-parser.jay: Added support for default value expressions.
12580
12581         * generics.cs (DefaultValueExpression): New public class.       
12582
12583 2003-10-17  Martin Baulig  <martin@ximian.com>
12584
12585         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12586         TypeContainer so we can also use this for Interfaces.
12587         (TypeParameter.Resolve): Likewise.
12588
12589         * interface.cs (Interface.DefineType): Added support for generic
12590         interfaces.
12591
12592         * cs-parser.jay: Added support for generic structs and interfaces.
12593
12594 2003-10-17  Martin Baulig  <martin@ximian.com>
12595
12596         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12597         call generic methods :-)
12598
12599 2003-10-16  Martin Baulig  <martin@ximian.com>
12600
12601         * cs-parser.jay (namespace_or_type_name): Only create a
12602         GenericMemberAccess if we actually have type arguments.
12603
12604 2003-10-13  Martin Baulig  <martin@ximian.com>
12605
12606         * class.cs (Method.Define): If we're a generic method, call
12607         TypeBuilder.DefineGenericMethod () before resolving
12608         the parameters.
12609         (MethodData): Added .ctor which takes an additional MethodBuilder
12610         argument; this is used for generic methods.
12611         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12612         we already have a MethodBuilder.
12613
12614 2003-10-10  Martin Baulig  <martin@ximian.com>
12615
12616         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12617         instead of a `DeclSpace'.  This is used for generic methods.
12618
12619         * cs-parser.jay (method_header): Added support for generic
12620         methods; create a `GenericMethod' instance and pass it to the
12621         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12622         parameters and locals.
12623
12624         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12625         since we already have the location.  Check whether we're a generic
12626         type declaration or a generic method and create the correct type
12627         parameter.
12628
12629         * generic.cs (TypeParameter.DefineMethod): New public method.
12630         (GenericMethod): New public class; derives from DeclSpace and is
12631         used for generic methods.       
12632
12633 2003-10-09  Martin Baulig  <martin@ximian.com>
12634
12635         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12636         to the .ctor.
12637         (MethodCore.DoDefineParameters): Removed the TypeContainer
12638         argument; use the DeclSpace which was passed to the .ctor instead.
12639         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12640         TypeContainer; we only need a DeclSpace here.
12641
12642 2003-10-09  Martin Baulig  <martin@ximian.com>
12643
12644         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12645         to the .ctor.
12646         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12647         EmitContext's .ctor.    
12648
12649 2003-10-09  Martin Baulig  <martin@ximian.com>
12650
12651         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12652         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12653         AsAccessible(), moved them as well.
12654
12655         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12656
12657 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12658
12659         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12660         generation for >=, as spotted by Paolo, bug 48679.  
12661         Patch from David Waite.
12662
12663         * cs-tokenizer.cs: Add handling for #pragma.
12664
12665         * cs-parser.jay: Allow for both yield and yield return in the
12666         syntax.  The anti-cobolization of C# fight will go on!
12667
12668         * class.cs (TypeBuilder.DefineType): Catch error condition here
12669         (Parent.DefineType erroring out and returning null).
12670
12671         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12672         coping with enumerations variables, we were mistakenly processing
12673         them as a regular value type instead of built-in types.  Fixes the
12674         bug #48063
12675
12676         * typemanager.cs (IsBuiltinOrEnum): New method.
12677
12678 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * cs-parser.jay: Upgrade: yield now needs the return clause.
12681
12682 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12683
12684         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12685
12686 2003-09-29  Martin Baulig  <martin@ximian.com>
12687
12688         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12689         inflated generic methods.
12690
12691         * generics.cs (ConstructedType): Distinguish between open and
12692         closed constructed types; correctly resolve the arguments.
12693
12694 2003-09-22  Martin Baulig  <martin@ximian.com>
12695
12696         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12697         all type arguments meet their constraints.
12698
12699 2003-09-19  Martin Baulig  <martin@ximian.com>
12700
12701         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12702         `MemberCache parent' argument.  Normally, an interface doesn't
12703         have a parent type except System.Object, but we use this in gmcs
12704         for generic type parameters.
12705
12706 2003-09-18  Martin Baulig  <martin@ximian.com>
12707
12708         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12709         on `type.IsInterface'; don't check whether the type has a parent
12710         to determine whether it's an interface.
12711
12712 2003-09-17  Martin Baulig  <martin@ximian.com>
12713
12714         * generic.cs (ConstructedType.ToString): Always use `name' as the
12715         type name.
12716
12717 2003-09-15  Martin Baulig  <martin@ximian.com>
12718
12719         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12720
12721         * generic.cs (Constraints.Resolve): New public method; this is
12722         called to resolve the constraint types and to check whether all
12723         the constraints are correct.
12724         (Constraints.Types): New public property.
12725         (TypeParameter.Resolve): New public method; resolves all the
12726         type's constraints.
12727
12728         * class.cs (TypeContainer.DefineType): Call
12729         TypeParameter.Resolve() before actually defining the type.
12730
12731 2003-09-15  Martin Baulig  <martin@ximian.com>
12732
12733         * class.cs (TypeContainer.DefineType): Added an error flag to
12734         avoid reporting duplicate CS0146's ("class definition is
12735         circular.").
12736
12737         * driver.cs (Driver.MainDriver): Abort if
12738         RootContext.ResolveTree() reported any errors.
12739
12740 2003-09-07  Martin Baulig  <martin@ximian.com>
12741
12742         * report.cs (Error, Warning): Added overloaded versions which take
12743         a `params object[] args' and call String.Format().
12744
12745 2003-09-07  Martin Baulig  <martin@ximian.com>
12746
12747         * decl.cs (DeclSpace..ctor): Don't call
12748         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12749         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12750         (DeclSpace.RecordDecl): New method.
12751
12752         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12753
12754 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12755
12756         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12757         value attributes to be applied to ParameterBuilders.
12758
12759         * class.cs (MethodCore.LabelParameters): Make static and more
12760         generic so that it can be used from other places - like interface
12761         methods, for instance.
12762
12763         * interface.cs (Interface.Emit): Call LabelParameters before
12764         emitting attributes on the InterfaceMethod.
12765
12766 2003-09-07  Martin Baulig  <martin@ximian.com>
12767
12768         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12769         if the number of type parameters doesn't match.
12770
12771 2003-09-04  Martin Baulig  <martin@ximian.com>
12772
12773         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12774         for arrays of generic type params (ie. `!0[]').
12775
12776 2003-09-04  Martin Baulig  <martin@ximian.com>
12777
12778         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12779         for the moment.
12780
12781 2003-09-04  Martin Baulig  <martin@ximian.com>
12782
12783         * decl.cs (DeclSpace.LookupGeneric): New method.
12784         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12785         moment.
12786
12787         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12788         argument, not just a string.
12789         (TypeParameter.Define): New public method; this is called to
12790         actually define the generic parameter; after this, you can use the
12791         new `Type' property to get the type.
12792
12793 2003-09-04  Martin Baulig  <martin@ximian.com>
12794
12795         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12796         is now an ArrayList; initialize the result of the `TypeParameters'
12797         property here.
12798         (DeclSpace.GetGenericData): Removed.
12799         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12800         implement this in a different way.
12801         (DeclSpace.GetTypeParameters): Removed; there's now a
12802         `TypeParameters' property.
12803         (DeclSpace.TypeParameters): New public property.
12804
12805         * generic.cs (Constraints): Make this class public.
12806         (TypeParameter): New public class.
12807
12808 2003-09-04  Martin Baulig  <martin@ximian.com>
12809
12810         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12811         generic parameters.
12812
12813         * class.cs (TypeContainer.DefineType): Call
12814         TypeBuilder.DefineGenericParameter () on all generic parameters if
12815         this is a generic type.
12816
12817 2003-08-28  Martin Baulig  <martin@ximian.com>
12818
12819         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12820         sample-stack.il".
12821
12822         * sample-hello.cs: Compile this with gmcs: "gmcs
12823         /r:sample-stack.dll sample-hello.cs".
12824
12825 2003-08-28  Martin Baulig  <martin@ximian.com>
12826
12827         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12828         the parameters to the generic type.
12829
12830 2003-08-28  Martin Baulig  <martin@ximian.com>
12831
12832         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12833
12834 2003-08-28  Martin Baulig  <martin@ximian.com>
12835
12836         * cs-parser.jay (opt_type_argument_list): Use
12837         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12838         (primary_expression): Replace `qualified_identifier' with `type_name'.
12839         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12840
12841         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12842         parser to check whether it is syntactically a type parameter list;
12843         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12844         this case.
12845
12846 2003-08-26  Martin Baulig  <martin@ximian.com>
12847
12848         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12849         resolving aliases; fixes #47927.
12850
12851 2003-08-26  Martin Baulig  <martin@ximian.com>
12852
12853         * statement.cs (Using.DoResolve): This is internally emitting a
12854         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12855         do not always return.  Fixes #47681.
12856
12857 2003-08-26  Martin Baulig  <martin@ximian.com>
12858
12859         * decl.cs (MemberCore): Moved WarningNotHiding(),
12860         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12861         into MemberBase.
12862         (AdditionResult): Make this nested in DeclSpace.
12863         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12864         argument; call NamespaceEntry.Define() unless we're nested in a
12865         class or struct.
12866
12867         * namespace.cs (Namespace.DefineName): New public function.  This
12868         is called from DeclSpace's .ctor to add 
12869         (Namespace.Lookup): Include DeclSpaces in the lookup.
12870
12871         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12872
12873         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12874
12875 2003-08-25  Martin Baulig  <martin@ximian.com>
12876
12877         * convert.cs (Convert.ExplicitReferenceConversion): When
12878         converting from an interface type to a class, unbox if the target
12879         type is a struct type.  Fixes #47822.
12880
12881 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12882
12883         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12884         #47854.
12885
12886 2003-08-22  Martin Baulig  <martin@ximian.com>
12887
12888         * class.cs (TypeManager.DefineType): When defining a nested type,
12889         call DefineType() on our parent; fixes #47801.
12890
12891 2003-08-22  Martin Baulig  <martin@ximian.com>
12892
12893         * class.cs (MethodData.Define): While checking if a method is an
12894         interface implementation, improve the test a bit more to fix #47654.
12895
12896 2003-08-22  Martin Baulig  <martin@ximian.com>
12897
12898         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12899         correctly; fixes #47722.
12900
12901 2003-08-22  Martin Baulig  <martin@ximian.com>
12902
12903         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12904         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12905
12906         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12907
12908 2003-08-22  Martin Baulig  <martin@ximian.com>
12909
12910         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12911         can only be assigned in static constructors.  Fixes #47161.
12912
12913 2003-08-22  Martin Baulig  <martin@ximian.com>
12914
12915         Rewrote and improved the flow analysis code.
12916
12917         * flowbranching.cs (FlowBranching): Make this class abstract.
12918         (FlowBranching.CreateBranching): New static function to create a
12919         new flow branching.
12920         (FlowBranchingBlock, FlowBranchingException): New classes.
12921         (FlowBranching.UsageVector.Type): New public readonly field.
12922         (FlowBranching.UsageVector.Breaks): Removed the setter.
12923         (FlowBranching.UsageVector.Returns): Removed the setter.
12924         (FlowBranching.UsageVector): Added Break(), Return(),
12925         NeverReachable() and Throw() methods to modify the reachability.
12926         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12927         done by FlowBranching.Merge().
12928         (FlowBranching.UsageVector.MergeChild): New method; merges the
12929         merge result into the current vector.
12930         (FlowBranching.Merge): New abstract method to merge a branching.
12931
12932 2003-08-12  Martin Baulig  <martin@ximian.com>
12933
12934         * expression.cs (Indirection.CacheTemporaries): Create the
12935         LocalTemporary with the pointer type, not its element type.
12936
12937 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12938
12939         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12940         token was a keyword or not.
12941
12942         Add `error' options where an IDENTIFIER was expected;  Provide
12943         CheckToken and CheckIdentifierToken convenience error reporting
12944         functions. 
12945
12946         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12947
12948         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12949         NameSpaceEntry NameSpaceEntry.
12950
12951         (LookupInterfaceOrClass): Avoid creating a full qualified name
12952         from namespace and name: avoid doing lookups when we know the
12953         namespace is non-existant.   Use new Tree.LookupByNamespace which
12954         looks up DeclSpaces based on their namespace, name pair.
12955
12956         * driver.cs: Provide a new `parser verbose' to display the
12957         exception thrown during parsing.  This is turned off by default
12958         now, so the output of a failure from mcs is more graceful.
12959
12960         * namespace.cs: Track all the namespaces defined in a hashtable
12961         for quick lookup.
12962
12963         (IsNamespace): New method
12964
12965 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12966
12967         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12968         we know that we need to concatenate (full typename can never be
12969         null). 
12970
12971         * class.cs: ditto.
12972
12973         * statement.cs: Use a bitfield;  Do not initialize to null things
12974         which are done by the constructor by default.
12975
12976         * cs-parser.jay: bug fix, parameter was 4, not 3.
12977
12978         * expression.cs: Just use the property;
12979
12980         * statement.cs: No need for GetVariableInfo method.
12981
12982 2003-08-08  Martin Baulig  <martin@ximian.com>
12983
12984         * flowanalysis.cs (FlowReturns): This is now nested in the
12985         `FlowBranching' class.
12986         (MyBitVector): Moved this here from statement.cs.
12987         (FlowBranching.SiblingType): New enum type.
12988         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12989
12990 2003-08-07  Martin Baulig  <martin@ximian.com>
12991
12992         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12993         `FlowBranching' class and called `BranchingType'.
12994
12995 2003-08-07  Martin Baulig  <martin@ximian.com>
12996
12997         * flowanalysis.cs: Moved all the control flow analysis code into
12998         its own file.
12999
13000 2003-08-07  Martin Baulig  <martin@ximian.com>
13001
13002         * assign.cs (Assign.DoResolve): `target' must either be an
13003         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13004         #37319.
13005
13006 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13007
13008         * expression.cs (BinaryMethod): This kind of expression is created by the
13009         Binary class if it determines that the operator has to be handled
13010         by a method.
13011
13012         (BinaryDelegate): This kind of expression is created if we are
13013         dealing with a + or - operator on delegates.
13014
13015         (Binary): remove method, argumetns, and DelegateOperator: when
13016         dealing with methods, 
13017
13018         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13019
13020         * statement.cs (Block): use bitfields for the three extra booleans
13021         we had in use.   Remove unused topblock parameter.
13022
13023         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13024
13025         * assign.cs: Drop extra unneeded tests.
13026
13027 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13028
13029         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13030
13031         * statement.cs (Foreach): Use VariableStorage instead of
13032         LocalBuilders.   
13033
13034         * codegen.cs (VariableStorage): New class used by clients that
13035         require a variable stored: locals or fields for variables that
13036         need to live across yield.
13037
13038         Maybe provide a convenience api for EmitThis+EmitLoad?
13039
13040         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13041         these bad boys.
13042
13043 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13044
13045         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13046         RemapParameterLValue): New methods that are used to turn a
13047         precomputed FieldInfo into an expression like this:
13048
13049                 instance.FieldInfo
13050
13051         The idea is to use this instead of making LocalVariableReference
13052         have more than one meaning.
13053
13054         * cs-parser.jay: Add error production to BASE.
13055
13056         * ecore.cs: Deal with TypeManager.GetField returning null, which
13057         is now a valid return value.
13058
13059         (FieldExprNoAddress): New expression for Fields whose address can
13060         not be taken.
13061
13062         * expression.cs (LocalVariableReference): During the resolve
13063         phases, create new expressions if we are in a remapping context.
13064         Remove code that dealt with remapping here.
13065
13066         (ParameterReference): same.
13067
13068         (ProxyInstance): New expression, like the `This' expression, but
13069         it is born fully resolved.  We know what we are doing, so remove
13070         the errors that are targeted to user-provided uses of `this'.
13071
13072         * statement.cs (Foreach): our variable is now stored as an
13073         Expression;  During resolution, follow the protocol, dont just
13074         assume it will return this.
13075
13076 2003-08-06  Martin Baulig  <martin@ximian.com>
13077
13078         * support.cs (SeekableStreamReader.cs): New public class.
13079
13080         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13081         SeekableStreamReader instead of the normal StreamReader.
13082
13083 2003-08-04  Martin Baulig  <martin@ximian.com>
13084
13085         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13086         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13087         deambiguate casts and delegate invocations.
13088         (parenthesized_expression): Use the new tokens to ensure this is
13089         not a cast of method invocation.
13090
13091         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13092         when reading a `)' and Deambiguate_CloseParens () was previously
13093         called.
13094
13095         * expression.cs (ParenthesizedExpression): New class.  This is
13096         just used for the CS0075 test.
13097         (Binary.DoResolve): Check for CS0075.   
13098
13099 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13100
13101         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13102         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13103         reference comparison.
13104
13105         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13106         examine the ReturnType for equality - this is necessary in the
13107         cases of implicit and explicit operators whose signature also
13108         includes the return type.
13109
13110 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13111
13112         * namespace.cs: Cache the result of the namespace computation,
13113         instead of computing it every time.
13114
13115 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13116
13117         * decl.cs: Use a global arraylist that we reuse over invocations
13118         to avoid excesive memory consumption.  Reduces memory usage on an
13119         mcs compile by one meg (45 average).
13120
13121         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13122         private, work around that.
13123
13124 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13125
13126         * literal.cs (IntLiteral): Define Zero and One static literals. 
13127
13128         * cs-parser.jay (integer_literal): use static literals to reduce
13129         memory usage for the most used literals (0, 1 and -1).  211kb
13130         reduced in memory usage.
13131
13132         Replace all calls to `new ArrayList' with `new
13133         ArrayList(4)' which is a good average number for most allocations,
13134         and also requires only 16 bytes of memory for its buffer by
13135         default. 
13136
13137         This reduced MCS memory usage in seven megabytes for the RSS after
13138         bootstrapping.
13139
13140 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13141
13142         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13143         handle params methods the correct way by forming only one
13144         applicable set with params and normal methods in them. Earlier we
13145         were looking at params methods only if we found no normal methods
13146         which was not the correct thing to do.
13147
13148         (Invocation.BetterFunction): Take separate arguments indicating
13149         when candidate and the best method are params methods in their
13150         expanded form.
13151
13152         This fixes bugs #43367 and #46199.
13153
13154         * attribute.cs: Documentation updates.
13155
13156         (CheckAttribute): Rename to CheckAttributeTarget.
13157         (GetValidPlaces): Rename to GetValidTargets.
13158
13159         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13160         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13161
13162         Fixes bug #44468.
13163
13164 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13165
13166         * codegen.cs: Compute IsGeneric correctly.
13167
13168         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13169         resolution. 
13170
13171         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13172         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13173         regressions, and I was chasing more bugs than I required.
13174
13175         * interface.cs: Use expressions for base type names (like classes
13176         and structs have been doing for a while now), and resolve that.
13177         This patch should probably go into head as well.
13178
13179         This makes it one less user of FindType.
13180
13181 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13182
13183         This compiler can not self host currently.  Need to fix that.
13184         
13185         * Makefile: compile to `gmcs.exe'
13186
13187         * driver.cs: Turn on v2 by default on gmcs.
13188
13189         * generic.cs (ConstructedType): Does no longer take a container
13190         type argument;  That will be taken care of later.
13191
13192         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13193         Use SimpleName to resolve for now, so we can continue the work on
13194         the parser, until we get Type.GetType that understands generics.
13195
13196         (ConstructedType.ToString): Implement
13197
13198         (TypeArguments.Resolve): Resolve the child expressions as types. 
13199         
13200         * cs-parser.jay: Rename interface_constraints to
13201         type_parameter_constraints
13202
13203         (namespace_or_type_name): Only use constructed types for the basic
13204         construction, we will deal with identifier<...> later.
13205
13206         (type/type_name): No longer call DecomposeQI, as
13207         namespace_or_type_name is always decoded now.
13208         
13209 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13210
13211         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13212         closely: we eliminate methods in base types when we have an
13213         applicable method in a top-level type.
13214
13215         Please see section 14.5.5.1 for an exact description of what goes
13216         on. 
13217
13218         This fixes bug #45127 and a host of other related to corlib compilation.
13219
13220         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13221         array is the method corresponding to the top-level type (this is
13222         because of the changes made to icall.c) so we change this
13223         accordingly.
13224
13225         (MethodGroupExpr.Name): This too.
13226
13227         * typemanager.cs (GetElementType): New method which does the right
13228         thing when compiling corlib. 
13229
13230         * everywhere: Make use of the above in the relevant places.
13231
13232 2003-07-22  Martin Baulig  <martin@ximian.com>
13233
13234         * cs-parser.jay (invocation_expression): Moved
13235         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13236         `cast_expression', but create a InvocationOrCast which later
13237         resolves to either an Invocation or a Cast.
13238
13239         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13240         method; call this before EmitStatement() to make sure that this
13241         expression can be used as a statement.
13242
13243         * expression.cs (InvocationOrCast): New class; resolves to either
13244         an Invocation or a Cast.
13245
13246         * statement.cs (StatementExpression): Call ResolveStatement() on
13247         the ExpressionStatement before emitting it.
13248
13249 2003-07-21  Martin Baulig  <martin@ximian.com>
13250
13251         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13252         `ref' and `out' attributes match; fixes #46220.
13253         (MemberAccess.ResolveMemberAccess): You can't reference a type
13254         through an expression; fixes #33180.
13255         (Indexers.GetIndexersForType): Don't return the indexers from
13256         interfaces the class implements; fixes #46502.
13257
13258 2003-07-21  Martin Baulig  <martin@ximian.com>
13259
13260         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13261         CS0661 checks; fixes bug #30442.
13262
13263 2003-07-21  Martin Baulig  <martin@ximian.com>
13264
13265         * decl.cs (AdditionResult): Added `Error'.
13266
13267         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13268
13269         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13270         cs0031.cs actually work.
13271
13272  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13273  
13274         * cs-parser.jay (namespace_name): do not use
13275         namespace_or_type_name, use qualified_identifier, because
13276         namespace_or_type_name will soon return a composed expression
13277         instead of a string.
13278  
13279         (namespace_or_type_name): Instead of returning a string, now this
13280         production returns an expression.
13281  
13282         * codegen.cs (EmitContext): Setup IsGeneric property based on
13283         whether our DeclSpace is generic, our the method is generic.
13284  
13285         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13286         the method is generic.
13287  
13288         * cs-parser.jay (type_arguments, opt_type_argument_list,
13289         type_parameters, type_parameter_list, opt_type_parameter_list,
13290         type_parameter,, opt_type_parameter_constraints_clauses,
13291         type_parameter_constraints_clauses,
13292         type_parameter_constraint_clause, type_parameter_constraint,
13293         interface_constraints): Add new production
13294  
13295         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13296         DeclSpace is generic or not.
13297  
13298         (DeclSpace.SetParameterInfo): New routine, used to set the
13299         parameter info for a type.
13300  
13301         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13302         returns a GenericTypeExpr
13303  
13304         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13305         generic, lookup the generic argument.
13306  
13307         * attribute.cs: Do not allow TypeParameterExpressions in
13308         Attributes.
13309  
13310         * class.cs: Do not allow the Main method to be defined in a
13311         Generic container.
13312  
13313         * expression.cs (SizeOf): Do not allow generic types to be used as
13314         arguments to sizeof.
13315  
13316         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13317         it: whether a type is generic or not.  Only works for types we are
13318         currently building for now.
13319         
13320 2003-07-20  Martin Baulig  <martin@ximian.com>
13321
13322         * namespace.cs: Fixed that bug which caused a crash when compiling
13323         the debugger's GUI.
13324
13325 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * typemanager.cs (LookupTypeReflection): Never expose types which
13328         are NotPublic, NestedPrivate, NestedAssembly, or
13329         NestedFamANDAssem.  We used to return these, and later do a check
13330         that would report a meaningful error, but the problem is that we
13331         would not get the real match, if there was a name override.
13332
13333 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13334
13335         * namespace.cs (Namespace, Name): Do not compute the namespace
13336         name dynamically, compute it in the constructor.  This reduced
13337         memory usage by 1697 KB.
13338
13339         * driver.cs: Use --pause to pause at the end.
13340
13341 2003-07-17  Peter Williams  <peter@newton.cx>
13342
13343         * Makefile: Change the name of the test target so that it doesn't
13344         conflict with the recursive test target.
13345
13346 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13347
13348         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13349         AddressOf): Do not use EmitThis, that was wrong, use the actual
13350         this pointer.
13351
13352 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * class.cs (MethodData.Define): While checking if a method is an
13355         interface implementation, improve the test: If we are not public
13356         (use new test here: use the computed MethodAttributes directly,
13357         instead of the parsed modifier flags) check if the `implementing'
13358         method comes from an interface or not.
13359
13360         * pending.cs (VerifyPendingMethods): Slightly better error
13361         message.
13362
13363         * makefile: add test target that does the mcs bootstrap.
13364
13365 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13366
13367         * interface.cs (Define): Do nothing here since there are no
13368         members to populate etc. Move the attribute emission out of here
13369         since this was just totally the wrong place to put it. Attribute
13370         application happens during the 'Emit' phase, not in the 'Define'
13371         phase.
13372
13373         (Emit): Add this method and move the attribute emission here
13374
13375         * rootcontext.cs (EmitCode): Call the Emit method on interface
13376         types too.
13377
13378 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13379
13380         * expression.cs (OverloadResolve): Report error only if Location
13381         is not 'Null' which means that there was a probe going on.
13382
13383 2003-07-14  Martin Baulig  <martin@ximian.com>
13384
13385         * expression.cs (ConditionalLogicalOperator): New public class to
13386         implement user defined conditional logical operators.
13387         This is section 14.11.2 in the spec and bug #40505.
13388
13389 2003-07-14  Martin Baulig  <martin@ximian.com>
13390
13391         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13392
13393 2003-07-14  Martin Baulig  <martin@ximian.com>
13394
13395         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13396
13397         * ecore.cs (IVariable.VerifyFixed): New interface method.
13398
13399         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13400         operator, check whether the variable is actually fixed.  Fixes bug
13401         #36055.  Set a variable definitely assigned when taking its
13402         address as required by the spec.
13403
13404         * statement.cs (LocalInfo.IsFixed): New field.
13405         (LocalInfo.MakePinned): Set `IsFixed' to true.
13406
13407 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13408
13409         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13410         for .ctors, ensure that we only ask for members declared in the
13411         attribute type (BindingFlags.DeclaredOnly).
13412
13413         Fixes bug #43632.
13414
13415         * expression.cs (Error_WrongNumArguments): Report error 1501
13416         correctly the way CSC does.
13417
13418 2003-07-13  Martin Baulig  <martin@ximian.com>
13419
13420         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13421         lookup on the fully qualified name, to make things like "X.X" work
13422         where "X.X" is a fully qualified type name, but we also have a
13423         namespace "X" in the using list.  Fixes #41975.
13424
13425 2003-07-13  Martin Baulig  <martin@ximian.com>
13426
13427         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13428         function. If we're a CompoundAssign, we need to create an embedded
13429         CompoundAssign, not an embedded Assign.
13430         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13431         Fixes #45854.
13432
13433 2003-07-13  Martin Baulig  <martin@ximian.com>
13434
13435         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13436         work to fix bug #46088.
13437
13438 2003-07-13  Ravi Pratap <ravi@ximian.com>
13439
13440         * class.cs (Operator.Emit): Do not emit attributes here - it is
13441         taken care of by the Method class that we delegate too. This takes
13442         care of bug #45876.
13443
13444 2003-07-10  Martin Baulig  <martin@ximian.com>
13445
13446         * expression.cs (TypeOfVoid): New class.
13447         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13448
13449 2003-07-10  Martin Baulig  <martin@ximian.com>
13450
13451         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13452         bug #35957.
13453
13454 2003-07-10  Martin Baulig  <martin@ximian.com>
13455
13456         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13457         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13458
13459         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13460
13461         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13462
13463 2003-07-10  Martin Baulig  <martin@ximian.com>
13464
13465         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13466         of decimal.  Fixes #42850.
13467
13468         NOTE: I also fixed the created byte blob, but this doesn't work on
13469         the MS runtime and csc never produces any byte blobs for decimal
13470         arrays.
13471
13472 2003-07-10  Martin Baulig  <martin@ximian.com>
13473
13474         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13475         structs; fixes #32068.
13476         (Block.AddChildVariableNames): Fixed #44302.
13477
13478 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13479
13480         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13481
13482 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13483
13484         * attribute.cs: And this test is onger needed.
13485
13486 2003-07-08  Martin Baulig  <martin@ximian.com>
13487
13488         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13489         inaccessible types.  Fixes #36313.
13490
13491         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13492
13493         * namespace.cs (NamespaceEntry): Create implicit entries for all
13494         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13495         implicit entries for N1.N2 and N1.
13496
13497 2003-07-08  Martin Baulig  <martin@ximian.com>
13498
13499         Rewrote the handling of namespaces to fix a lot of the issues
13500         wrt. `using' aliases etc.
13501
13502         * namespace.cs (Namespace): Splitted this class into a
13503         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13504
13505         * typemanager.cs (TypeManager.IsNamespace): Removed.
13506         (TypeManager.ComputeNamespaces): Only compute namespaces from
13507         loaded assemblies here, not the namespaces from the assembly we're
13508         currently compiling.
13509
13510 2003-07-08  Martin Baulig  <martin@ximian.com>
13511
13512         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13513
13514 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13515
13516         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13517         already fixed it.  
13518
13519         I thought about the memory savings here, but LookupTypeReflection
13520         is used under already very constrained scenarios.  Compiling
13521         corlib or mcs only exposes one hit, so it would not really reduce
13522         any memory consumption.
13523
13524 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13525
13526         * typemanager.cs: fixes bug #45889 by only adding public types from
13527         other assemblies to the list of known types.
13528
13529 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13530
13531         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13532         on the type we resolved.
13533
13534 2003-07-05  Martin Baulig  <martin@ximian.com>
13535
13536         * pending.cs (PendingImplementation.ParentImplements): Don't
13537         create the proxy if the parent is abstract.
13538
13539         * class.cs (TypeContainer.DefineIndexers): Process explicit
13540         interface implementations first.  Fixes #37714.
13541
13542 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13543
13544         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13545         defined recursively;  but since we modify the input parameters
13546         (left is set to `this' temporarily), we reset this value if the
13547         left_is_explicit is false, which gives the original semantics to
13548         the code.  
13549
13550         * literal.cs (NullPointer): new class used to represent a null
13551         literal in a pointer context.
13552
13553         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13554         type is a pointer, use a NullPointer object instead of a
13555         NullLiteral.   Closes 43687
13556
13557         (ExplicitConversion): Convert pointer values using
13558         the conv opcode to the proper type.
13559
13560         * ecore.cs (New): change ValueTypeVariable property into a method,
13561         that returns whether the valuetype is suitable for being used.
13562
13563         * expression.cs (Binary.DoNumericPromotions): Only return if we
13564         the int constant was a valid uint, and we can return both left and
13565         right as uints.  If not, we continue processing, to trigger the
13566         type conversion.  This fixes 39018.
13567
13568         * statement.cs (Block.EmitMeta): During constant resolution, set
13569         the CurrentBlock property on the emitcontext, so that we resolve
13570         constants propertly.
13571
13572 2003-07-02  Martin Baulig  <martin@ximian.com>
13573
13574         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13575         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13576
13577         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13578         than emitting it here.
13579
13580         * statement.cs: Fixed some more flow analysis bugs.
13581
13582 2003-07-02  Martin Baulig  <martin@ximian.com>
13583
13584         * class.cs (MethodData.Define): When implementing interface
13585         methods, set Final unless we're Virtual.
13586
13587         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13588         check work for interface methods.
13589
13590 2003-07-01  Martin Baulig  <martin@ximian.com>
13591
13592         * ecore.cs (EmitContext.This): Replaced this property with a
13593         GetThis() method which takes a Location argument.  This ensures
13594         that we get the correct error location for a CS0188.
13595
13596 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13597
13598         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13599         ImplicitStandardConversion.
13600
13601         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13602
13603 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13604
13605         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13606         optimization.
13607
13608 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13611         constructors.
13612
13613         (MethodData.Define): Turn off initlocals for unsafe methods.
13614
13615 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13616
13617         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13618         complete;  Fixes #37521.
13619
13620         * delegate.cs: Use Modifiers.TypeAttr to compute the
13621         TypeAttributes, instead of rolling our own.  This makes the flags
13622         correct for the delegates.
13623
13624 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13625
13626         * class.cs (Constructor.Define): Set the private flag for static
13627         constructors as well.
13628
13629         * cs-parser.jay (statement_expression): Set the return value to
13630         null, to avoid a crash when we catch an error.
13631
13632 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13633
13634         * cs-parser.jay: Applied patch from Jackson that adds support for
13635         extern and unsafe modifiers to destructor declarations.
13636
13637         * expression.cs: Report error 21 if the user is trying to index a
13638         System.Array.
13639
13640         * driver.cs: Add an error message, suggested by the bug report.
13641
13642         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13643         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13644
13645 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * namespace.cs: Add some information to reduce FAQs.
13648
13649 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13650
13651         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13652         underlying enumeration types.  Fixes #43915.
13653
13654         * expression.cs: Treat ushort/short as legal values to be used in
13655         bitwise operations.
13656
13657 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13658
13659         * delegate.cs: transfer custom attributes for paramenters from
13660         the delegate declaration to Invoke and BeginInvoke.
13661
13662 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13663
13664         * attribute.cs: handle custom marshalers and emit marshal info
13665         for fields, too.
13666
13667 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13668
13669         * makefile.gnu: Added anonymous.cs to the compiler sources.
13670
13671 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13672
13673         * iterators.cs: Change the name of the proxy class to include two
13674         underscores.
13675
13676         * cs-parser.jay: Update grammar to include anonymous methods.
13677
13678         * anonymous.cs: new file.
13679
13680 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13681
13682         * class.cs (Field.Define): Add missing test for pointers and
13683         safety. 
13684
13685 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13686
13687         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13688         we use the stobj opcode.
13689
13690         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13691         since it wasn't the correct fix. 
13692
13693         It still is puzzling that we are required to use stobj for IntPtr
13694         which seems to be a ValueType.
13695
13696 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13699         during regular simple name resolution.   Now, the trick is that
13700         instead of returning for processing the simplename, we do a
13701         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13702         contextual lookup type).   If a match is found, return that, if
13703         not, return for further composition.
13704
13705         This fixes long-standing 30485.
13706
13707         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13708         using the address to initialize an object, do an Stobj instead of
13709         using the regular Stelem.
13710
13711         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13712         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13713         Because if we are a BaseIndexerAccess that value will be true.
13714         Fixes 43643.
13715
13716         * statement.cs (GotoCase.Resolve): Return after reporting an
13717         error, do not attempt to continue. 
13718
13719         * expression.cs (PointerArithmetic.Emit): If our operand is a
13720         long, convert our constants to match the operand before
13721         multiplying.  Convert to I type before adding.   Fixes 43670.
13722
13723 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13724
13725         * enum.cs (ImplicitConversionExists) : Rename to
13726         ImplicitEnumConversionExists to remove ambiguity. 
13727
13728         * ecore.cs (NullCast): New type of cast expression class which
13729         basically is very similar to EmptyCast with the difference being
13730         it still is a constant since it is used only to cast a null to
13731         something else
13732         (eg. (string) null)
13733
13734         * convert.cs (ImplicitReferenceConversion): When casting a null
13735         literal, we return a NullCast.
13736
13737         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13738         should be around anymore.
13739
13740         The renaming (reported was slightly wrong). Corrections:
13741
13742         ConvertImplicitStandard -> ImplicitConversionStandard
13743         ConvertExplicitStandard -> ExplicitConversionStandard
13744
13745         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13746         before passing them in !
13747
13748         * convert.cs (ImplicitConversionStandard): When comparing for
13749         equal expr and target types, ensure that expr is not a
13750         NullLiteral.
13751
13752         In general, we must not be checking (expr_type ==
13753         target_type) in the top level conversion methods
13754         (ImplicitConversion, ExplicitConversion etc). This checking is
13755         done in the methods that they delegate to.
13756
13757 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13758
13759         * convert.cs: Move Error_CannotConvertType,
13760         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13761         ImplicitNumericConversion, ImplicitConversionExists,
13762         ImplicitUserConversionExists, StandardConversionExists,
13763         FindMostEncompassedType, FindMostSpecificSource,
13764         FindMostSpecificTarget, ImplicitUserConversion,
13765         ExplicitUserConversion, GetConversionOperators,
13766         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13767         TryImplicitIntConversion, Error_CannotConvertImplicit,
13768         ConvertImplicitRequired, ConvertNumericExplicit,
13769         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13770         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13771         its own file.
13772
13773         Perform the following renames:
13774
13775         StandardConversionExists -> ImplicitStandardConversionExists
13776         ConvertImplicit -> ImplicitConversion
13777         ConvertImplicitStandard -> ImplicitStandardConversion
13778         TryImplicitIntConversion -> ImplicitIntConversion
13779         ConvertImplicitRequired -> ImplicitConversionRequired
13780         ConvertNumericExplicit -> ExplicitNumericConversion
13781         ConvertReferenceExplicit -> ExplicitReferenceConversion
13782         ConvertExplicit -> ExplicitConversion
13783         ConvertExplicitStandard -> ExplicitStandardConversion
13784
13785 2003-05-19  Martin Baulig  <martin@ximian.com>
13786
13787         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13788         (TypeInfo): Added support for structs having structs as fields.
13789
13790         * ecore.cs (FieldExpr): Implement IVariable.
13791         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13792         VariableInfo for the field.
13793
13794 2003-05-18  Martin Baulig  <martin@ximian.com>
13795
13796         * expression.cs (This.DoResolve): Report a CS0027 if we're
13797         emitting a field initializer.
13798
13799 2003-05-18  Martin Baulig  <martin@ximian.com>
13800
13801         * expression.cs (This.ResolveBase): New public function.
13802         (This.DoResolve): Check for CS0188.
13803
13804         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13805         This.Resolve().
13806
13807         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13808         `instance_expression' to null if we don't have any non-static
13809         methods.
13810
13811 2003-05-18  Martin Baulig  <martin@ximian.com>
13812
13813         Reworked the way how local variables and parameters are handled by
13814         the flow analysis code.
13815
13816         * statement.cs (TypeInfo, VariableMap): New public classes.
13817         (VariableInfo): New public class.  This is now responsible for
13818         checking whether a variable has been assigned.  It is used for
13819         parameters and local variables.
13820         (Block.EmitMeta): Take the InternalParameters as argument; compute
13821         the layout of the flow vectors here.
13822         (Block.LocalMap, Block.ParameterMap): New public properties.
13823         (FlowBranching): The .ctor doesn't get the InternalParameters
13824         anymore since Block.EmitMeta() now computes the layout of the flow
13825         vector.
13826         (MyStructInfo): This class is now known as `StructInfo' and nested
13827         in `TypeInfo'; we don't access this directly anymore.
13828
13829         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13830         property and removed IsAssigned(), IsFieldAssigned(),
13831         SetAssigned() and SetFieldAssigned(); we now call them on the
13832         VariableInfo so we don't need to duplicate this code everywhere.
13833
13834         * expression.cs (ParameterReference): Added `Block block' argument
13835         to the .ctor.
13836         (LocalVariableReference, ParameterReference, This): The new
13837         VariableInfo class is now responsible for all the definite
13838         assignment stuff.
13839
13840         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13841         IsParameterAssigned, SetParameterAssigned): Removed.
13842
13843 2003-05-18  Martin Baulig  <martin@ximian.com>
13844
13845         * typemanager.cs (InitCoreTypes): Try calling
13846         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13847         the 3-args-version.  Corlib now also needs our `void_type'.
13848         (GetMethod): Added overloaded version which takes an optional
13849         `bool report_errors' to allow lookups of optional methods.
13850
13851 2003-05-12  Martin Baulig  <martin@ximian.com>
13852
13853         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13854         only used for locals and not for parameters.
13855
13856 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13857
13858         * support.cs (InternalParameters.ParameterType): Return the
13859         ExternalType of the parameter.
13860
13861         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13862         they were unused.
13863
13864 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13865
13866         * class.cs (MethodData.Define): Do not set the `newslot' on
13867         interface members, if they are also flagged as "override".
13868
13869         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13870         better code for ++i and i++.  This only works for static fields
13871         and local variables.
13872
13873         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13874         want to pull the DeclSpace out of the builder_to_declspace instead
13875         of the TypeBuilder (like in TypeContainer.FindMembers).
13876
13877         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13878         instead of LookupTypeContainer.  Fixes the crash on .NET for
13879         looking up interface members.
13880
13881         * const.cs: Create our own emit context during the Definition
13882         stage, so that constants are evaluated in the proper context, when
13883         a recursive definition happens.
13884
13885 2003-05-11  Martin Baulig  <martin@ximian.com>
13886
13887         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13888         new block for a switch section.
13889         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13890         the adding/lookup in the switch block.  Fixes #39828.
13891
13892 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13893
13894         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13895         functionality: I needed to convert the data after I had performed
13896         the add/sub operation into the operands type size.
13897
13898         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13899         pass the type for the box operation, otherwise the resulting
13900         object would have been of type object.
13901
13902         (BoxedCast): Add constructor to specify the type to box as.
13903
13904 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * iterators.cs: I was reusing the `count' variable inadvertently,
13907         take steps to not allow this to happen.
13908
13909 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13912         by creating an array at the point where the params starts and
13913         putting all those arguments there, then adjusting the size of the
13914         array.
13915
13916 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13917
13918         * expression.cs (New.AddressOf): Implement interface
13919         IMemoryLocation.  This is used when the `new' operator is used in
13920         the context of an invocation to a method on a value type.
13921
13922         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13923         example. 
13924
13925         * namespace.cs: Also check the using aliases here.
13926
13927         * driver.cs: Move the test for using validity after the types have
13928         been entered, so we do a single pass that also includes the using
13929         aliases. 
13930
13931         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13932         in the regular case.   CreateSiblingForFinally is doing extra
13933         error checking.
13934
13935         * attribute.cs (GetAttributeArgumentExpression): Store the result
13936         on an out value, and use the return value to indicate failure
13937         instead of using null (which is a valid return for Constant.GetValue).
13938
13939         * statement.cs: Perform the analysis flow for the increment
13940         portion after the statement, because this will be the real flow of
13941         execution.  Fixes #42385
13942
13943         * codegen.cs (EmitContext.EmitArgument,
13944         EmitContext.EmitStoreArgument): New helper functions when the
13945         RemapToProxy flag is set.
13946
13947         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13948         function.
13949
13950         Add support for remapping parameters. 
13951
13952         * iterators.cs: Propagate parameter values;  Store parameter
13953         values in the proxy classes.
13954
13955 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13958         need a proxy reference;  I do not know what I was thinking
13959
13960         * cs-parser.jay (constructor_initializer): catch another error,
13961         and display nice message.
13962
13963         (field_declaration): catch void field declaration
13964         to flag a better error. 
13965
13966         * class.cs (MemberBase.CheckBase): Report an error instead of a
13967         warning if a new protected member is declared in a struct. 
13968         (Field.Define): catch the error of readonly/volatile.
13969
13970         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13971
13972         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13973         volatile variable is taken
13974
13975 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * statement.cs (Fixed.Resolve): Report an error if we are not in
13978         an unsafe context.
13979
13980 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * typemanager.cs: reuse the code that handles type clashes for
13983         delegates and enumerations.
13984
13985         * class.cs (Report28): Always report.
13986
13987         * expression.cs (EncodeAsAttribute): Allow nulls here.
13988
13989 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13990
13991         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13992         the functionality for testing whether an expression is valid for
13993         an attribute here.  Also handle the case of arrays of elements
13994         being stored. 
13995
13996         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13997         encoding a linear array into an array of objects that are suitable
13998         to be passed to an CustomAttributeBuilder.
13999
14000         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14001
14002         * ecore.cs: (FieldExpr): Handle field remapping here.
14003
14004         * iteratators.cs: Pass the instance variable (if the method is an
14005         instance method) to the constructors, so we can access the field
14006         variables on the class.
14007
14008         TODO: Test this with structs.  I think the THIS variable on
14009         structs might have to be a pointer, and not a refenrece
14010
14011 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14014         local variables to fields in a proxy class.
14015
14016         * iterators.cs (PopulateProxy): Rename our internal fields to
14017         <XXX>.  
14018         Create a <THIS> field if we are an instance method, so we can
14019         reference our parent container variables.
14020         (MapVariable): Called back from the EmitContext code to enter a
14021         new variable to field mapping into the proxy class (we just create
14022         a FieldBuilder).
14023
14024         * expression.cs
14025         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14026         for using the remapped locals to fields.
14027
14028         I placed the code here, because that gives the same semantics to
14029         local variables, and only changes the Emit code.
14030
14031         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14032         statements inside iterators.
14033         (VariableInfo): Add a FieldBuilder for the cases when we are
14034         remapping local variables to fields in a proxy class
14035
14036         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14037         current_block != null.
14038
14039         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14040         not cope with strings, as it has been moved to the
14041         TableSwitchEmit.  Fixed bug in switch generation.
14042
14043         * expression.cs (New.DoResolve): Provide more context for the user
14044         when reporting an error.
14045
14046         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14047         pointers. 
14048
14049         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14050         check the permissions for it.  Note than in a type-resolution
14051         context the check was already present in DeclSpace.ResolveType,
14052         but was missing from the MemberAccess.
14053
14054         (ArrayCreation.CheckIndices): warn if the user has
14055         more nested levels of expressions, but there are no more
14056         dimensions specified.  Avoids crash on bug 41906.
14057
14058 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14059
14060         * statement.cs (Block): replace Implicit bool, for a generic
14061         flags.   
14062         New flag: `Unchecked'.  This is used during the EmitMeta phase
14063         (which is out-of-line with the regular Resolve/Emit process for a
14064         statement, as this is done ahead of time, but still gets a chance
14065         to call constant resolve).
14066
14067         (Block.Flags): new enum for adding a new flag.
14068
14069         (Block.EmitMeta): track the state of unchecked.
14070
14071         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14072         to enable constant resolution to work there as well.
14073
14074 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14075
14076         * typemanager.cs (ienumerable_type): Also look up
14077         System.Collections.IEnumerable. 
14078
14079 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14080
14081         TODO: Test more than one conditional per method.
14082
14083         * class.cs (Indexer.Define): Report the location where the user is
14084         referencing the unsupported feature.
14085
14086         (MethodData): Overload the use of `conditionals' to
14087         minimize the creation of needless ArrayLists.   This saves roughly
14088         212kb on my machine.
14089
14090         (Method): Implement the new IIteratorContainer interface.
14091         (Method.SetYields): Implement the method by setting the ModFlags
14092         to contain METHOD_YIELDS.
14093
14094         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14095         which just got set to null.
14096
14097         * iterators.cs: New file.
14098
14099         (Yield, YieldBreak): New statements.
14100
14101         * statement.cs (Return.Resolve): Flag an error if we are used in
14102         an iterator method.
14103
14104         * codegen.cs (InIterator): New flag set if the code is being
14105         compiled in an iterator method.
14106
14107         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14108         internal modifier, and we just use it to avoid adding extra
14109         fields, as this is seldom used.  
14110
14111         * cs-parser.jay: Add yield_statement (yield and yield break).
14112
14113         * driver.cs: New flag -v2 to turn on version 2 features. 
14114
14115         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14116         hashtable when v2 is enabled.
14117
14118 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14119
14120         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14121         there is already a namespace defined with this name.
14122
14123         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14124         people upgraded their corlibs.
14125
14126         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14127         always use fully qualified types, no need to use the compiler
14128         front end.
14129
14130         (TypeManager.IsNamespace): Use binarysearch.
14131
14132         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14133         AddDelegate): I did not quite use the new IsValid API properly: I
14134         have to pass the short-name and the fullname.  I was passing only
14135         the basename instead of the fullname sometimes. 
14136
14137         (TypeContainer.DefineType): call NamespaceClash.
14138
14139         * interface.cs (Interface.DefineType): use NamespaceClash before
14140         defining the type.
14141
14142         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14143         defining the type.
14144
14145         * enum.cs: (Enum.DefineType): use NamespaceClash before
14146         defining the type.
14147
14148         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14149         speed increase.  First, use the negative_hits cache when we get a
14150         negative.  Second, add the type with its full original name
14151         instead of the new . and + encoded name (reflection uses + to
14152         separate type from a nested type).  Use LookupTypeReflection
14153         directly which bypasses the type->name hashtable (that we already
14154         know does not contain the type.
14155
14156         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14157         location/container type. 
14158
14159         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14160
14161 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14162
14163         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14164
14165         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14166         method is being referenced in the method group from a static
14167         context, and report error 120 if so.
14168
14169         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14170         Error118. 
14171
14172         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14173         is created, we create the A namespace).
14174
14175         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14176         Fixes #41591
14177
14178 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14179
14180         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14181         invocation to ModuleBuilder.GetType with the same values will
14182         return a new type instance, so we need to cache its return
14183         values. 
14184
14185         * expression.cs (Binary.ResolveOperator): Only allow the compare
14186         operators on enums if they are of the same type.
14187
14188         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14189         types of ValueType on their own case.  Before we were giving them
14190         the same treatment as objects.
14191
14192         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14193         fullname.  Short name is used to compare against container name.
14194         Fullname is used to check against defined namespace names.
14195
14196         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14197         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14198
14199         (Method.CheckBase): Call parent.
14200         (MemberBase.CheckBase): Check for protected members on sealed
14201         classes.
14202         (PropertyBase.CheckBase): Call parent.
14203         (Field.Define): Call parent.
14204
14205         * report.cs: Negative error codes are now mapped to 8000 - code,
14206         so that the display is render more nicely.
14207
14208         * typemanager.cs: Do not use try/catch, instead report a regular
14209         error. 
14210
14211         (GetPointerType, GetReferenceType): These methods provide
14212         mechanisms to obtain the T* and T& from a T.  We had the code
14213         previously scattered around the code base, and it also used
14214         TypeManager.LookupType that would go through plenty of caches.
14215         This one goes directly to the type source.
14216
14217         In some places we did the Type.GetType followed by
14218         ModuleBuilder.GetType, but not in others, so this unifies the
14219         processing as well.
14220
14221         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14222         statements now that we have namespace information.
14223
14224         * typemanager.cs (IsNamespace): New method, returns whether the
14225         string presented is a namespace or not.
14226
14227         (ComputeNamespaces): New public entry point, computes the list of
14228         available namespaces, using the GetNamespaces API call in Mono, or
14229         the slower version in MS.NET.   
14230
14231         Now before we start the semantic analysis phase, we have a
14232         complete list of namespaces including everything that the user has
14233         provided.
14234
14235         Deleted old code to cache namespaces in .nsc files.
14236
14237 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14238
14239         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14240         class/struct location definition Location for the implicit
14241         constructor location.
14242
14243         (Operator.Define): Use the location of the operator for the
14244         implicit Method definition.
14245
14246         (Constructor.Emit): use the constructor location for the implicit
14247         base initializer constructor.
14248
14249         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14250         and the Expression class now contains two new methods:
14251
14252         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14253         isolate type lookup from the rest of the resolution process.
14254
14255         Since we use Expressions to hold type definitions due to the way
14256         we parse the input we have historically overloaded Resolve to
14257         perform the Type lookups if a special flag is passed.  Now this is
14258         eliminated and two methods take their place. 
14259
14260         The differences in the two methods between xStep and xTerminal is
14261         that xStep is involved in our current lookup system that uses
14262         SimpleNames to compose a name, while xTerminal is used just to
14263         catch the case where the simplename lookup failed.
14264
14265 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14266
14267         * expression.cs (ResolveMemberAccess): Remove redundant code.
14268         TypeExpr expressions are always born fully resolved.
14269
14270         * interface.cs (PopulateMethod): Do not lookup the types twice.
14271         We were doing it once during SemanticAnalysis and once during
14272         PopulateMethod.
14273
14274         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14275         in local variable type definitions, were being returned as a
14276         SimpleName (we decomposed everything into a string), that is
14277         because primary_expression was being used instead of a type in the
14278         grammar (reduce/reduce conflicts).
14279
14280         The part that was wrong is that we converted the expression into a
14281         string (an oversimplification in one hand, compounded with primary
14282         expressions doing string concatenation).
14283
14284         So things like:
14285
14286         A.B.C [] x;
14287
14288         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14289         using clauses from working on this particular context.  And a type
14290         was being matched directly against "A.B.C[]".
14291
14292         We now use the correct approach, and allow for ComposedCast to be
14293         part of the unary expression.  So the "A.B.C []" become a composed
14294         cast of "A.B.C" (as a nested group of MemberAccess with a
14295         SimpleName at the end) plus the rank composition "[]". 
14296
14297         Also fixes 35567
14298
14299 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14302         for the access level checking.
14303
14304         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14305         `TypeContainer container', because I kept getting confused when I
14306         was debugging this code.
14307
14308         * expression.cs (Indexers): Instead of tracking getters/setters,
14309         we now track them in parallel.  We create one arraylist less, but
14310         most importantly it is possible now for the LValue code to find a
14311         matching get for a set.
14312
14313         (IndexerAccess.DoResolveLValue): Update the code.
14314         GetIndexersForType has been modified already to extract all the
14315         indexers from a type.  The code assumed it did not.
14316
14317         Also make the code set the correct return type for the indexer.
14318         This was fixed a long time ago for properties, but was missing for
14319         indexers.  It used to be void_type.
14320
14321         (Binary.Emit): Test first for doubles instead of
14322         floats, as they are more common.
14323
14324         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14325         when dealing with floats and the <=, >= operators.  This fixes bug
14326         #39314 
14327
14328         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14329         to load the array value by emitting a load on the foreach variable
14330         type.  This was incorrect.  
14331
14332         We now emit the code to load an element using the the array
14333         variable type, and then we emit the conversion operator.
14334
14335         Fixed #40176
14336
14337 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14338
14339         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14340
14341 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14342
14343         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14344         test for protection before we test for signatures. 
14345
14346         (MethodSignature.ToString): implement.
14347
14348         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14349         to the case where we reduced into a LongConstant.
14350
14351         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14352         depend on whether the information is acurrate, because the
14353         Microsoft runtime will always claim that the array type is public,
14354         regardless of the real state.
14355
14356         If the type is a pointer, another problem happens: the type is
14357         reported as non-public in Microsoft.  
14358
14359         In both cases we have to call CheckAccessLevel recursively with
14360         the underlying type as the argument to be tested.
14361
14362 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14363
14364         * assign.cs (Assign.Emit): If we are dealing with a compound
14365         assignment expression, we should use the code path that stores the
14366         intermediate result in a temporary value.  This fixes #40903.
14367
14368         *expression.cs (Indirection.ToString): Provide ToString method for
14369         debugging. 
14370
14371 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14372
14373         * class.cs: Null out fields holding references to Block objects so
14374         they can be garbage collected.
14375
14376         * expression.cs (OverloadResolve): Remove unused local.
14377
14378 2003-04-07  Martin Baulig  <martin@ximian.com>
14379
14380         * codegen.cs (EmitContext.CurrentFile): New public field.
14381         (EmitContext.Mark): Use the CurrentFile to check whether the
14382         location is in the correct file.
14383         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14384
14385 2003-04-07  Martin Baulig  <martin@ximian.com>
14386
14387         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14388
14389         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14390         location.  [FIXME: The location argument which gets passed to this
14391         method is sometimes wrong!]
14392
14393 2003-04-07  Nick Drochak <ndrochak@gol.com>
14394
14395         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14396
14397 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14398
14399         * expression.cs (Indirection.EmitAssign): We were using the
14400         temporary, but returning immediately instead of continuing the
14401         EmitAssing flow.
14402
14403 2003-04-06  Martin Baulig  <martin@ximian.com>
14404
14405         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14406         if it's a nested child, but also deriving from the outer class.
14407         See test 190.cs.
14408
14409         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14410         nested child, but also deriving from the outer class.  See
14411         test-190.cs.
14412         (FilterWithClosure): We may access private members of the outer
14413         class if we're a nested child and deriving from the outer class.
14414         (RealMemberLookup): Only set `closure_private_ok' if the
14415         `original_bf' contained BindingFlags.NonPublic.
14416
14417 2003-04-05  Martin Baulig  <martin@ximian.com>
14418
14419         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14420         probe if its a type parameter, and if so, flag an error.
14421
14422         * decl.cs: Move here the SetParameterInfo code from class.cs.
14423         Handle IsGeneric here.
14424
14425         Handle a variety of errors in the parameter info definition.
14426
14427         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14428         type parameters here.
14429
14430         * cs-parser.jay (class_declaration): report errors for parameters
14431         here as well.
14432
14433 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14434
14435         * generic.cs: New file, contains support code for generics.
14436
14437         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14438         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14439
14440         Update parser for the above removals.
14441
14442         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14443         now taken care of in the parser.
14444
14445 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14446
14447         * class.cs (Event.Define): Do not allow abstract events to have
14448         initializers. 
14449
14450 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14451
14452         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14453         block in event declarations.
14454
14455         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14456         value type, get its address.
14457
14458         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14459         leaving a class on the stack instead of a boolean value (int
14460         0/1).  Change the code so we compare against null, and then the
14461         result against zero.
14462
14463         * class.cs (TypeContainer.GetClassBases): We were checking for the
14464         parent class being sealed too late.
14465
14466         * expression.cs (Binary.Emit): For <= and >= when dealing with
14467         floating point values, use cgt.un and clt.un instead of cgt and
14468         clt alone.
14469
14470 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14471
14472         * statement.cs: Apply the same optimization as MS: skip the 
14473         GetEnumerator returning an IEnumerator, and use the one returning a 
14474         CharEnumerator instead. This allows us to avoid the try-finally block 
14475         and the boxing.
14476
14477 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14478
14479         * cs-parser.jay: Attributes cannot be applied to
14480                          namespaces. Fixes #40473
14481
14482 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14483
14484         * class.cs:
14485         (Add*): check if the name is valid using the full name for constants,
14486         fields, properties and events.
14487
14488 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14489
14490         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14491         char constants to be part of the enumeration.
14492
14493         * expression.cs (Conditional.DoResolve): Add support for operator
14494         true. Implements the missing functionality from 14.12
14495
14496         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14497         operator true/false as required by the spec.
14498
14499         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14500         implicit conversion to boolean.
14501
14502         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14503         also one where the type implements `operator true'. 
14504
14505         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14506         get an expression that will invoke operator true based on an
14507         expression.  
14508
14509         (GetConversionOperators): Removed the hack that called op_True
14510         here.  
14511
14512         (Expression.ResolveBoolean): Move this from Statement.
14513
14514 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14515
14516         * ecore.cs (FieldExpr): do not allow initialization of initonly
14517         fields on derived classes
14518
14519 2003-03-13  Martin Baulig  <martin@ximian.com>
14520
14521         * statement.cs (Block.Emit): Call ig.BeginScope() and
14522         ig.EndScope() when compiling with debugging info; call
14523         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14524
14525 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14526
14527         * expression.cs (Indexers): Do not construct immediately, allow
14528         for new members to be appended as we go.  Fixes 38143
14529
14530 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14531
14532         * expression.cs: save/restore context when resolving an unchecked
14533         expression.
14534
14535 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * cfold.cs: Catch division by zero in modulus operator during
14538         constant folding.
14539
14540 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * interface.cs (Interface.DefineMembers): Avoid defining members
14543         twice. 
14544
14545 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * driver.cs: handle the +/- options for -noconfig
14548
14549         * statement.cs (Unckeched.Resolve): Also track the state of
14550         unchecked in the Resolve phase.
14551
14552 2003-02-27  Martin Baulig  <martin@ximian.com>
14553
14554         * ecore.cs (Expression.MemberLookup): Don't create a
14555         MethodGroupExpr for something which is not a method.  Fixes #38291.
14556
14557 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * class.cs (MemberBase.CheckParameters): Also check that the type
14560         is unmanaged if it is a pointer.
14561
14562         * expression.cs (SizeOf.Resolve): Add location information.
14563
14564         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14565         a managed type is declared.
14566
14567         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14568         parameter modifiers as well.  Fixes bug 38606
14569
14570         * class.cs: Very sad.  Am backing out the speed up changes
14571         introduced by the ArrayList -> Array in the TypeContainer, as they
14572         were not actually that much faster, and introduced a bug (no error
14573         reports on duplicated methods).
14574
14575         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14576         source first, this will guarantee that we have a valid expression
14577         before calling in lower levels functions that will require a
14578         resolved object.  Then use this original_source in the
14579         target.ResolveLValue instead of the original source that was
14580         passed to us.
14581
14582         Another change.  Use target.Resolve instead of LValueResolve.
14583         Although we are resolving for LValues, we will let the Assign code
14584         take care of that (it will be called again from Resolve).  This
14585         basically allows code like this:
14586
14587         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14588         class Y { void A (X x) { x [0] += o; }
14589
14590         The problem was that the indexer was trying to resolve for
14591         set_Item (idx, object o) and never finding one.  The real set_Item
14592         was set_Item (idx, X).  By delaying the process we get the right
14593         semantics. 
14594
14595         Fixes bug 36505
14596
14597 2003-02-23  Martin Baulig  <martin@ximian.com>
14598
14599         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14600         while calling DoEmit ().
14601
14602         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14603         source files; if you use the #line directive inside a method, the
14604         compiler stops emitting line numbers for the debugger until it
14605         reaches the end of the method or another #line directive which
14606         restores the original file.
14607
14608 2003-02-23  Martin Baulig  <martin@ximian.com>
14609
14610         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14611
14612 2003-02-23  Martin Baulig  <martin@ximian.com>
14613
14614         * statement.cs (Block.AddChildVariableNames): We need to call this
14615         recursively, not just for our immediate children.
14616
14617 2003-02-23  Martin Baulig  <martin@ximian.com>
14618
14619         * class.cs (Event.Define): Always make the field private, like csc does.
14620
14621         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14622         actually work, fixes bug #37521.
14623
14624 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14625
14626         * delegate.cs: When creating the various temporary "Parameters"
14627         classes, make sure that we call the ComputeAndDefineParameterTypes
14628         on those new parameters (just like we do with the formal ones), to
14629         allow them to be resolved in the context of the DeclSpace.
14630
14631         This fixes the bug that Dick observed in Bugzilla #38530.
14632
14633 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14634
14635         * expression.cs (ResolveMemberAccess): When resolving a constant,
14636         do not attempt to pull a constant if the value was not able to
14637         generate a valid constant.
14638
14639         * const.cs (LookupConstantValue): Do not report more errors than required.
14640
14641 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14642
14643         * expression.cs: fixes bug #38328.
14644
14645 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * class.cs: Changed all the various members that can be part of a
14648         class from being an ArrayList to be an Array of the right type.
14649         During the DefineType type_list, interface_list, delegate_list and
14650         enum_list are turned into types, interfaces, delegates and enums
14651         arrays.  
14652
14653         And during the member population, indexer_list, event_list,
14654         constant_list, field_list, instance_constructor_list, method_list,
14655         operator_list and property_list are turned into their real arrays.
14656
14657         Although we could probably perform this operation earlier, for
14658         good error reporting we need to keep the lists and remove the
14659         lists for longer than required.
14660
14661         This optimization was triggered by Paolo profiling the compiler
14662         speed on the output of `gen-sample-program.pl' perl script. 
14663
14664         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14665         not crash in methods like MemberLookupFailed that use this field.  
14666
14667         This problem arises when the compiler fails to resolve a type
14668         during interface type definition for example.
14669
14670 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14671
14672         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14673         inherit from System.Object, so we have to stop at null, not only
14674         when reaching System.Object.
14675
14676 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14677
14678         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14679         DeclaredOnly because the parent indexer might have had a different
14680         name, but did not loop until the top of the hierarchy was reached.
14681
14682         The problem this one fixes is 35492: when a class implemented an
14683         indexer from an interface, we were getting the interface method
14684         (which was abstract) and we were flagging an error (can not invoke
14685         abstract method).
14686
14687         This also keeps bug 33089 functioning, and test-148 functioning.
14688
14689         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14690         out if a method is special is to see if it is declared in a
14691         property or event, or whether it is one of the predefined operator
14692         names.   This should fix correctly #36804.
14693
14694 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14695
14696         The goal here is to remove the dependency on EmptyCast.Peel ().
14697         Killing it completely.
14698
14699         The problem is that currently in a number of places where
14700         constants are expected, we have to "probe" for an EmptyCast, and
14701         Peel, which is not the correct thing to do, as this will be
14702         repetitive and will likely lead to errors. 
14703
14704         The idea is to remove any EmptyCasts that are used in casts that
14705         can be reduced to constants, so we only have to cope with
14706         constants. 
14707
14708         This bug hunt was triggered by Bug 37363 and the desire to remove
14709         the duplicate pattern where we were "peeling" emptycasts to check
14710         whether they were constants.  Now constants will always be
14711         constants.
14712
14713         * ecore.cs: Use an enumconstant here instead of wrapping with
14714         EmptyCast.  
14715
14716         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14717         throwing me off.  By handling this we can get rid of a few hacks.
14718
14719         * statement.cs (Switch): Removed Peel() code.
14720
14721 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * class.cs: Location information for error 508
14724
14725         * expression.cs (New.DoResolve): Add a guard against double
14726         resolution of an expression.  
14727
14728         The New DoResolve might be called twice when initializing field
14729         expressions (see EmitFieldInitializers, the call to
14730         GetInitializerExpression will perform a resolve on the expression,
14731         and later the assign will trigger another resolution
14732
14733         This leads to bugs (#37014)
14734
14735         * delegate.cs: The signature for EndInvoke should contain any ref
14736         or out parameters as well.  We were not doing this in the past. 
14737
14738         * class.cs (Field.Define): Do not overwrite the type definition
14739         inside the `volatile' group.  Turns out that volatile enumerations
14740         were changing the type here to perform a validity test, which
14741         broke conversions. 
14742
14743 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14744
14745         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14746         and structs, we do not want to load the instance variable
14747
14748         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14749         enum_type has to be handled like an object reference (implicit
14750         conversions exists from this to object), but the regular IsClass
14751         and IsValueType tests will never return true for this one.
14752
14753         Also we use TypeManager.IsValueType instead of type.IsValueType,
14754         just for consistency with the rest of the code (this is only
14755         needed if we ever use the construct exposed by test-180.cs inside
14756         corlib, which we dont today).
14757
14758 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14759
14760         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14761         just InternalCall.
14762
14763 2003-02-09  Martin Baulig  <martin@ximian.com>
14764
14765         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14766         (Namespace.DefineNamespaces): New static public method; this is
14767         called when we're compiling with debugging to add all namespaces
14768         to the symbol file.
14769
14770         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14771         pass it to the Namespace's .ctor.
14772
14773         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14774         and MethodBase arguments; pass the namespace ID to the symwriter;
14775         pass the MethodBase instead of the token to the symwriter.
14776         (SymbolWriter.DefineNamespace): New method to add a namespace to
14777         the symbol file.
14778
14779 2003-02-09  Martin Baulig  <martin@ximian.com>
14780
14781         * symbolwriter.cs: New file.  This is a wrapper around
14782         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14783         methods here in near future.
14784
14785 2003-02-09  Martin Baulig  <martin@ximian.com>
14786
14787         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14788         ILGenerator.MarkSequencePoint() which are actually used by the
14789         symbol writer.
14790
14791 2003-02-09  Martin Baulig  <martin@ximian.com>
14792
14793         * location.cs (SourceFile): New public sealed class.  This
14794         contains the name and an index which is used in the location's token.
14795         (Location): Reserve an appropriate number of bits in the token for
14796         the source file instead of walking over that list, this gives us a
14797         really huge performance improvement when compiling with debugging.
14798
14799         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14800         `SourceFile' argument instead of a string.
14801         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14802         but don't parse/tokenize here, we need to generate the list of all
14803         source files before we do that.
14804         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14805         the files.
14806
14807         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14808         instead of a string.
14809
14810         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14811         of a string.
14812
14813 2003-02-09  Martin Baulig  <martin@ximian.com>
14814
14815         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14816         filename on `#line default'.
14817
14818 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14819
14820         * statement.cs: don't clear the pinned var when the fixed statement
14821         returns from the method (fixes bug#37752).
14822
14823 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14824
14825         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14826         to IsValueType.
14827
14828 2003-02-07  Martin Baulig  <martin@ximian.com>
14829
14830         * driver.cs: Removed the `--debug-args' command line argument.
14831
14832         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14833         automatically by the AsssemblyBuilder.
14834         (CodeGen.InitializeSymbolWriter): We don't need to call any
14835         initialization function on the symbol writer anymore.  This method
14836         doesn't take any arguments.
14837
14838 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14841         from referenced assemblies as well.
14842
14843 2003-02-02  Martin Baulig  <martin@ximian.com>
14844
14845         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14846
14847 2003-02-02  Martin Baulig  <martin@ximian.com>
14848
14849         * class.cs (Constructor.Emit): Open the symbol writer before
14850         emitting the constructor initializer.
14851         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14852         single-stepping through constructor initializers.
14853
14854 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * class.cs: Handle error 549: do not allow virtual methods in
14857         sealed classes. 
14858
14859 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14860
14861         * decl.cs: Check access levels when resolving types
14862
14863 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14864
14865         * statement.cs: Add parameters and locals set in catch blocks that might 
14866         return to set vector
14867
14868 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * class.cs (Operator): Set the SpecialName flags for operators.
14871
14872         * expression.cs (Invocation.DoResolve): Only block calls to
14873         accessors and operators on SpecialName methods.
14874
14875         (Cast.TryReduce): Handle conversions from char constants.
14876
14877
14878 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14879
14880         * statement.cs: small memory and time optimization in FlowBranching.
14881
14882 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14883
14884         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14885         problem that the last fix but in the other sid (Set).
14886
14887         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14888         access when there is no indexer in the hierarchy.
14889
14890 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14891
14892         * class.cs: Combine some if statements.
14893
14894 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14895
14896         * driver.cs: fixed bug #37187.
14897
14898 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14899
14900         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14901         any indexer, it's needed to build a list with all the indexers in the
14902         hierarchy (AllGetters), else we have problems. Fixes #35653.
14903
14904 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14905
14906         * class.cs (MethodData.Define): It is wrong for an interface
14907         implementation to be static in both cases: explicit and implicit.
14908         We were only handling this in one case.
14909
14910         Improve the if situation there to not have negations.
14911
14912         * class.cs (Field.Define): Turns out that we do not need to check
14913         the unsafe bit on field definition, only on usage.  Remove the test.
14914
14915 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14916
14917         * driver.cs: use assembly.Location instead of Codebase (the latest
14918         patch made mcs fail when using MS assemblies).
14919
14920 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14921
14922         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14923         get the path to *corlib.dll.
14924
14925 2003-01-21  Nick Drochak <ndrochak@gol.com>
14926
14927         * cs-tokenizer.cs:
14928         * pending.cs:
14929         * typemanager.cs: Remove compiler warnings
14930
14931 2003-01-20  Duncan Mak  <duncan@ximian.com>
14932
14933         * AssemblyInfo.cs: Bump the version number to 0.19.
14934
14935 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14936
14937         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14938
14939 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14940
14941         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14942
14943 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14944
14945         * cs-parser.jay: Small fix: we were not comparing the constructor
14946         name correctly.   Thanks to Zoltan for the initial pointer.
14947
14948 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14949
14950         * cs-tokenizer.cs: Set file name when specified with #line
14951
14952 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14953
14954         * cs-parser.jay: Only perform the constructor checks here if we
14955         are named like the class;  This will help provider a better
14956         error.  The constructor path is taken when a type definition is
14957         not found, but most likely the user forgot to add the type, so
14958         report that rather than the constructor error.
14959
14960 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14961
14962         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14963         allocations.
14964
14965 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14966
14967         * cs-parser.jay: Add cleanup call.
14968
14969 2003-01-13  Duncan Mak  <duncan@ximian.com>
14970
14971         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14972         consistent with other methods.
14973
14974 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14975
14976         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14977
14978 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14979
14980         * attribute.cs: only set GuidAttr to true when we have a
14981         GuidAttribute.
14982
14983 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14984
14985         * ecore.cs:
14986         * expression.cs:
14987         * typemanager.cs: fixes to allow mcs compile corlib with the new
14988         Type.IsSubclassOf fix.
14989
14990 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14991
14992         * expression.cs (LocalVariableReference.DoResolve): Classify a
14993         constant as a value, not as a variable.   Also, set the type for
14994         the variable.
14995
14996         * cs-parser.jay (fixed_statement): take a type instead of a
14997         pointer_type, so we can produce a better error message later.
14998
14999         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15000         as an error.  
15001
15002         (For.DoEmit): Make inifinite loops have a
15003         non-conditional branch back.
15004
15005         (Fixed.DoEmit): First populate the pinned variables, then emit the
15006         statement, then clear the variables.  Before I was emitting the
15007         code once for each fixed piece.
15008
15009
15010 2003-01-08  Martin Baulig  <martin@ximian.com>
15011
15012         * statement.cs (FlowBranching.MergeChild): A break in a
15013         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15014
15015 2003-01-08  Martin Baulig  <martin@ximian.com>
15016
15017         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15018         lives in the same number space than `param_map'.  Fixes #36154.
15019
15020 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15021
15022         * cs-parser.jay (constructor_declaration): Set the
15023         Constructor.ModFlags before probing for it.  This makes the
15024         compiler report 514, 515 and 132 (the code was there, but got
15025         broken). 
15026
15027         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15028         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15029         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15030
15031 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15032
15033         * enum.cs: create the enum static fields using the enum type.
15034
15035 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15036
15037         * class.cs: don't try to create the ParamBuilder for the return
15038         type if it's not needed (and handle it breaking for the ms runtime
15039         anyway).
15040
15041 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15042
15043         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15044
15045 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15046
15047         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15048         the command.   This showed up while compiling the JANET source
15049         code, which used \r as its only newline separator.
15050
15051 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15052
15053         * class.cs (Method.Define): If we are an operator (because it
15054         reuses our code), then set the SpecialName and HideBySig.  #36128
15055
15056 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15057
15058         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15059         exception, report error 120 `object reference required'.
15060
15061         * driver.cs: Add --pause option, used during to measure the size
15062         of the process as it goes with --timestamp.
15063
15064         * expression.cs (Invocation.DoResolve): Do not allow methods with
15065         SpecialName to be invoked.
15066
15067 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15068
15069         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15070         number before adding it.
15071
15072 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15073
15074         * ecore.cs (StandardImplicitConversion): When in an unsafe
15075         context, we allow conversion between void * to any other pointer
15076         type. This fixes bug #35973.
15077
15078 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15079
15080         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15081         is not thrown when extensionless outputs are used 
15082
15083 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15084
15085         * rootcontext.cs: fixed compilation of corlib.
15086
15087 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15088
15089         * attribute.cs (Attributes.Contains): Add new method.
15090
15091         * class.cs (MethodCore.LabelParameters): if the parameter is an
15092         `out' parameter, check that no attribute `[In]' has been passed.
15093
15094         * enum.cs: Handle the `value__' name in an enumeration.
15095
15096 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15097
15098         * decl.cs: Added special case to allow overrides on "protected
15099         internal" methods
15100
15101 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15102
15103         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15104         since it makes much more sense.
15105
15106         (Attributes.ctor): Don't require a Location parameter.
15107
15108         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15109
15110         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15111         since we already have that information per attribute.
15112
15113         * everywhere : make appropriate changes.
15114
15115         * class.cs (LabelParameters): Write the code which actually
15116         applies attributes to the return type. We can't do this on the MS
15117         .NET runtime so we flag a warning in the case an exception is
15118         thrown.
15119
15120 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * const.cs: Handle implicit null conversions here too.
15123
15124 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15125
15126         * class.cs (MethodCore.LabelParameters): Remove the extra
15127         Type [] parameter since it is completely unnecessary. Instead
15128         pass in the method's attributes so that we can extract
15129         the "return" attribute.
15130
15131 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15132
15133         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15134         of ignoring it and letting the compile continue.
15135
15136         * typemanager.cs (ChangeType): use an extra argument to return an
15137         error condition instead of throwing an exception.
15138
15139 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * expression.cs (Unary.TryReduce): mimic the code for the regular
15142         code path.  Perform an implicit cast in the cases where we can
15143         implicitly convert to one of the integral types, and then reduce
15144         based on that constant.   This fixes bug #35483.
15145
15146 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15147
15148         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15149
15150 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15151
15152         * namespace.cs: fixed bug #35489.
15153
15154 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15155
15156         * class.cs: Remove some dead code.
15157
15158         * cs-parser.jay: Estimate the number of methods needed
15159         (RootContext.MethodCount);
15160
15161         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15162         numbers instead of StringBuilders.
15163
15164         * support.cs (PtrHashtable): Add constructor with initial size;
15165         We can now reduce reallocations of the method table.
15166
15167 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15168
15169         * attribute.cs (ApplyAttributes): Keep track of the emitted
15170         attributes on a per-target basis. This fixes bug #35413.
15171
15172 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15175         default to the Windows 1252 encoding.
15176
15177         (UnixParseOption): Support version, thanks to Alp for the missing
15178         pointer. 
15179
15180         * AssemblyInfo.cs: Add nice assembly information.
15181
15182         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15183         (bug 35169).
15184
15185         * cs-parser.jay: Allow a trailing comma before the close bracked
15186         in the attribute_section production.
15187
15188         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15189         address of the instance was being taken, I will take this out,
15190         because we take the address of the object immediately here.
15191
15192 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15193
15194         * typemanager.cs (AreMultipleAllowed): Take care of the most
15195         obvious case where attribute type is not in the current assembly -
15196         stupid me ;-)
15197
15198 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15199
15200         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15201         definitions, instead of doing that afterwards.  
15202
15203         Also we use a nice little hack, depending on the constructor, we
15204         know if we are a "composed" name or a simple name.  Hence, we
15205         avoid the IndexOf test, and we avoid 
15206
15207         * codegen.cs: Add code to assist in a bug reporter to track down
15208         the source of a compiler crash. 
15209
15210 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15211
15212         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15213         types have been emitted for a given element and flag an error
15214         if something which does not have AllowMultiple set is used more
15215         than once.
15216
15217         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15218         attribute types and their corresponding AllowMultiple properties
15219
15220         (AreMultipleAllowed): Check the property for a given type.
15221
15222         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15223         property in the case we have a TypeContainer.
15224
15225         (Attributes.AddAttribute): Detect duplicates and just skip on
15226         adding them. This trivial fix catches a pretty gross error in our
15227         attribute emission - global attributes were being emitted twice!
15228
15229         Bugzilla bug #33187 is now fixed.
15230
15231 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15232
15233         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15234         instead of pp_and).
15235
15236         * expression.cs (Binary.ResolveOperator): I can only use the
15237         Concat (string, string, string) and Concat (string, string,
15238         string, string) if the child is actually a concatenation of
15239         strings. 
15240
15241 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15242
15243         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15244         context where we need a 2-character lookahead.
15245
15246         * pending.cs (PendingImplementation): Rework so we can keep track
15247         of interface types all the time, and flag those which were
15248         implemented by parents as optional.
15249
15250 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15251
15252         * expression.cs (Binary.ResolveOperator): Use
15253         String.Concat(string,string,string) or
15254         String.Concat(string,string,string,string) when possible. 
15255
15256         * typemanager: More helper methods.
15257
15258
15259 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15260
15261         * pending.cs: remove the bogus return from GetMissingInterfaces()
15262         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15263
15264 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15265
15266         * namespace.cs: avoid duplicated 'using xxx' being added to
15267         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15268         when we get more than one 'using' statement for the same namespace.
15269         Report a CS0105 warning for it.
15270
15271 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15272
15273         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15274         of calling getChar/putback, uses internal knowledge of it.    
15275
15276         (xtoken): Reorder tokenizer so most common patterns are checked
15277         first.  This reduces the compilation time in another 5% (from 8.11s
15278         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15279
15280         The parsing time is 22% of the compilation in mcs, and from that
15281         64% is spent on the tokenization process.  
15282
15283         I tried using a binary search for keywords, but this is slower
15284         than the hashtable.  Another option would be to do a couple of
15285         things:
15286
15287                 * Not use a StringBuilder, instead use an array of chars,
15288                   with a set value.  Notice that this way we could catch
15289                   the 645 error without having to do it *afterwards*.
15290
15291                 * We could write a hand-parser to avoid the hashtable
15292                   compares altogether.
15293
15294         The identifier consumption process takes 37% of the tokenization
15295         time.  Another 15% is spent on is_number.  56% of the time spent
15296         on is_number is spent on Int64.Parse:
15297
15298                 * We could probably choose based on the string length to
15299                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15300                   computations. 
15301
15302         Another 3% is spend on wrapping `xtoken' in the `token' function.
15303
15304         Handle 0xa0 as whitespace (#34752)
15305
15306 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15307
15308         * typemanager.cs (IsCLRType): New routine to tell whether a type
15309         is one of the builtin types.  
15310
15311         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15312         typecode in more places instead of doing pointer comparissions.
15313         We could leverage some knowledge about the way the typecodes are
15314         laid out.
15315
15316         New code to cache namespaces in assemblies, it is currently not
15317         invoked, to be used soon.
15318
15319         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15320
15321         * expression.cs (Binary.ResolveOperator): specially handle
15322         strings, and do not perform user-defined operator overloading for
15323         built-in types.
15324
15325 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15328         internalcall as it is a pretty simple operation;  Avoid whenever
15329         possible to call Char.IsLetter.
15330
15331         (consume_identifier): Cut by half the number of
15332         hashtable calls by merging the is_keyword and GetKeyword behavior.
15333
15334         Do not short-circuit, because if we do, we
15335         report errors (ie, #if false && true would produce an invalid
15336         directive error);
15337
15338
15339 2002-11-24  Martin Baulig  <martin@ximian.com>
15340
15341         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15342         check constant ranges and report a CS0221.  Fixes #33186.
15343
15344 2002-11-24  Martin Baulig  <martin@ximian.com>
15345
15346         * cs-parser.jay: Make this work for uninitialized variable
15347         declarations in the `for' initializer.  Fixes #32416.
15348
15349 2002-11-24  Martin Baulig  <martin@ximian.com>
15350
15351         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15352         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15353
15354 2002-11-24  Martin Baulig  <martin@ximian.com>
15355
15356         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15357         argument; if true, we also check for user-defined conversions.
15358         This is only needed if both arguments are of a user-defined type.
15359         Fixes #30443, added test-175.cs.
15360         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15361
15362         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15363
15364 2002-11-24  Martin Baulig  <martin@ximian.com>
15365
15366         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15367         function to get the store opcode.
15368         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15369         only emit the Ldelema if the store opcode is Stobj.  You must run
15370         both test-34 and test-167 to test this.  Fixes #34529.
15371
15372 2002-11-23  Martin Baulig  <martin@ximian.com>
15373
15374         * ecore.cs (Expression.MemberLookup): Added additional
15375         `qualifier_type' argument which is used when we're being called
15376         from MemberAccess.DoResolve() and null if we're called from a
15377         SimpleName lookup.
15378         (Expression.MemberLookupFailed): New method to report errors; this
15379         does the CS1540 check and reports the correct error message.
15380
15381         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15382         argument for the CS1540 check and redone the way how we're dealing
15383         with private members.  See the comment in the source code for details.
15384         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15385         `closure_start_type' to `closure_qualifier_type' and check whether
15386         it's not null.  It was not this filter being broken, it was just
15387         being called with the wrong arguments.
15388
15389         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15390         and pass it the correct `qualifier_type'; this also does the error
15391         handling for us.
15392
15393 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15394
15395         * expression.cs (Invocation.EmitParams): If the we are dealing
15396         with a non-built-in value type, load its address as well.
15397
15398         (ArrayCreation): Use a a pretty constant instead
15399         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15400         static initializers.  
15401
15402         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15403         because they are not really value types, just glorified integers. 
15404
15405         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15406
15407         * ecore.cs: Remove redundant code for enumerations, make them use
15408         the same code path as everything else, fixes the casting issue
15409         with enumerations in Windows.Forms.
15410
15411         * attribute.cs: Do only cast to string if it is a string, the
15412         validation happens later.
15413
15414         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15415         people upgrade their corlibs.
15416
15417         * ecore.cs: Oops, enumerations were not following the entire code path
15418
15419 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15420
15421         * typemanager.cs (FilterWithClosure): Commented out the test for
15422         1540 in typemanager.cs, as it has problems when accessing
15423         protected methods from a parent class (see test-174.cs). 
15424
15425         * attribute.cs (Attribute.ValidateGuid): new method.
15426         (Attribute.Resolve): Use above.
15427
15428 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15429
15430         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15431
15432         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15433         handling for enumerations, as we only needed the TypeContainer
15434         functionality to begin with (this is required for the fix below to
15435         work for enums that reference constants in a container class for
15436         example). 
15437
15438         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15439
15440         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15441         a valid TypeBuilder to perform lookups on.o
15442
15443         * class.cs (InheritableMemberSignatureCompare): Use true in the
15444         call to GetGetMethod and GetSetMethod, because we are comparing
15445         the signature, and we need to get the methods *even* if they are
15446         private. 
15447
15448         (PropertyBase.CheckBase): ditto.
15449
15450         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15451         GotoCase.Resolve): Use Peel on EmpytCasts.
15452
15453         * ecore.cs (EmptyCast): drop child, add Peel method.
15454
15455 2002-11-17  Martin Baulig  <martin@ximian.com>
15456
15457         * ecore.cs (EmptyCast.Child): New public property.
15458
15459         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15460         label resolved to an EmptyCast.  Fixes #34162.
15461         (GotoCase.Resolve): Likewise.
15462         (Block.EmitMeta): Likewise.
15463
15464 2002-11-17  Martin Baulig  <martin@ximian.com>
15465
15466         * expression.cs (Invocation.BetterConversion): Prefer int over
15467         uint; short over ushort; long over ulong for integer literals.
15468         Use ImplicitConversionExists instead of StandardConversionExists
15469         since we also need to check for user-defined implicit conversions.
15470         Fixes #34165.  Added test-173.cs.
15471
15472 2002-11-16  Martin Baulig  <martin@ximian.com>
15473
15474         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15475         with the `true' and `false' literals.  Fixes #33151.
15476
15477 2002-11-16  Martin Baulig  <martin@ximian.com>
15478
15479         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15480         October 22nd; don't do the cs1540 check for static members.
15481
15482         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15483         now using our own filter here and doing the cs1540 check again.
15484
15485 2002-11-16  Martin Baulig  <martin@ximian.com>
15486
15487         * support.cs (InternalParameters): Don't crash if we don't have
15488         any fixed parameters.  Fixes #33532.
15489
15490 2002-11-16  Martin Baulig  <martin@ximian.com>
15491
15492         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15493         when looking up static methods to make this work on Windows.
15494         Fixes #33773.
15495
15496 2002-11-16  Martin Baulig  <martin@ximian.com>
15497
15498         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15499         a setter rather than using PropertyInfo.CanWrite.
15500
15501 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15502
15503         * class.cs: Allow acces to block member by subclasses. Fixes build
15504         breaker.
15505
15506 2002-11-14  Martin Baulig  <martin@ximian.com>
15507
15508         * class.cs (Constructor.Emit): Added the extern/block check.
15509         Fixes bug #33678.
15510
15511 2002-11-14  Martin Baulig  <martin@ximian.com>
15512
15513         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15514         iteration while looking for indexers, this is needed because the
15515         indexer may have a different name in our base classes.  Fixed the
15516         error reporting (no indexers at all, not get accessor, no
15517         overloaded match).  Fixes bug #33089.
15518         (IndexerAccess.DoResolveLValue): Likewise.
15519
15520 2002-11-14  Martin Baulig  <martin@ximian.com>
15521
15522         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15523         indexers.  Fixes the first part of bug #33089.
15524         (MethodSignature.InheritableMemberSignatureCompare): Added support
15525         for properties.
15526
15527 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15528
15529         * attribute.cs (Attribute.Resolve): Catch the
15530         NullReferenceException and report it since it isn't supposed to
15531         happen. 
15532
15533 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15534
15535         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15536         LogicalOr and LogicalAnd that can benefit from recursively
15537         handling EmitBranchable.  The code now should be nice for Paolo.
15538
15539 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15542         the Type lookups, as we perform quite a number of lookups on
15543         non-Types.  This can be removed once we can deterministically tell
15544         whether we have a type or a namespace in advance.
15545
15546         But this might require special hacks from our corlib.
15547
15548         * TODO: updated.
15549
15550         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15551         and double which avoids a conversion from an integer to a double.
15552
15553         * expression.cs: tiny optimization, avoid calling IsConstant,
15554         because it effectively performs the lookup twice.
15555
15556 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15557
15558         But a bogus return here to keep the semantics of the old code
15559         until the Mono runtime is fixed.
15560
15561         * pending.cs (GetMissingInterfaces): New method used to remove all
15562         the interfaces that are already implemented by our parent
15563         classes from the list of pending methods. 
15564
15565         * interface.cs: Add checks for calls after ResolveTypeExpr.
15566
15567 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * class.cs (Class.Emit): Report warning 67: event not used if the
15570         warning level is beyond 3.
15571
15572         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15573         being a NullLiteral.
15574
15575         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15576         specifiers. 
15577
15578         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15579         path that might fail if a type can not be resolved.
15580
15581         * expression.cs (Binary.Emit): Emit unsigned versions of the
15582         operators. 
15583
15584         * driver.cs: use error 5.
15585
15586 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15587
15588         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15589
15590 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * cs-parser.jay (switch_section): A beautiful patch from Martin
15593         Baulig that fixed 33094.
15594
15595 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15596
15597         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15598         Check whether the base is abstract and report an error if so.
15599
15600         * expression.cs (IndexerAccess.DoResolveLValue,
15601         IndexerAccess.DoResolve): ditto. 
15602
15603         (Invocation.DoResolve): ditto.
15604
15605         (Invocation.FullMethodDesc): Improve the report string.
15606
15607         * statement.cs (Block): Eliminate IsVariableDefined as it is
15608         basically just a wrapper for GetVariableInfo.
15609
15610         * ecore.cs (SimpleName): Use new 
15611
15612         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15613         type, as we return the actual parameter ref/unref state on a
15614         different call.
15615
15616 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15617
15618         * support.cs: Return proper flags REF/OUT fixing the previous
15619         commit.  
15620
15621         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15622         not used to mean `ref' but `ref or out' in ParameterReference
15623
15624         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15625         full type signature instead of calling TypeManger.CSharpName
15626         ourselves. 
15627
15628         * support.cs (InternalParameters.ParameterDesc): Do not compare
15629         directly to the modflags, because REF/OUT will actually be bitsets
15630         if set. 
15631
15632         * delegate.cs (VerifyMethod): Check also the modifiers.
15633
15634         * cs-tokenizer.cs: Fix bug where floating point values with an
15635         exponent where a sign was missing was ignored.
15636
15637         * driver.cs: Allow multiple assemblies to be specified in a single
15638         /r: argument
15639
15640 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15643         because identifiers after a parenthesis would end up in this kind
15644         of production, and we needed to desamiguate it for having casts
15645         like:
15646
15647                 (UserDefinedType *) xxx
15648
15649 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15650
15651         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15652         we should set on the Bindingflags.NonPublic, but not turn on
15653         private_ok.  private_ok controls whether a Private member is
15654         returned (this is chekced on the filter routine), while the
15655         BindingFlags.NonPublic just controls whether private/protected
15656         will be allowed.   This fixes the problem part of the problem of
15657         private properties being allowed to be used in derived classes.
15658
15659         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15660         so we can call the children DoResolveLValue method (this will
15661         properly signal errors on lvalue assignments to base properties)
15662
15663         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15664         getter are null, and we have a property info, we know that this
15665         happened because the lookup failed, so we report an error 122 for
15666         protection level violation.
15667
15668         We also silently return if setter and getter are null in the
15669         resolve functions, this condition only happens if we have flagged
15670         the error before.  This is the other half of the problem. 
15671
15672         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15673         not have accessibility information, that is why we were returning
15674         true in the filter function in typemanager.cs.
15675
15676         To properly report 122 (property is inaccessible because of its
15677         protection level) correctly, we report this error in ResolveAccess
15678         by failing if both the setter and the getter are lacking (ie, the
15679         lookup failed). 
15680
15681         DoResolve and DoLResolve have been modified to check for both
15682         setter/getter being null and returning silently, the reason being
15683         that I did not want to put the knowledge about this error in upper
15684         layers, like:
15685
15686         int old = Report.Errors;
15687         x = new PropertyExpr (...);
15688         if (old != Report.Errors)
15689                 return null;
15690         else
15691                 return x;
15692
15693         So the property expr is returned, but it is invalid, so the error
15694         will be flagged during the resolve process. 
15695
15696         * class.cs: Remove InheritablePropertySignatureCompare from the
15697         class, as we no longer depend on the property signature to compute
15698         whether it is possible to implement a method or not.
15699
15700         The reason is that calling PropertyInfo.GetGetMethod will return
15701         null (in .NET, in Mono it works, and we should change this), in
15702         cases where the Get Method does not exist in that particular
15703         class.
15704
15705         So this code:
15706
15707         class X { public virtual int A { get { return 1; } } }
15708         class Y : X { }
15709         class Z : Y { public override int A { get { return 2; } } }
15710
15711         Would fail in Z because the parent (Y) would not have the property
15712         defined.  So we avoid this completely now (because the alternative
15713         fix was ugly and slow), and we now depend exclusively on the
15714         method names.
15715
15716         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15717         reference method, instead of using the property.
15718
15719         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15720         routines are gone now.
15721
15722         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15723         names, they were incorrectly named.
15724
15725         * cs-tokenizer.cs: Return are more gentle token on failure. 
15726
15727         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15728         had an out-of-sync index variable, which caused it to remove from
15729         the list of pending methods the wrong method sometimes.
15730
15731 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15732
15733         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15734         CanWrite, because those refer to this particular instance of the
15735         property, and do not take into account the fact that we can
15736         override single members of a property.
15737
15738         Constructor requires an EmitContext.  The resolution process does
15739         not happen here, but we need to compute the accessors before,
15740         because the resolution does not always happen for properties.
15741
15742         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15743         subclass, before we did not update this flag, but we did update
15744         bindingflags. 
15745
15746         (GetAccessors): Drop this routine, as it did not work in the
15747         presence of partially overwritten set/get methods. 
15748
15749         Notice that this broke the cs1540 detection, but that will require
15750         more thinking. 
15751
15752 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15753
15754         * class.cs:
15755         * codegen.cs:
15756         * driver.cs: issue a warning instead of an error if we don't support
15757         debugging for the platform. Also ignore a couple of errors that may
15758         arise when trying to write the symbols. Undo my previous patch.
15759
15760 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15761
15762         * driver.cs: ignore /debug switch except for Unix platforms.
15763
15764 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15765
15766         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15767
15768 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15769
15770         * driver.cs: Do not make mcs-debug conditional, so we do not break
15771         builds that use it.
15772
15773         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15774         review this patch.  But basically after all the children variables
15775         have been merged, the value of "Breaks" was not being set to
15776         new_breaks for Switch blocks.  I think that it should be set after
15777         it has executed.  Currently I set this to the value of new_breaks,
15778         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15779         conservative, but I do not understand this code very well.
15780
15781         I did not break anything in the build, so that is good ;-)
15782
15783         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15784
15785 2002-10-20  Mark Crichton  <crichton@gimp.org>
15786
15787         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15788
15789 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15790
15791         * cfold.cs: Fixed compile blocker.
15792
15793 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * driver.cs: I was chekcing the key, not the file.
15796
15797 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15798
15799         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15800         message that we were generating - we just need to silently return
15801         a null.
15802
15803 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * class.cs (Event.Define): Change my previous commit, as this
15806         breaks the debugger.  This is a temporary hack, as it seems like
15807         the compiler is generating events incorrectly to begin with.
15808
15809         * expression.cs (Binary.ResolveOperator): Added support for 
15810         "U operator - (E x, E y)"
15811
15812         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15813         y)".
15814
15815         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15816         init-only variables, but this path did not take into account that
15817         there might be also instance readonly variables.  Correct this
15818         problem. 
15819
15820         This fixes bug 32253
15821
15822         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15823         delegates as well.
15824
15825         * driver.cs: Change the extension for modules to `netmodule'
15826
15827         * cs-parser.jay: Improved slightly the location tracking for
15828         the debugger symbols.
15829
15830         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15831         modifiers that were specified instead of the hardcoded value
15832         (FamAndAssem).  This was basically ignoring the static modifier,
15833         and others.  Fixes 32429.
15834
15835         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15836         fixed a bug in the process (32476)
15837
15838         * expression.cs (ArrayAccess.EmitAssign): Patch from
15839         hwang_rob@yahoo.ca that fixes bug 31834.3
15840
15841 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15842
15843         * driver.cs: Make the module extension .netmodule.
15844
15845 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15846
15847         * driver.cs: Report an error if the resource file is not found
15848         instead of crashing.
15849
15850         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15851         false, like Emit does.
15852
15853 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15854
15855         * typemanager.cs: Remove unused private member.  Also reported mcs
15856         bug to report this as a warning like csc.
15857
15858 2002-10-15  Martin Baulig  <martin@gnome.org>
15859
15860         * statement.cs (Statement.Emit): Made this a virtual method; emits
15861         the line number info and calls DoEmit().
15862         (Statement.DoEmit): New protected abstract method, formerly knows
15863         as Statement.Emit().
15864
15865         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15866
15867 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15870         have fixed a remaining problem: not every AddXXXX was adding a
15871         fully qualified name.  
15872
15873         Now everyone registers a fully qualified name in the DeclSpace as
15874         being defined instead of the partial name.  
15875
15876         Downsides: we are slower than we need to be due to the excess
15877         copies and the names being registered this way.  
15878
15879         The reason for this is that we currently depend (on the corlib
15880         bootstrap for instance) that types are fully qualified, because
15881         we dump all the types in the namespace, and we should really have
15882         types inserted into the proper namespace, so we can only store the
15883         basenames in the defined_names array.
15884
15885 2002-10-10  Martin Baulig  <martin@gnome.org>
15886
15887         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15888         from bug #31834, see the bug report for a testcase which is
15889         miscompiled.
15890
15891 2002-10-10  Martin Baulig  <martin@gnome.org>
15892
15893         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15894         flow analysis code for this.
15895
15896         * statement.cs (Do, While, For): Tell the flow analysis code about
15897         infinite loops.
15898         (FlowBranching.UsageVector): Added support for infinite loops.
15899         (Block.Resolve): Moved the dead code elimination here and use flow
15900         analysis to do it.
15901
15902 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15903
15904         * class.cs (Field.Define): Catch cycles on struct type
15905         definitions. 
15906
15907         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15908         fields if the fields are static.  We only need to check instance
15909         fields. 
15910
15911         * expression.cs (As.DoResolve): Test for reference type.
15912
15913         * statement.cs (Using.ResolveExpression): Use
15914         ConvertImplicitRequired, not ConvertImplicit which reports an
15915         error on failture
15916         (Using.ResolveLocalVariableDecls): ditto.
15917
15918         * expression.cs (Binary.ResolveOperator): Report errors in a few
15919         places where we had to.
15920
15921         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15922
15923 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15924
15925         * expression.cs: Use StoreFromPtr instead of extracting the type
15926         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15927
15928         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15929         an enumeration value to a System.Enum, but System.Enum is not a
15930         value type, but an class type, so we need to box.
15931
15932         (Expression.ConvertExplicit): One codepath could return
15933         errors but not flag them.  Fix this.  Fixes #31853
15934
15935         * parameter.cs (Resolve): Do not allow void as a parameter type.
15936
15937 2002-10-06  Martin Baulig  <martin@gnome.org>
15938
15939         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15940         if it's a class type and not a struct.  Fixes #31815.
15941
15942 2002-10-06  Martin Baulig  <martin@gnome.org>
15943
15944         * statement.cs: Reworked the flow analysis code a bit to make it
15945         usable for dead code elimination.
15946
15947 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15948
15949         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15950
15951 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15952
15953         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15954         to fix the test 165, will investigate deeper.
15955
15956 2002-10-04  Martin Baulig  <martin@gnome.org>
15957
15958         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15959         finally blocks actually work.
15960         (Try.Resolve): We don't need to create a sibling for `finally' if
15961         there is no finally block.
15962
15963 2002-10-04  Martin Baulig  <martin@gnome.org>
15964
15965         * class.cs (Constructor.Define): The default accessibility for a
15966         non-default constructor is private, not public.
15967
15968 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15969
15970         * class.cs (Constructor): Make AllowedModifiers public, add
15971         EXTERN.
15972
15973         * cs-parser.jay: Perform the modifiers test here, as the
15974         constructor for the Constructor class usually receives a zero
15975         because of the way we create it (first we create, later we
15976         customize, and we were never checking the modifiers).
15977
15978         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15979         is a version of LookupTypeReflection that includes the type-name
15980         cache.  This can be used as a fast path for functions that know
15981         the fully qualified name and are only calling into *.GetType() to
15982         obtain a composed type.
15983
15984         This is also used by TypeManager.LookupType during its type
15985         composition.
15986
15987         (LookupType): We now also track the real type name, as sometimes
15988         we can get a quey for the real type name from things like
15989         ComposedCast.  This fixes bug 31422.
15990
15991         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15992         complete type fullname, it does not have to go through the type
15993         resolution system to obtain the composed version of the type (for
15994         obtaining arrays or pointers).
15995
15996         (Conditional.Emit): Use the EmitBoolExpression to
15997         generate nicer code, as requested by Paolo.
15998
15999         (ArrayCreation.CheckIndices): Use the patch from
16000         hwang_rob@yahoo.ca to validate the array initializers. 
16001
16002 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * class.cs (ConstructorInitializer.Emit): simplify code by using
16005         Invocation.EmitCall, and at the same time, fix the bugs in calling
16006         parent constructors that took variable arguments. 
16007
16008         * ecore.cs (Expression.ConvertNumericExplicit,
16009         Expression.ImplicitNumericConversion): Remove the code that
16010         manually wrapped decimal (InternalTypeConstructor call is now gone
16011         as well).
16012
16013         * expression.cs (Cast.TryReduce): Also handle decimal types when
16014         trying to perform a constant fold on the type.
16015
16016         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16017
16018         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16019         that only turned off an error report, and did nothing else. 
16020
16021 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16022
16023         * driver.cs: Handle and ignore /fullpaths
16024
16025 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * expression.cs (Binary.ResolveOperator): Catch the case where
16028         DoNumericPromotions returns true, 
16029
16030         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16031
16032 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16035         report error 70.
16036
16037 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16040         conversion exists, but it is also required that the conversion be
16041         performed.  This manifested in "(Type64Enum) 2".  
16042
16043         * class.cs (TypeManager.AddMethod): The fix is not to change
16044         AddEnum, because that one was using a fully qualified name (every
16045         DeclSpace derivative does), but to change the AddMethod routine
16046         that was using an un-namespaced name.  This now correctly reports
16047         the duplicated name.
16048
16049         Revert patch until I can properly fix it.  The issue
16050         is that we have a shared Type space across all namespaces
16051         currently, which is wrong.
16052
16053         Options include making the Namespace a DeclSpace, and merge
16054         current_namespace/current_container in the parser.
16055
16056 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16057
16058         * cs-parser.jay: Improve error reporting when we get a different
16059         kind of expression in local_variable_type and
16060         local_variable_pointer_type. 
16061
16062         Propagate this to avoid missleading errors being reported.
16063
16064         * ecore.cs (ImplicitReferenceConversion): treat
16065         TypeManager.value_type as a target just like object_type.   As
16066         code like this:
16067
16068         ValueType v = 1;
16069
16070         Is valid, and needs to result in the int 1 being boxed before it
16071         is assigned to the value type v.
16072
16073         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16074         to validate the enumeration name.
16075
16076         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16077         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16078         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16079
16080         * ecore.cs (TryImplicitIntConversion): When doing an
16081         implicit-enumeration-conversion, check if the type is 64-bits and
16082         perform a conversion before passing to EnumConstant.
16083
16084 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16085
16086         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16087         report ambiguous type references.  Unlike the MS version, we
16088         report what the ambiguity is.   Innovation at work ;-)
16089
16090         (DeclSpace.FindType): Require a location argument to
16091         display when we display an ambiguous error.
16092
16093         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16094
16095         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16096
16097         * expression.cs (EmitDynamicInitializers): Apply patch from
16098         hwang_rob@yahoo.ca that fixes the order in which we emit our
16099         initializers. 
16100
16101 2002-09-21  Martin Baulig  <martin@gnome.org>
16102
16103         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16104         delegate takes no arguments.
16105
16106 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16107
16108         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16109         from integers.
16110
16111         * expression.cs: Extract the underlying type.
16112
16113         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16114
16115         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16116
16117 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16118
16119         * class.cs (TypeContainer.DefineType): We can not use the nice
16120         PackingSize with the size set to 1 DefineType method, because it
16121         will not allow us to define the interfaces that the struct
16122         implements.
16123
16124         This completes the fixing of bug 27287
16125
16126         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16127         means also structs.  This fixes part of the problem. 
16128         (Expresion.ImplicitReferenceConversionExists): ditto.
16129
16130         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16131         error if there were no errors reported during the type lookup
16132         process, to avoid duplicates or redundant errors.  Without this
16133         you would get an ambiguous errors plus a type not found.  We have
16134         beaten the user enough with the first error.  
16135
16136         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16137         reference. 
16138
16139         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16140         during the resolution process, stop the lookup, this avoids
16141         repeated error reports (same error twice).
16142
16143         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16144
16145         * typemanager.cs (LookupType): Redo the type lookup code to match
16146         the needs of System.Reflection.  
16147
16148         The issue is that System.Reflection requires references to nested
16149         types to begin with a "+" sign instead of a dot.  So toplevel
16150         types look like: "NameSpace.TopLevelClass", and nested ones look
16151         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16152         levels. 
16153
16154 2002-09-19  Martin Baulig  <martin@gnome.org>
16155
16156         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16157         says that a method always returns or always throws an exception,
16158         don't report the CS0161.
16159
16160         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16161         set `Returns = new_returns'.
16162
16163 2002-09-19  Martin Baulig  <martin@gnome.org>
16164
16165         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16166         to an enum constant, check for a CS0176.
16167
16168 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16169
16170         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16171         for operators that must be in pairs and report errors.
16172
16173         * ecore.cs (SimpleName.DoResolveType): During the initial type
16174         resolution process, when we define types recursively, we must
16175         check first for types in our current scope before we perform
16176         lookups in the enclosing scopes.
16177
16178         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16179
16180         (Invocation.VerifyArgumentsCompat): Call
16181         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16182         I thought we were supposed to always call this, but there are a
16183         few places in the code where we dont do it.
16184
16185 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16186
16187         * driver.cs: Add support in -linkres and -resource to specify the
16188         name of the identifier.
16189
16190 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16191
16192         * ecore.cs (StandardConversionExists): Sync with the conversion
16193         code: allow anything-* to void* conversions.
16194
16195         (FindMostSpecificSource): Use an Expression argument
16196         instead of a Type, because we might be handed over a Literal which
16197         gets a few more implicit conversions that plain types do not.  So
16198         this information was being lost.
16199
16200         Also, we drop the temporary type-holder expression when not
16201         required.
16202
16203 2002-09-17  Martin Baulig  <martin@gnome.org>
16204
16205         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16206         this is an explicit interface implementation.
16207
16208 2002-09-17  Martin Baulig  <martin@gnome.org>
16209
16210         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16211         different `IndexerName' attributes.
16212
16213         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16214         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16215         virtual CommonResolve().
16216
16217 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16218
16219         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16220         and convert that to the UnderlyingType.
16221
16222         * statement.cs (Foreach.Resolve): Indexers are just like variables
16223         or PropertyAccesses.
16224
16225         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16226         inside quoted strings, we were not doing this before.
16227
16228 2002-09-16  Martin Baulig  <martin@gnome.org>
16229
16230         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16231         resolve it.  This is needed for the definite assignment check of the
16232         instance expression, fixes bug #29846.
16233         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16234
16235 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16236
16237         * parameter.cs: Fix compile error.  Cannot reference static member
16238         from an instance object.  Is this an mcs bug?
16239
16240 2002-09-14  Martin Baulig  <martin@gnome.org>
16241
16242         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16243         multiple times.  Fixes bug #30295, added test-166.cs.
16244
16245 2002-09-14  Martin Baulig  <martin@gnome.org>
16246
16247         * statement.cs (Block.Emit): Don't emit unreachable code.
16248         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16249         `break' statements.
16250         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16251
16252 2002-09-14  Martin Baulig  <martin@gnome.org>
16253
16254         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16255         is set.
16256
16257 2002-09-14  Martin Baulig  <martin@gnome.org>
16258
16259         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16260         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16261         be false on the ms runtime.
16262
16263 2002-09-13  Martin Baulig  <martin@gnome.org>
16264
16265         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16266         the CS0038 error message.
16267
16268 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16269
16270         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16271         constant inside, return it.
16272
16273 2002-09-12  Martin Baulig  <martin@gnome.org>
16274
16275         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16276         implicit conversion can be done between enum types.
16277
16278         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16279         check whether an implicit conversion to the current enum's UnderlyingType
16280         exists and report an error if not.
16281
16282         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16283         without debugging support.
16284
16285         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16286         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16287
16288 2002-09-12  Martin Baulig  <martin@gnome.org>
16289
16290         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16291
16292         * ecore.cs (IMemberExpr.DeclaringType): New property.
16293         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16294         nonstatic member of an outer type (CS0038).
16295
16296 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * driver.cs: Activate the using-error detector at warning level
16299         4 (at least for MS-compatible APIs).
16300
16301         * namespace.cs (VerifyUsing): Small buglett fix.
16302
16303         * pending.cs (PendingImplementation): pass the container pointer. 
16304
16305         * interface.cs (GetMethods): Allow for recursive definition.  Long
16306         term, I would like to move every type to support recursive
16307         definitions, not the current ordering mechanism that we have right
16308         now.
16309
16310         The situation is this: Attributes are handled before interfaces,
16311         so we can apply attributes to interfaces.  But some attributes
16312         implement interfaces, we will now handle the simple cases
16313         (recursive definitions will just get an error).  
16314
16315         * parameter.cs: Only invalidate types at the end if we fail to
16316         lookup all types.  
16317
16318 2002-09-09  Martin Baulig  <martin@gnome.org>
16319
16320         * ecore.cs (PropertyExpr.Emit): Also check for
16321         TypeManager.system_int_array_get_length so this'll also work when
16322         compiling corlib.  Fixes #30003.
16323
16324 2002-09-09  Martin Baulig  <martin@gnome.org>
16325
16326         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16327         and throw an exception if we can't get the type's size.  Fixed #30040,
16328         added test-165.cs.
16329
16330 2002-09-09  Martin Baulig  <martin@gnome.org>
16331
16332         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16333
16334         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16335         context.  Fixes bug #30027.
16336
16337         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16338         virtual functions.  Fixes bug #30043, added test-164.cs.
16339
16340 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16341
16342         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16343
16344 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16345
16346         * driver.cs: Use an object to get the windows codepage since it's not a
16347         static property.
16348
16349 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16350
16351         * statement.cs (For.Emit): for infinite loops (test == null)
16352         return whether there is a break inside, not always "true".
16353
16354         * namespace.cs (UsingEntry): New struct to hold the name of the
16355         using definition, the location where it is defined, and whether it
16356         has been used in a successful type lookup.
16357
16358         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16359         strings.
16360
16361         * decl.cs: ditto.
16362
16363 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16364
16365         * attribute.cs : Fix incorrect code which relied on catching
16366         a NullReferenceException to detect a null being passed in
16367         where an object was expected.
16368
16369 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16370
16371         * statement.cs (Try): flag the catch variable as assigned
16372
16373         * expression.cs (Cast): Simplified by using ResolveType instead of
16374         manually resolving.
16375
16376         * statement.cs (Catch): Fix bug by using ResolveType.
16377
16378 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16379
16380         * expression.cs (BetterConversion): Special case for when we have
16381         a NullLiteral as the argument and we have to choose between string
16382         and object types - we choose string the way csc does.
16383
16384         * attribute.cs (Attribute.Resolve): Catch the
16385         NullReferenceException and report error #182 since the Mono
16386         runtime no more has the bug and having this exception raised means
16387         we tried to select a constructor which takes an object and is
16388         passed a null.
16389
16390 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16391
16392         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16393         message (1502, 1503) when we can't locate a method after overload
16394         resolution. This is much more informative and closes the bug
16395         Miguel reported.
16396
16397         * interface.cs (PopulateMethod): Return if there are no argument
16398         types. Fixes a NullReferenceException bug.
16399
16400         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16401         expressions too. Previously we were checking only in one place for
16402         positional arguments leaving out named arguments.
16403
16404         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16405         type to the enum type is not allowed. Remove code corresponding to
16406         that.
16407
16408         (ConvertNumericExplicit): Allow explicit conversions from
16409         the underlying type to enum type. This precisely follows the spec
16410         and closes a bug filed by Gonzalo.
16411
16412 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16413
16414         * compiler.csproj:
16415         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16416
16417 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16418
16419         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16420         it was important that we stored the right value after the
16421         reduction in `converted'.
16422
16423 2002-09-04  Martin Baulig  <martin@gnome.org>
16424
16425         * location.cs (Location.SymbolDocument): Use full pathnames for the
16426         source files.
16427
16428 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16429
16430         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16431         of the expression resolve mechanism, because that will catch the
16432         SimpleName error failures.
16433
16434         (Conditional): If we can not resolve the
16435         expression, return, do not crash.
16436
16437 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16438
16439         * cs-tokenizer.cs:
16440         (location): display token name instead of its number.
16441
16442 2002-08-28  Martin Baulig  <martin@gnome.org>
16443
16444         * expression.cs (Binary.ResolveOperator): Don't silently return
16445         but return an error if an operator cannot be applied between two
16446         enum types.
16447
16448 2002-08-28  Martin Baulig  <martin@gnome.org>
16449
16450         * class.cs (Constructor.Define): Set the permission attributes
16451         correctly instead of making all constructors public.
16452
16453 2002-08-28  Martin Baulig  <martin@gnome.org>
16454
16455         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16456         for private members before reporting a CS0103; if we find anything,
16457         it's a CS0122.
16458
16459 2002-08-28  Martin Baulig  <martin@gnome.org>
16460
16461         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16462         to check whether `closure_start_type == closure_invocation_type',
16463         we also need to check whether `m.DeclaringType == closure_invocation_type'
16464         before bypassing the permission checks.  We might be accessing
16465         protected/private members from the base class.
16466         (TypeManager.RealMemberLookup): Only set private_ok if private
16467         members were requested via BindingFlags.NonPublic.
16468
16469         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16470
16471         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16472         MethodGroupExpr.IsExplicitImpl if appropriate.
16473         (Invocation.DoResolve): Don't report the CS0120 for explicit
16474         interface implementations.
16475
16476 2002-08-27  Martin Baulig  <martin@gnome.org>
16477
16478         * expression.cs (Invocation.DoResolve): If this is a static
16479         method and we don't have an InstanceExpression, we must report
16480         a CS0120.
16481
16482 2002-08-25  Martin Baulig  <martin@gnome.org>
16483
16484         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16485         `==' between a valuetype and an object.
16486
16487 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * ecore.cs (TypeExpr): Provide a ToString method.
16490
16491 2002-08-24  Martin Baulig  <martin@gnome.org>
16492
16493         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16494         now called proggie.dbg and it's a binary file.
16495
16496 2002-08-23  Martin Baulig  <martin@gnome.org>
16497
16498         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16499
16500 2002-08-23  Martin Baulig  <martin@gnome.org>
16501
16502         * struct.cs (MyStructInfo.ctor): Make this work with empty
16503         structs; it's not allowed to use foreach() on null.
16504
16505 2002-08-23  Martin Baulig  <martin@gnome.org>
16506
16507         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16508         writer the full pathname of the generated assembly.
16509
16510 2002-08-23  Martin Baulig  <martin@gnome.org>
16511
16512         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16513         A `finally' block never returns or breaks; improved handling of
16514         unreachable code.
16515
16516 2002-08-23  Martin Baulig  <martin@gnome.org>
16517
16518         * statement.cs (Throw.Resolve): Allow `throw null'.
16519
16520 2002-08-23  Martin Baulig  <martin@gnome.org>
16521
16522         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16523         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16524         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16525         MemberLookup would return a wrong event if this is an explicit
16526         interface implementation and the class has an event with the same
16527         name.
16528
16529 2002-08-23  Martin Baulig  <martin@gnome.org>
16530
16531         * statement.cs (Block.AddChildVariableNames): New public method.
16532         (Block.AddChildVariableName): Likewise.
16533         (Block.IsVariableNameUsedInChildBlock): Likewise.
16534         (Block.AddVariable): Check whether a variable name has already
16535         been used in a child block.
16536
16537         * cs-parser.jay (declare_local_variables): Mark all variable names
16538         from the current block as being used in a child block in the
16539         implicit block.
16540
16541 2002-08-23  Martin Baulig  <martin@gnome.org>
16542
16543         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16544         find the symbol writer.
16545
16546         * driver.cs: csc also allows the arguments to /define being
16547         separated by commas, not only by semicolons.
16548
16549 2002-08-23  Martin Baulig  <martin@gnome.org>
16550
16551         * interface.cs (Interface.GetMembers): Added static check for events.
16552
16553 2002-08-15  Martin Baulig  <martin@gnome.org>
16554
16555         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16556         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16557
16558         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16559         why the MethodData.EmitDestructor() change was necessary.
16560
16561 2002-08-20  Martin Baulig  <martin@gnome.org>
16562
16563         * class.cs (TypeContainer.FindMembers): Added static check for events.
16564
16565         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16566
16567         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16568         use Type.GetEvents(), not Type.FindMembers().
16569
16570 2002-08-20  Martin Baulig  <martin@gnome.org>
16571
16572         * decl.cs (MemberCache): Added a special method cache which will
16573         be used for method-only searched.  This ensures that a method
16574         search will return a MethodInfo with the correct ReflectedType for
16575         inherited methods.      
16576
16577 2002-08-20  Martin Baulig  <martin@gnome.org>
16578
16579         * decl.cs (DeclSpace.FindMembers): Made this public.
16580
16581 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16582
16583         * delegate.cs: fixed build on windows.
16584         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16585
16586 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16587
16588         * ecore.cs (StandardConversionExists): Return a false
16589         if we are trying to convert the void type to anything else
16590         since that is not allowed.
16591
16592         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16593         we flag error 70 in the event an event is trying to be accessed
16594         directly from outside the declaring type.
16595
16596 2002-08-20  Martin Baulig  <martin@gnome.org>
16597
16598         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16599         MemberCache from typemanager.cs to decl.cs.
16600
16601 2002-08-19  Martin Baulig  <martin@gnome.org>
16602
16603         * class.cs (TypeContainer): Implement IMemberContainer.
16604         (TypeContainer.DefineMembers): Create the MemberCache.
16605         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16606         return public members if BindingFlags.Public was given, check
16607         whether members are static.
16608
16609 2002-08-16  Martin Baulig  <martin@gnome.org>
16610
16611         * decl.cs (DeclSpace.Define): Splitted this in Define and
16612         DefineMembers.  DefineMembers is called first and initializes the
16613         MemberCache.
16614
16615         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16616         DefineMembers() on all our DeclSpaces.
16617
16618         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16619         but call DefineMembers() on all nested interfaces.  We call their
16620         Define() in our new Define() function.
16621
16622         * interface.cs (Interface): Implement IMemberContainer.
16623         (Interface.Define): Moved all code except the attribute stuf to
16624         DefineMembers().
16625         (Interface.DefineMembers): Initialize the member cache.
16626
16627         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16628         need this anymore since we can use MemberCache.FindMembers directly.
16629
16630 2002-08-19  Martin Baulig  <martin@gnome.org>
16631
16632         * typemanager.cs (MemberCache): When creating the cache for an
16633         interface type, add all inherited members.
16634         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16635         to `out bool used_cache' and documented it.
16636         (TypeManager.MemberLookup): If we already used the cache in the first
16637         iteration, we don't need to do the interfaces check.
16638
16639 2002-08-19  Martin Baulig  <martin@gnome.org>
16640
16641         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16642         here from IMemberFinder and don't implement this interface anymore.
16643         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16644
16645         * typemanager.cs (IMemberFinder): This interface is now only used by
16646         classes which actually support the member cache.
16647         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16648         since we only put DeclSpaces into this Hashtable.
16649         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16650         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16651
16652 2002-08-16  Martin Baulig  <martin@gnome.org>
16653
16654         * typemanager.cs (ICachingMemberFinder): Removed.
16655         (IMemberFinder.MemberCache): New property.
16656         (TypeManager.FindMembers): Merged this with RealFindMembers().
16657         This function will never be called from TypeManager.MemberLookup()
16658         so we can't use the cache here, just the IMemberFinder.
16659         (TypeManager.MemberLookup_FindMembers): Check whether the
16660         IMemberFinder has a MemberCache and call the cache's FindMembers
16661         function.
16662         (MemberCache): Rewrote larger parts of this yet another time and
16663         cleaned it up a bit.
16664
16665 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16666
16667         * driver.cs (LoadArgs): Support quoting.
16668
16669         (Usage): Show the CSC-like command line arguments.
16670
16671         Improved a few error messages.
16672
16673 2002-08-15  Martin Baulig  <martin@gnome.org>
16674
16675         * typemanager.cs (IMemberContainer.Type): New property.
16676         (IMemberContainer.IsInterface): New property.
16677
16678         The following changes are conditional to BROKEN_RUNTIME, which is
16679         defined at the top of the file.
16680
16681         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16682         class'es members, but add all members from TypeHandle.ObjectType
16683         if we're an interface.
16684         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16685         is the current type.
16686         (MemberCache.CacheEntry.Container): Removed this field.
16687         (TypeHandle.GetMembers): Include inherited members.
16688
16689 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16690
16691         * typemanager.cs: fixed compilation and added a comment on a field that
16692         is never used.
16693
16694 2002-08-15  Martin Baulig  <martin@gnome.org>
16695
16696         * class.cs (ConstructorInitializer.Resolve): In the
16697         Expression.MemberLookup call, use the queried_type as
16698         invocation_type.
16699
16700         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16701         declared' attribute, it's always true.
16702         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16703         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16704         temporary wrapper for FindMembers which tells MemberLookup whether
16705         members from the base classes are included in the return value.
16706         This will go away soon.
16707         (TypeManager.MemberLookup): Use this temporary hack here; once the
16708         new MemberCache is completed, we don't need to do the DeclaredOnly
16709         looping here anymore since the MemberCache will take care of this.
16710         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16711         (MemberCache): When creating the MemberCache for a class, get
16712         members from the current class and all its base classes.
16713         (MemberCache.CacheEntry.Container): New field.  This is a
16714         temporary hack until the Mono runtime is fixed to distinguish
16715         between ReflectedType and DeclaringType.  It allows us to use MCS
16716         with both the MS runtime and the unfixed Mono runtime without
16717         problems and without accecting performance.
16718         (MemberCache.SearchMembers): The DeclaredOnly looping from
16719         TypeManager.MemberLookup is now done here.      
16720
16721 2002-08-14  Martin Baulig  <martin@gnome.org>
16722
16723         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16724         Type.GetFields on dynamic types but get the fields from the
16725         corresponding TypeContainer.
16726         (MyStructInfo.GetStructInfo): Added check for enum types.
16727
16728         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16729         (MemberList.SyncRoot): Implemented.
16730         (TypeManager.FilterWithClosure): No need to check permissions if
16731         closure_start_type == closure_invocation_type, don't crash if
16732         closure_invocation_type is null.
16733
16734 2002-08-13  Martin Baulig  <martin@gnome.org>
16735
16736         Rewrote TypeContainer.FindMembers to use a member cache.  This
16737         gives us a speed increase of about 35% for the self-hosting MCS
16738         build and of about 15-20% for the class libs (both on GNU/Linux).
16739
16740         * report.cs (Timer): New class to get enhanced profiling.  This
16741         whole class is "TIMER" conditional since it remarkably slows down
16742         compilation speed.
16743
16744         * class.cs (MemberList): New class.  This is an IList wrapper
16745         which we're now using instead of passing MemberInfo[]'s around to
16746         avoid copying this array unnecessarily.
16747         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16748         (ICachingMemberFinder, IMemberContainer): New interface.
16749         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16750         has already been checked, otherwise use it for the name comparision.
16751         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16752         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16753         if possible.  Returns a MemberList, not a MemberInfo [].
16754         (TypeHandle): New class, implements IMemberContainer.  We create
16755         one instance of this class per type, it contains a MemberCache
16756         which is used to do the member lookups.
16757         (MemberCache): New class.  Each instance of this class contains
16758         all members of a type and a name-based hash table.
16759         (MemberCache.FindMembers): This is our new member lookup
16760         function.  First, it looks up all members of the requested name in
16761         the hash table.  Then, it walks this list and sorts out all
16762         applicable members and returns them.
16763
16764 2002-08-13  Martin Baulig  <martin@gnome.org>
16765
16766         In addition to a nice code cleanup, this gives us a performance
16767         increase of about 1.4% on GNU/Linux - not much, but it's already
16768         half a second for the self-hosting MCS compilation.
16769
16770         * typemanager.cs (IMemberFinder): New interface.  It is used by
16771         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16772         Enum, Delegate or Interface.
16773         (TypeManager.finder_to_member_finder): New PtrHashtable.
16774         (TypeManager.finder_to_container): Removed.
16775         (TypeManager.finder_to_delegate): Removed.
16776         (TypeManager.finder_to_interface): Removed.
16777         (TypeManager.finder_to_enum): Removed.
16778
16779         * interface.cs (Interface): Implement IMemberFinder.
16780
16781         * delegate.cs (Delegate): Implement IMemberFinder.
16782
16783         * enum.cs (Enum): Implement IMemberFinder.
16784
16785         * class.cs (TypeContainer): Implement IMemberFinder.
16786
16787 2002-08-12  Martin Baulig  <martin@gnome.org>
16788
16789         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16790
16791 2002-08-12  Martin Baulig  <martin@gnome.org>
16792
16793         * ecore.cs (ITypeExpression): New interface for expressions which
16794         resolve to a type.
16795         (TypeExpression): Renamed to TypeLookupExpression.
16796         (Expression.DoResolve): If we're doing a types-only lookup, the
16797         expression must implement the ITypeExpression interface and we
16798         call DoResolveType() on it.
16799         (SimpleName): Implement the new ITypeExpression interface.
16800         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16801         hack, the situation that we're only looking up types can't happen
16802         anymore when this method is called.  Moved the type lookup code to
16803         DoResolveType() and call it.
16804         (SimpleName.DoResolveType): This ITypeExpression interface method
16805         is now doing the types-only lookup.
16806         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16807         (ResolveFlags): Added MaskExprClass.
16808
16809         * expression.cs (MemberAccess): Implement the ITypeExpression
16810         interface.
16811         (MemberAccess.DoResolve): Added support for a types-only lookup
16812         when we're called via ITypeExpression.DoResolveType().
16813         (ComposedCast): Implement the ITypeExpression interface.
16814
16815         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16816         Expression.Resolve() with ResolveFlags.Type instead.
16817
16818 2002-08-12  Martin Baulig  <martin@gnome.org>
16819
16820         * interface.cs (Interface.Define): Apply attributes.
16821
16822         * attribute.cs (Attribute.ApplyAttributes): Added support for
16823         interface attributes.
16824
16825 2002-08-11  Martin Baulig  <martin@gnome.org>
16826
16827         * statement.cs (Block.Emit): Only check the "this" variable if we
16828         do not always throw an exception.
16829
16830         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16831         whether the property has a set accessor.
16832
16833 2002-08-11  Martin Baulig  <martin@gnome.org>
16834
16835         Added control flow analysis support for structs.
16836
16837         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16838         with control flow analysis turned off.
16839         (IVariable): New interface.
16840         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16841         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16842         (FieldExpr.DoResolve): Resolve the instance expression with flow
16843         analysis turned off and do the definite assignment check after the
16844         resolving when we know what the expression will resolve to.
16845
16846         * expression.cs (LocalVariableReference, ParameterReference):
16847         Implement the new IVariable interface, only call the flow analysis
16848         code if ec.DoFlowAnalysis is true.
16849         (This): Added constructor which takes a Block argument.  Implement
16850         the new IVariable interface.
16851         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16852         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16853         This does the definite assignment checks for struct members.
16854
16855         * class.cs (Constructor.Emit): If this is a non-static `struct'
16856         constructor which doesn't have any initializer, call
16857         Block.AddThisVariable() to tell the flow analysis code that all
16858         struct elements must be initialized before control returns from
16859         the constructor.
16860
16861         * statement.cs (MyStructInfo): New public class.
16862         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16863         argument to this indexer.  If non-zero, check an individual struct
16864         member, not the whole struct.
16865         (FlowBranching.CheckOutParameters): Check struct members.
16866         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16867         overloaded versions of these methods which take an additional
16868         `int field_idx' argument to check struct members.
16869         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16870         overloaded versions of these methods which take an additional
16871         `string field_name' argument to check struct member.s
16872         (VariableInfo): Implement the IVariable interface.
16873         (VariableInfo.StructInfo): New public property.  Returns the
16874         MyStructInfo instance of the variable if it's a struct or null.
16875         (Block.AddThisVariable): New public method.  This is called from
16876         Constructor.Emit() for non-static `struct' constructor which do
16877         not have any initializer.  It creates a special variable for the
16878         "this" instance variable which will be checked by the flow
16879         analysis code to ensure that all of the struct's fields are
16880         initialized before control returns from the constructor.
16881         (UsageVector): Added support for struct members.  If a
16882         variable/parameter is a struct with N members, we reserve a slot
16883         in the usage vector for each member.  A struct is considered fully
16884         initialized if either the struct itself (slot 0) or all its
16885         members are initialized.
16886
16887 2002-08-08  Martin Baulig  <martin@gnome.org>
16888
16889         * driver.cs (Driver.MainDriver): Only report an error CS5001
16890         if there were no compilation errors.
16891
16892         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16893         `UnsafeContext' property to determine whether the parent is in
16894         unsafe context rather than checking the parent's ModFlags:
16895         classes nested in an unsafe class are unsafe as well.
16896
16897 2002-08-08  Martin Baulig  <martin@gnome.org>
16898
16899         * statement.cs (UsageVector.MergeChildren): Distinguish between
16900         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16901         we return.  Added test17() and test18() to test-154.cs.
16902
16903 2002-08-08  Martin Baulig  <martin@gnome.org>
16904
16905         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16906         Family access, make sure the invoking type isn't a subclass of the
16907         queried type (that'd be a CS1540).
16908
16909         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16910         this method which takes an additional `Type invocation_type'.
16911
16912         * expression.cs (BaseAccess.DoResolve): Use the base type as
16913         invocation and query type.
16914         (MemberAccess.DoResolve): If the lookup failed and we're about to
16915         report a CS0122, try a lookup with the ec.ContainerType - if this
16916         succeeds, we must report a CS1540.
16917
16918 2002-08-08  Martin Baulig  <martin@gnome.org>
16919
16920         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16921         (MethodGroupExpr): Implement the IMemberExpr interface.
16922
16923         * expression (MemberAccess.ResolveMemberAccess): No need to have
16924         any special code for MethodGroupExprs anymore, they're now
16925         IMemberExprs.   
16926
16927 2002-08-08  Martin Baulig  <martin@gnome.org>
16928
16929         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16930         Family, FamANDAssem and FamORAssem permissions.
16931         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16932
16933 2002-08-08  Martin Baulig  <martin@gnome.org>
16934
16935         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16936         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16937         or loop block.
16938
16939 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16940
16941         * driver.cs: implemented /resource option to embed managed resources.
16942
16943 2002-08-07  Martin Baulig  <martin@gnome.org>
16944
16945         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16946         (FieldBase.HasFieldInitializer): New public property.
16947         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16948         returns the field initializer and makes sure it is only resolved once.
16949         (TypeContainer.EmitFieldInitializers): Call
16950         FieldBase.GetInitializerExpression to get the initializer, this ensures
16951         that it isn't resolved multiple times.
16952
16953         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16954         the resolving process (SimpleName/MemberLookup) that we're currently
16955         emitting a field initializer (which must not access any instance members,
16956         this is an error CS0236).
16957
16958         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16959         argument, if the `IsFieldInitializer' flag is set, we must report and
16960         error CS0236 and not an error CS0120.   
16961
16962 2002-08-07  Martin Baulig  <martin@gnome.org>
16963
16964         * ecore.cs (IMemberExpr): New public interface.
16965         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16966         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16967         if the expression is an IMemberExpr.
16968
16969         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16970         to be null, implicitly default to `this' if we're non-static in
16971         this case.  Simplified the code a lot by using the new IMemberExpr
16972         interface.  Also fixed bug #28176 here.
16973
16974 2002-08-06  Martin Baulig  <martin@gnome.org>
16975
16976         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16977         ParameterReferences during semantic analysis so that we can do a
16978         type-only search when resolving Cast, TypeOf and SizeOf.
16979         (block): Pass the `current_local_parameters' to the Block's
16980         constructor.
16981
16982         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16983         argument to the constructor.
16984         (ConstructorInitializer.Resolve): Create a temporary implicit
16985         block with the parameters.
16986
16987         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16988         references here if we aren't doing a type-only search.
16989
16990         * statement.cs (Block): Added constructor which takes a
16991         `Parameters parameters' argument.
16992         (Block.Parameters): New public property.
16993
16994         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16995         to `Parameters' and made it public readonly.
16996
16997 2002-08-06  Martin Baulig  <martin@gnome.org>
16998
16999         * ecore.cs (Expression.Warning): Made this public as well.
17000
17001         * report.cs (Report.Debug): Print the contents of collections.
17002
17003 2002-08-06  Martin Baulig  <martin@gnome.org>
17004
17005         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17006         used to tell Resolve() which kinds of expressions it may return.
17007         (Expression.Resolve): Added overloaded version of this method which
17008         takes a `ResolveFlags flags' argument.  This can be used to tell
17009         Resolve() which kinds of expressions it may return.  Reports a
17010         CS0118 on error.
17011         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17012         ResolveFlags.SimpleName.
17013         (Expression.Error118): Added overloaded version of this method which
17014         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17015         which kinds of expressions are allowed.
17016
17017         * expression.cs (Argument.ResolveMethodGroup): New public method.
17018         Resolves an argument, but allows a MethodGroup to be returned.
17019         This is used when invoking a delegate.
17020
17021         * TODO: Updated a bit.
17022
17023 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17024
17025         Fixed compilation with csc.
17026
17027         * ecore.cs: Expression.Error made public. Is this correct? Should
17028         Warning be made public too?
17029
17030         * expression.cs: use ea.Location instead of ea.loc.
17031         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17032
17033 2002-08-06  Martin Baulig  <martin@gnome.org>
17034
17035         * ecore.cs (Expression.loc): Moved the location here instead of
17036         duplicating it in all derived classes.
17037         (Expression.Location): New public property.
17038         (Expression.Error, Expression.Warning): Made them non-static and
17039         removed the location argument.
17040         (Expression.Warning): Added overloaded version which takes an
17041         `int level' argument.
17042         (Expression.Error118): Make this non-static and removed the
17043         expression and location arguments.
17044         (TypeExpr): Added location argument to the constructor.
17045
17046         * expression.cs (StaticCallExpr): Added location argument to
17047         the constructor.
17048         (Indirection, PointerArithmetic): Likewise.
17049         (CheckedExpr, UnCheckedExpr): Likewise.
17050         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17051         (StringPtr): Likewise.
17052
17053
17054 2002-08-05  Martin Baulig  <martin@gnome.org>
17055
17056         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17057
17058         * assign.cs (Assign.DoResolve): Check whether the source
17059         expression is a value or variable.
17060
17061         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17062         while resolving the corresponding blocks.
17063
17064         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17065         an error, don't silently return null.
17066
17067         * statement.cs (Block.AddVariable): Do the error reporting here
17068         and distinguish between CS0128 and CS0136.
17069         (Block.DoResolve): Report all unused labels (warning CS0164).
17070         (LabeledStatement): Pass the location to the constructor.
17071         (LabeledStatement.HasBeenReferenced): New property.
17072         (LabeledStatement.Resolve): Set it to true here.
17073
17074         * statement.cs (Return.Emit): Return success even after reporting
17075         a type mismatch error (CS0126 or CS0127), this is what csc does and
17076         it avoids confusing the users with any consecutive errors.
17077
17078 2002-08-05  Martin Baulig  <martin@gnome.org>
17079
17080         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17081
17082         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17083
17084         * expression.cs (MemberAccess.DoResolve): Silently return if an
17085         error has already been reported.
17086
17087         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17088         error has already been reported.
17089
17090 2002-08-05  Martin Baulig  <martin@gnome.org>
17091
17092         * statement.cs (UsageVector): Only initialize the `parameters'
17093         vector if we actually have any "out" parameters.
17094
17095 2002-08-05  Martin Baulig  <martin@gnome.org>
17096
17097         * expression.cs (Binary.ResolveOperator): When combining delegates,
17098         they must have the same type.
17099
17100 2002-08-05  Martin Baulig  <martin@gnome.org>
17101
17102         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17103         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17104         work with the ms runtime and we also don't need it: if we're a
17105         PropertyBuilder and not in the `indexer_arguments' hash, then we
17106         are a property and not an indexer.
17107
17108         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17109         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17110         since the latter one doesn't work with the ms runtime.
17111
17112 2002-08-03  Martin Baulig  <martin@gnome.org>
17113
17114         Fixed bugs #27998 and #22735.
17115
17116         * class.cs (Method.IsOperator): New public field.
17117         (Method.CheckBase): Report CS0111 if there's already a method
17118         with the same parameters in the current class.  Report CS0508 when
17119         attempting to change the return type of an inherited method.
17120         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17121         and it's not marked abstract or extern.
17122         (PropertyBase): New abstract base class for Property and Indexer.
17123         (PropertyBase.CheckBase): Moved here from Property and made it work
17124         for indexers.
17125         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17126         the same so we can reuse it there.
17127         (Property, Indexer): Derive from PropertyBase.
17128         (MethodSignature.inheritable_property_signature_filter): New delegate
17129         to find properties and indexers.
17130
17131         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17132         argument and improved error reporting.
17133
17134         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17135         EmptyReadOnlyParameters and made it a property.
17136
17137         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17138         version of this method which takes a `PropertyInfo indexer'.
17139         (TypeManager.RegisterIndexer): New method.
17140
17141         * class.cs: Added myself as author of this file :-)
17142
17143 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17144
17145         * class.cs: fixed compilation on windoze.
17146
17147 2002-08-03  Martin Baulig  <martin@gnome.org>
17148
17149         * interface.cs (Interface.GetInterfaceBases): Check whether all
17150         base interfaces are at least as accessible than the current one.
17151
17152         * class.cs (TypeContainer.GetClassBases): Check whether base types
17153         are at least as accessible than the current type.
17154         (TypeContainer.AsAccessible): Implemented and made non-static.
17155         (MemberBase.CheckParameters): Report errors if the accessibility
17156         checks fail.
17157
17158         * delegate.cs (Delegate.Delegate): The default visibility is
17159         internal for top-level types and private for nested types.
17160         (Delegate.Define): Report errors if the accessibility checks fail.
17161
17162         * enum.cs (Enum.Enum): The default visibility is internal for
17163         top-level types and private for nested types.
17164         (Enum.DefineType): Compute the correct visibility.
17165
17166         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17167         function which takes a `bool is_toplevel' instead of a TypeContainer.
17168
17169         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17170         builtin type.
17171
17172 2002-08-02  Martin Baulig  <martin@gnome.org>
17173
17174         * expression.cs (LocalVariableReferenc): Added constructor which
17175         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17176         (LocalVariableReference.IsReadOnly): New property.
17177         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17178         variable is readonly, use our own readonly flag to do this; you can
17179         use the new constructor to get a writable reference to a read-only
17180         variable.
17181
17182         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17183         reference to the local variable.
17184
17185 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17186
17187         * rootcontext.cs (ResolveCore): Also include System.Exception
17188
17189         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17190         we reach an EmptyStatement.
17191
17192         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17193         is also fine.
17194
17195         * expression.cs (Binary.ResolveOperator): Check error result in
17196         two places.
17197
17198         use brtrue/brfalse directly and avoid compares to null.
17199
17200 2002-08-02  Martin Baulig  <martin@gnome.org>
17201
17202         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17203         Fixes bug #28407, added test-155.cs.
17204
17205 2002-08-01  Martin Baulig  <martin@gnome.org>
17206
17207         * class.cs (Event.EmitDefaultMethod): Make this work with static
17208         events.  Fixes #28311, added verify-3.cs.
17209
17210 2002-08-01  Martin Baulig  <martin@gnome.org>
17211
17212         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17213         `is_disposable' fields.
17214         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17215         `hm.is_disposable' if we're using the collection pattern.
17216         (Foreach.EmitCollectionForeach): Use the correct type for the
17217         enumerator's local variable, only emit the try/finally block if
17218         necessary (fixes #27713).
17219
17220 2002-08-01  Martin Baulig  <martin@gnome.org>
17221
17222         * ecore.cs (Expression.report118): Renamed to Error118 and made
17223         it public static.
17224
17225         * statement.cs (Throw.Resolve): Check whether the expression is of
17226         the correct type (CS0118) and whether the type derives from
17227         System.Exception (CS0155).
17228         (Catch.Resolve): New method.  Do the type lookup here and check
17229         whether it derives from System.Exception (CS0155).
17230         (Catch.CatchType, Catch.IsGeneral): New public properties.
17231
17232         * typemanager.cs (TypeManager.exception_type): Added.
17233
17234 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17235
17236         * driver.cs: Updated About function.
17237
17238 2002-07-31  Martin Baulig  <martin@gnome.org>
17239
17240         Implemented Control Flow Analysis.
17241
17242         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17243         (EmitContext.CurrentBranching): Added.
17244         (EmitContext.StartFlowBranching): Added.
17245         (EmitContext.EndFlowBranching): Added.
17246         (EmitContext.KillFlowBranching): Added.
17247         (EmitContext.IsVariableAssigned): Added.
17248         (EmitContext.SetVariableAssigned): Added.
17249         (EmitContext.IsParameterAssigned): Added.
17250         (EmitContext.SetParameterAssigned): Added.
17251         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17252         Added control flow analysis stuff here.
17253
17254         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17255         resolve the expression as lvalue.
17256         (LocalVariableReference.DoResolve): Check whether the variable has
17257         already been assigned.
17258         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17259         the parameter as assigned here.
17260         (ParameterReference.DoResolve): Check whether the parameter has already
17261         been assigned.
17262         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17263         expression as lvalue.
17264
17265         * statement.cs (FlowBranching): New class for the flow analysis code.
17266         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17267         (LabeledStatement.IsDefined): New public property.
17268         (LabeledStatement.AddUsageVector): New public method to tell flow
17269         analyis that the label may be reached via a forward jump.
17270         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17271         flow analysis.
17272         (VariableInfo.Number): New public field.  This is used by flow analysis
17273         to number all locals of a block.
17274         (Block.CountVariables): New public property.  This is the number of
17275         local variables in this block (including the locals from all parent
17276         blocks).
17277         (Block.EmitMeta): Number all the variables.
17278
17279         * statement.cs: Added flow analysis support to all classes.
17280
17281 2002-07-31  Martin Baulig  <martin@gnome.org>
17282
17283         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17284         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17285         then use this argument.
17286
17287         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17288
17289         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17290         use this to specify /define options.
17291
17292 2002-07-29  Martin Baulig  <martin@gnome.org>
17293
17294         * statement.cs (Fixed): Moved all code that does variable lookups
17295         and resolvings from Emit to Resolve.
17296
17297         * statement.cs (For): Moved all code that does variable lookups
17298         and resolvings from Emit to Resolve.
17299
17300         * statement.cs (Using): Moved all code that does variable lookups
17301         and resolvings from Emit to Resolve.
17302
17303 2002-07-29  Martin Baulig  <martin@gnome.org>
17304
17305         * attribute.cs (Attribute.Resolve): Explicitly catch a
17306         System.NullReferenceException when creating the
17307         CustromAttributeBuilder and report a different warning message.
17308
17309 2002-07-29  Martin Baulig  <martin@gnome.org>
17310
17311         * support.cs (ParameterData.ParameterName): Added method to
17312         get the name of a parameter.
17313
17314         * typemanager.cs (TypeManager.IsValueType): New public method.
17315
17316 2002-07-29  Martin Baulig  <martin@gnome.org>
17317
17318         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17319         is a flag which specifies that it's either ref or out.
17320         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17321         the out parameter to `out Parameter.Modifier mod', also set the
17322         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17323
17324         * support.cs (InternalParameters.ParameterModifier): Distinguish
17325         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17326         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17327
17328         * expression.cs (Argument.GetParameterModifier): Distinguish
17329         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17330         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17331
17332 2002-07-29  Martin Baulig  <martin@gnome.org>
17333
17334         * expression.cs (ParameterReference.ParameterReference): Added
17335         `Location loc' argument to the constructor.
17336
17337         * cs-parser.jay: Pass location to ParameterReference.
17338
17339 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17340
17341         * statement.cs (Try): Initialize the location.
17342
17343         * cs-parser.jay: pass location to Try.
17344
17345         * expression.cs (Unary.Reduce): Change the prototype to return
17346         whether a constant fold could be performed or not.  The result is
17347         returned in an out parameters.  In the case of Indirection and
17348         AddressOf, we want to perform the full tests.
17349
17350 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * statement.cs (Statement.Emit): Flag dead code.
17353
17354 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17355
17356         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17357
17358 2002-07-27  Martin Baulig  <martin@gnome.org>
17359
17360         * class.cs (MethodData.Define): Put back call to
17361         TypeManager.AddMethod(), accidentally commented this out.
17362
17363         * report.cs (Debug): New public method to print debugging information,
17364         this is `[Conditional ("DEBUG")]'.
17365
17366 2002-07-26  Martin Baulig  <martin@gnome.org>
17367
17368         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17369         (switch_statement): Push the current_block to the switch_stack and
17370         pop it again when we're done with the switch.
17371         (switch_section): The new block is a child of the current_block.
17372         Fixes bug #24007, added test-152.cs.
17373
17374 2002-07-27  Martin Baulig  <martin@gnome.org>
17375
17376         * expression.cs (Invocation.EmitArguments): When calling a varargs
17377         function with only its fixed arguments, we need to pass an empty
17378         array.
17379
17380 2002-07-27  Martin Baulig  <martin@gnome.org>
17381
17382         Mono 0.13 has been released.
17383
17384 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * driver.cs: Rename --resource to --linkres, because that is what
17387         we do currently, we dont support --resource yet.
17388
17389         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17390
17391 2002-07-25  Martin Baulig  <martin@gnome.org>
17392
17393         * class.cs (MethodData): New public class.  This is a `method builder'
17394         class for a method or one accessor of a Property/Indexer/Event.
17395         (MethodData.GetMethodFlags): Moved here from MemberBase.
17396         (MethodData.ApplyAttributes): Likewise.
17397         (MethodData.ApplyObsoleteAttribute): Likewise.
17398         (MethodData.ApplyConditionalAttribute): Likewise.
17399         (MethodData.ApplyDllImportAttribute): Likewise.
17400         (MethodData.CheckAbstractAndExternal): Likewise.
17401         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17402         (MethodData.Emit): Formerly known as Method.Emit().
17403         (MemberBase): Moved everything which was specific to a single
17404         accessor/method to MethodData.
17405         (Method): Create a new MethodData and call Define() and Emit() on it.
17406         (Property, Indexer, Event): Create a new MethodData objects for each
17407         accessor and call Define() and Emit() on them.
17408
17409 2002-07-25  Martin Baulig  <martin@gnome.org>
17410
17411         Made MethodCore derive from MemberBase to reuse the code from there.
17412         MemberBase now also checks for attributes.
17413
17414         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17415         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17416         as virtual.
17417         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17418         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17419         (MemberBase.ApplyAttributes): New virtual method; applies the
17420         attributes to a method or accessor.
17421         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17422         (MemberBase.ApplyConditionalAttribute): Likewise.
17423         (MemberBase.ApplyDllImportAttribute): Likewise.
17424         (MemberBase.CheckAbstractAndExternal): Likewise.
17425         (MethodCore.ParameterTypes): This is now a property instead of a
17426         method, it's initialized from DoDefineParameters().
17427         (MethodCore.ParameterInfo): Removed the set accessor.
17428         (MethodCore.DoDefineParameters): New protected virtual method to
17429         initialize ParameterTypes and ParameterInfo.
17430         (Method.GetReturnType): We can now simply return the MemberType.
17431         (Method.GetMethodFlags): Override the MemberBase version and add
17432         the conditional flags.
17433         (Method.CheckBase): Moved some code from Define() here, call
17434         DoDefineParameters() here.
17435         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17436         here to avoid some larger code duplication.
17437         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17438         ensure that abstract and external accessors don't declare a body.
17439
17440         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17441         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17442         lookup in the attribute's parent classes, so we need to abort as soon
17443         as we found the first match.
17444         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17445         the attribute has no arguments.
17446
17447         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17448         of a Method.
17449
17450 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17451
17452         * cs-parser.jay: reverted previous patch.
17453
17454 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17455
17456         * cs-parser.jay: fixed bug #22119.
17457
17458 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17459
17460         * attribute.cs: fixed compilation. The error was:
17461         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17462         be assigned to before control leaves the current method."
17463         [FIXME:  Filed as bug #28186: MCS must report this error.]
17464
17465 2002-07-25  Martin Baulig  <martin@gnome.org>
17466
17467         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17468         method to pull the condition name ouf of a Conditional attribute.
17469         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17470         the obsolete message and error flag out of an Obsolete attribute.
17471
17472         * class.cs (Method.GetMethodFlags): New public method to get the
17473         TypeManager.MethodFlags for this method.
17474         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17475         private methods.
17476         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17477         if we're overriding a virtual function, set the new private variable
17478         `parent_method'; call the new TypeManager.AddMethod().
17479
17480         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17481         the MethodBuilder and the Method in a PtrHashtable.
17482         (TypeManager.builder_to_method): Added for this purpose.
17483         (TypeManager.MethodFlags): Added IsObsoleteError.
17484         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17485         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17486         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17487         the message from the attribute.
17488
17489 2002-07-24  Martin Baulig  <martin@gnome.org>
17490
17491         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17492         preprocessor directives, ensure that the argument to #define/#undef is
17493         exactly one identifier and that it's actually an identifier.
17494
17495         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17496         did not work ....
17497
17498 2002-07-24  Martin Baulig  <martin@gnome.org>
17499
17500         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17501         initialize it to TypeManager.object_type in the constructor.
17502         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17503         of the `hm.get_current' method if we're using the collection pattern.
17504         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17505         for the explicit conversion to make it work when we're using the collection
17506         pattern and the `Current' property has a different return type than `object'.
17507         Fixes #27713.
17508
17509 2002-07-24  Martin Baulig  <martin@gnome.org>
17510
17511         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17512         does not match, but don't report any errors.  This method is called in
17513         order for all methods in a MethodGroupExpr until a matching method is
17514         found, so we don't want to bail out if the first method doesn't match.
17515         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17516         matches, report the 123.  Fixes #28070.
17517
17518 2002-07-24  Martin Baulig  <martin@gnome.org>
17519
17520         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17521         TypeManager.TypeToCoreType() to the top of the method so the
17522         following equality checks will work.  Fixes #28107.
17523
17524 2002-07-24  Martin Baulig  <martin@gnome.org>
17525
17526         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17527         operand is of type uint, and the other operand is of type sbyte,
17528         short or int, the operands are converted to type long." -
17529         Actually do what this comment already told us.  Fixes bug #28106,
17530         added test-150.cs.
17531
17532 2002-07-24  Martin Baulig  <martin@gnome.org>
17533
17534         * class.cs (MethodBase): New abstract class.  This is now a base
17535         class for Property, Indexer and Event to avoid some code duplication
17536         in their Define() and DefineMethods() methods.
17537         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17538         generic methods for Define() and DefineMethods().
17539         (FieldBase): Derive from MemberBase, not MemberCore.
17540         (Property): Derive from MemberBase, not MemberCore.
17541         (Property.DefineMethod): Moved all the code from this method to the
17542         new MethodBase.DefineAccessor(), just call it with appropriate
17543         argumetnts.
17544         (Property.Define): Call the new Property.DoDefine(), this does some
17545         sanity checks and we don't need to duplicate the code everywhere.
17546         (Event): Derive from MemberBase, not MemberCore.
17547         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17548         accessors, this will also make them work with interface events.
17549         (Indexer): Derive from MemberBase, not MemberCore.
17550         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17551         (Indexer.Define): Use the new MethodBase functions.
17552
17553         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17554         argument to the constructor.
17555         (Interface.FindMembers): Added support for interface events.
17556         (Interface.PopluateEvent): Implemented.
17557
17558         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17559
17560 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17563         but this is required to check for a method name being the same as
17564         the containing class.  
17565
17566         Handle this now.
17567
17568 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17569
17570         * interface.cs: initialize variable.
17571
17572 2002-07-23  Martin Baulig  <martin@gnome.org>
17573
17574         Implemented the IndexerName attribute in interfaces.
17575
17576         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17577         name if this is an explicit interface implementation.
17578         (Indexer.InterfaceIndexerName): New public variable.  If we're
17579         implementing an interface indexer, this is the IndexerName in that
17580         interface.  Otherwise, it's the IndexerName.
17581         (Indexer.DefineMethod): If we're implementing interface indexer,
17582         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17583         and Pending.ImplementIndexer methods.
17584         (Indexer.Define): Also define the PropertyBuilder if we're
17585         implementing an interface indexer and this is neither an explicit
17586         interface implementation nor do the IndexerName match the one in
17587         the interface.
17588
17589         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17590         If a method is defined here, then we always need to create a proxy
17591         for it.  This is used when implementing interface indexers.
17592         (Pending.IsInterfaceIndexer): New public method.
17593         (Pending.ImplementIndexer): New public method.
17594         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17595         This is used when implementing interface indexers to define a proxy
17596         if necessary.
17597         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17598         define a proxy if necessary.
17599
17600         * interface.cs (Interface.IndexerName): New public variable.
17601         (Interface.PopulateIndexer): Set the IndexerName.
17602         (Interface.DefineIndexers): New private method.  Populate all the
17603         indexers and make sure their IndexerNames match.
17604
17605         * typemanager.cs (IndexerPropertyName): Added support for interface
17606         indexers.
17607
17608 2002-07-22  Martin Baulig  <martin@gnome.org>
17609
17610         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17611         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17612         ret if HasReturnLabel.
17613         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17614         variables.
17615
17616         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17617         and set the ec.LoopBeginTryCatchLevel.
17618         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17619         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17620         the current ec.TryCatchLevel, the branch goes out of an exception
17621         block.  In this case, we need to use Leave and not Br.
17622
17623 2002-07-22  Martin Baulig  <martin@gnome.org>
17624
17625         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17626         block unless the block does not always return or it is contained in
17627         another try { ... } catch { ... } block.  Fixes bug #26506.
17628         Added verify-1.cs to the test suite.
17629
17630 2002-07-22  Martin Baulig  <martin@gnome.org>
17631
17632         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17633         then we do not always return.  Fixes bug #24985.
17634
17635 2002-07-22  Martin Baulig  <martin@gnome.org>
17636
17637         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17638         lookup on a per-class level; ie. walk up the class hierarchy until we
17639         found at least one applicable method, then choose the best among them.
17640         Fixes bug #24463 and test-29.cs.
17641
17642 2002-07-22  Martin Baulig  <martin@gnome.org>
17643
17644         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17645         return types of the methods.  The return type is not part of the
17646         signature and we must not check it to make the `new' modifier work.
17647         Fixes bug #27999, also added test-147.cs.
17648         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17649
17650         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17651         on the method's return type.
17652
17653 2002-07-21  Martin Baulig  <martin@gnome.org>
17654
17655         * assign.cs: Make this work if the rightmost source is a constant and
17656         we need to do an implicit type conversion.  Also adding a few more tests
17657         to test-38.cs which should have caught this.
17658
17659         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17660         target in the makefile for this.  The makefile.gnu is primarily intended
17661         for end-users who don't want to debug the compiler.
17662
17663 2002-07-21  Martin Baulig  <martin@gnome.org>
17664
17665         * assign.cs: Improved the Assign class so it can now handle embedded
17666         assignments (X = Y = Z = something).  As a side-effect this'll now also
17667         consume less local variables.  test-38.cs now passes with MCS, added
17668         a few new test cases to that test.
17669
17670 2002-07-20  Martin Baulig  <martin@gnome.org>
17671
17672         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17673         instructions.  Fixes bug #27977, also added test-146.cs.
17674
17675 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17676
17677         * cs-tokenizer.cs: fixed getHex ().
17678
17679 2002-07-19  Martin Baulig  <martin@gnome.org>
17680
17681         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17682         not Type.GetType() to lookup the array type.  This is needed when
17683         we're constructing an array of a user-defined type.
17684         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17685         single-dimensional arrays, but also for single-dimensial arrays of
17686         type decimal.
17687
17688 2002-07-19  Martin Baulig  <martin@gnome.org>
17689
17690         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17691         this function is called, it's not allowed to share LocalBuilders
17692         among ILGenerators.
17693
17694 2002-07-19  Martin Baulig  <martin@gnome.org>
17695
17696         * expression.cs (Argument.Resolve): Report an error 118 when trying
17697         to pass a type as argument.
17698
17699 2002-07-18  Martin Baulig  <martin@gnome.org>
17700
17701         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17702         Conv_R_Un for the signed `long' type.
17703
17704 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17705
17706         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17707         `expr' for the temporary result, as that will fail if we do
17708         multiple resolves on the same expression.
17709
17710 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17713         ec.TypeContainer for looking up aliases. 
17714
17715         * class.cs (TypeContainer): Remove LookupAlias from here.
17716
17717         * decl.cs (DeclSpace); Move here.
17718
17719 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17720
17721         * class.cs (FindMembers): Only call filter if the constructor
17722         bulider is not null.
17723
17724         Also handle delegates in `NestedTypes' now.  Now we will perform
17725         type lookups using the standard resolution process.  This also
17726         fixes a bug.
17727
17728         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17729         This uses Expressions (the limited kind that can be parsed by the
17730         tree) instead of strings.
17731
17732         * expression.cs (ComposedCast.ToString): Implement, used to flag
17733         errors since now we have to render expressions.
17734
17735         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17736         FormArrayType. 
17737
17738         * ecore.cs (SimpleName.ToString): ditto.
17739
17740         * cs-parser.jay: Instead of using strings to assemble types, use
17741         Expressions to assemble the type (using SimpleName, ComposedCast,
17742         MemberAccess).  This should fix the type lookups in declarations,
17743         because we were using a different code path for this.
17744
17745         * statement.cs (Block.Resolve): Continue processing statements
17746         even when there is an error.
17747
17748 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17749
17750         * class.cs (Event.Define): Also remove the `remove' method from
17751         the list of pending items.
17752
17753         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17754         generate more compact code. 
17755
17756 2002-07-17  Martin Baulig  <martin@gnome.org>
17757
17758         * const.cs (Const.LookupConstantValue): Add support for constant
17759         `unchecked' and `checked' expressions.
17760         Also adding test case test-140.cs for this.
17761
17762 2002-07-17  Martin Baulig  <martin@gnome.org>
17763
17764         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17765         check whether mi.ReturnType implements the IEnumerator interface; the
17766         `==' and the IsAssignableFrom() will fail in this situation.
17767
17768 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17769
17770         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17771         here too.
17772
17773 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17774
17775         * expression.cs: fixed bug #27811.
17776
17777 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17778
17779         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17780         Molaro: when we are a ref, the value already contains a pointer
17781         value, do not take the address of it.
17782
17783 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17784         * removed mb-parser.jay and mb-tokenizer.cs
17785
17786 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17787
17788         * expression.cs: check against the building corlib void type.
17789
17790 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17791
17792         * ecore.cs: fix for valuetype static readonly fields: when 
17793         initializing them, we need their address, not the address of a copy.
17794
17795 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17796
17797         * typemanager.cs: register also enum_type in corlib.
17798
17799 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17800
17801         * class.cs: allow calling this (but not base) initializers in structs.
17802
17803 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17804
17805         * ecore.cs: make sure we compare against the building base types
17806         in GetTypeSize ().
17807
17808 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17809
17810         * typemanager.cs: fix TypeToCoreType() to handle void and object
17811         (corlib gets no more typerefs after this change).
17812
17813 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17814
17815         * expression.cs (ArrayCreation.EmitArrayArguments): use
17816         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17817
17818         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17819         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17820         array indexes, the runtime actually forbids them.
17821
17822         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17823         for array arguments here.
17824
17825         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17826         instead of the default for ValueTypes.
17827
17828         (New.DoEmit): Use IsValueType instead of
17829         IsSubclassOf (value_type)
17830         (New.DoResolve): ditto.
17831         (Invocation.EmitCall): ditto.
17832
17833         * assign.cs (Assign): ditto.
17834
17835         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17836         Statements *are* currently doing part of their resolution during
17837         Emit.  
17838
17839         Expressions do always resolve during resolve, but statements are
17840         only required to propagate resolution to their children.
17841
17842 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17843
17844         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17845
17846         (LoadAssembly): Do not add the dll if it is already specified
17847
17848         (MainDriver): Add the System directory to the link path at the end,
17849         after all the other -L arguments. 
17850
17851         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17852         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17853         ldelem.u1) and using the opposite for sbytes.
17854
17855         This fixes Digger, and we can finally run it.
17856
17857         * driver.cs (UnixParseOption): Move the option parsing here.  
17858         (CSCParseOption): Implement CSC-like parsing of options.
17859
17860         We now support both modes of operation, the old Unix way, and the
17861         new CSC-like way.  This should help those who wanted to make cross
17862         platform makefiles.
17863
17864         The only thing broken is that /r:, /reference: and /lib: are not
17865         implemented, because I want to make those have the same semantics
17866         as the CSC compiler has, and kill once and for all the confussion
17867         around this.   Will be doing this tomorrow.
17868
17869         * statement.cs (Unsafe.Resolve): The state is checked during
17870         resolve, not emit, so we have to set the flags for IsUnsfe here.
17871
17872 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17875         not catch the Error_ObjectRefRequired in SimpleName (as it is
17876         possible to have a class/instance variable name that later gets
17877         deambiguated), we have to check this here.      
17878
17879 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17880
17881         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17882         make static and put into Expression.
17883
17884         (Event.Define): Register the private field of the event with the 
17885         TypeManager so that GetFieldFromEvent can get at it.
17886
17887         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17888         keep track of the private field associated with an event which
17889         has no accessors.
17890
17891         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17892         private field.
17893
17894         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17895
17896 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17897
17898         * expression.cs (Binary.EmitBranchable): this routine emits the
17899         Binary expression in a branchable context.  This basically means:
17900         we need to branch somewhere, not just get the value on the stack.
17901
17902         This works together with Statement.EmitBoolExpression.
17903
17904         * statement.cs (Statement.EmitBoolExpression): Use
17905         EmitBranchable. 
17906
17907 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17908
17909         * statement.cs (For): Reduce the number of jumps in loops.
17910
17911         (For): Implement loop inversion for the For statement.
17912
17913         (Break): We can be breaking out of a Try/Catch controlled section
17914         (foreach might have an implicit try/catch clause), so we need to
17915         use Leave instead of Br.
17916
17917         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17918         now).  If the instace expression supports IMemoryLocation, we use
17919         the AddressOf method from the IMemoryLocation to extract the
17920         address instead of emitting the instance.
17921
17922         This showed up with `This', as we were emitting the instance
17923         always (Emit) instead of the Address of This.  Particularly
17924         interesting when This is a value type, as we dont want the Emit
17925         effect (which was to load the object).
17926
17927 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17930
17931         * statement.cs (Checked): Set the CheckedState during the resolve
17932         process too, as the ConvCast operations track the checked state on
17933         the resolve process, and not emit.
17934
17935         * cs-parser.jay (namespace_member_declaration): Flag that we have
17936         found a declaration when we do.  This is used to flag error 1529
17937
17938         * driver.cs: Report ok when we display the help only.
17939
17940 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17941
17942         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17943
17944 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17945
17946         * cs-tokenizer.cs (define): We also have to track locally the
17947         defines.  AllDefines is just used for the Conditional Attribute,
17948         but we also need the local defines for the current source code. 
17949
17950 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * statement.cs (While, For, Do): These loops can exit through a
17953         Break statement, use this information to tell whether the
17954         statement is the last piece of code.
17955
17956         (Break): Flag that we break.
17957
17958         * codegen.cs (EmitContexts): New `Breaks' state variable.
17959
17960 2002-07-03  Martin Baulig  <martin@gnome.org>
17961
17962         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17963         modifiers in method declarations in structs.  Otherwise, you won't
17964         be able to override things like Object.Equals().
17965
17966 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17967
17968         * class.cs (Method, Property, Indexer): Do not allow the public
17969         modifier to be used in explicit interface implementations.
17970
17971         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17972         override modifiers in method declarations in structs
17973
17974 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17975
17976         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17977         integer or real overflow, report an error
17978
17979 2002-07-02  Martin Baulig  <martin@gnome.org>
17980
17981         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17982         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17983         to tell the runtime about our newly created System.Object and
17984         System.ValueType types.
17985
17986 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17987
17988         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17989         struct instead of Ldarg/Starg.
17990
17991 2002-07-02  Martin Baulig  <martin@gnome.org>
17992
17993         * expression.cs (Indirection.Indirection): Call
17994         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17995
17996 2002-07-02  Martin Baulig  <martin@gnome.org>
17997
17998         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17999         ValueType, call TypeManager.TypeToCoreType() on it.
18000         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18001         the OpCodes.Newarr argument.
18002
18003 2002-07-02  Martin Baulig  <martin@gnome.org>
18004
18005         * expression.cs (Invocation.EmitCall): When compiling corlib,
18006         replace all calls to the system's System.Array type to calls to
18007         the newly created one.
18008
18009         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18010         System.Array methods.
18011         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18012         from the system's System.Array type which must be replaced.
18013
18014 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18015
18016         * typemanager.cs: load unverifiable_code_ctor so we can build
18017         corlib using the correct type. Avoid using GetTypeCode() with
18018         TypeBuilders.
18019         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18020         TypeManager.object_type to allow building corlib.
18021
18022 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18023
18024         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18025
18026 2002-07-01  Martin Baulig  <martin@gnome.org>
18027
18028         * class.cs: Make the last change actually work, we need to check
18029         whether `ifaces != null' to avoid a crash.
18030
18031 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18032
18033         * class.cs: when we build structs without fields that implement
18034         interfaces, we need to add the interfaces separately, since there is
18035         no API to both set the size and add the interfaces at type creation
18036         time.
18037
18038 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18039
18040         * expression.cs: the dimension arguments to the array constructors
18041         need to be converted if they are a long.
18042
18043 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18044
18045         * class.cs: don't emit ldarg.0 if there is no parent constructor
18046         (fixes showstopper for corlib).
18047
18048 2002-06-29  Martin Baulig  <martin@gnome.org>
18049
18050         MCS now compiles corlib on GNU/Linux :-)
18051
18052         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18053         ie. check for MethodImplOptions.InternalCall.
18054
18055         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18056         and TypeManager.attribute_type are null, so we must explicitly check
18057         whether parent is not null to find out whether it's an attribute type.
18058         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18059         and SetBuilder, not only if the property is neither abstract nor external.
18060         This is necessary to set the MethodImplOptions on the accessor methods.
18061         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18062         SetBuilder, see Property.Emit().
18063
18064         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18065         populate "System.Object", "System.ValueType" and "System.Attribute" since
18066         they've already been populated from BootCorlib_PopulateCoreTypes().
18067
18068 2002-06-29  Martin Baulig  <martin@gnome.org>
18069
18070         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18071         is the NullLiteral, we also need to make sure that target_type is not
18072         an enum type.   
18073
18074 2002-06-29  Martin Baulig  <martin@gnome.org>
18075
18076         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18077         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18078         before calling BootstrapCorlib_ResolveDelegate ().
18079
18080 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18081
18082         * statement.cs: fixed build-breaker. All tests passed ok.
18083
18084 2002-06-27  Martin Baulig  <martin@gnome.org>
18085
18086         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18087         for System.Decimal when compiling corlib.
18088
18089 2002-06-27  Martin Baulig  <martin@gnome.org>
18090
18091         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18092         switch blocks which contain nothing but a default clause.
18093
18094 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18095
18096        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18097
18098 2002-06-27  Martin Baulig  <martin@gnome.org>
18099
18100         * ecore.cs (PropertyExpr.PropertyExpr): Call
18101         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18102
18103         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18104         is already a TypeBuilder.
18105
18106 2002-06-27  Martin Baulig  <martin@gnome.org>
18107
18108         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18109         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18110         the "from an array-type to System.Array" case.  This makes it work
18111         when compiling corlib.
18112
18113 2002-06-27  Martin Baulig  <martin@gnome.org>
18114
18115         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18116         non-static PropertyExpr, set its InstanceExpression.  This makes
18117         the `ICollection.Count' property work in System/Array.cs.
18118
18119 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18120
18121         * driver.cs: Made error handling more consistent.  Errors now
18122         tracked by Report class, so many methods which used to return int
18123         now return void.  Main() now prints success/failure and 
18124         errors/warnings message.
18125
18126         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18127         the magic number return values (123 and 124).  Now, if the
18128         expected error occurs, the compiler exits with success (exit value
18129         0).  If the compilation completes without seeing that particular
18130         error, the compiler exits with failure (exit value 1).  The
18131         makefile in mcs/errors has been changed to handle the new behaviour.
18132
18133         * report.cs: Made 'expected error' number a property and renamed
18134         it from 'Probe' to 'ExpectedError'.
18135
18136         * genericparser.cs: Removed error handling support, since it is
18137         now all done by Report class.
18138
18139         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18140         class, so parse() no longer returns an int.
18141
18142         * namespace.cs: Use Report.Error instead of GenericParser.error
18143
18144 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18145
18146         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18147         TypeContainer.AddOperator): At the front of the list put the
18148         explicit implementations, so they get resolved/defined first. 
18149
18150 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18151
18152         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18153         interface type is implemented by this TypeContainer.  Used during
18154         explicit interface implementation.
18155
18156         (Property.Define, Indexer.Define, Method.Define): Validate that
18157         the given interface in the explicit implementation is one of the
18158         base classes for the containing type.
18159
18160         Also if we are explicitly implementing an interface, but there is
18161         no match in the pending implementation table, report an error.
18162
18163         (Property.Define): Only define the property if we are
18164         not explicitly implementing a property from an interface.  Use the
18165         correct name also for those properties (the same CSC uses,
18166         although that is really not needed).
18167
18168         (Property.Emit): Do not emit attributes for explicitly implemented
18169         properties, as there is no TypeBuilder.
18170
18171         (Indexer.Emit): ditto.
18172
18173         Hiding then means that we do not really *implement* a pending
18174         implementation, which makes code fail.
18175
18176 2002-06-22  Martin Baulig  <martin@gnome.org>
18177
18178         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18179         the return value of Object.GetType().  [FIXME: we need to do this whenever
18180         we get a type back from the reflection library].
18181
18182 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18183
18184         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18185
18186 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * attribute.cs: Return null if we can not look up the type.
18189
18190         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18191         the interface types found.
18192
18193         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18194         interface types found.
18195
18196         * typemanager.cs (GetInterfaces): Make this routine returns alll
18197         the interfaces and work around the lame differences between
18198         System.Type and System.Reflection.Emit.TypeBuilder in the results
18199         result for GetInterfaces.
18200
18201         (ExpandInterfaces): Given an array of interface types, expand and
18202         eliminate repeated ocurrences of an interface.  This expands in
18203         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18204         be IA, IB, IC.
18205
18206 2002-06-21  Martin Baulig  <martin@gnome.org>
18207
18208         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18209         on System.Enum.
18210
18211 2002-06-21  Martin Baulig  <martin@gnome.org>
18212
18213         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18214         and called with one of the core types, return the corresponding typebuilder for
18215         that type.
18216
18217         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18218         element type.
18219
18220 2002-06-21  Martin Baulig  <martin@gnome.org>
18221
18222         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18223         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18224         (Expression.ConvertReferenceExplicit): Likewise.
18225
18226         * expression.cs (ElementAccess.DoResolve): Likewise.
18227         (ElementAccess.DoResolveLValue): Likewise.
18228
18229 2002-06-10  Martin Baulig  <martin@gnome.org>
18230
18231         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18232         add the "value" parameter to the parameter list.
18233
18234         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18235         to our caller.
18236
18237 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18240         the argument to an int, uint, long or ulong, per the spec.  Also
18241         catch negative constants in array creation.
18242
18243 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18244
18245         * class.cs: do not allow the same interface to appear twice in
18246         the definition list.
18247
18248 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18249
18250         * ecore.cs: don't use ldlen with System.Array.
18251
18252 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18253
18254         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18255
18256 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18257
18258         * modifiers.cs: produce correct field attributes for protected
18259         internal. Easy fix so miguel can work on ther harder stuff:-)
18260
18261 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * pending.cs: New file.  Move the code from class.cs here.
18264         Support clearning the pending flag for all methods (when not doing
18265         explicit interface implementation).
18266
18267 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18268
18269         * rootcontext.cs: added a couple more types needed to bootstrap.
18270
18271 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18272
18273         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18274         constructor in the type, instead of any constructor in the type
18275         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18276         a bug in the Mono runtime when applying the params attribute). 
18277
18278 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18279         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18280
18281 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18282
18283         * expression.cs (Unary.ResolveOperator): Use TypeManager
18284         to resolve the type.
18285
18286 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18287
18288         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18289         attached.
18290
18291         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18292         with each member too.
18293
18294         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18295         field builders too - this takes care of the enum member case.
18296
18297 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18298
18299         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18300         address-of operator on both value types and pointers.
18301
18302 2002-06-10  Martin Baulig  <martin@gnome.org>
18303
18304         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18305         PropertyBuilder to the `property_builders' list.
18306
18307         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18308         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18309         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18310         find any indexers which are inherited from an interface.
18311
18312 2002-06-09  Martin Baulig  <martin@gnome.org>
18313
18314         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18315         the same type as the constant if necessary.  There's also a test-130.cs
18316         for this.
18317
18318         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18319
18320         * typemanager.cs (TypeManager.ChangeType): Previously known as
18321         Enum.ChangeEnumType().
18322
18323 2002-06-09  Martin Baulig  <martin@gnome.org>
18324
18325         * expression.cs (Cast.TryReduce): Added support for consts.
18326
18327 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18328
18329         * class.cs (Accessor): Hold attributes information so we can pass
18330         it along.
18331
18332         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18333         Modify to pass in attributes attached to the methods.
18334
18335         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18336
18337         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18338         to handle the Accessor kind :-)
18339
18340         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18341
18342 2002-06-08  Martin Baulig  <martin@gnome.org>
18343
18344         * expression.cs (Unary.TryReduceNegative): Added support for
18345         ULongConstants.
18346
18347 2002-06-08  Martin Baulig  <martin@gnome.org>
18348
18349         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18350         name can't be found in the `defined_names' - the caller will do a
18351         MemberLookup in this case and thus find methods in System.Enum
18352         such as Enum.IsDefined().
18353
18354 2002-06-08  Martin Baulig  <martin@gnome.org>
18355
18356         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18357         Convert.ChangeType() which works with TypeBuilder created types.
18358         (Enum.LookupEnumValue, Enum.Define): Use it here.
18359
18360         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18361         `TypeBuilder.BaseType != null' check.
18362         (TypeContainer.FindMembers): Only lookup parent members if we
18363         actually have a parent.
18364         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18365         (ConstructorInitializer.Resolve): Likewise.
18366
18367         * interface.cs (Interface.FindMembers): Added
18368         `TypeBuilder.BaseType != null' check.
18369
18370         * rootcontext.cs (RootContext.ResolveCore): Added
18371         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18372         classes_second_stage.
18373
18374         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18375         debug_type and trace_type when compiling with --nostdlib.       
18376
18377 2002-06-07  Martin Baulig  <martin@gnome.org>
18378
18379         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18380         (AddField): Set it to true when adding a non-static field.
18381         (DefineType): Use `have_nonstatic_fields' to find out whether we
18382         have non-static fields, not `Fields != null'.
18383
18384 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18385
18386         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18387         dereferencing a null on the static-field code path)
18388
18389 2002-05-30  Martin Baulig  <martin@gnome.org>
18390
18391         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18392         to take command line arguments.  Use reflection to call the new
18393         custom `Initialize' function on the symbol writer and pass it the
18394         command line arguments.
18395
18396         * driver.cs (--debug-args): New command line argument to pass command
18397         line arguments to the symbol writer.
18398
18399 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18400
18401         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18402         the target type for indexers and properties.  Thanks to Joe for
18403         catching this.
18404
18405 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18406
18407         * typemanager.cs (MethodFlags): returns the method flags
18408         (Obsolete/ShouldIgnore) that control warning emission and whether
18409         the invocation should be made, or ignored. 
18410
18411         * expression.cs (Invocation.Emit): Remove previous hack, we should
18412         not do this on matching a base type, we should do this based on an attribute
18413
18414         Only emit calls to System.Diagnostics.Debug and
18415         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18416         on the command line.
18417
18418         * rootcontext.cs: Global settings for tracing and debugging.
18419
18420         * cs-tokenizer.cs (define): New utility function to track
18421         defines.   Set the global settings for TRACE and DEBUG if found.
18422
18423 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18424
18425         * interface.cs (Populate*): Pass in the TypeContainer as well as
18426         the DeclSpace as parameters so that we can create EmitContexts and
18427         then use that to apply attributes etc.
18428
18429         (PopulateMethod, PopulateEvent, PopulateProperty)
18430         (PopulateIndexer): Apply attributes everywhere.
18431
18432         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18433         etc.
18434
18435         (ApplyAttributes): Update accordingly.
18436
18437         We now apply interface attributes for all members too.
18438
18439 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18440
18441         * class.cs (Indexer.Define); Correctly check if we are explicit
18442         implementation (instead of checking the Name for a ".", we
18443         directly look up if the InterfaceType was specified).
18444
18445         Delay the creation of the PropertyBuilder.
18446
18447         Only create the PropertyBuilder if we are not an explicit
18448         interface implementation.   This means that explicit interface
18449         implementation members do not participate in regular function
18450         lookups, and hence fixes another major ambiguity problem in
18451         overload resolution (that was the visible effect).
18452
18453         (DefineMethod): Return whether we are doing an interface
18454         implementation. 
18455
18456         * typemanager.cs: Temporary hack until we get attributes in
18457         interfaces (Ravi is working on that) and we get IndexerName
18458         support in interfaces.
18459
18460         * interface.cs: Register the indexers as properties.
18461
18462         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18463         warning, I have verified that this is a bug in the .NET runtime
18464         (JavaScript suffers of the same problem).
18465
18466         * typemanager.cs (MemberLookup): When looking up members for
18467         interfaces, the parent of an interface is the implicit
18468         System.Object (so we succeed in searches of Object methods in an
18469         interface method invocation.  Example:  IEnumerable x;  x.ToString
18470         ()) 
18471
18472 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * class.cs (Event): Events should also register if they do
18475         implement the methods that an interface requires.
18476
18477         * typemanager.cs (MemberLookup); use the new GetInterfaces
18478         method. 
18479
18480         (GetInterfaces): The code used to lookup interfaces for a type is
18481         used in more than one place, factor it here. 
18482
18483         * driver.cs: Track the errors at the bottom of the file, we kept
18484         on going.
18485
18486         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18487         instance if the method we are calling is static!
18488
18489 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18490
18491         * attribute.cs (ApplyAttributes): Make this function filter out
18492         the IndexerName attribute (as that attribute in reality is never
18493         applied) and return the string constant for the IndexerName
18494         attribute. 
18495
18496         * class.cs (TypeContainer.Emit): Validate that all the indexers
18497         have the same IndexerName attribute, and if so, set the
18498         DefaultName attribute on the class. 
18499
18500         * typemanager.cs: The return value might contain other stuff (not
18501         only methods).  For instance, consider a method with an "Item"
18502         property and an Item method.
18503
18504         * class.cs: If there is a problem with the parameter types,
18505         return. 
18506
18507 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18508
18509         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18510         looks at user defined conversion after making a call to 
18511         StandardConversionExists - we need this for overload resolution.
18512
18513         * expression.cs : Update accordingly the various method calls.
18514
18515         This fixes 2 bugs filed against implicit user defined conversions 
18516
18517 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18518
18519         * statement.cs: Track the result of the assignment.
18520
18521 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18522
18523         * expression.cs (MemberAccess): Improved error reporting for
18524         inaccessible members.
18525
18526 2002-05-22  Martin Baulig  <martin@gnome.org>
18527
18528         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18529         itself with debugging support.
18530
18531 2002-05-22  Martin Baulig  <martin@gnome.org>
18532
18533         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18534         Removed, this isn't needed anymore.
18535
18536 2002-05-20  Martin Baulig  <martin@gnome.org>
18537
18538         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18539         be underlying type for an enum.
18540
18541 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18542
18543         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18544         that splits out the loading of just the core types.
18545
18546         * rootcontext.cs (ResolveCore): Split the struct resolution in
18547         two, so we can load the enumeration underlying types before any
18548         enums are used.
18549
18550         * expression.cs (Is): Bandaid until we fix properly Switch (see
18551         bug #24985 for details).
18552
18553         * typemanager.cs (ImplementsInterface): The hashtable will contain
18554         a null if there are no interfaces implemented.
18555
18556 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18557
18558         * cs-parser.jay (indexer_declarator): It is fine to have array
18559         parameters
18560
18561 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18562
18563         * typemanager.cs: (RegisterBuilder): New function used to register
18564         TypeBuilders that implement interfaces.  Since
18565         TypeBuilder.GetInterfaces (as usual) does not work with lame
18566         Reflection.Emit. 
18567         (AddUserType): register interfaces.
18568
18569         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18570         dealing with TypeBuilder.  Also, arrays are showing up as
18571         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18572         methods can not be invoked on them!
18573
18574         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18575         (ImplicitReferenceConversionExists): Split out from
18576         StandardConversionExists. 
18577
18578         * expression.cs (As): We were only implementing one of the three
18579         cases for the as operator.  We now implement them all.
18580         (Is): Implement the various other cases for Is as well.
18581
18582         * typemanager.cs (CACHE): New define used to control if we want or
18583         not the FindMembers cache.  Seems to have a negative impact on
18584         performance currently
18585
18586         (MemberLookup): Nested types have full acess to
18587         enclosing type members
18588
18589         Remove code that coped with instance/static returns for events, we
18590         now catch this in RealFindMembers.
18591
18592         (RealFindMembers): only perform static lookup if the instance
18593         lookup did not return a type or an event.  
18594
18595 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18596
18597         * assign.cs (CompoundAssign): We pass more semantic information
18598         now to Compound Assignments than we did before: now we have all
18599         the information at hand, and now we resolve the target *before* we
18600         do the expression expansion, which allows the "CacheValue" method
18601         to have the effect we intended (before, a [x] += 1 would generate
18602         two differen ArrayAccess expressions from the ElementAccess,
18603         during the resolution process).
18604
18605         (CompoundAssign.DoResolve): Resolve target and original_source here.
18606
18607 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18608
18609         * expression.cs (ArrayAccess): dropped debugging information. 
18610
18611         * typemanager.cs: Small bug fix: I was always returning i_members,
18612         instead of one of i_members or s_members (depending on which had
18613         the content).
18614
18615         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18616         method is invoked before any code generation takes place, and it
18617         is a mechanism to inform that the expression will be invoked more
18618         than once, and that the method should use temporary values to
18619         avoid having side effects
18620
18621         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18622
18623         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18624         implementation.
18625
18626         * expression.cs (Indirection, ArrayAccess): Add support for
18627         CacheTemporaries in these two bad boys. 
18628
18629         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18630         ldobj or ldind_ref.  
18631         (StoreFromPtr): Handle stobj as well.
18632
18633         * expression.cs (UnaryMutator): Share more code.
18634
18635         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18636         down: I was not tracking the Filter function as well, which
18637         was affecting the results of the cache.
18638
18639 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18640
18641         * attribute.cs: Remove the hack to handle the CharSet property on
18642         StructLayouts. 
18643
18644 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18645
18646         * attribute.cs (DoResolve): More uglyness, we now only try to
18647         resolve the attribute partially, to extract the CharSet
18648         information (only if we are a StructLayout attribute).  Otherwise 
18649
18650         (GetExtraTypeInfo): Add some code to conditionally kill in the
18651         future this.   I am more and more convinced that the .NET
18652         framework has special code to handle the attribute setting on
18653         certain elements.
18654
18655         * expression.cs (IsParamsMethodApplicable): Revert my previous
18656         foreach change here, it was wrong.
18657
18658 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18659
18660         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18661         (pp_expr): do not abort on unknown input, just return.
18662         (eval): abort if there are pending chars.
18663
18664         * attribute.cs (Attribute.Resolve): Positional parameters are
18665         optional.  Deal with that case.
18666
18667         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18668         the Ansi/Unicode/Auto information for the type.
18669
18670         (TypeContainer.DefineType): instantiate the EmitContext here, as
18671         we will be using it during the type definition (to resolve
18672         attributes) and during the emit phase.
18673
18674         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18675         to pull type information out of the attributes
18676
18677         (Attribute.Resolve): track the constructor builder, and allow for
18678         multiple invocations (structs and classes will use this).
18679
18680         * ecore.cs (MemberLookupFinal): new version with all the
18681         parameters customizable.
18682
18683         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18684         constructors.  Return if the result value is null (as the error
18685         would have been flagged already by MemberLookupFinal)
18686
18687         Do not allow instances of abstract classes or interfaces to be
18688         created.
18689
18690         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18691         We have to compare the assembly property here when dealing with
18692         FamANDAssem and Assembly access modifiers, because we might be
18693         creating an assembly from *modules* (that means that we are not
18694         getting TypeBuilders for types defined in other modules that are
18695         part of this assembly).
18696
18697         (Method.Emit): If the method is marked abstract and has a body,
18698         emit an error. 
18699
18700         (TypeContainer.DefineMembers): If both the defined member and the
18701         parent name match are methods, then do not emit any warnings: let
18702         the Method.Define routine take care of flagging warnings.  But if
18703         there is a mismatch (method overrides something else, or method is
18704         overriwritten by something, then emit warning).
18705
18706         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18707         set to null, this means `do not check for the return type on the
18708         signature'. 
18709
18710         (Method.Define): set the return type for the method signature to
18711         null, so that we get methods with the same name and parameters and
18712         different return types.  This is used to flag warning 114 (you are
18713         hiding a method, and you probably want to use the new/override
18714         keywords instead).
18715
18716         * typemanager.cs (MemberLookup): Implemented proper access
18717         control, closing a long standing set of bug reports.  The problem
18718         was that the Framework only has two bits: Public and NonPublic,
18719         and NonPublic includes private and protected methods, but we need
18720         to enforce the FamANDAssem, FamOrAssem and Family. 
18721
18722 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18723
18724         * statement.cs (GotoCase): Return true: Ammounts to giving up
18725         knowledge on whether we return or not, and letting the other case
18726         be responsible for it.
18727
18728 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18729
18730         * driver.cs: Do not load directories for each file processed, only
18731         do it if there is a pattern.
18732
18733         * ecore.cs: Report readonly assigns here as well, as we might have
18734         been resolved only by MemberAccess.
18735
18736         (SimpleName.SimpleNameResolve): Also be useful for LValue
18737         resolution.   We need this to propagate assign to local readonly variables
18738
18739         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18740         do not want to reuse potential criteria memory.
18741
18742         * class.cs (MyEventBuilder): Set reflected_type;
18743
18744         * ecore.cs (Constantify): Added support for constifying bools.
18745
18746         (RootContext.LookupType): Added a cache for values looked up in
18747         the declaration space.
18748
18749         * typemanager.cs (FindMembers): Now is a front-end to
18750         RealFindMembers, and provides a two-level hashtable-based cache to
18751         the request.  
18752
18753         15% performance improvement: from 22.5 to 19.2 seconds.
18754
18755         * expression.cs (IsParamsMethodApplicable): use foreach.
18756         (Invocation.DoResolve): ditto.
18757         (New.DoResolve): ditto.
18758         (ArrayCreation.DoResolve): ditto.
18759
18760         * ecore.cs (FindMostEncompassingType): use foreach.
18761
18762         * delegate.cs (NewDelegate.DoResolve): Use foreach
18763
18764         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18765         (RemoveMethods): use foreach.
18766
18767         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18768         nested foreach statements instead of for, and also break out of
18769         the inner loop once a match is found.
18770
18771         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18772
18773 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18774
18775         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18776         we actually unwrap the expression to allow for extra information
18777         to be extracted. 
18778
18779         * expression.cs: Use Shr_Un on unsigned operations. 
18780
18781 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18782
18783         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18784         applicable operators was not being considered correctly. This closes
18785         the bug Miguel reported.
18786
18787 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18788
18789         * attribute.cs: check that the type derives from System.Attribute
18790         and report the correct error in that case (moved the duplicate code to
18791         its own method, too).
18792
18793 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18794
18795         * attribute.cs: lookup attribute type name as the spec says: first the
18796         bare attribute name and then name + "Attribute" (nant compiles with
18797         mcs after this fix).
18798
18799 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18802         Because of the way we parse things, we should try to see if a
18803         UIntConstant can fit in an integer.
18804
18805 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18806
18807         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18808         when we are in an explicit context.
18809
18810         (ConvertReferenceExplicit): When converting from Iface type S to Class
18811         T make sure the rules are implemented as an OR.
18812
18813         * parameter.cs (ParameterType): Make it a property for now although the
18814         purpose really isn't anything immediate.
18815
18816         * expression.cs (Is*Applicable): Do better checking on the parameter type
18817         of a ref/out parameter. The ones from the system assemblies are already 
18818         marked with the correct type so we don't need to do any correction.
18819
18820         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18821         the object type is standard too so include that.
18822
18823 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18824
18825         * ecore.cs (StandardConversionExists): Augment with missing code:
18826         deal with IntConstant, LongConstants and Enumerations.
18827
18828         * assign.cs: Report the error, instead of failing silently
18829
18830         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18831         typecontainer that they are declared, because the
18832         typecontainer/namespace will have the list of using clauses that
18833         need to be applied.
18834
18835         Assembly Attributes were escaping the normal registration
18836         mechanism. 
18837
18838         (EmitCode): Apply attributes within an EmitContext that represents
18839         the container they were declared on.
18840
18841         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18842
18843 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18844
18845         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18846         Revamp completely - make much cleaner as we now operate only
18847         on a set of Types.
18848
18849         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18850         to implement the logic detailed in the spec more correctly.
18851
18852         (UserDefinedConversion): Update accordingly.
18853
18854 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * statement.cs: Return flow analysis information up.
18857
18858         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18859         and the default.
18860
18861         (token): Do not consume an extra character before calling
18862         decimal_digits.
18863
18864 2002-05-06  Piers Haken <piersh@friskit.com>
18865
18866         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18867
18868 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18869
18870         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18871         EmitContext during the instance constructor initializer
18872         resolution, to stop access to instance variables.
18873
18874         This is mandated by the spec, last paragraph of the `constructor
18875         initializers' section. 
18876
18877 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18878
18879         * cs-parser.jay, class.cs (Accessor): new class used to represent
18880         an accessor (get or set).  In the past we used `null' to represent
18881         a missing accessor.  But this is ambiguous because there was no
18882         way to tell in abstract indexers/properties if one of them was
18883         specified.
18884
18885         Now there is a way of addressing that.
18886
18887         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18888         instead of FindMembers.
18889
18890         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18891         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18892
18893         * attribute.cs: Treat indexers and properties as the same in terms
18894         of applying attributes
18895
18896         * ecore.cs (FindMostEncompassedType): Use statically initialized
18897         EmptyExpressions()s like we do elsewhere to avoid creating useless
18898         objects (and we take this out of the tight loop).
18899
18900         (GetConversionOperators): Move the code to extract the actual
18901         operators to a separate routine to clean things up.
18902
18903 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18906         events are always registered FieldBuilders.
18907
18908         * class.cs (FieldBase): New class shared by Fields 
18909
18910         * delegate.cs: If we are a toplevel delegate, use our full name.
18911         If we are a nested delegate, then only use our tail name.
18912
18913 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18914
18915         * expression.cs (IsApplicable): Ensure that we add the "&" to
18916         ref/out types before comparing it with the type of the argument.
18917
18918         (IsParamsMethodApplicable): Ditto.
18919
18920         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18921         silly me ;-)
18922
18923         * delegate.cs : Handle the case when we have more than one applicable
18924         method. Flag an error only when we finish checking all.
18925
18926 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18927
18928         * expression.cs: Add support for boolean static initializers.
18929
18930 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18931
18932         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18933
18934         * parameter.cs (ComputeParameterTypes,
18935         ComputeAndDefineParameterTypes): Better error handling: now we
18936         clear the `types' cache if we fail during any of the type lookups.
18937         We also return the status code correctly to our caller
18938
18939         * delegate.cs: If we fail to define a delegate, abort the extra
18940         steps. 
18941
18942         * expression.cs (Binary.ResolveOperator): for
18943         operator==(object,object) and operator !=(object, object) we also
18944         have to verify that there is an implicit conversion from one to
18945         the other.
18946
18947         (ArrayAccess.DoResolve): Array Access can operate on
18948         non-variables. 
18949
18950 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * assign.cs (CompoundAssign): A new class used as a "flag" that
18953         the assignment actually is happening as part of a compound
18954         assignment operator.
18955
18956         During compound assignment, a few new rules exist to enable things
18957         like:
18958
18959         byte b |= 1 + 2
18960
18961         From the spec:
18962
18963         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18964         to the type of x) if y is implicitly convertible to the type of x,
18965         and the operator is a builtin operator and the return type of the
18966         operator is explicitly convertible to the type of x. 
18967
18968         * rootcontext.cs: Reset warning level to 2.  4 catches various
18969         "interesting" features in mcs, we must clean this up at some
18970         point, but currently am trying to kill other bugs ;-)
18971
18972         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18973         in container classes as well.  
18974
18975         * expression.cs (Binary.ResolveOperator): Handle string case
18976         before anything else (as operator overloading does emit an error
18977         before doing anything else).
18978
18979         This code could go away when we move to a table driven model, but
18980         i could not come up with a good plan last night.
18981
18982 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18983
18984         * typemanager.cs (CSharpName): reimplementation using regex.
18985         * class.cs: added null check for fields in Emit
18986         * rootcontext.cs: set warninglevel to 4
18987
18988 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * typemanager.cs (CSharpName): reimplemented with Lupus
18991         suggestion.
18992
18993 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * statement.cs (If): correclty implement Resolve, because we were
18996         not catching sem errors in there.  The same process is needed
18997         everywhere else. 
18998         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18999
19000
19001         (Statement.Warning_DeadCodeFound): Factorize code.
19002         (While): Report dead code here too.
19003
19004         (Statement): Added Resolve virtual method to allow
19005         for resolution split from the emit code.
19006
19007 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19008
19009         * statement.cs (EmitBoolExpression): No longer try to resolve the
19010         expression here.    
19011         (MakeBoolean): New utility function that resolve, implicitly
19012         converts to boolean and tags the expression. 
19013
19014
19015         (If, Do): Implement dead code elimination.
19016         (While): Implement loop inversion
19017
19018         (Do, While, For, If): Resolve the expression prior to calling our
19019         code generation.
19020
19021 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19022
19023         * class.cs:
19024           - added method Report28 (warning: program has more than one entry point)
19025           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19026           - modified method Method.Define, the part at the end of the method
19027
19028         * rootcontext.cs: added static public Location EntryPointLocation;
19029           
19030         * ../errors/cs0028.cs : Add test case for the above warning.              
19031
19032         * typemanager.cs:
19033           - modified method CSharpName to allow arrays of primitive type to
19034             be printed nicely (e.g. instead of System.Int32[][] it now prints
19035             int[][])
19036           - added method CSharpSignature: returns the signature of a method
19037             in string format to be used in reporting errors, warnings, etc.
19038
19039         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19040         with String.Empty.
19041
19042 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19043
19044         * delegate.cs (Define): Fix extremely silly bug where I was
19045         setting the type of the 'object' parameter of the BeginInvoke
19046         method to System.IAsyncResult instead of System.Object ;-)
19047
19048 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19049
19050         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19051         here. 
19052
19053         (Constructor.Emit): return if we fail to initialize the
19054         constructor.  Another door closed!  
19055
19056         * expression.cs (New.DoResolve): Improve error message (from -6 to
19057         1501).  Use DeclaredOnly lookup to find the exact constructor.
19058
19059         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19060         loop.  This is useful.
19061
19062         * cs-parser.jay: Adjust the default parameters so that destructors
19063         have the proper signature.
19064
19065 2002-04-26  Martin Baulig  <martin@gnome.org>
19066
19067         * driver.cs (LoadAssembly): If `assembly' contains any characters
19068         which are only valid in path names and not in assembly names
19069         (currently slash, backslash and point), use Assembly.LoadFrom ()
19070         instead of Assembly.Load () on the `assembly' (before iteration
19071         over the link_paths).
19072
19073 2002-04-26  Martin Baulig  <martin@gnome.org>
19074
19075         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19076
19077 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19078
19079         * class.cs (Property): use the new typemanager.MemberLookup
19080
19081         (TypeContainer.MemberLookup): Implement using the
19082         TypeManager.MemberLookup now. 
19083
19084         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19085         and return MemberInfos, so that these can be used without an
19086         EmitContext (what we had before).
19087
19088 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19089
19090         * expression.cs: Fix the case where the argument to params if the
19091         type of the params.  I omitted handling this before.   Fixed
19092
19093 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19094
19095         * driver.cs: Call BootCorlib_PopulateCoreType
19096
19097         * class.cs (Property.CheckBase): Check for properties only, not
19098         for all members. 
19099
19100         * interface.cs: Temporary hack: try/catch around the
19101         CustomAttributeBuilder, because I am getting an exception that I
19102         do not understand.
19103
19104         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19105         types whose definitions are required to be there (attributes are
19106         defined before standard types).
19107
19108         Compute definitions as we boot the various types, as they are used
19109         immediately (value_type class will need object_type, but if we do
19110         not initialize object_type, we will pass a null, which will let
19111         the runtime pick the System.Object from the existing corlib, which
19112         is not what we want).
19113
19114 2002-04-22  Patrik Torstensson <totte@labs2.com>
19115
19116         * cs-tokenizer.cs: fixed a number of trim() issues.
19117
19118 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19119
19120         * expression.cs (Argument.Type): Ensure that we return the correct
19121         type when we have out or ref parameters [in which case we 
19122         append a "&"].
19123
19124 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19125
19126         * class.cs (Property, Indexer): Allow extern modifier in there. 
19127
19128         * typemanager.cs (InitBaseTypes): Initializes object_type and
19129         value_type, since those will be used early on during the bootstrap
19130         process to compile corlib.
19131
19132         (InitCoreTypes): Move code from here to InitBaseTypes.
19133
19134 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19135
19136         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19137         single-dimension arrays as using the ldlen opcode.  
19138
19139         Daniel Lewis discovered this optimization.  
19140
19141         * typemanager.cs: Add signature for System.Array::get_Length
19142
19143 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19144
19145         * statement.cs: report the error when the foreach does not apply to an
19146         array nor a collection.
19147
19148 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * expression.cs: Add implicit conversions to the operator ~.
19151
19152         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19153
19154         * typemanager.cs: Locate the decimal constructor.
19155
19156 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19157
19158         * attribute.cs: use the new property of TypeOf.
19159         * expression.cs: added 'get' property around typearg.
19160
19161         These changes fix a build breaker reported by NickD. Is this the
19162         correct way to fix?  If not, please, revert my changes and make it
19163         work :-).
19164
19165 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19166
19167         * attribute.cs: Add support for typeof in attribute invocations.
19168         I am not sure that this is right though.
19169
19170 2002-04-14  Duncan Mak  <duncan@ximian.com>
19171
19172         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19173         Binary.Operator.Division case.
19174
19175 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19176
19177         * class.cs (DefineType): Ensure that we do a proper check on
19178         attribute types and also register it with the TypeManager.
19179
19180         (TypeContainer.Targets): The default for attribute types is
19181         AttributeTargets.All.
19182
19183         * attribute.cs (ApplyAttributes): Registering the attribute type
19184         is done elsewhere, not when we discover we have a Usage attribute.
19185
19186 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19187
19188         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19189         and get rid of is_delegate parameter.
19190
19191         * everywhere : update.
19192
19193 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19194
19195         * cs-parser.jay (compilation_unit): Revamp completely to use
19196         some new ideas that I got from Rhys' grammar to solve the problems
19197         with assembly level attributes.
19198
19199         (outer_declaration): New grammar production.
19200
19201         (attribute_sections): Add.
19202
19203         (opt_attributes): Base on attribute_sections
19204
19205         (namespace_declaration): Allow opt_attributes to tackle the case
19206         when we have assembly level attributes - we are clever in this
19207         regard now ;-)
19208
19209         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19210         attributes in the non-global context.
19211
19212         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19213         instead of SetGlobalAttributes.
19214
19215         * class.cs, rootcontext.cs : Ensure we define and generate 
19216         attribute types before anything else.
19217
19218         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19219         and flag the new error -20 for the case when the attribute type
19220         does not have valid targets specified. csc does not catch this.
19221
19222         * ../errors/errors.txt : update for error # -20
19223
19224 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19225
19226         * support.cs (InternalParameters.ParameterModifier): Do some null
19227         checking and return sane values.
19228
19229         * class.cs (Method.Define): If we are a PInvoke method, ensure
19230         that we are static and extern. Report error # 601
19231
19232         * ../errors/cs0601.cs : Add test case for the above error.
19233
19234 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19235
19236         * rootcontext.cs (attribute_types): We need to keep type of
19237         all attribute types separately and emit code for them first.
19238
19239         (RegisterAttribute) : Implement.
19240
19241         * class.cs (DefineType): Check if the current Type is a custom
19242         attribute type and register it accordingly.
19243
19244         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19245         adding the first attribute twice and rename to
19246
19247         (SetGlobalAttributes): this.
19248
19249         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19250         lookups.
19251
19252         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19253         if we are processing global arguments. Hmm, I am unsure of this.
19254
19255 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19256
19257         * expression.cs: added static array of strings to avoid calling
19258         Enum.ToString () for Operator in Binary. Significant recover of
19259         performance.
19260
19261 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19262
19263         * class.cs (FindMembers): Allow the Builders of the various
19264         members to be null.  If they are skip them.  This only happens
19265         during the PInvoke declaration.
19266
19267 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19268
19269         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19270         failure, so we do not keep going afterwards.
19271
19272         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19273         wanted to pass `false' as the `is_delegate' argument.  If this is
19274         the case, why not use delegate_type == null to mean `is_delegate =
19275         false' and anything else as is_delegate = true.
19276
19277 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19278
19279         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19280         code for the section, not the beginning of the tests.
19281
19282 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19283
19284         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19285
19286         * expression.cs (Binary): same.  Warn about errors where we have
19287         Enum/Enum in operator + as well.
19288
19289 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19290
19291         * statement.cs:
19292                 - added support for switch(bool)
19293                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19294                 - add TableSwitchEmit() to handle table-based switch statements
19295
19296 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19297
19298         * expression.cs (Invocation.OverloadResolve): Factor out code which
19299         does parameter compatibility checking with arguments so that we can 
19300         re-use the code even from Delegate.VerifyApplicability
19301
19302         (VerifyArgumentsCompat): Move above code here.
19303
19304         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19305         and instead make a call to the above method.
19306
19307 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19308
19309         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19310         We use it to keep track of classes which are attribute types.
19311
19312 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * delegate.cs (Delegate.Define): Correctly define the types in the
19315         presence of fixed and array parameters.
19316
19317         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19318         doing FindMembers.
19319
19320         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19321         include NonPublic after the first iteration.
19322
19323         * class.cs (Indexer.CheckBase): Only check if both parents are
19324         non-null. 
19325
19326         * cs-parser.jay (accessor_body): If empty, set to null.
19327
19328         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19329         same code path here to resolve constants names that we did have in
19330         MemberAccess.DoResolve.  There is too much code duplicated here.
19331
19332 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19333
19334         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19335
19336         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19337         to MakeUnionSet.
19338
19339         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19340         tokens, numbers and strings.
19341
19342         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19343         parenthesis.
19344
19345         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19346         asyncronous parameters and the regular parameters.  
19347
19348         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19349         specify the target directory.
19350
19351         * expression.cs: (This.DoResolve): Simplify
19352         (As.Emit): Optimize, do not generate IsInst if the expression is
19353         always of the given type.
19354
19355         (Is.DoResolve): Bug fix, we were reporting both always/never for
19356         the is expression.
19357
19358         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19359         creating too many unnecessary arrays.
19360
19361 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19362
19363         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19364         fields instead of rolling our own initializer.   Takes care of all
19365         implicit conversions, and drops unnecessary static checks/argument.
19366
19367 2002-03-31  Dick Porter  <dick@ximian.com>
19368
19369         * driver.cs: use the GetDirectories() return values properly, and
19370         use "/" as path separator.
19371
19372 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19373
19374         * expression.cs (Unary): Optimize - - expr into expr.
19375         (Binary): Optimize a + (-b) into a -b.
19376
19377         * codegen.cs (CodeGen): Made all methods static.
19378
19379 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * rootcontext.cs: 
19382
19383         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19384         TypeBuilder property.
19385
19386         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19387         instead. 
19388
19389         * tree.cs: Removed the various RecordXXXX, and replaced with a
19390         single RecordDecl.  Removed all the accessor methods, and just
19391         left a single access point Type 
19392
19393         * enum.cs: Rename DefineEnum to DefineType.
19394
19395         * decl.cs: New abstract method `DefineType' used to unify the
19396         Defines for Enumerations, Interfaces, TypeContainers and
19397         Delegates.
19398
19399         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19400         LookupBaseClasses method that used to live in class.cs and
19401         interface.cs here, and renamed to FindType.
19402
19403         * delegate.cs: Implement DefineType.  Take advantage of the
19404         refactored pattern for locating the parent builder without taking
19405         the parent_builder argument (which we know does not work if we are
19406         nested, and triggering a toplevel definition).
19407
19408 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19411         accessibility of a member has changed during override and report
19412         an error if so.
19413
19414         * class.cs (Method.Define, Property.Define): Only complain on
19415         overrides if the method is private, any other accessibility is
19416         fine (and since we just checked the permission is the same, we are
19417         good to go).
19418
19419         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19420         and elif are processed always.  The other pre-processing
19421         directives are only processed if we are "taking" the path
19422
19423 2002-03-29  Martin Baulig  <martin@gnome.org>
19424
19425         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19426         current location is not Null.
19427
19428         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19429         a separate method so we can profile it.
19430
19431         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19432         `span.Seconds' are just seconds, but no minutes or hours.
19433         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19434
19435 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19436
19437         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19438         Remove the gratuitous set of Final:
19439
19440                                 // If an interface implementation, then we can set Final.
19441                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19442                                     implementing.DeclaringType.IsInterface)
19443                                         flags |= MethodAttributes.Final;
19444
19445         I do not know what I was smoking when I used that.
19446
19447
19448         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19449         step into fixing the name resolution issues for delegates and
19450         unifying the toplevel name resolution.
19451
19452 2002-03-28  Martin Baulig  <martin@gnome.org>
19453
19454         * class.cs (Method.Emit): If we have a symbol writer, call its
19455         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19456         tell it about the current method.
19457
19458         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19459         writer that we're going to emit the first byte of IL code for a new
19460         statement (a new source line).
19461         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19462         EmitContext.Mark() before emitting any code.
19463
19464         * location.cs (SymbolDocument): Return null when we're Null.
19465
19466         * statement.cs (Statement): Moved the `Location loc' variable here.
19467         (Statement.EmitBoolExpression): If we have a symbol writer, call
19468         ec.Mark() before emitting any code to tell it that we're at the
19469         beginning of a new statement.
19470         (StatementExpression): Added `Location' argument to the constructor.
19471         (Block): Added public readonly variable `StartLocation' and public
19472         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19473         (Block): Added constructor which takes a start and end location.
19474         (Block.SetEndLocation): New method. This sets the end location.
19475         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19476         local variables we create.
19477         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19478         each statement and do also mark the begin and end of the block.
19479
19480         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19481         tell it the current lexer.Location, use Location.Null for the end of the
19482         block.
19483         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19484         current block, set its end location using SetEndLocation().
19485         (statement_expression): StatementExpression constructor now takes the
19486         lexer.Location as additional argument.
19487         (for_statement, declare_local_variables): Likewise.
19488         (declare_local_variables): When creating a new implicit block, use the
19489         new Block constructor and pass it the lexer.Location.
19490
19491 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19492
19493         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19494         members also on the parent interfaces recursively.
19495
19496 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19497
19498         * report.cs: Use new formats, since Gonzalo finished the missing
19499         bits. 
19500
19501         * expression.cs (Binary.ResolveOperator): added missing operator|
19502         operator& and operator^ for bool/bool.
19503
19504         * cs-parser.jay: CheckDef now takes a Location argument that is
19505         used to report errors more precisly (instead of reporting the end
19506         of a definition, we try to track something which is a lot closer
19507         to the source of the problem).
19508
19509         * cs-tokenizer.cs: Track global token use, so we can properly flag
19510         the use of #define/#undef after the first token has been seen.
19511
19512         Also, rename the reportXXXX to Error_DescriptiveName
19513
19514         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19515         TypeContainer, so that Enum and Interface can use this too.
19516
19517         * class.cs (TypeContainer.LookupInterfaceOrClass,
19518         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19519         `builder' argument.  Typically this was used to pass the parent
19520         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19521         the definition).  
19522
19523         The problem is that a nested class could trigger the definition of
19524         a toplevel class, and the builder would be obviously wrong in that
19525         case. 
19526
19527         So we drop this argument, and we compute dynamically the
19528         TypeBuilder/ModuleBuilder (the correct information was available
19529         to us anyways from DeclSpace.Parent)
19530
19531         * interface.cs (Interface.DefineInterface): Drop builder
19532         parameter cleanup like class.cs
19533
19534         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19535         like class.cs
19536
19537         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19538         values. 
19539
19540         (Try.Emit): Propagate the returns value from the statement.
19541
19542         (Return.Emit): Even if we are leavning 
19543
19544         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19545
19546         * modifiers.cs: Fix the computation of MethodAttributes flags.
19547
19548 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19549
19550         * driver.cs: allow compilation of files that start with '/'.
19551         Add a default case when checking the argument of --target.
19552
19553 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19554
19555         * interface.cs: Implement the same search algorithm for types in
19556         the interface code.
19557
19558         * delegate.cs: Do not allow multiple definition.
19559
19560         * Recovered ChangeLog that got accidentally amputated
19561
19562         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19563
19564         * rootcontext.cs: Load manually enum to allow core classes to
19565         contain enumerations.
19566
19567         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19568         Update to new static methods in TypeManager.
19569
19570         * typemanager.cs (GetMethod, GetConstructor): Use our
19571         implementation of FindMembers to find the members, since during
19572         corlib compilation, the types are TypeBuilders and GetMethod and
19573         GetConstructor do not work.
19574
19575         Make all methods in TypeManager static.
19576
19577         (InitCodeHelpers): Split the functionality from
19578         the InitCodeTypes function.
19579
19580         * driver.cs: Call InitCodeHelpers after we have populated the
19581         types. 
19582
19583         * cs-parser.jay (delegate_declaration): we did not used to compute
19584         the delegate name correctly for void delegates.
19585
19586 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19587
19588         * rootcontext.cs (RootContext): Init the interface_resolve_order
19589         and type_container_resolve_order always.
19590
19591         (ResolveCore, BootstrapCorlib_ResolveClass,
19592         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19593         compiler when compiling with --nostdlib
19594
19595         * class.cs (TypeContainer.DefineType): Check that our parent is
19596         not null.  This test is most important when we are bootstraping
19597         the core types.
19598
19599         * codegen.cs: Split out the symbol writing code.
19600
19601 2002-03-25  Martin Baulig  <martin@gnome.org>
19602
19603         * driver.cs (-g): Made -g an alias for --debug.
19604
19605 2002-03-24  Martin Baulig  <martin@gnome.org>
19606
19607         * codegen.cs (SymbolWriter): New public variable. Returns the
19608         current symbol writer.
19609         (CodeGen): Added `bool want_debugging_support' argument to the
19610          constructor. If true, tell the ModuleBuild that we want debugging
19611         support and ask it for the ISymbolWriter.
19612         (Save): If we have a symbol writer, call it's Close() method after
19613         saving the assembly.
19614
19615         * driver.c (--debug): New command line argument to create a
19616         debugger information file.
19617
19618         * location.cs (SymbolDocument): New public property. Returns an
19619         ISymbolDocumentWriter object for the current source file or null
19620         if we don't have a symbol writer.
19621
19622 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19623
19624         * driver.cs (LoadAssembly): Correctly return when all the paths
19625         have been tried and not before.
19626
19627         * statement.cs (Switch.Emit): return the actual coverage for this
19628         statement (returns/not-returns)
19629
19630         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19631         switch of the statement if we are the last switch section.  That
19632         kills two problems: try/catch problems (we used to emit an empty
19633         nop at the end) and switch statements where all branches would
19634         return. 
19635
19636 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19637
19638         * driver.cs: Add default assemblies (the equivalent to the
19639         Microsoft CSC.RSP file)
19640
19641         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19642         also update tokens_seen and set it to false.
19643
19644         * driver.cs: Implement --recurse for Mike.
19645
19646         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19647         correctly splitting out the paths.
19648
19649 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19650
19651         * interface.cs (Interface.PopulateProperty): Instead of using
19652         `parent' as the declaration space for the set parameters, use
19653         `this' 
19654
19655         * support.cs (InternalParameters): InternalParameters constructor
19656         takes a DeclSpace instead of a TypeContainer.
19657
19658         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19659         types are being initialized, load the address of it before calling
19660         the function.  
19661
19662         (New): Provide a mechanism to disable the generation of local
19663         value type temporaries when the caller will be providing us with
19664         an address to store it.
19665
19666         (ArrayCreation.EmitDynamicInitializers): Use it.
19667
19668 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19669
19670         * expression.cs (Invocation.EmitArguments): Only probe for array
19671         property if there is more than one argument.  Sorry about that.
19672
19673         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19674         empty param arrays.
19675
19676         * class.cs (Method.LabelParameters): Fix incorrect code path that
19677         prevented the `ParamArrayAttribute' from being applied to the
19678         params attribute.
19679
19680 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19681
19682         * support.cs (ReflectionParameters): Correctly compute whether the
19683         last argument is a params array.  Fixes the problem with
19684         string.Split ('a')
19685
19686         * typemanager.cs: Make the assemblies array always be non-null
19687         (empty, but non-null)
19688
19689         * tree.cs (RecordDecl): New function that abstracts the recording
19690         of names.  This reports error 101, and provides a pointer to the
19691         previous declaration.  Fixes a crash in the compiler.
19692
19693         * cs-parser.jay (constructor_declaration): Update to new grammar,
19694         and provide a constructor_body that can be empty.
19695
19696 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19697
19698         * driver.cs: Add support for --resources.
19699
19700         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19701         Make all types for the various array helper methods be integer.
19702
19703         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19704         CheckState to ConvCast.
19705
19706         (ConvCast): Now it takes a `checked' state argument, to avoid
19707         depending on the emit context for the conversion, and just using
19708         the resolve time setting.
19709
19710         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19711         instead of Invocation.EmitArguments.  We do not emit the original
19712         arguments, instead we emit those which have been converted to
19713         unsigned int expressions.
19714
19715         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19716
19717         * codegen.cs: ditto.
19718
19719         * expression.cs (LocalVariableReference): Drop the use of the
19720         Store function that depended on the variable index.
19721
19722         * statement.cs (VariableInfo): Drop the `Idx' property from this
19723         class, as this is not taking into account the indexes for
19724         temporaries tat we generate during the execution, getting the
19725         indexes wrong.
19726
19727         * class.cs: First emit class initializers, then call the parent
19728         constructor. 
19729
19730         * expression.cs (Binary): Fix opcode emision.
19731         (UnaryMutator.EmitCode): Support checked code generation
19732
19733         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19734         matches for events for both the Static and Instance scans,
19735         pointing to the same element.   Fix that.
19736
19737 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19738
19739         * rootcontext.cs (ResolveTree): Always set the
19740         interface_resolve_order, because nested interfaces will be calling
19741         into us.
19742
19743         * class.cs (GetInterfaceOrClass): Track the same resolution
19744         process used by TypeManager.LookupType.  This fixes the nested
19745         type lookups in class declarations (separate path from
19746         LookupType). 
19747
19748         (TypeContainer.DefineType): Also define nested interfaces.
19749         (TypeContainer.RegisterOrder): New public function used to
19750         register the order in which child interfaces need to be closed.
19751
19752         Nested interfaces need to be closed after their parents have been
19753         created. 
19754
19755         * interface.cs (InterfaceAttr): Put all the logic for computing
19756         the interface attribute here. 
19757
19758         (DefineInterface): Register our interface order with the
19759         RootContext or with the TypeContainer depending on the case.
19760
19761 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19762
19763         * cs-parser.jay: rework foreach statement to work with the new
19764         changes to the policy on SimpleNames.
19765
19766         * report.cs: support Stacktrace on warnings as well.
19767
19768         * makefile: drop --unsafe and /unsafe from the compile.
19769
19770 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19771
19772         * ecore.cs (StandardConversionExists): Modify to take an Expression
19773         as the first parameter. Ensure we do null -> reference type conversion
19774         checking.
19775
19776         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19777         temporary Expression objects.
19778
19779 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19780
19781         * interface.cs: workaround bug in method overloading resolution
19782         (there is already a bugzilla bug for it).
19783
19784 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19785
19786         We could also solve this problem by having a separate path for
19787         performing type lookups, instead of DoResolve, we could have a
19788         ResolveType entry point, and only participating pieces of the
19789         production (simplename, deref, array) would implement this. 
19790
19791         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19792         signal SimpleName to only resolve type names and not attempt to
19793         resolve anything else.
19794
19795         * expression.cs (Cast): Set the flag.
19796
19797         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19798
19799         * class.cs: Only report 108 if there is no `new' modifier.
19800
19801         * cs-parser.jay: rework foreach statement to work with the new
19802         changes to the policy on SimpleNames.
19803         
19804         * report.cs: support Stacktrace on warnings as well.
19805
19806         * makefile: drop --unsafe and /unsafe from the compile.
19807
19808 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19811         lookups here, instead of doing that at parse time.  This means
19812         that our grammar will not introduce `LocalVariableReferences' as
19813         expressions at this point.  That solves the problem of code like
19814         this:
19815
19816         class X {
19817            static void Main ()
19818            { int X = 1;
19819             { X x = null }}}
19820
19821         This is only half the fix.  The full fix requires parameters to
19822         also be handled in this way.
19823
19824         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19825         makes the use more obvious of the DeclSpace.  The
19826         ec.TypeContainer.TypeBuilder is now only used to pull the
19827         TypeBuilder for it.
19828
19829         My theory is that I can get rid of the TypeBuilder completely from
19830         the EmitContext, and have typecasts where it is used (from
19831         DeclSpace to where it matters).  
19832
19833         The only pending problem is that the code that implements Aliases
19834         is on TypeContainer, and probably should go in DeclSpace.
19835
19836         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19837         lookups here, instead of doing that at parse time.  This means
19838         that our grammar will not introduce `LocalVariableReferences' as
19839         expressions at this point.  That solves the problem of code like
19840         this:
19841
19842         class X {
19843            static void Main ()
19844            { int X = 1;
19845             { X x = null }}}
19846
19847         This is only half the fix.  The full fix requires parameters to
19848         also be handled in this way.
19849
19850         * class.cs (Property.DefineMethod): When implementing an interface
19851         method, set newslot, when implementing an abstract method, do not
19852         set the flag (before we tried never setting it, or always setting
19853         it, which is the difference).
19854         (Indexer.DefineMethod): same.
19855         (Method.DefineMethod): same.
19856
19857         * ecore.cs: Only set the status used flag if we get back a Field.
19858
19859         * attribute.cs: Temporary hack, so Paolo can keep working.
19860
19861 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19862
19863         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19864         the unmanaged type in the case we have a MarshalAs attribute.
19865
19866         (Resolve): Handle the case when we are parsing the special MarshalAs
19867         attribute [we need to store the unmanaged type to use later]
19868
19869         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19870         MarshalAs Attribute.
19871
19872         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19873         on parameters and accordingly set the marshalling info.
19874
19875 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19876
19877         * class.cs: Optimizing slightly by removing redundant code after
19878         we switched to the `NoTypes' return value.
19879         (Property.DefineMethod): use NoTypes here too.
19880
19881         This fixes the bug I introduced in my last batch of changes.
19882
19883 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19884
19885         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19886
19887         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19888         Enums since those are types too. 
19889
19890         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19891
19892         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19893         thanks to a call during the lookup process.
19894
19895 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19896
19897         * statement.cs (Foreach): Lots of work to accomodate a particular
19898         kind of foreach statement that I had not kept in mind.  It is
19899         possible to have foreachs on classes that provide a GetEnumerator
19900         method that return objects that implement the "pattern" for using
19901         a foreach, there is no need to support GetEnumerator
19902         specifically. 
19903
19904         This is needed to compile nant.
19905
19906         * decl.cs: Only report 114 if the member is not `Finalize' and if
19907         the warning level is at least 2.
19908
19909         * class.cs: Moved the compare function from Method to
19910         MethodSignature. 
19911
19912         (MethodSignature.InheritableMemberSignatureCompare): Add new
19913         filter function that is used to extract inheritable methods from a
19914         class. 
19915
19916         (Method.Define): Use the new `inheritable_method_signature_filter'
19917         delegate
19918
19919         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19920         command. 
19921
19922 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19923
19924         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19925
19926         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19927
19928         * expression.cs: Pass location information to
19929         ConvertImplicitStandard. 
19930
19931         * class.cs: Added debugging code to track return values from
19932         interfaces. 
19933
19934 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19935
19936         * expression.cs (Is.DoResolve): If either side of the `is' is an
19937         interface, do not flag the warning.
19938
19939         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19940         for interfaces
19941
19942         * report.cs: Allow for --fatal to be used with --probe.
19943
19944         * typemanager.cs (NoTypes): Move the definition for the empty Type
19945         array here. 
19946
19947         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19948         properties. 
19949         (TypeContainer.DefineProxy): New function used to proxy to parent
19950         implementations when implementing interfaces.
19951         (TypeContainer.ParentImplements): used to lookup if our parent
19952         implements a public function that is required by an interface.
19953         (TypeContainer.VerifyPendingMethods): Hook this up.
19954
19955         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19956         `modules' and `assemblies' arraylists into arrays.  We only grow
19957         these are the very early start up of the program, so this improves
19958         the speedof LookupType (nicely measured).
19959
19960         * expression.cs (MakeByteBlob): Replaced unsafe code with
19961         BitConverter, as suggested by Paolo.
19962
19963         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19964         folding of string concatenation, but if either side is a string,
19965         and the other is not, then return null, and let the runtime use
19966         the concatenation on the string plus the object (using
19967         `Object.ToString'). 
19968
19969 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19970
19971         Constant Folding has been implemented now.
19972
19973         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19974         the error instead on types that are not supported in one's
19975         complement. 
19976
19977         * constant.cs (Constant and all children): New set of functions to
19978         perform implict and explicit conversions.
19979
19980         * ecore.cs (EnumConstant): Implement the new functions to perform
19981         conversion by proxying to the child expression.
19982
19983         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19984         own separate setting that can not be turned off from the command
19985         line using --unchecked or --checked and is only controlled using
19986         the checked/unchecked statements and expressions.  This setting is
19987         used by the constant folder to flag errors.
19988
19989         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19990         ConstantCheckState as well.   
19991
19992         During Resolve, they also have to flag the state, because the
19993         constant folder runs completely in the Resolve phase.
19994
19995         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19996         well.
19997
19998 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * cfold.cs: New file, this file contains the constant folder.
20001
20002         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20003         argument to track whether we are using the resulting address to
20004         load or store a value and provide better error messages. 
20005
20006         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20007         new AddressOf arguments.
20008
20009         * statement.cs (Foreach.EmitCollectionForeach): Update
20010
20011         * expression.cs (Argument.Emit): Call AddressOf with proper
20012         arguments to track usage.
20013
20014         (New.DoEmit): Call AddressOf with new arguments.
20015
20016         (Unary.Emit): Adjust AddressOf call.
20017
20018 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20019
20020         * cs-parser.jay (member_access): Change the case for pre-defined types
20021         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20022         this suggestion.
20023
20024         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20025         a method body.
20026
20027         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20028         essentially like methods and apply attributes like MethodImplOptions to them too.
20029
20030         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20031         not being null.
20032
20033         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20034         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20035         is the DeclSpace.
20036
20037         * Update code everywhere accordingly.
20038
20039         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20040
20041         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20042
20043 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20044
20045         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20046         try performing lookups against those instead of jumping straight into using
20047         the 'using' clauses.
20048
20049         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20050
20051         (LookupType): Perform lookups in implicit parents too.
20052
20053         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20054         sequence as RootContext.LookupType. 
20055
20056         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20057         the various cases of namespace lookups into this method.
20058
20059 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20062         in positional arguments)
20063
20064         * class.cs (Operator): Update the AllowedModifiers to contain
20065         extern. 
20066
20067         * cs-parser.jay: Update operator declaration to allow for the
20068         operator body to be empty.
20069
20070         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20071         values. 
20072
20073 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20074
20075         * class.cs (Method.Emit): Label parameters.
20076
20077         * driver.cs: Return 1 or 0 as the program exit code.
20078
20079 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20080
20081         * expression.cs: Special case the `null' object when trying to
20082         auto-compute the type, as anything can be explicitly converted to
20083         that. 
20084
20085         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20086         spotting this Paolo.
20087
20088         (Expression.ImplicitNumericConversion): Perform comparissions of
20089         the type using the underlying type in the case of an enumeration
20090         rather than using the enumeration type for the compare.
20091
20092         Cope with the underlying == type case, which is not possible to
20093         catch before. 
20094
20095         (Expression.ConvertNumericExplicit): Perform comparissions of
20096         the type using the underlying type in the case of an enumeration
20097         rather than using the enumeration type for the compare.
20098
20099         * driver.cs: If the user does not supply an extension, assume .exe
20100
20101         * cs-parser.jay (if_statement): Rewrote so that we can track the
20102         location for the if statement.
20103
20104         * expression.cs (Binary.ConstantFold): Only concat strings when
20105         the operation is "+", not everything ;-)
20106
20107         * statement.cs (Statement.EmitBoolExpression): Take a location
20108         argument. 
20109         (If, While, Do): Track location.
20110
20111         * expression.cs (Binary.ResolveOperator): In the object + string
20112         case, I was missing a call to ConvertImplicit
20113
20114 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20115
20116         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20117         Location arguments. Ensure we use RootContext.LookupType to do our work
20118         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20119
20120         * interface.cs (PopulateMethod): Handle the type of the parameter being
20121         null gracefully.
20122
20123         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20124         have a params method with no fixed arguments and a call is made with no
20125         arguments.
20126
20127 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20128
20129         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20130         the verbatim-string-literal
20131
20132         * support.cs (InternalParameters.ParameterModifier): handle null
20133         fixed parameters.
20134         (InternalParameters.ParameterType): ditto.
20135
20136         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20137         duplicating the name of the variable parameter.
20138         (GetParameterByName): Fix bug where we were not looking up array
20139         paramters if they were the only present (thanks Paolo!).
20140         (GetParameterInfo): We only have an empty set of types if both
20141         fixed and array are set to null.
20142         (GetParameterInfo-idx): Handle FixedParameter == null
20143
20144         * cs-parser.jay: Handle the case where there is no catch
20145         statements (missing null test).
20146
20147 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20148
20149         * driver.cs (MainDriver): Be conservative on our command line
20150         handling.
20151
20152         Catch DirectoryNotFoundException when calling GetFiles.
20153
20154         (SplitPathAndPattern): Used to split the input specification into
20155         a path and a pattern that we can feed to Directory.GetFiles.
20156
20157 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20158
20159         * statement.cs (Fixed): Implement the last case of the Fixed
20160         statement (string handling).
20161
20162         * expression.cs (StringPtr): New class used to return a char * to
20163         a string;  Used by the Fixed statement.
20164
20165         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20166
20167         * expression.cs (Binary.ResolveOperator): Remove redundant
20168         MemberLookup pn parent type.
20169         Optimize union call, we do not need a union if the types are the same.
20170         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20171         type.
20172
20173         Specialize the use of MemberLookup everywhere, instead of using
20174         the default settings. 
20175
20176         (StackAlloc): Implement stackalloc keyword.
20177
20178         * cs-parser.jay: Add rule to parse stackalloc.
20179
20180         * driver.cs: Handle /h, /help, /?
20181
20182         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20183         before we supported unsafe code.
20184
20185         * makefile: add --unsafe to the self compilation of mcs.
20186
20187 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20188
20189         * expression.cs (PointerArithmetic): New class that is used to
20190         perform pointer arithmetic.
20191         (Binary.Resolve): Handle pointer arithmetic
20192         Handle pointer comparission.
20193         (ArrayPtr): Utility expression class that is used to take the
20194         address of an array.
20195
20196         (ElementAccess): Implement array access for pointers
20197
20198         * statement.cs (Fixed): Implement fixed statement for arrays, we
20199         are missing one more case before we are done.
20200
20201         * expression.cs (Indirection): Implement EmitAssign and set the
20202         ExprClass to Variable.  This allows pointer dereferences to be
20203         treated as variables, and to have values assigned to them.
20204
20205         * ecore.cs (Expression.StoreFromPtr): New utility function to
20206         store values dereferencing.
20207
20208 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20209
20210         * expression.cs (Binary.ResolveOperator): Ensure that we are
20211         not trying to operate on a void type - this fixes the reported
20212         bug.
20213
20214         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20215         the parent implementation is sealed.
20216
20217         * ../errors/cs0239.cs : Add.
20218
20219         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20220
20221         * typemanager.cs (unverifiable_code_type): Corresponds to 
20222         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20223         which have unsafe code in them.
20224
20225         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20226         unsafe context.
20227
20228 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20229
20230         * cs-tokenizer.cs: Add support for @"litreal strings"
20231
20232         Make tokenizer accept pre-processor directives
20233         on any column (remove the old C-like limitation). 
20234
20235         * rootcontext.cs (EmitCode): Emit any global attributes.
20236         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20237
20238         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20239
20240         * cs-parser.jay: Add support for global attributes.  
20241
20242 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * expression.cs (Indirection): New helper class.  Unary will
20245         create Indirection classes to be able to implement the
20246         IMemoryLocation interface on it.
20247
20248 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20249
20250         * cs-parser.jay (fixed_statement): reference the right statement.
20251
20252         * statement.cs (Fixed.Emit): Finish implementing the fixed
20253         statement for the &x case.
20254
20255 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20256
20257         * class.cs (Property.Define, Method.Define): Remove newslot when
20258         `implementing'.  
20259
20260         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20261         wrong.  NewSlot should only be used if the `new' keyword is present.
20262
20263         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20264         locating our system dir.  Sorry about this.
20265
20266 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20267
20268         * driver.cs (GetSystemDir): Compute correctly the location of our
20269         system assemblies.  I was using the compiler directory instead of
20270         the library directory.
20271
20272 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20273
20274         * expression.cs (BetterFunction): Put back in what Miguel commented out
20275         since it is the correct fix. The problem is elsewhere ;-)
20276
20277         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20278         parameters of the parms method are themselves compatible or not !
20279
20280         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20281         to check that a class implements an interface before saying that an implicit
20282         conversion was allowed. Use ImplementsInterface to do the checking.
20283
20284 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20285
20286         * class.cs (Method.Define): Track whether we are an explicit
20287         implementation or not.  And only call DefineMethodOverride if we
20288         are an explicit implementation.
20289
20290         (Property.DefineMethod): Ditto.
20291
20292 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20293
20294         * expression.cs (BetterFunction): Catch hideous bug which was
20295          preventing us from detecting ambiguous calls due to implicit casts i.e
20296         cs0121.
20297
20298 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20299
20300         * support.cs (Pair): Remove un-needed method.  I figured why I was
20301         getting the error in cs-parser.jay, the variable in a foreach loop
20302         is readonly, and the compiler does not really treat this as a variable.
20303
20304         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20305         instead of EQUALS in grammar.  
20306
20307         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20308
20309         * expression.cs (Unary.DoResolve): Check whether the argument is
20310         managed or not.
20311
20312 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20313
20314         * support.cs: Api for Pair to set a value.  Despite the fact that
20315         the variables are public the MS C# compiler refuses to compile
20316         code that accesses the field if the variable is part of a foreach
20317         statement. 
20318
20319         * statement.cs (Fixed): Begin implementation of the fixed
20320         statement.
20321
20322         (Block.AddVariable): Return the VariableInfo on success and null
20323         on failure instead of true/false. 
20324
20325         * cs-parser.jay (foreach): Catch errors on variables already
20326         defined (we were ignoring this value before) and properly unwind
20327         the block hierarchy
20328
20329         (fixed_statement): grammar for the fixed statement.
20330
20331 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20332
20333         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20334         pointer types to be incretemented.
20335
20336         (SizeOf): Implement.
20337
20338         * cs-parser.jay (pointer_member_access): Implement
20339         expr->IDENTIFIER production.
20340
20341         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20342         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20343         on safe contexts.
20344
20345         (Unary): Implement indirection.
20346
20347         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20348         use in non-unsafe context).
20349
20350         (SimpleName.DoResolve): Check for pointers in field access on safe
20351         contexts. 
20352
20353         (Expression.LoadFromPtr): Factor the load-indirect code in this
20354         function.  This was duplicated in UnboxCast and ParameterReference
20355
20356 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20357
20358         * expression.cs (ComposedCast): report an error if a pointer cast
20359         is used in a safe region.
20360
20361         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20362         pointer type casts in unsafe context.
20363
20364         * codegen.cs (EmitContext): Set up IsUnsafe.
20365
20366         * cs-parser.jay (non_expression_type): Add productions for pointer
20367         casts. 
20368
20369         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20370         code.  We should not use force into static mode if the method is
20371         not virtual.  Fixes bug in MIS
20372
20373         * statement.cs (Do.Emit, While.Emit, For.Emit,
20374         Statement.EmitBoolExpression): Add support to Do and While to
20375         propagate infinite loop as `I do return' semantics.
20376
20377         Improve the For case to also test for boolean constants.
20378
20379         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20380         to the list of attributes we can add.
20381
20382         Remove `EmitContext' argument.
20383
20384         * class.cs (Method.Define): Apply parameter attributes.
20385         (Constructor.Define): Apply parameter attributes.
20386         (MethodCore.LabelParameters): Move here the core of labeling
20387         parameters. 
20388
20389         * support.cs (ReflectionParameters.ParameterModifier,
20390         InternalParameters.ParameterModifier): Use IsByRef on the type and
20391         only return the OUT bit for these parameters instead of in/out/ref
20392         flags.
20393
20394         This is because I miss-understood things.  The ParameterInfo.IsIn
20395         and IsOut represent whether the parameter has the [In] and [Out]
20396         attributes set.  
20397
20398 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * ecore.cs (FieldExpr.Emit): Release temporaries.
20401
20402         * assign.cs (LocalTemporary.Release): new function.
20403
20404         * codegen.cs (EmitContext.GetTemporaryStorage,
20405         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20406         temporary storage.  Now we can "put back" localbuilders when we
20407         are done with them
20408
20409 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20410
20411         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20412         need to make a copy of the variable to generate verifiable code.
20413
20414 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20415
20416         * driver.cs: Compute dynamically the system directory.
20417
20418         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20419         Slower, but more generally useful.  Used by the abstract
20420         registering implementation. 
20421
20422         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20423         the rules for the special rule on Type/instances.  First check if
20424         we have the same name, and if so, try that special static path
20425         rather than the instance path.
20426
20427 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20428
20429         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20430         for, while and if.
20431
20432         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20433         Enum, ValueType, Delegate or Array for non-corlib compiles.
20434
20435         * cs-tokenizer.cs: Catch long identifiers (645)
20436
20437         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20438         piece of code.
20439
20440         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20441         fix, we were returning too early, so we were not registering
20442         pending methods from abstract classes.
20443
20444         Do not register pending methods if the class is abstract.
20445
20446         * expression.cs (Conditional.DoResolve): Report circular implicit
20447         conversions when we neecd to compute it for conditional
20448         expressions. 
20449
20450         (Is.DoResolve): If the expression is always of the provided type,
20451         flag warning 183.  If the expression can not ever be of the
20452         provided type flag warning 184.
20453
20454         * class.cs: Catch 169 as well.
20455
20456         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20457         read. 
20458
20459 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20460
20461         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20462
20463 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20464
20465         * interface.cs: (PopulateMethod): Check for pointers being defined
20466         only if the unsafe context is active.
20467         (PopulateProperty): ditto.
20468         (PopulateIndexer): ditto.
20469
20470         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20471         specified.  If pointers are present, make sure that they are
20472         present in an unsafe context.
20473         (Constructor, Constructor.Define): ditto.
20474         (Field, Field.Define): ditto.
20475         (Property, Property.Define): ditto.
20476         (Event, Event.Define): ditto.
20477
20478         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20479         hashtable if there are classes or structs defined.
20480
20481         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20482         code, as the constant resolution moved.
20483
20484         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20485         the metadata, so we can flag error 133. 
20486
20487         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20488         pointer is being declared in an unsafe context.
20489
20490 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20491
20492         * modifiers.cs (Modifiers.Check): Require a Location argument.
20493         Report error 227 for Unsafe use.
20494
20495         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20496
20497         * statement.cs (For.Emit): If the test is null, then report that
20498         we do `return', as we wont reach anything afterwards.
20499
20500         (Switch.SwitchGoverningType): Track the expression that matched
20501         the conversion.
20502
20503         * driver.cs: Allow negative numbers as an error code to flag.
20504
20505         * cs-parser.jay: Handle 1551.
20506
20507         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20508
20509 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20510
20511         * cs-parser.jay: Report 1518 (type declaration can only contain
20512         class, struct, interface, enum or delegate)
20513
20514         (switch_label): Report 1523 (keywords `case' or `default' must
20515         preced code)
20516
20517         (opt_switch_sections): Report 1522 (empty switch)
20518
20519         * driver.cs: Report 1515 (response file specified multiple times)
20520         Report 1516 (Source file specified multiple times).
20521
20522         * expression.cs (Argument.Resolve): Signal 1510
20523
20524         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20525         access not allowed in static code)
20526
20527 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20528
20529         * typemanager.cs (IsPointerType): Utility method which we are going
20530         to need a lot.
20531
20532         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20533         the object type, so we take care of that.
20534
20535         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20536
20537         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20538         added to non-params parameters :-)
20539
20540         * typemanager.cs (CSharpName): Include 'void' type too. 
20541
20542         (void_ptr_type): Include in the set of core types.
20543
20544         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20545         duplicating code.
20546
20547         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20548         an unsafe context.
20549
20550         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20551         completely forgotten about it.
20552
20553 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20554
20555         * cs-parser.jay (pointer_type): Add. This begins our implementation
20556         of parsing rules for unsafe code.
20557
20558         (unsafe_statement): Implement.
20559
20560         (embedded_statement): Modify to include the above.
20561
20562         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20563
20564         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20565         if the current context is an unsafe one.
20566
20567         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20568         are handled differently, we need separate rules for them.
20569
20570         (local_variable_declaration): Update to use local_variable_pointer_type
20571         to allow variable declarations of unmanaged pointer types.
20572
20573         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20574         in unsafe contexts.
20575
20576         * ../errors/cs0214.cs : Add.
20577
20578 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20579
20580         * makefile: remove 'response' file when cleaning.
20581
20582 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20583
20584         * cs-parser.jay: Report 1524.
20585
20586 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * typemanager.cs (RegisterMethod): drop checking if we have
20589         registered this from here
20590
20591 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20592
20593         * class.cs (Method.EmitDestructor): Implement calling our base
20594         destructor. 
20595
20596         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20597         value of InFinally.
20598
20599         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20600         this routine and will wrap the call in a try/catch block.  Deal
20601         with the case.
20602
20603 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * ecore.cs (Expression.MemberLookup): instead of taking a
20606         parameter `same_type' that was used to tell whether we could
20607         access private members we compute our containing type from the
20608         EmitContext.
20609
20610         (FieldExpr): Added partial support for volatile fields.  This does
20611         not work for volatile fields exposed from assemblies, as I can not
20612         figure out how to extract the modreq from it.
20613
20614         Updated all the source files to use this.
20615
20616         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20617         because it is referenced by MemberLookup very often. 
20618
20619 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20620
20621         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20622         TypeBuilder.GetCustomAttributes to retrieve what we need.
20623
20624         Get rid of redundant default_member_attr_type as this is the same as
20625         default_member_type which already exists.
20626
20627         * interface.cs, attribute.cs : Update accordingly.
20628
20629 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20630
20631         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20632         work for TYpeBuilders though.  Ravi, can you please fix this?
20633
20634         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20635
20636         * expression.cs (Argument.Emit): Handle the case of ref objects
20637         being passed to ref functions;  
20638
20639         (ParameterReference.EmitLoad): Loads the content of the pointer
20640         without dereferencing.
20641
20642 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20643
20644         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20645
20646 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20647
20648         * class.cs (Indexer.DefineMethod): Incorporate the interface
20649         type in the name of the method if we are doing explicit interface
20650         implementation.
20651
20652         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20653
20654         (BetterConversion): Fix extremely trivial bug where we were referring to
20655         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20656         again !
20657
20658         * ../errors/bug16.cs : Add although we have fixed it.
20659
20660 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20661
20662         * expression.cs (BaseIndexer): Begin implementation.
20663
20664         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20665
20666         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20667         production directly to remove a shift/reduce, and implement
20668         explicit interface implementation.
20669
20670         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20671         after a floating point suffix.
20672
20673         * expression.cs (DoNumericPromotions): Improved the conversion for
20674         uint/uint.  If we have a constant, we avoid doing a typecast to a
20675         larger type.
20676
20677         * class.cs (Indexer): Implement explicit interface implementation
20678         for indexers.
20679
20680 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20681
20682         * class.cs: make the default instance constructor public and hidebysig.
20683
20684 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20685
20686         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20687         so we can call it from elsewhere.
20688
20689         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20690         we emit it internally if the class has a defined indexer; otherwise the user
20691         emits it by decorating the class definition with the DefaultMemberAttribute.
20692
20693         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20694         attribute is not used on a type which defines an indexer.
20695
20696         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20697         character when we skip whitespace.
20698
20699         * ../errors/cs0646.cs : Add.
20700
20701 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20702
20703         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20704         again. 
20705
20706         * makefile: Add practical target `mcs3.exe' which builds the third
20707         generation compiler. 
20708
20709         * expression.cs (New): Fix structures constructor calling.
20710
20711         * class.cs (Property, Method, Indexer): Emit Final flag on the
20712         method if we are an interface implementation and we are not
20713         abstract. 
20714
20715         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20716         whether this property is referencing a `base' method.
20717
20718         * expression.cs (Invocation.EmitCall): take an extra argument:
20719         is_base, this is used to determine whether the `call' or
20720         `callvirt' opcode should be used.
20721
20722
20723         * delegate.cs: update EmitCall.
20724
20725         * class.cs (Method.Define): Set NewSlot for the cases where we are
20726         not implementing an interface method.
20727
20728         (Property.Define): ditto.
20729
20730 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20731
20732         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20733         'r'.  Allows mcs to parse itself fully.
20734
20735 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20736
20737         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20738         of the number of initializers that require the InitializeArray method.
20739
20740         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20741         update the above field where necessary.
20742
20743         (MakeByteBlob): Update accordingly.
20744
20745         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20746         greater than 2.
20747
20748         (EmitDynamicInitializers): Update in accordance with the new optimization.
20749
20750         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20751         same OpCode applies.
20752
20753         * cs-parser.jay : Fix some glaring errors I introduced.
20754
20755 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20756
20757         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20758         so that we can check for name clashes there too.
20759
20760         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20761         for interface indexers.
20762
20763         * interfaces.cs (Define): Emit the default member attribute.
20764
20765         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20766         variable was being referred to while setting the value ;-)
20767
20768 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20771         byte-by-byte information when we know the data is zero.
20772
20773         Make the block always a multiple of 4, because
20774         DefineInitializedData has a bug.
20775
20776         * assign.cs: Fix, we should assign from the temporary, not from
20777         the source. 
20778
20779         * expression.cs (MakeByteBlob): Fix my incorrect code.
20780
20781 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20782
20783         * typemanager.cs (EnumToUnderlying): This function is used to get
20784         the underlying type from an enumeration, because it does not
20785         always work. 
20786
20787         * constant.cs: Use the I4_S form for values between -128 and 127.
20788
20789         * statement.cs (Block.LookupLabel): Looks up a label.
20790         (Block): Drop support for labeled blocks.
20791
20792         (LabeledStatement): New kind of statement that represents a label
20793         only.
20794
20795         (Goto): Finally implement this bad boy.
20796
20797         * cs-parser.jay: Update to reflect new mechanism to implement
20798         labels.
20799
20800 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * codegen.cs (EmitContext.This): a codegen property that keeps the
20803         a single instance of this instead of creating many different this
20804         instances. 
20805
20806         * delegate.cs (Delegate.DoResolve): Update to use the property;
20807
20808         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20809
20810         * expression.cs (BaseAccess.DoResolve): Ditto.
20811
20812 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20813
20814         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20815         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20816
20817         (InitCoreTypes): Update accordingly.
20818
20819         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20820         so we can quickly store the state.
20821
20822         (ApplyAttributes): Set the correct implementation flags
20823         for InternalCall methods.
20824
20825 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * expression.cs (EmitCall): if a method is not virtual, then do
20828         not use callvirt on it.
20829
20830         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20831         user defined stuff) requires the use of stobj, which takes an
20832         address on the stack instead of an array and an index.  So emit
20833         the Ldelema operation for it.
20834
20835         (EmitStoreOpcode): Use stobj for valuetypes.
20836
20837         (UnaryMutator.EmitCode): Use the right 1 value depending on
20838         whether we are dealing with int64/uint64, float or doubles.
20839
20840         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20841         constructors that I implemented last night.
20842
20843         (Constructor.IsDefault): Fix to work properly for static
20844         constructors.
20845
20846         * cs-parser.jay (CheckDef): report method signature errors.
20847         Update error number 103 to be 132.
20848
20849         * decl.cs: New AdditionResult enumeration value: MethodExists.
20850         Although we do this check for methods later on in the semantic
20851         analysis, catching repeated default constructors is so easy that
20852         we catch these here. 
20853
20854         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20855         promotions code.
20856
20857         (ParameterReference.EmitAssign, Emit): handle
20858         bools as bytes.
20859
20860         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20861         (ArrayAccess.EmitStoreOpcode): ditto.
20862
20863         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20864
20865         * expression.cs (MakeByteBlob): Complete all the missing types
20866         (uint, short, ushort, byte, sbyte)
20867
20868         * class.cs: Only init instance field initializers on instance
20869         constructors. 
20870
20871         Rename `constructors' to instance_constructors. 
20872
20873         (TypeContainer.AddConstructor): Only add constructors to the list
20874         if it is not static.
20875
20876         Make sure that we handle default_static_constructor independently
20877         everywhere where we handle instance_constructors
20878
20879 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20880
20881         * class.cs: Do not lookup or create a base initializer for a
20882         static constructor.
20883
20884         (ConstructorInitializer.Resolve): use the proper type to lookup
20885         for constructors.
20886
20887         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20888
20889         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20890         in DeclSpace. 
20891
20892         * decl.cs: CloseType is now an virtual method, the default
20893         implementation just closes this type.
20894
20895 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20896
20897         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20898         to PreserveSig by default. Also emit HideBySig on such methods.
20899
20900         Basically, set the defaults to standard values.
20901
20902         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20903         argument, if candidate is better, it can't be worse than the best !
20904
20905         (Invocation): Re-write bits to differentiate between methods being
20906         applicable in their expanded form and their normal form - for params
20907         methods of course.
20908
20909         Get rid of use_standard everywhere as only standard conversions are allowed
20910         in overload resolution. 
20911
20912         More spec conformance.
20913
20914 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20915
20916         * driver.cs: Add --timestamp, to see where the compiler spends
20917         most of its time.
20918
20919         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20920         `this' in static code.
20921
20922         (SimpleName.DoResolve): Implement in terms of a helper function
20923         that allows static-references to be passed upstream to
20924         MemberAccess.
20925
20926         (Expression.ResolveWithSimpleName): Resolve specially simple
20927         names when called by MemberAccess to implement the special
20928         semantics. 
20929
20930         (Expression.ImplicitReferenceConversion): Handle conversions from
20931         Null to reference types before others, as Null's type is
20932         System.Object. 
20933
20934         * expression.cs (Invocation.EmitCall): Handle the special case of
20935         calling methods declared on a reference type from a ValueType
20936         (Base classes System.Object and System.Enum)
20937
20938         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20939         the left hand side is a TypeExpr, not on every enumeration. 
20940
20941         (Binary.Resolve): If types are reference types, then do a cast to
20942         object on operators != and == of both arguments.
20943
20944         * typemanager.cs (FindMembers): Extract instance and static
20945         members if requested.
20946
20947         * interface.cs (PopulateProperty): Use void_type instead of null
20948         as the return type for the setter method.
20949
20950         (PopulateIndexer): ditto.
20951
20952 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20953
20954         * support.cs (ReflectionParameters): Fix minor bug where we
20955         were examining the wrong parameter for the ParamArray attribute.
20956
20957         Cope with requests for the type of the parameter at position
20958         greater than the params parameter's. We now return the element
20959         type of the params array as that makes more sense.
20960
20961         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20962         accordingly as we no longer have to extract the element type
20963         ourselves.
20964
20965         (Invocation.OverloadResolve): Update.
20966
20967 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20968
20969         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20970         against IEnumerator, test whether the return value is a descendant
20971         of the IEnumerator interface.
20972
20973         * class.cs (Indexer.Define): Use an auxiliary method to implement
20974         the other bits of the method definition.  Begin support for
20975         explicit interface implementation.
20976
20977         (Property.DefineMethod): Use TypeManager.void_type instead of null
20978         for an empty return value.
20979
20980 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20981
20982         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20983         dealing with a FieldExpr which is composed of a FieldBuilder, in
20984         the code path we did extract the constant, but we should have
20985         obtained the underlying value to be able to cast it (otherwise we
20986         end up in an infinite loop, this is what Ravi was running into).
20987
20988         (ArrayCreation.UpdateIndices): Arrays might be empty.
20989
20990         (MemberAccess.ResolveMemberAccess): Add support for section
20991         14.5.4.1 that deals with the special case of E.I when E is a type
20992         and something else, that I can be a reference to a static member.
20993
20994         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20995         handle a particular array type to create byte blobs, it is just
20996         something we dont generate byteblobs for.
20997
20998         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20999         arguments. 
21000
21001         * location.cs (Push): remove the key from the hashtable that we
21002         are about to add.   This happens for empty files.
21003
21004         * driver.cs: Dispose files after we have parsed them.
21005
21006         (tokenize): new function that only runs the tokenizer on its
21007         input, for speed testing.
21008
21009 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21010
21011         * class.cs (Event.Define): Define the private field only if there
21012         are no accessors defined.
21013
21014         * expression.cs (ResolveMemberAccess): If there is no associated
21015         field with the event, that means we have an event defined with its
21016         own accessors and we should flag error cs0070 since transforming
21017         ourselves into a field is not valid in that case.
21018
21019         * ecore.cs (SimpleName.DoResolve): Same as above.
21020
21021         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21022         and charset to sane values.
21023
21024 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21025
21026         * assign.cs (DoResolve): Perform check on events only if they 
21027         are being accessed outside the declaring type.
21028
21029         * cs-parser.jay (event_declarations): Update rules to correctly
21030         set the type of the implicit parameter etc.
21031
21032         (add_accessor, remove_accessor): Set current local parameters.
21033
21034         * expression.cs (Binary): For delegate addition and subtraction,
21035         cast the return value from the method into the appropriate delegate
21036         type.
21037
21038 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21039
21040         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21041         of these as the workaround is unnecessary.
21042
21043         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21044         delegate data - none of that is needed at all.
21045
21046         Re-write bits to extract the instance expression and the delegate method
21047         correctly.
21048
21049         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21050         on delegates too.
21051
21052         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21053         of attaching attributes instead of duplicating code everywhere.
21054
21055         * everywhere : Update code to do attribute emission using the above method.
21056
21057 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21058
21059         * expression.cs (IsParamsMethodApplicable): if there are not
21060         parameters, return immediately.
21061
21062         * ecore.cs: The 0 literal can be implicity converted to an enum
21063         type. 
21064
21065         (SimpleName.DoResolve): First lookup the type, then lookup the
21066         members. 
21067
21068         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21069         want to get its address.  If the InstanceExpression is not
21070         addressable, store the result in a temporary variable, then get
21071         the address of it.
21072
21073         * codegen.cs: Only display 219 errors on warning level or above. 
21074
21075         * expression.cs (ArrayAccess): Make it implement the
21076         IMemoryLocation interface.
21077
21078         (Binary.DoResolve): handle the operator == (object a, object b)
21079         and operator != (object a, object b) without incurring into a
21080         BoxedCast (because 5 != o should never be performed).
21081
21082         Handle binary enumerator operators.
21083
21084         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21085         value type, otherwise use Ldelem_ref.
21086
21087         Use precomputed names;
21088
21089         (AddressOf): Implement address of
21090
21091         * cs-parser.jay (labeled_statement): Fix recursive block
21092         addition by reworking the production.
21093
21094         * expression.cs (New.DoEmit): New has a special case:
21095                 
21096                  If we are dealing with a ValueType, we have a few
21097                  situations to deal with:
21098                 
21099                     * The target of New is a ValueType variable, that is
21100                       easy, we just pass this as the variable reference
21101                 
21102                     * The target of New is being passed as an argument,
21103                       to a boxing operation or a function that takes a
21104                       ValueType.
21105                 
21106                       In this case, we need to create a temporary variable
21107                       that is the argument of New.
21108
21109
21110 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21111
21112         * rootcontext.cs (LookupType): Check that current_type is not null before
21113         going about looking at nested types.
21114
21115         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21116         not implement the IAssignMethod interface any more.
21117
21118         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21119         where we tranform them into FieldExprs if they are being resolved from within
21120         the declaring type.
21121
21122         * ecore.cs (SimpleName.DoResolve): Do the same here.
21123
21124         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21125
21126         * ../errors/bug10.cs : Add.
21127
21128         * ../errors/cs0070.cs : Add.
21129
21130         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21131
21132         * assign.cs : Get rid of EventIsLocal everywhere.
21133
21134 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21135
21136         * ecore.cs (ConvertIntLiteral): finished the implementation.
21137
21138         * statement.cs (SwitchLabel): Convert the value we are using as a
21139         key before looking up the table.
21140
21141 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21142
21143         * codegen.cs (EmitTopBlock): Require a Location argument now.
21144
21145         * cs-parser.jay (constructor_declarator): We need to setup
21146         current_local_parameters before we parse the
21147         opt_constructor_initializer, to allow the variables to be bound
21148         to the constructor arguments.
21149
21150         * rootcontext.cs (LookupType): First lookup nested classes in our
21151         class and our parents before we go looking outside our class.
21152
21153         * expression.cs (ConstantFold): Extract/debox the values at the
21154         beginnning. 
21155
21156         * rootcontext.cs (EmitCode): Resolve the constants first before we
21157         resolve the types.  This is not really needed, but it helps debugging.
21158
21159         * statement.cs: report location.
21160
21161         * cs-parser.jay: pass location to throw statement.
21162
21163         * driver.cs: Small bug fix.
21164
21165         * report.cs: Updated format to be 4-zero filled digits.
21166
21167 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21168
21169         * expression.cs (CheckIndices): Fix minor bug where the wrong
21170         variable was being referred to ;-)
21171
21172         (DoEmit): Do not call EmitStaticInitializers when the 
21173         underlying type is System.Object.
21174
21175 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21176
21177         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21178         and do the usual workaround for SRE.
21179
21180         * class.cs (MyEventBuilder.EventType): New member to get at the type
21181         of the event, quickly.
21182
21183         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21184
21185         * assign.cs (Assign.DoResolve): Handle the case when the target
21186         is an EventExpr and perform the necessary checks.
21187
21188         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21189         interface.
21190
21191         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21192
21193         (EventExpr): Set the type in the constructor itself since we 
21194         are meant to be born fully resolved.
21195
21196         (EventExpr.Define): Revert code I wrote earlier.
21197                 
21198         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21199         instance expression is null. The instance expression is a This in that case
21200         or a null, depending on whether it is a static method or not.
21201
21202         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21203         refers to more than one method.
21204
21205         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21206         and accordingly flag errors.
21207
21208 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21209
21210         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21211
21212 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21213
21214         * location.cs (ToString): Provide useful rutine.
21215
21216 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21217
21218         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21219         objects, return the actual integral boxed.
21220
21221         * statement.cs (SwitchLabel): define an ILLabel for each
21222         SwitchLabel. 
21223
21224         (Switch.CheckSwitch): If the value is a Literal, extract
21225         the underlying literal.
21226
21227         Also in the unused hashtable we had, add the SwitchLabel so we can
21228         quickly look this value up.
21229
21230         * constant.cs: Implement a bunch of new constants.  Rewrite
21231         Literal based on this.  Made changes everywhere to adapt to this.
21232
21233         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21234         dereferencing array only once, and also copes with enumrations.
21235
21236         bytes are two bytes wide, not one.
21237
21238         (Cast): Perform constant conversions.
21239
21240         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21241         wrappers to the literals here.
21242
21243         * expression.cs (DoNumericPromotions): long literals can converted
21244         to ulong implicity (this is taken care of elsewhere, but I was
21245         missing this spot).
21246
21247         * ecore.cs (Expression.Literalize): Make the return type Literal,
21248         to improve type checking.
21249
21250         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21251
21252 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21253
21254         * literal.cs: Revert code from ravi that checked the bounds.  The
21255         bounds are sane by the definition of the type itself. 
21256
21257         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21258         need to actually look up in our parent hierarchy for interfaces
21259         implemented. 
21260
21261         * const.cs: Use the underlying type for enumerations
21262
21263         * delegate.cs: Compute the basename for the delegate creation,
21264         that should fix the delegate test case, and restore the correct
21265         Type Lookup semantics in rootcontext
21266
21267         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21268         referencing a nested type with the Reflection API is using the "+"
21269         sign. 
21270
21271         * cs-parser.jay: Do not require EOF token at the end.
21272
21273 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21274
21275         * rootcontext.cs (LookupType): Concatenate type names with
21276         a '.' instead of a '+' The test suite passes again.
21277
21278         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21279         field of the enumeration.
21280
21281         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21282         the case when the member is an EventExpr.
21283
21284         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21285         static has an associated instance expression.
21286
21287         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21288
21289         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21290
21291         * class.cs (Event.Define): Register event and perform appropriate checks
21292         for error #111.
21293
21294         We define the Add and Remove methods even if the use provides none because
21295         in that case, we provide default implementations ourselves.
21296
21297         Define a private field of the type of the event. This is done by the CSC compiler
21298         and we should be doing it too ;-)
21299
21300         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21301         More methods we use in code we generate.
21302
21303         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21304         is important.
21305
21306         (InitCoreTypes): Update accordingly for the above.
21307
21308         * class.cs (Event.Emit): Generate code for default accessors that we provide
21309
21310         (EmitDefaultMethod): Do the job in the above.
21311
21312         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21313         appropriate place.
21314
21315 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21316
21317         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21318         builders even if we were missing one.
21319
21320         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21321         pass the Basename as our class name instead of the Name.  The
21322         basename will be correctly composed for us.
21323
21324         * parameter.cs (Paramters): Now takes a Location argument.
21325
21326         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21327         make all the code call directly LookupType in RootContext and take
21328         this chance to pass the Location information everywhere.
21329
21330         * Everywhere: pass Location information.
21331
21332 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * class.cs (Constructor.Define): Updated way of detecting the
21335         length of the parameters.
21336
21337         (TypeContainer.DefineType): Use basename as the type name for
21338         nested types.
21339
21340         (TypeContainer.Define): Do not recursively define types here, as
21341         definition is taken care in order by the RootContext.
21342
21343         * tree.cs: Keep track of namespaces in a per-file basis.
21344
21345         * parameter.cs (Parameter.ComputeSignature): Update to use
21346         DeclSpace. 
21347
21348         (Parameters.GetSignature): ditto.
21349
21350         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21351         instead of a TypeContainer.
21352
21353         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21354         resolve names.  Because we need to be resolve in our context, not
21355         our parents.
21356
21357         * driver.cs: Implement response files.
21358
21359         * class.cs (TypeContainer.DefineType): If we are defined, do not
21360         redefine ourselves.
21361
21362         (Event.Emit): Emit the code for add/remove handlers.
21363         (Event.Define): Save the MethodBuilders for add/remove.
21364
21365         * typemanager.cs: Use pair here too.
21366
21367         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21368         DictionaryEntry requires the first argument to be non-null.  
21369
21370         (enum_declaration): Compute full name for registering the
21371         enumeration.
21372
21373         (delegate_declaration): Instead of using
21374         formal_parameter_list, use opt_formal_parameter_list as the list
21375         can be empty.
21376
21377         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21378         (EventParsing): New property that controls whether `add' and
21379         `remove' are returned as tokens or identifiers (for events);
21380
21381 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21382
21383         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21384         use MyEventBuilder only and let it wrap the real builder for us.
21385
21386         (MyEventBuilder): Revamp constructor etc.
21387
21388         Implement all operations that we perform on EventBuilder in precisely the same
21389         way here too.
21390
21391         (FindMembers): Update to use the EventBuilder member.
21392
21393         (Event.Emit): Update accordingly.
21394
21395 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21396
21397         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21398         by calling the appropriate methods.
21399
21400         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21401         useful.
21402
21403         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21404
21405 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21406
21407         * delegate.cs (Delegate.Populate): Check that the return type
21408         and various parameters types are indeed accessible.
21409
21410         * class.cs (Constructor.Define): Same here.
21411
21412         (Field.Define): Ditto.
21413
21414         (Event.Define): Ditto.
21415
21416         (Operator.Define): Check that the underlying Method defined itself
21417         correctly - so it's MethodBuilder should not be null.
21418
21419         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21420         expression happens to be null.
21421
21422         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21423         members but as of now we don't seem to be able to do anything really useful with it.
21424
21425         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21426         not the EventBuilder.
21427
21428 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21429
21430         * cs-tokenizer.cs: Add support for defines.
21431         Add support for #if, #elif, #else, #endif
21432
21433         (eval_var): evaluates a variable.
21434         (eval): stubbed for evaluating functions.
21435
21436         * cs-parser.jay: Pass the defines information
21437
21438         * driver.cs: Add --define command line option.
21439
21440         * decl.cs: Move MemberCore here.
21441
21442         Make it the base class for DeclSpace.  This allows us to catch and
21443         report 108 and 109 for everything now.
21444
21445         * class.cs (TypeContainer.Define): Extract all the members
21446         before populating and emit the warning 108 (new keyword required
21447         to override) instead of having each member implement this.
21448
21449         (MemberCore.Define): New abstract method, we will be using this in
21450         the warning reporting engine in Populate.
21451
21452         (Operator.Define): Adjust to new MemberCore protocol. 
21453
21454         * const.cs (Const): This does not derive from Expression, it is a
21455         temporary object we use to create fields, it is a MemberCore. 
21456
21457         * class.cs (Method.Define): Allow the entry point to be in a
21458         specific class.
21459
21460         * driver.cs: Rewrite the argument handler to clean it up a bit.
21461
21462         * rootcontext.cs: Made it just an auxiliary namespace feature by
21463         making everything static.
21464
21465         * driver.cs: Adapt code to use RootContext type name instead of
21466         instance variable.
21467
21468         * delegate.cs: Remove RootContext argument.
21469
21470         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21471         argument. 
21472
21473         * class.cs (Event.Define): The lookup can fail.
21474
21475         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21476
21477         * expression.cs: Resolve the this instance before invoking the code.
21478
21479 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21480
21481         * cs-parser.jay: Add a production in element_access that allows
21482         the thing to become a "type" reference.  This way we can parse
21483         things like "(string [])" as a type.
21484
21485         Note that this still does not handle the more complex rules of
21486         casts. 
21487
21488
21489         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21490
21491         * ecore.cs: (CopyNewMethods): new utility function used to
21492         assemble the list of methods from running FindMembers.
21493
21494         (MemberLookup): Rework FindMembers so that 
21495
21496 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21497
21498         * class.cs (TypeContainer): Remove Delegates who fail to be
21499         defined.
21500
21501         * delegate.cs (Populate): Verify that we dont get null return
21502         values.   TODO: Check for AsAccessible.
21503
21504         * cs-parser.jay: Use basename to emit error 574 (destructor should
21505         have the same name as container class), not the full name.
21506
21507         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21508         possible representation.  
21509
21510         Also implements integer type suffixes U and L.
21511
21512 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21513
21514         * expression.cs (ArrayCreation.DoResolve): We need to do the
21515         argument resolution *always*.
21516
21517         * decl.cs: Make this hold the namespace.  Hold the root context as
21518         well.
21519         (LookupType): Move here.
21520
21521         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21522
21523         * location.cs (Row, Name): Fixed the code, it was always returning
21524         references to the first file.
21525
21526         * interface.cs: Register properties defined through interfaces.
21527
21528         * driver.cs: Add support for globbing on the command line
21529
21530         * class.cs (Field): Make it derive from MemberCore as well.
21531         (Event): ditto.
21532
21533 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21534
21535         * class.cs (Event::Define): Check that the type of the event is a delegate
21536         type else flag error #66.
21537
21538         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21539         same.
21540
21541         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21542         values of EntryPoint, CharSet etc etc.
21543
21544         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21545
21546         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21547         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21548         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21549         which needs this to do its work.
21550
21551         * ../errors/cs0066.cs : Add.
21552
21553 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21554
21555         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21556         helper functions.
21557
21558         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21559         clears out the parameters field.
21560         (MemberSignatureCompare): Cleanup
21561
21562         (MemberCore): New base class used to share code between MethodCore
21563         and Property.
21564
21565         (RegisterRequiredImplementations) BindingFlags.Public requires
21566         either BindingFlags.Instace or Static.  Use instance here.
21567
21568         (Property): Refactored code to cope better with the full spec.
21569
21570         * parameter.cs (GetParameterInfo): Return an empty array instead
21571         of null on error.
21572
21573         * class.cs (Property): Abstract or extern properties have no bodies.
21574
21575         * parameter.cs (GetParameterInfo): return a zero-sized array.
21576
21577         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21578         method modifier validation to the typecontainer so we can reuse
21579         this on properties.
21580
21581         (MethodCore.ParameterTypes): return an empty sized array of types.
21582
21583         (Property.Define): Test property modifier validity.
21584
21585         Add tests for sealed/override too.
21586
21587         (Method.Emit): abstract or extern methods have no bodies.
21588
21589 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21590
21591         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21592         thing.
21593
21594         (Method::Define, ::Emit): Modify accordingly.
21595
21596         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21597
21598         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21599
21600         * makefile: Pass in /unsafe.
21601
21602 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * class.cs (MakeKey): Kill routine.
21605
21606         * class.cs (TypeContainer.Define): Correctly define explicit
21607         method implementations (they require the full interface name plus
21608         the method name).
21609
21610         * typemanager.cs: Deply the PtrHashtable here and stop using the
21611         lame keys.  Things work so much better.
21612
21613         This of course broke everyone who depended on `RegisterMethod' to
21614         do the `test for existance' test.  This has to be done elsewhere.
21615
21616         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21617         the object stupid Equals method (because, that like fails all over
21618         the place).  We still do not use it.
21619
21620         * class.cs (TypeContainer.SetRequiredInterface,
21621         TypeContainer.RequireMethods): Killed these two routines and moved
21622         all the functionality to RegisterRequiredImplementations.
21623
21624         (TypeContainer.RegisterRequiredImplementations): This routine now
21625         registers all the implementations required in an array for the
21626         interfaces and abstract methods.  We use an array of structures
21627         which can be computed ahead of time to reduce memory usage and we
21628         also assume that lookups are cheap as most classes will not
21629         implement too many interfaces.
21630
21631         We also avoid creating too many MethodSignatures.
21632
21633         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21634         clear the "pending" bit if we find that there are problems with
21635         the declaration.
21636
21637         (TypeContainer.VerifyPendingMethods): Update to report errors of
21638         methods that look like implementations but are not.
21639
21640         (TypeContainer.Define): Add support for explicit interface method
21641         implementation. 
21642
21643 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21644
21645         * typemanager.cs: Keep track of the parameters here instead of
21646         being a feature of the TypeContainer.
21647
21648         * class.cs: Drop the registration of parameters here, as
21649         InterfaceMethods are also interface declarations.
21650
21651         * delegate.cs: Register methods with the TypeManager not only with
21652         the TypeContainer.  This code was buggy.
21653
21654         * interface.cs: Full registation here.
21655
21656 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21657
21658         * expression.cs: Remove reducer for binary expressions, it can not
21659         be done this way.
21660
21661         * const.cs: Put here the code that used to go into constant.cs
21662
21663         * constant.cs: Put here the code for constants, this is a new base
21664         class for Literals.
21665
21666         * literal.cs: Make Literal derive from Constant.
21667
21668 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21669
21670         * statement.cs (Return.Emit): Report error 157 if the user
21671         attempts to return from a finally block.
21672
21673         (Return.Emit): Instead of emitting a return, jump to the end of
21674         the function.
21675
21676         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21677         LocalBuilder to store the result of the function.  ReturnLabel is
21678         the target where we jump.
21679
21680
21681 2001-12-09  Radek Doulik  <rodo@ximian.com>
21682
21683         * cs-parser.jay: remember alias in current namespace
21684
21685         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21686         namespaces
21687
21688         * class.cs (LookupAlias): lookup alias in my_namespace
21689
21690         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21691         aliases hashtable
21692         (LookupAlias): lookup alias in this and if needed in parent
21693         namespaces
21694
21695 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21696
21697         * support.cs: 
21698
21699         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21700         making things static.  I need this to avoid passing the
21701         TypeContainer when calling ParameterType.
21702
21703         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21704         that did string manipulation to compute the type and then call
21705         GetType.  Use Parameter.ParameterType instead.
21706
21707         * cs-tokenizer.cs: Consume the suffix for floating values.
21708
21709         * expression.cs (ParameterReference): figure out whether this is a
21710         reference parameter or not.  Kill an extra variable by computing
21711         the arg_idx during emission.
21712
21713         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21714         function that returns whether a parameter is an out/ref value or not.
21715
21716         (Parameter.ParameterType): The type of the parameter (base,
21717         without ref/out applied).
21718
21719         (Parameter.Resolve): Perform resolution here.
21720         (Parameter.ExternalType): The full type (with ref/out applied).
21721
21722         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21723         support for expressions on the using statement.
21724
21725 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * statement.cs (Using.EmitLocalVariableDecls): Split the
21728         localvariable handling of the using statement.
21729
21730         (Block.EmitMeta): Keep track of variable count across blocks.  We
21731         were reusing slots on separate branches of blocks.
21732
21733         (Try.Emit): Emit the general code block, we were not emitting it. 
21734
21735         Check the type of the declaration to be an IDisposable or
21736         something that can be implicity converted to it. 
21737
21738         Emit conversions if required.
21739
21740         * ecore.cs (EmptyExpression): New utility class.
21741         (Expression.ImplicitConversionExists): New utility function.
21742
21743 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21744
21745         * statement.cs (Using): Implement.
21746
21747         * expression.cs (LocalVariableReference): Support read only variables.
21748
21749         * statement.cs: Remove the explicit emit for the Leave opcode.
21750         (VariableInfo): Add a readonly field.
21751
21752 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21753
21754         * ecore.cs (ConvCast): new class used to encapsulate the various
21755         explicit integer conversions that works in both checked and
21756         unchecked contexts.
21757
21758         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21759         properly generate the overflow opcodes.
21760
21761 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21762
21763         * statement.cs: The correct type for the EmptyExpression is the
21764         element_type, not the variable type.  Ravi pointed this out.
21765
21766 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21767
21768         * class.cs (Method::Define): Handle PInvoke methods specially
21769         by using DefinePInvokeMethod instead of the usual one.
21770
21771         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21772         above to do the task of extracting information and defining the method.
21773
21774 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21775
21776         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21777         of the condition for string type.
21778
21779         (Emit): Move that here. 
21780
21781         (ArrayCreation::CheckIndices): Keep string literals in their expression
21782         form.
21783
21784         (EmitDynamicInitializers): Handle strings appropriately.
21785
21786 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21787
21788         * codegen.cs (EmitContext): Replace multiple variables with a
21789         single pointer to the current Switch statement.
21790
21791         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21792         EmitContext.
21793
21794 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21795
21796         * statement.cs 
21797
21798         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21799         default'.
21800
21801         (Foreach.Emit): Foreach on arrays was not setting
21802         up the loop variables (for break/continue).
21803
21804         (GotoCase): Semi-implented.
21805
21806 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21807
21808         * attribute.cs (CheckAttribute): Handle system attributes by using
21809         Attribute.GetAttributes to examine information we need.
21810
21811         (GetValidPlaces): Same here.
21812
21813         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21814
21815         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21816
21817         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21818
21819         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21820
21821         (Method::Emit): Handle the case when we are a PInvoke method.
21822
21823 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21824
21825         * expression.cs: Use ResolveWithSimpleName on compound names.
21826
21827 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21828
21829         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21830         before trying to reduce it.
21831
21832         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21833
21834         * constant.cs (LookupConstantValue): Implement.
21835
21836         (EmitConstant): Use the above in emitting the constant.
21837
21838         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21839         that are user-defined by doing a LookupConstantValue on them.
21840
21841         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21842         too, like above.
21843
21844 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21847
21848         (BaseAccess.DoResolve): Implement.
21849
21850         (MemberAccess.DoResolve): Split this routine into a
21851         ResolveMemberAccess routine that can be used independently
21852
21853 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21854
21855         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21856         As that share bits of the implementation.  Is returns a boolean,
21857         while As returns the Type that is being probed.
21858
21859 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21860
21861         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21862         instead of a Literal - much easier.
21863
21864         (EnumInTransit): Remove - utterly useless :-)
21865
21866         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21867
21868         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21869
21870         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21871         chain when we have no associated expression.
21872
21873 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21874
21875         * constant.cs (Define): Use Location while reporting the errror.
21876
21877         Also emit a warning when 'new' is used and there is no inherited
21878         member to hide.
21879
21880         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21881         populated.
21882
21883         (LookupEnumValue): Implement to lookup an enum member's value and define it
21884         if necessary.
21885
21886         (Populate): Re-write accordingly to use the above routine.
21887
21888 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21889
21890         * expression.cs (This): Fix prototype for DoResolveLValue to
21891         override the base class DoResolveLValue.
21892
21893         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21894         declarations) 
21895
21896         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21897         (we need to load the address of the field here).  This fixes
21898         test-22. 
21899
21900         (FieldExpr.DoResolveLValue): Call the DoResolve
21901         function to initialize the Instance expression.
21902
21903         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21904         correctly the GetEnumerator operation on a value type.
21905
21906         * cs-parser.jay: Add more simple parsing error catches.
21907
21908         * statement.cs (Switch): Add support for string switches.
21909         Handle null specially.
21910
21911         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21912
21913 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21914
21915         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21916
21917         (declare_local_constant): New helper function.
21918
21919         * statement.cs (AddConstant): Keep a separate record of constants
21920
21921         (IsConstant): Implement to determine if a variable is a constant.
21922
21923         (GetConstantExpression): Implement.
21924
21925         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21926
21927         * statement.cs (IsVariableDefined): Re-write.
21928
21929 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21930
21931         * class.cs (TypeContainer::FindMembers): Look for constants
21932         in the case when we are looking for MemberTypes.Field
21933
21934         * expression.cs (MemberAccess::DoResolve): Check that in the
21935         case we are a FieldExpr and a Literal, we are not being accessed
21936         by an instance reference.
21937
21938         * cs-parser.jay (local_constant_declaration): Implement.
21939
21940         (declaration_statement): Implement for constant declarations.
21941
21942 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21943
21944         * statement.cs (Switch): Catch double defaults.
21945
21946         (Switch): More work on the switch() statement
21947         implementation.  It works for integral values now, need to finish
21948         string support.
21949
21950
21951 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21952
21953         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21954         integer literals into other integer literals.  To be used by
21955         switch. 
21956
21957 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21958
21959         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21960         some memory.
21961
21962         (EmitDynamicInitializers): Cope with the above since we extract data
21963         directly from ArrayData now.
21964
21965         (ExpectInitializers): Keep track of whether initializers are mandatory
21966         or not.
21967
21968         (Bounds): Make it a hashtable to prevent the same dimension being 
21969         recorded for every element in that dimension.
21970
21971         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21972         from being found.
21973
21974         Also fix bug which was causing the indices to be emitted in the reverse
21975         order.
21976
21977 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21978
21979         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21980         unfinished.  They do not work, because the underlying code is
21981         sloppy.
21982
21983 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21984
21985         * cs-parser.jay: Remove bogus fixme.
21986
21987         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21988         on Switch statement.
21989
21990 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21991
21992         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21993         the same. 
21994
21995         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21996         parameter. Apparently, any expression is allowed. 
21997
21998         (ValidateInitializers): Update accordingly.
21999
22000         (CheckIndices): Fix some tricky bugs thanks to recursion.
22001
22002         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22003         I was being completely brain-dead.
22004
22005         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22006         and re-write acordingly.
22007
22008         (DelegateInvocation): Re-write accordingly.
22009
22010         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22011
22012         (MakeByteBlob): Handle types more correctly.
22013
22014         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22015         initialization from expressions but it is incomplete because I am a complete
22016         Dodo :-|
22017
22018 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22021         on If.  Basically, we have to return `true' (ie, we do return to
22022         our caller) only if both branches of the if return.
22023
22024         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22025         short-circuit operators, handle them as short circuit operators. 
22026
22027         (Cast.DoResolve): Resolve type.
22028         (Cast.Cast): Take an expression as the target type.
22029
22030         * cs-parser.jay (cast_expression): Remove old hack that only
22031         allowed a limited set of types to be handled.  Now we take a
22032         unary_expression and we resolve to a type during semantic
22033         analysis.
22034
22035         Use the grammar productions from Rhys to handle casts (this is
22036         not complete like Rhys syntax yet, we fail to handle that corner
22037         case that C# has regarding (-x), but we will get there.
22038
22039 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22040
22041         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22042         field which is an array type.
22043
22044         * cs-parser.jay (declare_local_variables): Support array initialization too.
22045
22046         * typemanager.cs (MakeKey): Implement.
22047
22048         (everywhere): Use the above appropriately.
22049
22050         * cs-parser.jay (for_statement): Update for array initialization while
22051         declaring variables.
22052
22053         * ecore.cs : The error message was correct, it's the variable's names that
22054         were misleading ;-) Make the code more readable.
22055
22056         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22057         the correct type etc.
22058
22059         (ConvertExplicit): Handle Enum types by examining the underlying type.
22060
22061 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22062
22063         * parameter.cs (GetCallingConvention): Always return
22064         CallingConventions.Standard for now.
22065
22066 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22067
22068         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22069         and `r' after calling DoNumericPromotions.
22070
22071         * ecore.cs: Fix error message (the types were in the wrong order).
22072
22073         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22074         BindingFlags.Instance as well 
22075
22076         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22077         implicit int literal conversion in an empty cast so that we
22078         propagate the right type upstream.
22079
22080         (UnboxCast): new class used to unbox value types.
22081         (Expression.ConvertExplicit): Add explicit type conversions done
22082         by unboxing.
22083
22084         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22085         the target type before applying the implicit LongLiterals to ULong
22086         literal cast.
22087
22088 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22089
22090         * cs-parser.jay (for_statement): Reworked the way For works: now
22091         we declare manually any variables that are introduced in
22092         for_initializer to solve the problem of having out-of-band code
22093         emition (that is what got for broken).
22094
22095         (declaration_statement): Perform the actual variable declaration
22096         that used to be done in local_variable_declaration here.
22097
22098         (local_variable_declaration): Do not declare anything, just pass
22099         the information on a DictionaryEntry
22100
22101 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22102
22103         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22104         re-write of the logic to now make it recursive.
22105
22106         (UpdateIndices): Re-write accordingly.
22107
22108         Store element data in a separate ArrayData list in the above methods.
22109
22110         (MakeByteBlob): Implement to dump the array data into a byte array.
22111
22112 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22113
22114         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22115         into CheckIndices.
22116
22117         * constant.cs (Define): Implement.
22118
22119         (EmitConstant): Re-write fully.
22120
22121         Pass in location info.
22122
22123         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22124         respectively.
22125
22126         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22127         DictionaryEntry since we need location info too.
22128
22129         (constant_declaration): Update accordingly.
22130
22131         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22132         code into another method : UpdateIndices.
22133
22134 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22135
22136         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22137         some type checking etc.
22138
22139 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22140
22141         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22142         bits to provide dimension info if the user skips doing that.
22143
22144         Update second constructor to store the rank correctly.
22145
22146 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22147
22148         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22149         and try to implement.
22150
22151         * ../errors/cs0150.cs : Add.
22152
22153         * ../errors/cs0178.cs : Add.
22154
22155 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22156
22157         * statement.cs: Implement foreach on multi-dimensional arrays. 
22158
22159         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22160         name of the params argument.
22161
22162         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22163         initializing the array.
22164
22165         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22166         we can use this elsewhere.
22167
22168         * statement.cs: Finish implementation of foreach for single
22169         dimension arrays.
22170
22171         * cs-parser.jay: Use an out-of-band stack to pass information
22172         around, I wonder why I need this.
22173
22174         foreach_block: Make the new foreach_block the current_block.
22175
22176         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22177         function used to return a static Parameters structure.  Used for
22178         empty parameters, as those are created very frequently.
22179
22180         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22181
22182 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22183
22184         * interface.cs : Default modifier is private, not public. The
22185         make verify test passes again.
22186
22187 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22188
22189         * support.cs (ReflectionParameters): Fix logic to determine
22190         whether the last parameter is a params one. Test 9 passes again.
22191
22192         * delegate.cs (Populate): Register the builders we define with
22193         RegisterParameterForBuilder. Test 19 passes again.
22194
22195         * cs-parser.jay (property_declaration): Reference $6 instead
22196         of $$ to get at the location.
22197
22198         (indexer_declaration): Similar stuff.
22199
22200         (attribute): Ditto.
22201
22202         * class.cs (Property): Register parameters for the Get and Set methods
22203         if they exist. Test 23 passes again.
22204
22205         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22206         call to EmitArguments as we are sure there aren't any params arguments. 
22207         Test 32 passes again.
22208
22209         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22210         IndexOutOfRangeException. 
22211
22212         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22213         Test 33 now passes again.
22214
22215 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22216
22217         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22218         broke a bunch of things.  Will have to come up with a better way
22219         of tracking locations.
22220
22221         * statement.cs: Implemented foreach for single dimension arrays.
22222
22223 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22224
22225         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22226         an error.  This removes the lookup from the critical path.
22227
22228         * cs-parser.jay: Removed use of temporary_loc, which is completely
22229         broken. 
22230
22231 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22232
22233         * support.cs (ReflectionParameters.ParameterModifier): Report
22234         whether the argument is a PARAMS argument or not.
22235
22236         * class.cs: Set the attribute `ParamArrayAttribute' on the
22237         parameter argument.
22238
22239         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22240         and cons_param_array_attribute (ConstructorInfo for
22241         ParamArrayAttribute)., 
22242
22243         * codegen.cs: Emit the return using the `Return' statement, that
22244         way we can report the error correctly for missing return values. 
22245
22246         * class.cs (Method.Emit): Clean up.
22247
22248         * expression.cs (Argument.Resolve): Take another argument: the
22249         location where this argument is used.  Notice that this is not
22250         part of the "Argument" class as to reduce the size of the
22251         structure (we know the approximate location anyways).
22252
22253         Test if the argument is a variable-reference, if not, then
22254         complain with a 206.
22255
22256         (Argument.Emit): Emit addresses of variables.
22257
22258         (Argument.FullDesc): Simplify.
22259
22260         (Invocation.DoResolve): Update for Argument.Resolve.
22261
22262         (ElementAccess.DoResolve): ditto.
22263
22264         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22265         method should be virtual, as this method is always virtual.
22266
22267         (NewDelegate.DoResolve): Update for Argument.Resolve.
22268
22269         * class.cs (ConstructorInitializer.DoResolve): ditto.
22270
22271         * attribute.cs (Attribute.Resolve): ditto.
22272
22273 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22274
22275         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22276
22277         * expression.cs (ParameterReference): Drop IStackStorage and implement
22278         IAssignMethod instead. 
22279
22280         (LocalVariableReference): ditto.
22281
22282         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22283         IAssignMethod instead. 
22284
22285 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22286
22287         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22288         enumerations that are used in heavily used structures derive from
22289         byte in a laughable and pathetic attempt to reduce memory usage.
22290         This is the kind of pre-optimzations that you should not do at
22291         home without adult supervision.
22292
22293         * expression.cs (UnaryMutator): New class, used to handle ++ and
22294         -- separatedly from the other unary operators.  Cleans up the
22295         code, and kills the ExpressionStatement dependency in Unary.
22296
22297         (Unary): Removed `method' and `Arguments' from this class, making
22298         it smaller, and moving it all to SimpleCall, so I can reuse this
22299         code in other locations and avoid creating a lot of transient data
22300         strucutres when not required.
22301
22302         * cs-parser.jay: Adjust for new changes.
22303
22304 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22305
22306         * enum.cs (Enum.Populate): If there is a failure during
22307         definition, return
22308
22309         * cs-parser.jay (opt_enum_base): we used to catch type errors
22310         here, but this is really incorrect.  The type error should be
22311         catched during semantic analysis.
22312
22313 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22314
22315         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22316         current_local_parameters as expected since I, in my stupidity, had forgotten
22317         to do this :-)
22318
22319         * attribute.cs (GetValidPlaces): Fix stupid bug.
22320
22321         * class.cs (Method::Emit): Perform check on applicability of attributes.
22322
22323         (Constructor::Emit): Ditto.
22324
22325         (Field::Emit): Ditto.
22326
22327         (Field.Location): Store location information.
22328
22329         (Property, Event, Indexer, Operator): Ditto.
22330
22331         * cs-parser.jay (field_declaration): Pass in location for each field.
22332
22333         * ../errors/cs0592.cs : Add.
22334
22335 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22336
22337         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22338
22339         (InitCoreTypes): Update accordingly.
22340
22341         (RegisterAttrType, LookupAttr): Implement.
22342
22343         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22344         info about the same.
22345
22346         (Resolve): Update to populate the above as necessary.
22347
22348         (Error592): Helper.
22349
22350         (GetValidPlaces): Helper to the above.
22351
22352         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22353
22354         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22355
22356 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22357
22358         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22359
22360         * ../errors/cs0617.cs : Add.
22361
22362 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22363
22364         * enum.cs (Emit): Rename to Populate to be more consistent with what
22365         we expect it to do and when exactly it is called.
22366
22367         * class.cs, rootcontext.cs : Update accordingly.
22368
22369         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22370         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22371
22372         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22373
22374         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22375         of a fieldinfo using the above, when dealing with a FieldBuilder.
22376
22377 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22378
22379         * ../errors/cs0031.cs : Add.
22380
22381         * ../errors/cs1008.cs : Add.
22382
22383         * ../errrors/cs0543.cs : Add.
22384
22385         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22386         enum type.
22387
22388         (FindMembers): Implement.
22389
22390         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22391         enums and delegates too.
22392
22393         (enum_types): Rename to builder_to_enum.
22394
22395         (delegate_types): Rename to builder_to_delegate.
22396
22397         * delegate.cs (FindMembers): Implement.
22398
22399 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22400
22401         * typemanager.cs (IsEnumType): Implement.
22402
22403         * enum.cs (Emit): Re-write parts to account for the underlying type
22404         better and perform checking etc.
22405
22406         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22407         of the underlying type.
22408
22409         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22410         value
22411
22412         * enum.cs (error31): Helper to report error #31.
22413
22414         * cs-parser.jay (enum_declaration): Store location of each member too.
22415
22416         * enum.cs (member_to_location): New hashtable. 
22417
22418         (AddEnumMember): Update location hashtable.
22419
22420         (Emit): Use the location of each member while reporting errors.
22421
22422 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22423
22424         * cs-parser.jay: A for_initializer if is a
22425         local_variable_declaration really ammount to have an implicit
22426         block with the variable declaration and no initializer for for.
22427
22428         * statement.cs (For.Emit): Cope with null initializers.
22429
22430         This fixes the infinite loop on for initializers.
22431
22432 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22433
22434         * enum.cs: More cleanup.
22435
22436         * ecore.cs: Remove dead code.
22437
22438         * class.cs (Property.Emit): More simplification.
22439         (Event.Emit): ditto.
22440
22441         Reworked to have less levels of indentation.
22442
22443 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22444
22445         * class.cs (Property): Emit attributes.
22446
22447         (Field): Ditto.
22448
22449         (Event): Ditto.
22450
22451         (Indexer): Ditto.
22452
22453         (Operator): Ditto.
22454
22455         * enum.cs (Emit): Ditto.
22456
22457         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22458         Enums too.
22459
22460         * class.cs (Field, Event, etc.): Move attribute generation into the
22461         Emit method everywhere.
22462
22463         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22464         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22465         as we had no way of defining nested enums !
22466
22467         * rootcontext.cs : Adjust code accordingly.
22468
22469         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22470
22471 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22472
22473         * expression.cs (EvalConstantExpression): Move into ecore.cs
22474
22475         * enum.cs (Enum): Rename some members and make them public and readonly
22476         according to our convention.
22477
22478         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22479         nothing else.
22480
22481         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22482
22483         (Enum::Emit): Write a simple version for now which doesn't try to compute
22484         expressions. I shall modify this to be more robust in just a while.
22485
22486         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22487
22488         (TypeContainer::CloseType): Create the Enum types too.
22489
22490         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22491
22492         * expression.cs (EvalConstantExpression): Get rid of completely.
22493
22494         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22495         user-defined values and other cases.
22496
22497         (IsValidEnumLiteral): Helper function.
22498
22499         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22500         out there in the case we had a literal FieldExpr.
22501
22502         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22503
22504         (Literalize): Revamp a bit to take two arguments.
22505
22506         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22507
22508 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22509
22510         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22511
22512         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22513
22514         (Resolve): Use the above to ensure we have proper initializers.
22515
22516 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22517
22518         * expression.cs (Expression::EvalConstantExpression): New method to 
22519         evaluate constant expressions.
22520
22521         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22522
22523 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22524
22525         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22526         in an array.
22527
22528         (Binary.ResolveOperator): Handle operator != (object a, object b)
22529         and operator == (object a, object b);
22530
22531         (Binary.DoNumericPromotions): Indicate whether the numeric
22532         promotion was possible.
22533
22534         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22535         Implement.  
22536
22537         Made the ArrayAccess implement interface IAssignMethod instead of
22538         IStackStore as the order in which arguments are passed reflects
22539         this.
22540
22541         * assign.cs: Instead of using expr.ExprClass to select the way of
22542         assinging, probe for the IStackStore/IAssignMethod interfaces.
22543
22544         * typemanager.cs: Load InitializeArray definition.
22545
22546         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22547         static data that can be used to initialize arrays. 
22548
22549 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22550
22551         * expression.cs: Handle operator== and operator!= for booleans.
22552
22553         (Conditioal.Reduce): Implement reducer for the ?: operator.
22554
22555         (Conditional.Resolve): Implement dead code elimination.
22556
22557         (Binary.Resolve): Catch string literals and return a new
22558         concatenated string.
22559
22560         (Unary.Reduce): Implement reduction of unary expressions.
22561
22562         * ecore.cs: Split out the expression core handling here.
22563
22564         (Expression.Reduce): New method used to perform constant folding
22565         and CSE.  This is needed to support constant-expressions. 
22566
22567         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22568         targets, and optimize for !x.
22569
22570 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22571
22572         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22573         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22574         set custom atttributes.
22575
22576         * literal.cs (Literal::GetValue): New abstract method to return the actual
22577         value of the literal, cast as an object.
22578
22579         (*Literal): Implement GetValue method.
22580
22581         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22582         expressions to the arraylist but objects of type Argument.
22583
22584         * class.cs (TypeContainer::Emit): Emit our attributes too.
22585
22586         (Method::Emit, Constructor::Emit): Ditto.
22587
22588         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22589         to be ignoring earlier.
22590
22591 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22592
22593         * attribute.cs (AttributeSection::Define): Implement to do the business
22594         of constructing a CustomAttributeBuilder.
22595
22596         (Attribute): New trivial class. Increases readability of code.  
22597
22598         * cs-parser.jay : Update accordingly.
22599
22600         (positional_argument_list, named_argument_list, named_argument): New rules
22601
22602         (attribute_arguments): Use the above so that we are more correct.
22603
22604 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22605
22606         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22607         to perform all checks for a method with a params parameter.
22608
22609         (Invocation::OverloadResolve): Update to use the above method and therefore
22610         cope correctly with params method invocations.
22611
22612         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22613         params too.
22614
22615         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22616         constructors in our parent too because we can't afford to miss out on 
22617         protected ones ;-)
22618
22619         * attribute.cs (AttributeSection): New name for the class Attribute
22620
22621         Other trivial changes to improve readability.
22622
22623         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22624         use the new class names.
22625
22626 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22627
22628         * class.cs (Method::Define): Complete definition for params types too
22629
22630         (Indexer::Define): Ditto.
22631
22632         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22633         Cope everywhere with a request for info about the array parameter.
22634
22635 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22636
22637         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22638
22639         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22640         local_variable_type to extract the string corresponding to the type.
22641
22642         (local_variable_type): Fixup the action to use the new helper method.
22643
22644         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22645         go.
22646
22647         * expression.cs : Clean out code which uses the above.
22648
22649 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22650
22651         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22652         and bale out if necessary by returning a false.
22653
22654         (RegisterProperty): Ditto.
22655
22656         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22657         and print out appropriate error messages.
22658
22659         * interface.cs (everywhere): Ditto.
22660
22661         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22662         location to constructor.
22663
22664         * class.cs (Property, Event, Indexer): Update accordingly.
22665
22666         * ../errors/cs111.cs : Added.
22667
22668         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22669         of a method, as laid down by the spec.
22670
22671         (Invocation::OverloadResolve): Use the above method.
22672
22673 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22674
22675         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22676         now take a TypeContainer and a Parameters object.
22677
22678         (ParameterData): Modify return type of ParameterModifier method to be 
22679         Parameter.Modifier and not a string.
22680
22681         (ReflectionParameters, InternalParameters): Update accordingly.
22682
22683         * expression.cs (Argument::GetParameterModifier): Same here.
22684
22685         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22686         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22687         symbol in it at all so maybe this is only for now.
22688
22689 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22690
22691         * support.cs (InternalParameters): Constructor now takes an extra argument 
22692         which is the actual Parameters class.
22693
22694         (ParameterDesc): Update to provide info on ref/out modifiers.
22695
22696         * class.cs (everywhere): Update call to InternalParameters to pass in
22697         the second argument too.
22698
22699         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22700         to return the modifier info [ref/out etc]
22701
22702         (InternalParameters, ReflectionParameters): Implement the above.
22703
22704         * expression.cs (Argument::ParameterModifier): Similar function to return
22705         info about the argument's modifiers.
22706
22707         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22708         too.
22709
22710         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22711         a new SetFormalParameters object which we pass to InternalParameters.
22712
22713 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22714
22715         * expression.cs (NewArray): Merge into the ArrayCreation class.
22716
22717 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22718
22719         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22720         NewUserdefinedArray into one as there wasn't much of a use in having
22721         two separate ones.
22722
22723         * expression.cs (Argument): Change field's name to ArgType from Type.
22724
22725         (Type): New readonly property which returns the proper type, taking into 
22726         account ref/out modifiers.
22727
22728         (everywhere): Adjust code accordingly for the above.
22729
22730         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22731         whether we are emitting for a ref or out parameter.
22732
22733         * expression.cs (Argument::Emit): Use the above field to set the state.
22734
22735         (LocalVariableReference::Emit): Update to honour the flag and emit the
22736         right stuff.
22737
22738         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22739
22740         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22741
22742         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22743
22744         (ReflectionParameters, InternalParameters): Implement the above method.
22745
22746         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22747         reporting errors.
22748
22749         (Invocation::FullMethodDesc): Ditto. 
22750
22751 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22752
22753         * cs-parser.jay: Add extra production for the second form of array
22754         creation. 
22755
22756         * expression.cs (ArrayCreation): Update to reflect the above
22757         change. 
22758
22759         * Small changes to prepare for Array initialization.
22760
22761 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22762
22763         * typemanager.cs (ImplementsInterface): interface might be null;
22764         Deal with this problem;
22765
22766         Also, we do store negative hits on the cache (null values), so use
22767         this instead of calling t.GetInterfaces on the type everytime.
22768
22769 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22770
22771         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22772
22773         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22774         split functionality out into different classes.
22775
22776         (New::FormArrayType): Move into NewBuiltinArray.
22777
22778         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22779         quite useless.
22780
22781         (NewBuiltinArray): New class to handle creation of built-in arrays.
22782
22783         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22784         account creation of one-dimensional arrays.
22785
22786         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22787
22788         (NewUserdefinedArray::DoResolve): Implement.
22789
22790         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22791
22792         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22793         we maintain inside the TypeManager. This is necessary to perform lookups on the
22794         module builder.
22795
22796         (LookupType): Update to perform GetType on the module builders too.     
22797
22798         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22799
22800         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22801
22802 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22803
22804         * expression.cs (New::DoResolve): Implement guts of array creation.
22805
22806         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22807
22808 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22809
22810         * expression.cs: Fix bug I introduced lsat night that broke
22811         Delegates. 
22812
22813         (Expression.Resolve): Report a 246 error (can not resolve name)
22814         if we find a SimpleName in the stream.
22815
22816         (Expression.ResolveLValue): Ditto.
22817
22818         (Expression.ResolveWithSimpleName): This function is a variant of
22819         ResolveName, this one allows SimpleNames to be returned without a
22820         warning.  The only consumer of SimpleNames is MemberAccess
22821
22822 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22823
22824         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22825         might arrive here.  I have my doubts that this is correct.
22826
22827         * statement.cs (Lock): Implement lock statement.
22828
22829         * cs-parser.jay: Small fixes to support `lock' and `using'
22830
22831         * cs-tokenizer.cs: Remove extra space
22832
22833         * driver.cs: New flag --checked, allows to turn on integer math
22834         checking. 
22835
22836         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22837         Threading.Monitor.Exit 
22838
22839 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22840
22841         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22842         Expression Class to be IndexerAccess.
22843
22844         Notice that Indexer::DoResolve sets the eclass to Value.
22845
22846 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22847
22848         * class.cs (TypeContainer::Emit): Emit code for indexers.
22849
22850         * assign.cs (IAssignMethod): New interface implemented by Indexers
22851         and Properties for handling assignment.
22852
22853         (Assign::Emit): Simplify and reuse code. 
22854
22855         * expression.cs (IndexerAccess, PropertyExpr): Implement
22856         IAssignMethod, clean up old code. 
22857
22858 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22859
22860         * typemanager.cs (ImplementsInterface): New method to determine if a type
22861         implements a given interface. Provides a nice cache too.
22862
22863         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22864         method.
22865
22866         (ConvertReferenceExplicit): Ditto.
22867
22868         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22869         various methods, with correct names etc.
22870
22871         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22872         Operator.UnaryNegation.
22873
22874         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22875         we have a unary plus or minus operator.
22876
22877         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22878         UnaryMinus.
22879
22880         * everywhere : update accordingly.
22881
22882         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22883         respectively.
22884
22885         * class.cs (Method::Define): For the case where we are implementing a method
22886         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22887         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22888
22889 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22890
22891         * interface.cs (FindMembers): Implement to work around S.R.E
22892         lameness.
22893
22894         * typemanager.cs (IsInterfaceType): Implement.
22895
22896         (FindMembers): Update to handle interface types too.
22897
22898         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22899         use IsAssignableFrom as that is not correct - it doesn't work.
22900
22901         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22902         and accordingly override EmitStatement.
22903
22904         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22905         using the correct logic :-)
22906
22907 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22908
22909         * ../errors/cs-11.cs : Add to demonstrate error -11 
22910
22911 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22912
22913         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22914         then pass this as a hint to ResolveLValue.
22915
22916         * expression.cs (FieldExpr): Add Location information
22917
22918         (FieldExpr::LValueResolve): Report assignment to readonly
22919         variable. 
22920
22921         (Expression::ExprClassFromMemberInfo): Pass location information.
22922
22923         (Expression::ResolveLValue): Add new method that resolves an
22924         LValue. 
22925
22926         (Expression::DoResolveLValue): Default invocation calls
22927         DoResolve. 
22928
22929         (Indexers): New class used to keep track of indexers in a given
22930         Type. 
22931
22932         (IStackStore): Renamed from LValue, as it did not really describe
22933         what this did.  Also ResolveLValue is gone from this interface and
22934         now is part of Expression.
22935
22936         (ElementAccess): Depending on the element access type
22937
22938         * typemanager.cs: Add `indexer_name_type' as a Core type
22939         (System.Runtime.CompilerServices.IndexerNameAttribute)
22940
22941         * statement.cs (Goto): Take a location.
22942
22943 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22944
22945         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22946         if two delegates are compatible.
22947
22948         (NewDelegate::DoResolve): Update to take care of the case when
22949         we instantiate a delegate from another delegate.
22950
22951         * typemanager.cs (FindMembers): Don't even try to look up members
22952         of Delegate types for now.
22953
22954 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22955
22956         * delegate.cs (NewDelegate): New class to take care of delegate
22957         instantiation.
22958
22959         * expression.cs (New): Split the delegate related code out into 
22960         the NewDelegate class.
22961
22962         * delegate.cs (DelegateInvocation): New class to handle delegate 
22963         invocation.
22964
22965         * expression.cs (Invocation): Split out delegate related code into
22966         the DelegateInvocation class.
22967
22968 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22969
22970         * expression.cs (New::DoResolve): Implement delegate creation fully
22971         and according to the spec.
22972
22973         (New::DoEmit): Update to handle delegates differently.
22974
22975         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22976         because of which we were printing out arguments in reverse order !
22977
22978         * delegate.cs (VerifyMethod): Implement to check if the given method
22979         matches the delegate.
22980
22981         (FullDelegateDesc): Implement.
22982
22983         (VerifyApplicability): Implement.
22984
22985         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22986         delegate invocations too.
22987
22988         (Invocation::Emit): Ditto.
22989
22990         * ../errors/cs1593.cs : Added.
22991
22992         * ../errors/cs1594.cs : Added.
22993
22994         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22995
22996 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22997
22998         * typemanager.cs (intptr_type): Core type for System.IntPtr
22999
23000         (InitCoreTypes): Update for the same.
23001
23002         (iasyncresult_type, asynccallback_type): Ditto.
23003
23004         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23005         correct.
23006
23007         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23008         too.
23009
23010         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23011         the builders for the 4 members of a delegate type :-)
23012
23013         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23014         type.
23015
23016         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23017
23018         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23019
23020 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23021
23022         * statement.cs (Break::Emit): Implement.   
23023         (Continue::Emit): Implement.
23024
23025         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23026         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23027         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23028         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23029         end loop
23030
23031         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23032         properties that track the label for the current loop (begin of the
23033         loop and end of the loop).
23034
23035 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23036
23037         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23038         use of emitting anything at all.
23039
23040         * class.cs, rootcontext.cs : Get rid of calls to the same.
23041
23042         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23043
23044         (Populate): Define the constructor correctly and set the implementation
23045         attributes.
23046
23047         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23048         have been defined.
23049
23050         (AddDelegateType): Implement.
23051
23052         (IsDelegateType): Implement helper method.
23053
23054         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23055
23056         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23057         and accordingly handle it.
23058
23059         * delegate.cs (Populate): Take TypeContainer argument.
23060         Implement bits to define the Invoke method. However, I still haven't figured out
23061         how to take care of the native int bit :-(
23062
23063         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23064         Qualify the name of the delegate, not its return type !
23065
23066         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23067         conversion.
23068
23069         (StandardConversionExists): Checking for array types turns out to be recursive.
23070
23071         (ConvertReferenceExplicit): Implement array conversion.
23072
23073         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23074
23075 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23076
23077         * cs-parser.jay (delegate_declaration): Store the fully qualified
23078         name as it is a type declaration.
23079
23080         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23081         readonly.
23082
23083         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23084         as TypeContainer::DefineType.
23085
23086         (Populate): Method in which all the definition of the various methods (Invoke)
23087         etc is done.
23088
23089         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23090         see.
23091
23092         (CloseDelegate): Finally creates the delegate.
23093
23094         * class.cs (TypeContainer::DefineType): Update to define delegates.
23095         (Populate, Emit and CloseType): Do the same thing here too.
23096
23097         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23098         delegates in all these operations.
23099
23100 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23101
23102         * expression.cs: LocalTemporary: a new expression used to
23103         reference a temporary that has been created.
23104
23105         * assign.cs: Handle PropertyAccess back here, so that we can
23106         provide the proper semantic access to properties.
23107
23108         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23109         a few more explicit conversions. 
23110
23111         * modifiers.cs: `NEW' modifier maps to HideBySig.
23112
23113         * expression.cs (PropertyExpr): Make this into an
23114         ExpressionStatement, and support the EmitStatement code path. 
23115
23116         Perform get/set error checking, clean up the interface.
23117
23118         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23119         them into toplevel access objects.
23120
23121 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23122
23123         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23124         SRE.
23125
23126         * typemanager.cs: Keep track here of our PropertyBuilders again to
23127         work around lameness in SRE.
23128
23129 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23130
23131         * expression.cs (LValue::LValueResolve): New method in the
23132         interface, used to perform a second resolution pass for LValues. 
23133
23134         (This::DoResolve): Catch the use of this in static methods.
23135
23136         (This::LValueResolve): Implement.
23137
23138         (This::Store): Remove warning, assigning to `this' in structures
23139         is 
23140
23141         (Invocation::Emit): Deal with invocation of
23142         methods on value types.  We need to pass the address to structure
23143         methods rather than the object itself.  (The equivalent code to
23144         emit "this" for structures leaves the entire structure on the
23145         stack instead of a pointer to it). 
23146
23147         (ParameterReference::DoResolve): Compute the real index for the
23148         argument based on whether the method takes or not a `this' pointer
23149         (ie, the method is static).
23150
23151         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23152         value types returned from functions when we need to invoke a
23153         method on the sturcture.
23154
23155
23156 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23157
23158         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23159         defining the type in the Modulebuilder or Typebuilder. This is to take
23160         care of nested types which need to be defined on the TypeBuilder using
23161         DefineNestedMethod.
23162
23163         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23164         methods in RootContext, only ported to be part of TypeContainer.
23165
23166         (TypeContainer::GetInterfaceOrClass): Ditto.
23167
23168         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23169
23170         * interface.cs (Interface::DefineInterface): New method. Does exactly
23171         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23172         too.
23173
23174         (Interface::GetInterfaces): Move from RootContext here and port.
23175
23176         (Interface::GetInterfaceByName): Same here.
23177
23178         * rootcontext.cs (ResolveTree): Re-write.
23179
23180         (PopulateTypes): Re-write.
23181
23182         * class.cs (TypeContainer::Populate): Populate nested types too.
23183         (TypeContainer::Emit): Emit nested members too.
23184
23185         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23186         instead just use the name argument passed in as it is already fully
23187         qualified.
23188
23189         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23190         to TypeContainer mapping to see if a type is user-defined.
23191
23192         * class.cs (TypeContainer::CloseType): Implement. 
23193
23194         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23195         the default constructor.
23196
23197         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23198         twice.
23199
23200         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23201
23202         * interface.cs (CloseType): Create the type here.
23203
23204         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23205         the hierarchy.
23206
23207         Remove all the methods which are now in TypeContainer.
23208
23209 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23210
23211         * delegate.cs (Define): Re-write bits to define the delegate
23212         correctly.
23213
23214 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23215
23216         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23217
23218         * expression.cs (ImplicitReferenceConversion): handle null as well
23219         as a source to convert to any reference type.
23220
23221         * statement.cs (Return): Perform any implicit conversions to
23222         expected return type.  
23223
23224         Validate use of return statement.  
23225
23226         * codegen.cs (EmitContext): Pass the expected return type here.
23227
23228         * class.cs (Method, Constructor, Property): Pass expected return
23229         type to EmitContext.
23230
23231 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23232
23233         * expression.cs: Make DoResolve take an EmitContext instead of a
23234         TypeContainer.
23235
23236         Replaced `l' and `location' for `loc', for consistency.
23237
23238         (Error, Warning): Remove unneeded Tc argument.
23239
23240         * assign.cs, literal.cs, constant.cs: Update to new calling
23241         convention. 
23242
23243         * codegen.cs: EmitContext now contains a flag indicating whether
23244         code is being generated in a static method or not.
23245
23246         * cs-parser.jay: DecomposeQI, new function that replaces the old
23247         QualifiedIdentifier.  Now we always decompose the assembled
23248         strings from qualified_identifier productions into a group of
23249         memberaccesses.
23250
23251 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23252
23253         * rootcontext.cs: Deal with field-less struct types correctly now
23254         by passing the size option to Define Type.
23255
23256         * class.cs: Removed hack that created one static field. 
23257
23258 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23259
23260         * statement.cs: Moved most of the code generation here. 
23261
23262 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23263
23264         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23265         seem very right.
23266
23267         (ElementAccess): Remove useless bits for now - keep checks as the spec
23268         says.
23269
23270 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23271
23272         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23273         and start performing checks according to the spec.
23274
23275 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23276
23277         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23278         rank_specifiers instead.
23279
23280         (rank_specifiers): Change the order in which the rank specifiers are stored
23281
23282         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23283
23284         * expression.cs (ElementAccess): Implement the LValue interface too.
23285
23286 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23287
23288         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23289         except that user defined conversions are not included.
23290
23291         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23292         perform the conversion of the return type, if necessary.
23293
23294         (New::DoResolve): Check whether we are creating an array or an object
23295         and accordingly do the needful.
23296
23297         (New::Emit): Same here.
23298
23299         (New::DoResolve): Implement guts of array creation.
23300
23301         (New::FormLookupType): Helper function.
23302
23303 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23304
23305         * codegen.cs: Removed most of the code generation here, and move the
23306         corresponding code generation bits to the statement classes. 
23307
23308         Added support for try/catch/finalize and throw.
23309
23310         * cs-parser.jay: Added support for try/catch/finalize.
23311
23312         * class.cs: Catch static methods having the flags override,
23313         virtual or abstract.
23314
23315         * expression.cs (UserCast): This user cast was not really doing
23316         what it was supposed to do.  Which is to be born in fully resolved
23317         state.  Parts of the resolution were being performed at Emit time! 
23318
23319         Fixed this code.
23320
23321 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23322
23323         * expression.cs: Implicity convert the result from UserCast.
23324
23325 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23326
23327         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23328         prevented it from working correctly. 
23329
23330         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23331         merely ConvertImplicit.
23332
23333 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23334
23335         * typemanager.cs: Make the LookupTypeContainer function static,
23336         and not per-instance.  
23337
23338         * class.cs: Make static FindMembers (the one that takes a Type
23339         argument). 
23340
23341         * codegen.cs: Add EmitForeach here.
23342
23343         * cs-parser.jay: Make foreach a toplevel object instead of the
23344         inline expansion, as we need to perform semantic analysis on it. 
23345
23346 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23347
23348         * expression.cs (Expression::ImplicitUserConversion): Rename to
23349         UserDefinedConversion.
23350
23351         (Expression::UserDefinedConversion): Take an extra argument specifying 
23352         whether we look for explicit user conversions too.
23353
23354         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23355
23356         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23357
23358         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23359         with the appropriate arguments.
23360
23361         * cs-parser.jay (cast_expression): Record location too.
23362
23363         * expression.cs (Cast): Record location info.
23364
23365         (Expression::ConvertExplicit): Take location argument.
23366
23367         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23368         to determine if we are doing explicit conversions.
23369
23370         (UserCast::Emit): Update accordingly.
23371
23372         (Expression::ConvertExplicit): Report an error if everything fails.
23373
23374         * ../errors/cs0030.cs : Add.
23375
23376 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23377
23378         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23379         virtual and newslot bits. 
23380
23381         * class.cs (TypeContainer::RegisterRequiredImplementations):
23382         Record methods we need.
23383
23384         (TypeContainer::MakeKey): Helper function to make keys for
23385         MethodBases, since the Methodbase key is useless.
23386
23387         (TypeContainer::Populate): Call RegisterRequiredImplementations
23388         before defining the methods.   
23389
23390         Create a mapping for method_builders_to_methods ahead of time
23391         instead of inside a tight loop.
23392
23393         (::RequireMethods):  Accept an object as the data to set into the
23394         hashtable so we can report interface vs abstract method mismatch.
23395
23396 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23397
23398         * report.cs: Make all of it static.
23399
23400         * rootcontext.cs: Drop object_type and value_type computations, as
23401         we have those in the TypeManager anyways.
23402
23403         Drop report instance variable too, now it is a global.
23404
23405         * driver.cs: Use try/catch on command line handling.
23406
23407         Add --probe option to debug the error reporting system with a test
23408         suite. 
23409
23410         * report.cs: Add support for exiting program when a probe
23411         condition is reached.
23412
23413 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23414
23415         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23416         we do a forcible conversion regardless of type, to check if 
23417         ForceConversion returns a null.
23418
23419         (Binary::error19): Use location to report error.
23420
23421         (Unary::error23): Use location here too.
23422
23423         * ../errors/cs0019.cs : Check in.
23424
23425         * ../errors/cs0023.cs : Check in.
23426
23427         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23428         case of a non-null MethodInfo object with a length of 0 !
23429
23430         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23431         an applicable member - according to the spec :-)
23432         Also fix logic to find members in base types.
23433
23434         (Unary::ResolveOperator): Same here.
23435
23436         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23437         as I was getting thoroughly confused between this and error19 :-)
23438
23439         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23440         (::FindMostEncompassedType): Implement.
23441         (::FindMostEncompassingType): Implement.
23442         (::StandardConversionExists): Implement.
23443
23444         (UserImplicitCast): Re-vamp. We now need info about most specific
23445         source and target types so that we can do the necessary conversions.
23446
23447         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23448         mathematical union with no duplicates.
23449
23450 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23451
23452         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23453         in order from base classes to child classes, so that we can in
23454         child classes look up in our parent for method names and
23455         attributes (required for handling abstract, virtual, new, override
23456         constructs: we need to instrospect our base class, and if we dont
23457         populate the classes in order, the introspection might be
23458         incorrect.  For example, a method could query its parent before
23459         the parent has any methods and would determine that the parent has
23460         no abstract methods (while it could have had them)).
23461
23462         (RootContext::CreateType): Record the order in which we define the
23463         classes.
23464
23465 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23466
23467         * class.cs (TypeContainer::Populate): Also method definitions can
23468         fail now, keep track of this.
23469
23470         (TypeContainer::FindMembers): Implement support for
23471         DeclaredOnly/noDeclaredOnly flag.
23472
23473         (Constructor::Emit) Return the ConstructorBuilder.
23474
23475         (Method::Emit) Return the MethodBuilder. 
23476         Check for abstract or virtual methods to be public.
23477
23478         * rootcontext.cs (RootContext::CreateType): Register all the
23479         abstract methods required for the class to be complete and the
23480         interface methods that must be implemented. 
23481
23482         * cs-parser.jay: Report error 501 (method requires body if it is
23483         not marked abstract or extern).
23484
23485         * expression.cs (TypeOf::Emit): Implement.
23486
23487         * typemanager.cs: runtime_handle_type, new global type.
23488
23489         * class.cs (Property::Emit): Generate code for properties.
23490
23491 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23492
23493         * expression.cs (Unary::ResolveOperator): Find operators on base type
23494         too - we now conform exactly to the spec.
23495
23496         (Binary::ResolveOperator): Same here.
23497
23498         * class.cs (Operator::Define): Fix minor quirk in the tests.
23499
23500         * ../errors/cs0215.cs : Added.
23501
23502         * ../errors/cs0556.cs : Added.
23503
23504         * ../errors/cs0555.cs : Added.
23505
23506 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23507
23508         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23509         single integer which is really efficient
23510
23511 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23512
23513         *  expression.cs (Expression::ImplicitUserConversion): Use location
23514         even in the case when we are examining True operators.
23515  
23516         * class.cs (Operator::Define): Perform extensive checks to conform
23517         with the rules for operator overloading in the spec.
23518
23519         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23520         some of the other conversions mentioned in the spec.
23521
23522         * typemanager.cs (array_type): New static member for the System.Array built-in
23523         type.
23524
23525         (cloneable_interface): For System.ICloneable interface.
23526
23527         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23528         we start resolving the tree and populating types.
23529
23530         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23531  
23532 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23533
23534         * expression.cs (Expression::ExprClassFromMemberInfo,
23535         Expression::Literalize): Create literal expressions from
23536         FieldInfos which are literals.
23537
23538         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23539         type casts, because they were wrong.  The test suite in tests
23540         caught these ones.
23541
23542         (ImplicitNumericConversion): ushort to ulong requires a widening
23543         cast. 
23544
23545         Int32 constant to long requires widening cast as well.
23546
23547         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23548         for integers because the type on the stack is not i4.
23549
23550 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23551
23552         * expression.cs (report118): require location argument. 
23553
23554         * parameter.cs: Do not dereference potential null value.
23555
23556         * class.cs: Catch methods that lack the `new' keyword when
23557         overriding a name.  Report warnings when `new' is used without
23558         anything being there to override.
23559
23560         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23561
23562         * class.cs: Only add constructor to hashtable if it is non-null
23563         (as now constructors can fail on define).
23564
23565         (TypeManager, Class, Struct): Take location arguments.
23566
23567         Catch field instance initialization in structs as errors.
23568
23569         accepting_filter: a new filter for FindMembers that is static so
23570         that we dont create an instance per invocation.
23571
23572         (Constructor::Define): Catch errors where a struct constructor is
23573         parameterless 
23574
23575         * cs-parser.jay: Pass location information for various new
23576         constructs. 
23577
23578         * delegate.cs (Delegate): take a location argument.
23579
23580         * driver.cs: Do not call EmitCode if there were problesm in the
23581         Definition of the types, as many Builders wont be there. 
23582
23583         * decl.cs (Decl::Decl): Require a location argument.
23584
23585         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23586         into integers, and find the most appropiate integer for it.
23587
23588         * literal.cs: Implement ULongLiteral.
23589
23590         * rootcontext.cs: Provide better information about the location of
23591         failure when CreateType fails.
23592
23593 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23594
23595         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23596         as well.
23597
23598         * expression.cs (Binary::CheckShiftArguments): Add missing type
23599         computation.
23600         (Binary::ResolveOperator): Add type to the logical and and logical
23601         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23602         before.
23603
23604         (Binary::DoNumericPromotions): In the case where either argument
23605         is ulong (and most signed types combined with ulong cause an
23606         error) perform implicit integer constant conversions as well.
23607
23608 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23609
23610         * expression.cs (UserImplicitCast): Method should always be
23611         non-null. 
23612         (Invocation::BetterConversion): Simplified test for IntLiteral.
23613
23614         (Expression::ImplicitNumericConversion): Split this routine out.
23615         Put the code that performs implicit constant integer conversions
23616         here. 
23617
23618         (Expression::Resolve): Become a wrapper around DoResolve so we can
23619         check eclass and type being set after resolve.
23620
23621         (Invocation::Badness): Remove this dead function
23622
23623         (Binary::ResolveOperator): Do not compute the expensive argumnets
23624         unless we have a union for it.
23625
23626         (Probe::Emit): Is needs to do an isinst and then
23627         compare against null.
23628
23629         (::CanConvert): Added Location argument.  If the Location argument
23630         is null (Location.Null), then we do not report errors.  This is
23631         used by the `probe' mechanism of the Explicit conversion.  We do
23632         not want to generate an error for something that the user
23633         explicitly requested to be casted.  But the pipeline for an
23634         explicit cast first tests for potential implicit casts.
23635
23636         So for now, if the Location is null, it means `Probe only' to
23637         avoid adding another argument.   Might have to revise this
23638         strategy later.
23639
23640         (ClassCast): New class used to type cast objects into arbitrary
23641         classes (used in Explicit Reference Conversions).
23642
23643         Implement `as' as well.
23644
23645         Reverted all the patches from Ravi below: they were broken:
23646
23647                 * The use of `level' as a mechanism to stop recursive
23648                   invocations is wrong.  That was there just to catch the
23649                   bug with a strack trace but not as a way of addressing
23650                   the problem.
23651
23652                   To fix the problem we have to *understand* what is going
23653                   on and the interactions and come up with a plan, not
23654                   just get things going.
23655
23656                 * The use of the type conversion cache that I proposed
23657                   last night had an open topic: How does this work across
23658                   protection domains.  A user defined conversion might not
23659                   be public in the location where we are applying the
23660                   conversion, a different conversion might be selected
23661                   (ie, private A->B (better) but public B->A (worse),
23662                   inside A, A->B applies, but outside it, B->A will
23663                   apply).
23664
23665                 * On top of that (ie, even if the above is solved),
23666                   conversions in a cache need to be abstract.  Ie, `To
23667                   convert from an Int to a Short use an OpcodeCast', not
23668                   `To convert from an Int to a Short use the OpcodeCast on
23669                   the variable 5' (which is what this patch was doing).
23670
23671 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23672
23673         * expression.cs (Invocation::ConversionExists): Re-write to use
23674         the conversion cache
23675
23676         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23677         cache all conversions done, not just user-defined ones.
23678
23679         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23680         to determine if a conversion exists instead of acutually trying to 
23681         perform the conversion. It's faster too.
23682
23683         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23684         and only then attempt the implicit conversion.
23685
23686 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23687
23688         * expression.cs (ConvertImplicit): Use a cache for conversions
23689         already found. Check level of recursion and bail out if necessary.
23690
23691 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23692
23693         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23694         Export standard methods that we expect for string operations.
23695
23696         * statement.cs (Block::UsageWarning): Track usage of variables and
23697         report the errors for not used variables.
23698
23699         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23700         operator. 
23701
23702 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23703
23704         * codegen.cs: remove unnneded code 
23705
23706         * expression.cs: Removed BuiltinTypeAccess class
23707
23708         Fix the order in which implicit conversions are
23709         done.  
23710
23711         The previous fixed dropped support for boxed conversions (adding a
23712         test to the test suite now)
23713
23714         (UserImplicitCast::CanConvert): Remove test for source being null,
23715         that code is broken.  We should not feed a null to begin with, if
23716         we do, then we should track the bug where the problem originates
23717         and not try to cover it up here.
23718
23719         Return a resolved expression of type UserImplicitCast on success
23720         rather than true/false.  Ravi: this is what I was talking about,
23721         the pattern is to use a static method as a "constructor" for
23722         objects. 
23723
23724         Also, do not create arguments until the very last minute,
23725         otherwise we always create the arguments even for lookups that
23726         will never be performed. 
23727
23728         (UserImplicitCast::Resolve): Eliminate, objects of type
23729         UserImplicitCast are born in a fully resolved state. 
23730
23731         * typemanager.cs (InitCoreTypes): Init also value_type
23732         (System.ValueType). 
23733
23734         * expression.cs (Cast::Resolve): First resolve the child expression.
23735
23736         (LValue): Add new method AddressOf to be used by
23737         the `&' operator.  
23738
23739         Change the argument of Store to take an EmitContext instead of an
23740         ILGenerator, because things like FieldExpr need to be able to call
23741         their children expression to generate the instance code. 
23742
23743         (Expression::Error, Expression::Warning): Sugar functions for
23744         reporting errors.
23745
23746         (Expression::MemberLookup): Accept a TypeContainer instead of a
23747         Report as the first argument.
23748
23749         (Expression::ResolvePrimary): Killed.  I still want to improve
23750         this as currently the code is just not right.
23751
23752         (Expression::ResolveMemberAccess): Simplify, but it is still
23753         wrong. 
23754
23755         (Unary::Resolve): Catch errors in AddressOf operators.
23756
23757         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23758         index to a byte for the short-version, or the compiler will choose
23759         the wrong Emit call, which generates the wrong data.
23760
23761         (ParameterReference::Emit, ::Store): same.
23762
23763         (FieldExpr::AddressOf): Implement.
23764
23765         * typemanager.cs: TypeManager: made public variable instead of
23766         property.
23767
23768         * driver.cs: document --fatal.
23769
23770         * report.cs (ErrorMessage, WarningMessage): new names for the old
23771         Error and Warning classes.
23772
23773         * cs-parser.jay (member_access): Turn built-in access to types
23774         into a normal simplename
23775
23776 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23777
23778         * expression.cs (Invocation::BetterConversion): Fix to cope
23779         with q being null, since this was introducing a bug.
23780
23781         * expression.cs (ConvertImplicit): Do built-in conversions first.
23782
23783 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23784
23785         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23786
23787 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23788
23789         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23790         I had introduced long ago (what's new ?).
23791
23792         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23793         the work of all the checking. 
23794         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23795         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23796
23797         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23798         that is the right way. 
23799
23800         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23801         overloading resolution. Use everywhere instead of cutting and pasting code.
23802
23803         (Binary::ResolveOperator): Use MakeUnionSet.
23804
23805         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23806         we have to convert to bool types. Not complete yet.
23807
23808 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23809
23810         * typemanager.cs (TypeManager::CSharpName): support ushort.
23811
23812         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23813         to provide an expression that performsn an implicit constant int
23814         conversion (section 6.1.6).
23815         (Expression::ConvertImplicitRequired): Reworked to include
23816         implicit constant expression conversions.
23817
23818         (Expression::ConvertNumericExplicit): Finished.
23819
23820         (Invocation::Emit): If InstanceExpression is null, then it means
23821         that we perform a call on this.
23822
23823 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23824
23825         * expression.cs (Unary::Emit): Remove some dead code.
23826         (Probe): Implement Resolve and Emit for `is'.
23827         (Expression::ConvertImplicitRequired): Attempt to do constant
23828         expression conversions here.  Maybe should be moved to
23829         ConvertImplicit, but I am not sure.
23830         (Expression::ImplicitLongConstantConversionPossible,
23831         Expression::ImplicitIntConstantConversionPossible): New functions
23832         that tell whether is it possible to apply an implicit constant
23833         expression conversion.
23834
23835         (ConvertNumericExplicit): Started work on explicit numeric
23836         conversions.
23837
23838         * cs-parser.jay: Update operator constants.
23839
23840         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23841         (Parameters::GetSignature): Hook up VerifyArgs here.
23842         (Parameters::VerifyArgs): Verifies that no two arguments have the
23843         same name. 
23844
23845         * class.cs (Operator): Update the operator names to reflect the
23846         ones that the spec expects (as we are just stringizing the
23847         operator names).
23848
23849         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23850         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23851         previous usage did only work for our methods.
23852         (Expression::ConvertImplicit): Handle decimal implicit numeric
23853         conversions as well.
23854         (Expression::InternalTypeConstructor): Used to invoke constructors
23855         on internal types for default promotions.
23856
23857         (Unary::Emit): Implement special handling for the pre/post
23858         increment/decrement for overloaded operators, as they need to have
23859         the same semantics as the other operators.
23860
23861         (Binary::ResolveOperator): ditto.
23862         (Invocation::ConversionExists): ditto.
23863         (UserImplicitCast::Resolve): ditto.
23864
23865 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23866
23867         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23868         operator, return after emitting body. Regression tests pass again !
23869
23870         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23871         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23872         (Invocation::OverloadResolve): Ditto.
23873         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23874
23875         * everywhere : update calls to the above methods accordingly.
23876
23877 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23878
23879         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23880
23881         * expression.cs (ExpressionStatement): New base class used for
23882         expressions that can appear in statements, so that we can provide
23883         an alternate path to generate expression that do not leave a value
23884         on the stack.
23885
23886         (Expression::Emit, and all the derivatives): We no longer return
23887         whether a value is left on the stack or not.  Every expression
23888         after being emitted leaves a single value on the stack.
23889
23890         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23891         facilties of ExpressionStatement if possible.
23892
23893         * cs-parser.jay: Update statement_expression.
23894
23895 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23896
23897         * driver.cs: Change the wording of message
23898
23899 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23900
23901         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23902         the type of the expression to the return type of the method if
23903         we have an overloaded operator match ! The regression tests pass again !
23904         (Unary::ResolveOperator): Ditto.
23905
23906         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23907         to find "op_Implicit", not "implicit" ;-)
23908         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23909         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23910
23911         * everywhere : Correct calls to the above accordingly.
23912
23913         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23914         (ConvertImplicit): Do user-defined conversion if it exists.
23915
23916 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23917
23918         * assign.cs: track location.
23919         (Resolve): Use implicit conversions on assignment.
23920
23921         * literal.cs: Oops.  Not good, Emit of short access values should
23922         pass (Bytes) or the wrong argument will be selected.
23923
23924         * expression.cs (Unary::Emit): Emit code for -expr.
23925
23926         (Unary::ResolveOperator): Handle `Substract' for non-constants
23927         (substract from zero from the non-constants).
23928         Deal with Doubles as well. 
23929
23930         (Expression::ConvertImplicitRequired): New routine that reports an
23931         error if no implicit conversion exists. 
23932
23933         (Invocation::OverloadResolve): Store the converted implicit
23934         expressions if we make them
23935
23936 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23937
23938         * class.cs (ConstructorInitializer): Take a Location argument.
23939         (ConstructorBaseInitializer): Same here.
23940         (ConstructorThisInitializer): Same here.
23941
23942         * cs-parser.jay : Update all calls accordingly.
23943
23944         * expression.cs (Unary, Binary, New): Take location argument.
23945         Update accordingly everywhere.
23946
23947         * cs-parser.jay : Update all calls to the above to take a location
23948         argument.
23949
23950         * class.cs : Ditto.
23951
23952 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23953
23954         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23955         (Invocation::BetterConversion): Same here
23956         (Invocation::ConversionExists): Ditto.
23957
23958         (Invocation::ConversionExists): Implement.
23959
23960 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23961
23962         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23963         Also take an additional TypeContainer argument.
23964
23965         * All over : Pass in TypeContainer as argument to OverloadResolve.
23966
23967         * typemanager.cs (CSharpName): Update to check for the string type and return
23968         that too.
23969
23970         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23971         a given method.
23972
23973 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23974
23975         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23976         (Invocation::BetterFunction): Implement.
23977         (Invocation::BetterConversion): Implement.
23978         (Invocation::ConversionExists): Skeleton, no implementation yet.
23979
23980         Okay, things work fine !
23981
23982 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23983
23984         * typemanager.cs: declare and load enum_type, delegate_type and
23985         void_type. 
23986
23987         * expression.cs (Expression::Emit): Now emit returns a value that
23988         tells whether a value is left on the stack or not.  This strategy
23989         might be reveted tomorrow with a mechanism that would address
23990         multiple assignments.
23991         (Expression::report118): Utility routine to report mismatches on
23992         the ExprClass.
23993
23994         (Unary::Report23): Report impossible type/operator combination
23995         utility function.
23996
23997         (Unary::IsIncrementableNumber): Whether the type can be
23998         incremented or decremented with add.
23999         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24000         complemented. 
24001         (Unary::ResolveOperator): Implement ++, !, ~,
24002
24003         (Invocation::Emit): Deal with new Emit convetion.
24004
24005         * All Expression derivatives: Updated their Emit method to return
24006         whether they leave values on the stack or not.
24007
24008         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24009         stack for expressions that are statements. 
24010
24011 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24012
24013         * expression.cs (LValue): New interface.  Must be implemented by
24014         LValue objects.
24015         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24016         LValue interface.
24017
24018         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24019         interface for generating code, simplifies the code.
24020
24021 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24022
24023         * expression.cs (everywhere): Comment out return statements in ::Resolve
24024         methods to avoid the warnings.
24025
24026 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24027
24028         * driver.cs (parse): Report error 2001 if we can not open the
24029         source file.
24030
24031         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24032         not resolve it.
24033
24034         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24035         object. 
24036
24037         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24038         otherwise nested blocks end up with the same index.
24039
24040         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24041
24042         * expression.cs:  Instead of having FIXMEs in the Resolve
24043         functions, throw exceptions so it is obvious that we are facing a
24044         bug. 
24045
24046         * cs-parser.jay (invocation_expression): Pass Location information.
24047
24048         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24049         Use a basename for those routines because .NET does not like paths
24050         on them. 
24051
24052         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24053         already defined.
24054
24055 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24056
24057         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24058         are loading the correct data types (throws an exception if not).
24059         (TypeManager::InitCoreTypes): Use CoreLookupType
24060
24061         * expression.cs (Unary::ResolveOperator): return the child
24062         expression for expressions which are just +expr.
24063         (Unary::ResolveOperator): Return negative literals for -LITERAL
24064         expressions (otherwise they are Unary {Literal}).
24065         (Invocation::Badness): Take into account `Implicit constant
24066         expression conversions'.
24067
24068         * literal.cs (LongLiteral): Implement long literal class.
24069         (IntLiteral): export the `Value' of the intliteral. 
24070
24071 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24072
24073         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24074
24075         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24076         instead of 'Operator'
24077
24078         * expression.cs (Binary::ResolveOperator): Update accordingly.
24079         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24080         and 'Minus'
24081
24082         * cs-parser.jay (unary_expression): Update to use the new names.
24083
24084         * gen-treedump.cs (GetUnary): Same here.
24085
24086         * expression.cs (Unary::Resolve): Implement.
24087         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24088         operators are found instead of making noise ;-)
24089         (Unary::ResolveOperator): New method to do precisely the same thing which
24090         Binary::ResolveOperator does for Binary expressions.
24091         (Unary.method, .Arguments): Add.
24092         (Unary::OperName): Implement.   
24093         (Unary::ForceConversion): Copy and Paste !
24094
24095         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24096         a unary operator.
24097
24098         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24099         for the inbuilt operators. Only overloading works for now ;-)
24100
24101 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24102
24103         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24104         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24105
24106         * expression.cs (This::Emit): Implement. 
24107         (This::Resolve): Implement.
24108         (TypeOf:Resolve): Implement.
24109         (Expression::ResolveSimpleName): Add an implicit this to instance
24110         field references. 
24111         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24112         Bind instance variable to Field expressions.
24113         (FieldExpr::Instance): New field used to track the expression that
24114         represents the object instance.
24115         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24116         binding 
24117         (FieldExpr::Emit): Implement.
24118
24119         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24120         the last instruction contains a return opcode to avoid generating
24121         the last `ret' instruction (this generates correct code, and it is
24122         nice to pass the peverify output).
24123
24124         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24125         initializer for static and instance variables.
24126         (Constructor::Emit): Allow initializer to be null in the case of
24127         static constructors.  Only emit initializer for instance
24128         constructors. 
24129
24130         (TypeContainer::FindMembers): Return a null array if there are no
24131         matches.
24132
24133         Also fix the code for the MemberTypes.Method branch, as it was not
24134         scanning that for operators (or tried to access null variables before).
24135
24136         * assign.cs (Assign::Emit): Handle instance and static fields. 
24137
24138         * TODO: Updated.
24139
24140         * driver.cs: Stop compilation if there are parse errors.
24141
24142         * cs-parser.jay (constructor_declaration): Provide default base
24143         initializer for non-static constructors.
24144         (constructor_declarator): Do not provide a default base
24145         initializers if none was specified.
24146         Catch the fact that constructors should not have parameters.
24147
24148         * class.cs: Do not emit parent class initializers for static
24149         constructors, that should be flagged as an error.
24150
24151 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24152
24153         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24154         Move back code into TypeContainer::Populate.
24155
24156 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24157
24158         * class.cs (TypeContainer::AddConstructor): Fix the check to
24159         compare against Name, not Basename. 
24160         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24161
24162         * cs-parser.jay : Update accordingly.
24163
24164         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24165         for methods, don't forget to look into the operators too.
24166         (RegisterMethodBuilder): Helper method to take care of this for
24167         methods, constructors and operators.
24168         (Operator::Define): Completely revamp.
24169         (Operator.OperatorMethod, MethodName): New fields.
24170         (TypeContainer::Populate): Move the registering of builders into
24171         RegisterMethodBuilder.
24172         (Operator::Emit): Re-write.
24173
24174         * expression.cs (Binary::Emit): Comment out code path to emit method
24175         invocation stuff for the case when we have a user defined operator. I am
24176         just not able to get it right !
24177
24178 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24179
24180         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24181         argument. 
24182
24183         (Expression::MemberLookup): Provide a version that allows to
24184         specify the MemberTypes and BindingFlags. 
24185
24186         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24187         so it was not fetching variable information from outer blocks.
24188
24189         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24190         Beforefieldinit as it was buggy.
24191
24192         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24193         that Ravi put here.  
24194
24195         * class.cs (Constructor::Emit): Only emit if block is not null.
24196         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24197         deal with this by semantically definining it as if the user had
24198         done it.
24199
24200         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24201         constructors as we now "emit" them at a higher level.
24202
24203         (TypeContainer::DefineDefaultConstructor): Used to define the
24204         default constructors if none was provided.
24205
24206         (ConstructorInitializer): Add methods Resolve and Emit. 
24207
24208         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24209
24210 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24211
24212         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24213         the default constructor builder with our hashtable for methodbuilders
24214         to methodcores.
24215
24216         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24217         and argument_count is 0 in which case we have a match.
24218         (Binary::ResolveOperator): More null checking and miscellaneous coding
24219         style cleanup.
24220
24221 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24222
24223         * rootcontext.cs (IsNameSpace): Compare against null.
24224
24225         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24226
24227         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24228         and Unary::Operator.
24229
24230         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24231         accordingly.
24232
24233         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24234         we have overloaded operators.
24235         (Binary::ResolveOperator): Implement the part which does the operator overload
24236         resolution.
24237
24238         * class.cs (Operator::Emit): Implement.
24239         (TypeContainer::Emit): Emit the operators we have too.
24240
24241         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24242         the case when we have a user-defined operator.
24243
24244 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24245
24246         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24247
24248 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24249
24250         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24251         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24252         (Constructor::Emit): Implement.
24253         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24254         if we have no work to do. 
24255         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24256         Emit method.
24257
24258         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24259         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24260
24261         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24262         of parent.parent.
24263
24264 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24265
24266         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24267         in the source.
24268         (Tree::RecordNamespace): Method to do what the name says ;-)
24269         (Tree::Namespaces): Property to get at the namespaces hashtable.
24270
24271         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24272         keep track.
24273
24274         * rootcontext.cs (IsNamespace): Fixed it :-)
24275
24276 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24277
24278         * class.cs (TypeContainer::FindMembers): Add support for
24279         constructors. 
24280         (MethodCore): New class that encapsulates both the shared aspects
24281         of a Constructor and a Method.  
24282         (Method, Constructor): Factored pieces into MethodCore.
24283
24284         * driver.cs: Added --fatal which makes errors throw exceptions.
24285         Load System assembly as well as part of the standard library.
24286
24287         * report.cs: Allow throwing exceptions on errors for debugging.
24288
24289         * modifiers.cs: Do not use `parent', instead use the real type
24290         container to evaluate permission settings.
24291
24292         * class.cs: Put Ravi's patch back in.  He is right, and we will
24293         have to cope with the
24294
24295 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24296
24297         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24298         FamORAssem, not FamANDAssem.
24299
24300 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24301
24302         * driver.cs: Added --parse option that only parses its input files
24303         and terminates.
24304
24305         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24306         incorrect.  IsTopLevel is not used to tell whether an object is
24307         root_types or not (that can be achieved by testing this ==
24308         root_types).  But to see if this is a top-level *class* (not
24309         necessarly our "toplevel" container). 
24310
24311 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24312
24313         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24314         parent instead of a direct call to GetType.
24315
24316 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24317
24318         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24319         Modifiers.TypeAttr. This should just be a call to that method.
24320
24321         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24322         object so that we can determine if we are top-level or not.
24323
24324         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24325         TypeContainer too.
24326
24327         * enum.cs (Enum::Define): Ditto.
24328
24329         * modifiers.cs (FieldAttr): Re-write.
24330
24331         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24332         (TypeContainer::HaveStaticConstructor): New property to provide access
24333         to precisely that info.
24334
24335         * modifiers.cs (MethodAttr): Re-write.
24336         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24337
24338         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24339         of top-level types as claimed.
24340
24341 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24342
24343         * expression.cs (MemberLookup): Fruitless attempt to lookup
24344         constructors.  Maybe I need to emit default constructors?  That
24345         might be it (currently .NET emits this for me automatically).
24346         (Invocation::OverloadResolve): Cope with Arguments == null.
24347         (Invocation::EmitArguments): new function, shared by the new
24348         constructor and us.
24349         (Invocation::Emit): Handle static and instance methods.  Emit
24350         proper call instruction for virtual or non-virtual invocations.
24351         (New::Emit): Implement.
24352         (New::Resolve): Implement.
24353         (MemberAccess:Resolve): Implement.
24354         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24355         to track instances.
24356         (FieldExpr::Resolve): Set type.
24357
24358         * support.cs: Handle empty arguments.
24359                 
24360         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24361         SimpleLookup): Auxiliary routines to help parse a qualifier
24362         identifier.  
24363
24364         Update qualifier_identifier rule.
24365
24366         * codegen.cs: Removed debugging messages.
24367
24368         * class.cs: Make this a global thing, this acts just as a "key" to
24369         objects that we might have around.
24370
24371         (Populate): Only initialize method_builders_to_methods once.
24372
24373         * expression.cs (PropertyExpr): Initialize type from the
24374         PropertyType. 
24375
24376         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24377         Resolve pattern.  Attempt to implicitly convert value to boolean.
24378         Emit code.
24379
24380         * expression.cs: Set the type for the int32/int32 argument case.
24381         (Binary::ResolveOperator): Set the return type to boolean for
24382         comparission operators
24383
24384         * typemanager.cs: Remove debugging print code.
24385
24386         (Invocation::Resolve): resolve type.
24387
24388         * class.cs: Allocate a MemberInfo of the correct size, as the code
24389         elsewhere depends on the test to reflect the correct contents.
24390
24391         (Method::) Keep track of parameters, due to System.Reflection holes
24392
24393         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24394         mapping here.
24395
24396         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24397         of the exact size and return that.
24398
24399         (Class::LookupMethodByBuilder): New function that maps
24400         MethodBuilders to its methods.  Required to locate the information
24401         on methods because System.Reflection bit us again.
24402
24403         * support.cs: New file, contains an interface ParameterData and
24404         two implementations: ReflectionParameters and InternalParameters
24405         used to access Parameter information.  We will need to grow this
24406         as required.
24407
24408         * expression.cs (Invocation::GetParameterData): implement a cache
24409         and a wrapper around the ParameterData creation for methods. 
24410         (Invocation::OverloadResolve): Use new code.
24411
24412 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24413
24414         * class.cs (TypeContainer::EmitField): Remove and move into 
24415         (Field::Define): here and modify accordingly.
24416         (Field.FieldBuilder): New member.
24417         (TypeContainer::Populate): Update accordingly.
24418         (TypeContainer::FindMembers): Implement.
24419
24420 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24421
24422         * statement.cs: (VariableInfo::VariableType): New field to be
24423         initialized with the full type once it is resolved. 
24424
24425 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24426
24427         * parameter.cs (GetParameterInfo): Use a type cache to compute
24428         things only once, and to reuse this information
24429
24430         * expression.cs (LocalVariableReference::Emit): Implement.
24431         (OpcodeCast::Emit): fix.
24432
24433         (ParameterReference::Resolve): Implement.
24434         (ParameterReference::Emit): Implement.
24435
24436         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24437         that are expressions need to stay as Expressions.
24438
24439         * typemanager.cs (CSharpName): Returns the C# name of a type if
24440         possible. 
24441
24442         * expression.cs (Expression::ConvertImplicit): New function that
24443         implements implicit type conversions.
24444
24445         (Expression::ImplicitReferenceConversion): Implements implicit
24446         reference conversions.
24447
24448         (EmptyCast): New type for transparent casts.
24449
24450         (OpcodeCast): New type for casts of types that are performed with
24451         a sequence of bytecodes.
24452
24453         (BoxedCast): New type used for casting value types into reference
24454         types.  Emits a box opcode.
24455
24456         (Binary::DoNumericPromotions): Implements numeric promotions of
24457         and computation of the Binary::Type.
24458
24459         (Binary::EmitBranchable): Optimization.
24460
24461         (Binary::Emit): Implement code emission for expressions.
24462
24463         * typemanager.cs (TypeManager): Added two new core types: sbyte
24464         and byte.
24465
24466 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24467
24468         * class.cs (TypeContainer::FindMembers): Method which does exactly
24469         what Type.FindMembers does, only we don't have to use reflection. No
24470         implementation yet.
24471
24472         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24473         typecontainer objects as we need to get at them.
24474         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24475
24476         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24477         typecontainer object.
24478
24479         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24480         of just a Report object.
24481
24482 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24483
24484         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24485         "remove_"
24486         (TypeContainer::Populate): Now define the delegates of the type too.
24487         (TypeContainer.Delegates): Property to access the list of delegates defined
24488         in the type.
24489
24490         * delegates.cs (Delegate::Define): Implement partially.
24491
24492         * modifiers.cs (TypeAttr): Handle more flags.
24493
24494 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24495
24496         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24497         and not <=
24498         (Operator::Define): Re-write logic to get types by using the LookupType method
24499         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24500         (Indexer::Define): Ditto.
24501         (Event::Define): Ditto.
24502         (Property::Define): Ditto.
24503
24504 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24505
24506         * class.cs (TypeContainer::Populate): Now define operators too. 
24507         (TypeContainer.Operators): New property to access the list of operators
24508         in a type.
24509         (Operator.OperatorMethodBuilder): New member to hold the method builder
24510         for the operator we are defining.
24511         (Operator::Define): Implement.
24512
24513 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24514
24515         * class.cs (Event::Define): Make the prefixes of the accessor methods
24516         addOn_ and removeOn_ 
24517
24518         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24519         of the location being passed in too. Ideally, this should go later since all
24520         error reporting should be done through the Report object.
24521
24522         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24523         (Populate): Iterate thru the indexers we have and define them too.
24524         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24525         for the get and set accessors.
24526         (Indexer::Define): Implement.
24527
24528 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24529
24530         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24531         my previous implementation, did not work.
24532
24533         * typemanager.cs: Add a couple of missing types (the longs).
24534
24535         * literal.cs: Use TypeManager.bool_type instead of getting it.
24536
24537         * expression.cs (EventExpr): New kind of expressions.
24538         (Expressio::ExprClassFromMemberInfo): finish
24539
24540 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24541
24542         * assign.cs: Emit stores to static fields differently.
24543
24544 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24545
24546         * Merge in changes and adjust code to tackle conflicts. Backed out my
24547         code in Assign::Resolve ;-) 
24548
24549 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24550
24551         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24552         instead Report.Error and also pass in the location.
24553         (CSharpParser::Lexer): New readonly property to return the reference
24554         to the Tokenizer object.
24555         (declare_local_variables): Use Report.Error with location instead of plain 
24556         old error.
24557         (CheckDef): Ditto.
24558
24559         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24560         (Operator.CheckBinaryOperator): Ditto.
24561
24562         * cs-parser.jay (operator_declarator): Update accordingly.
24563
24564         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24565         (CheckBinaryOperator): Same here.
24566
24567         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24568         on the name without any prefixes of namespace names etc. This is because we
24569         already might have something already fully qualified like 
24570         'System.Console.WriteLine'
24571
24572         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24573
24574 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24575
24576         * cs-tokenizer.cs (location): Return a string which also contains
24577         the file name.
24578
24579         * expression.cs (ElementAccess): New class for expressions of the
24580         type 'element access.'
24581         (BaseAccess): New class for expressions of the type 'base access.'
24582         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24583         respectively.
24584
24585         * cs-parser.jay (element_access): Implement action.
24586         (base_access): Implement actions.
24587         (checked_expression, unchecked_expression): Implement.
24588
24589         * cs-parser.jay (local_variable_type): Correct and implement.
24590         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24591
24592         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24593
24594         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24595         name and the specifiers.
24596
24597         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24598
24599         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24600         making them all public ;-)
24601
24602         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24603         class anyways.
24604
24605 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24606
24607         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24608         PropertyExprs.
24609         (FieldExpr, PropertyExprs): New resolved expressions.
24610         (SimpleName::MemberStaticCheck): Perform static checks for access
24611         to non-static fields on static methods. Maybe this should be
24612         generalized for MemberAccesses. 
24613         (SimpleName::ResolveSimpleName): More work on simple name
24614         resolution. 
24615
24616         * cs-parser.jay (primary_expression/qualified_identifier): track
24617         the parameter index.
24618
24619         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24620         (EmitContext::EmitBoolExpression): Chain to expression generation
24621         instead of temporary hack.
24622         (::EmitStatementExpression): Put generic expression code generation.
24623
24624         * assign.cs (Assign::Emit): Implement variable assignments to
24625         local variables, parameters and fields.
24626
24627 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24628
24629         * statement.cs (Block::GetVariableInfo): New method, returns the
24630         VariableInfo for a variable name in a block.
24631         (Block::GetVariableType): Implement in terms of GetVariableInfo
24632
24633         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24634         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24635
24636 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24637
24638         * cs-parser.jay (operator_declaration): Continue on my quest : update
24639         to take attributes argument.
24640         (event_declaration): Ditto.
24641         (enum_declaration): Ditto.
24642         (indexer_declaration): Ditto.
24643
24644         * class.cs (Operator::Operator): Update constructor accordingly.
24645         (Event::Event): Ditto.
24646
24647         * delegate.cs (Delegate::Delegate): Same here.
24648
24649         * enum.cs (Enum::Enum): Same here.
24650
24651 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24652
24653         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24654
24655         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24656
24657         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24658         being passed around as an arraylist.
24659         (Attributes::AddAttribute): Method to add attribute sections.
24660
24661         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24662         (struct_declaration): Update accordingly.
24663         (constant_declaration): Update.
24664         (field_declaration): Update.
24665         (method_header): Update.
24666         (fixed_parameter): Update.
24667         (parameter_array): Ditto.
24668         (property_declaration): Ditto.
24669         (destructor_declaration): Ditto.
24670
24671         * class.cs (Struct::Struct): Update constructors accordingly.
24672         (Class::Class): Ditto.
24673         (Field::Field): Ditto.
24674         (Method::Method): Ditto.
24675         (Property::Property): Ditto.
24676         (TypeContainer::OptAttribute): update property's return type.
24677
24678         * interface.cs (Interface.opt_attributes): New member.
24679         (Interface::Interface): Update to take the extra Attributes argument.
24680
24681         * parameter.cs (Parameter::Parameter): Ditto.
24682
24683         * constant.cs (Constant::Constant): Ditto.
24684
24685         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24686         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24687         the attributes as a parameter.
24688         (InterfaceProperty): Update constructor call.
24689         (InterfaceEvent): Ditto.
24690         (InterfaceMethod): Ditto.
24691         (InterfaceIndexer): Ditto.
24692
24693         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24694         pass the attributes too.
24695         (interface_event_declaration): Ditto.
24696         (interface_property_declaration): Ditto.
24697         (interface_method_declaration): Ditto.
24698         (interface_declaration): Ditto.
24699
24700 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24701
24702         * class.cs (Method::Define): Track the "static Main" definition to
24703         create an entry point. 
24704
24705         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24706         EntryPoint if we find it. 
24707
24708         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24709         (EmitContext::ig): Make this variable public.
24710
24711         * driver.cs: Make the default output file be the first file name
24712         with the .exe extension.  
24713
24714         Detect empty compilations
24715
24716         Handle various kinds of output targets.  Handle --target and
24717         rename -t to --dumper.
24718
24719         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24720         methods inherited from Expression return now an Expression.  This
24721         will is used during the tree rewriting as we resolve them during
24722         semantic analysis.
24723
24724         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24725         the spec.  Missing entirely is the information about
24726         accessability of elements of it.
24727
24728         (Expression::ExprClassFromMemberInfo): New constructor for
24729         Expressions that creates a fully initialized Expression based on
24730         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24731         a Type.
24732
24733         (Invocation::Resolve): Begin implementing resolution of invocations.
24734
24735         * literal.cs (StringLiteral):  Implement Emit.
24736
24737 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24738
24739         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24740         member.
24741
24742 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24743
24744         * cs-parser.jay (attribute_arguments): Implement actions.
24745         (attribute): Fix bug in production. Implement action.
24746         (attribute_list): Implement.
24747         (attribute_target): Implement.
24748         (attribute_target_specifier, opt_target_specifier): Implement
24749         (CheckAttributeTarget): New method to check if the attribute target
24750         is valid.
24751         (attribute_section): Implement.
24752         (opt_attributes): Implement.
24753
24754         * attribute.cs : New file to handle attributes.
24755         (Attribute): Class to hold attribute info.
24756
24757         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24758         (attribute_section): Modify production to use 2 different rules to 
24759         achieve the same thing. 1 s/r conflict down !
24760         Clean out commented, useless, non-reducing dimension_separator rules.
24761
24762         * class.cs (TypeContainer.attributes): New member to hold list
24763         of attributes for a type.
24764         (Struct::Struct): Modify to take one more argument, the attribute list.
24765         (Class::Class): Ditto.
24766         (Field::Field): Ditto.
24767         (Method::Method): Ditto.
24768         (Property::Property): Ditto.
24769
24770         * cs-parser.jay (struct_declaration): Update constructor call to
24771         pass in the attributes too.
24772         (class_declaration): Ditto.
24773         (constant_declaration): Ditto.
24774         (field_declaration): Ditto.
24775         (method_header): Ditto.
24776         (fixed_parameter): Ditto.
24777         (parameter_array): Ditto.
24778         (property_declaration): Ditto.
24779
24780         * constant.cs (Constant::Constant): Update constructor similarly.
24781         Use System.Collections.
24782
24783         * parameter.cs (Parameter::Parameter): Update as above.
24784
24785 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24786
24787         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24788         (TypeContainer.delegates): New member to hold list of delegates.
24789
24790         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24791         this time as I seem to be on crack ;-)
24792
24793 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24794
24795         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24796         tell whether an identifier represents a namespace.
24797
24798         * expression.cs (NamespaceExpr): A namespace expression, used only
24799         temporarly during expression resolution.
24800         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24801         utility functions to resolve names on expressions.
24802
24803 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24804
24805         * codegen.cs: Add hook for StatementExpressions. 
24806
24807         * class.cs: Fix inverted test for static flag in methods.
24808
24809 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24810
24811         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24812         to make it coincide with MS' number.
24813         (Operator::CheckBinaryOperator): Ditto.
24814
24815         * ../errors/errors.txt : Remove error numbers added earlier.
24816
24817         * ../errors/cs1019.cs : Test case for error # 1019
24818
24819         * ../errros/cs1020.cs : Test case for error # 1020
24820
24821         * cs-parser.jay : Clean out commented cruft.
24822         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24823         used anywhere - non-reducing rule.
24824         (namespace_declarations): Non-reducing rule - comment out.
24825
24826         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24827         with TypeContainer::AddEnum.
24828
24829         * delegate.cs : New file for delegate handling classes.
24830         (Delegate): Class for declaring delegates.
24831
24832         * makefile : Update.
24833
24834         * cs-parser.jay (delegate_declaration): Implement.
24835
24836 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24837
24838         * class.cs (Event::Define): Implement.
24839         (Event.EventBuilder): New member.
24840
24841         * class.cs (TypeContainer::Populate): Update to define all enums and events
24842         we have.
24843         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24844         readonly fields for all these cases ?
24845
24846 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24847
24848         * class.cs (Property): Revamp to use the convention of making fields readonly.
24849         Accordingly modify code elsewhere.
24850
24851         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24852         the Define method of the Property class.
24853
24854         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24855         trivial bug.
24856         (TypeContainer::Populate): Update to define all the properties we have. Also
24857         define all enumerations.
24858
24859         * enum.cs (Define): Implement.
24860
24861 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24862
24863         * cs-parser.jay (overloadable_operator): The semantic value is an
24864         enum of the Operator class.
24865         (operator_declarator): Implement actions.
24866         (operator_declaration): Implement.
24867
24868         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24869         validity of definitions.
24870         (Operator::CheckBinaryOperator): Static method to check for binary operators
24871         (TypeContainer::AddOperator): New method to add an operator to a type.
24872
24873         * cs-parser.jay (indexer_declaration): Added line to actually call the
24874         AddIndexer method so it gets added ;-)
24875
24876         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24877         already taken care of by the MS compiler ?  
24878
24879 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24880
24881         * class.cs (Operator): New class for operator declarations.
24882         (Operator::OpType): Enum for the various operators.
24883
24884 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24885
24886         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24887         ostensibly handle this in semantic analysis.
24888
24889         * cs-parser.jay (general_catch_clause): Comment out
24890         (specific_catch_clauses, specific_catch_clause): Ditto.
24891         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24892         (catch_args, opt_catch_args): New productions.
24893         (catch_clause): Rewrite to use the new productions above
24894         (catch_clauses): Modify accordingly.
24895         (opt_catch_clauses): New production to use in try_statement
24896         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24897         and re-write the code in the actions to extract the specific and
24898         general catch clauses by being a little smart ;-)
24899
24900         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24901         Hooray, try and catch statements parse fine !
24902
24903 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24904
24905         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24906         string from the hashtable of variables.
24907
24908         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24909         I end up making that mistake ;-)
24910         (catch_clauses): Fixed gross error which made Key and Value of the 
24911         DictionaryEntry the same : $1 !!
24912
24913 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24914
24915         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24916
24917         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24918         when the add and remove accessors are specified. 
24919
24920 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24921
24922         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24923         information about indexer_declarator.
24924         (indexer_declarator): Implement actions.
24925         (parsing_indexer): New local boolean used to keep track of whether
24926         we are parsing indexers or properties. This is necessary because 
24927         implicit_parameters come into picture even for the get accessor in the 
24928         case of an indexer.
24929         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24930
24931         * class.cs (Indexer): New class for indexer declarations.
24932         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24933         (TypeContainer::indexers): New member to hold list of indexers for the
24934         type.
24935
24936 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24937
24938         * cs-parser.jay (add_accessor_declaration): Implement action.
24939         (remove_accessor_declaration): Implement action.
24940         (event_accessors_declaration): Implement
24941         (variable_declarators): swap statements for first rule - trivial.
24942
24943         * class.cs (Event): New class to hold information about event
24944         declarations.
24945         (TypeContainer::AddEvent): New method to add an event to a type
24946         (TypeContainer::events): New member to hold list of events.
24947
24948         * cs-parser.jay (event_declaration): Implement actions.
24949
24950 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24951
24952         * cs-parser.jay (dim_separators): Implement. Make it a string
24953         concatenating all the commas together, just as they appear.
24954         (opt_dim_separators): Modify accordingly
24955         (rank_specifiers): Update accordingly. Basically do the same
24956         thing - instead, collect the brackets here.
24957         (opt_rank_sepcifiers): Modify accordingly.
24958         (array_type): Modify to actually return the complete type string
24959         instead of ignoring the rank_specifiers.
24960         (expression_list): Implement to collect the expressions
24961         (variable_initializer): Implement. We make it a list of expressions
24962         essentially so that we can handle the array_initializer case neatly too.
24963         (variable_initializer_list): Implement.
24964         (array_initializer): Make it a list of variable_initializers
24965         (opt_array_initializer): Modify accordingly.
24966
24967         * expression.cs (New::NType): Add enumeration to help us
24968         keep track of whether we have an object/delegate creation
24969         or an array creation.
24970         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24971         members to hold data about array creation.
24972         (New:New): Modify to update NewType
24973         (New:New): New Overloaded contructor for the array creation
24974         case.
24975
24976         * cs-parser.jay (array_creation_expression): Implement to call
24977         the overloaded New constructor.
24978
24979 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24980
24981         * class.cs (TypeContainer::Constructors): Return member
24982         constructors instead of returning null.
24983
24984 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24985
24986         * typemanager.cs (InitCoreTypes): Initialize the various core
24987         types after we have populated the type manager with the user
24988         defined types (this distinction will be important later while
24989         compiling corlib.dll)
24990
24991         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24992         on Expression Classification.  Now all expressions have a method
24993         `Resolve' and a method `Emit'.
24994
24995         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24996         generation from working.     Also add some temporary debugging
24997         code. 
24998
24999 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25000
25001         * codegen.cs: Lots of code generation pieces.  This is only the
25002         beginning, will continue tomorrow with more touches of polish.  We
25003         handle the fundamentals of if, while, do, for, return.  Others are
25004         trickier and I need to start working on invocations soon.
25005
25006         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25007         s.InitStatement. 
25008
25009         * codegen.cs (EmitContext): New struct, used during code
25010         emission to keep a context.   Most of the code generation will be
25011         here. 
25012
25013         * cs-parser.jay: Add embedded blocks to the list of statements of
25014         this block.  So code generation proceeds in a top down fashion.
25015
25016 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * statement.cs: Add support for multiple child blocks.
25019
25020 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25021
25022         * codegen.cs (EmitCode): New function, will emit the code for a
25023         Block of code given a TypeContainer and its ILGenerator. 
25024
25025         * statement.cs (Block): Standard public readonly optimization.
25026         (Block::Block constructors): Link children. 
25027         (Block::Child): Child Linker.
25028         (Block::EmitVariables): Emits IL variable declarations.
25029
25030         * class.cs: Drop support for MethodGroups here, delay until
25031         Semantic Analysis.
25032         (Method::): Applied the same simplification that I did before, and
25033         move from Properties to public readonly fields.
25034         (Method::ParameterTypes): Returns the parameter types for the
25035         function, and implements a cache that will be useful later when I
25036         do error checking and the semantic analysis on the methods is
25037         performed.
25038         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25039         and made a method, optional argument tells whether this is a class
25040         or a structure to apply the `has-this' bit.
25041         (Method::GetCallingConvention): Implement, returns the calling
25042         convention. 
25043         (Method::Define): Defines the type, a second pass is performed
25044         later to populate the methods.
25045
25046         (Constructor::ParameterTypes): implement a cache similar to the
25047         one on Method::ParameterTypes, useful later when we do semantic
25048         analysis. 
25049
25050         (TypeContainer::EmitMethod):  New method.  Emits methods.
25051
25052         * expression.cs: Removed MethodGroup class from here.
25053
25054         * parameter.cs (Parameters::GetCallingConvention): new method.
25055
25056 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25057
25058         * class.cs (TypeContainer::Populate): Drop RootContext from the
25059         argument. 
25060
25061         (Constructor::CallingConvention): Returns the calling convention.
25062         (Constructor::ParameterTypes): Returns the constructor parameter
25063         types. 
25064
25065         (TypeContainer::AddConstructor): Keep track of default constructor
25066         and the default static constructor.
25067
25068         (Constructor::) Another class that starts using `public readonly'
25069         instead of properties. 
25070
25071         (Constructor::IsDefault): Whether this is a default constructor. 
25072
25073         (Field::) use readonly public fields instead of properties also.
25074
25075         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25076         track of static constructors;  If none is used, turn on
25077         BeforeFieldInit in the TypeAttributes. 
25078
25079         * cs-parser.jay (opt_argument_list): now the return can be null
25080         for the cases where there are no arguments. 
25081
25082         (constructor_declarator): If there is no implicit `base' or
25083         `this', then invoke the default parent constructor. 
25084
25085         * modifiers.cs (MethodAttr): New static function maps a set of
25086         modifiers flags into a MethodAttributes enum
25087         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25088         MethodAttr, TypeAttr to represent the various mappings where the
25089         modifiers are used.
25090         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25091
25092 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25093
25094         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25095         method arguments.
25096
25097         * interface.cs (PopulateIndexer): Implemented the code generator
25098         for interface indexers.
25099
25100 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25101
25102         * interface.cs (InterfaceMemberBase): Now we track the new status
25103         here.  
25104
25105         (PopulateProperty): Implement property population.  Woohoo!  Got
25106         Methods and Properties going today. 
25107
25108         Removed all the properties for interfaces, and replaced them with
25109         `public readonly' fields. 
25110
25111 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25112
25113         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25114         initialize their hashtables/arraylists only when they are needed
25115         instead of doing this always.
25116
25117         * parameter.cs: Handle refs and out parameters.
25118
25119         * cs-parser.jay: Use an ArrayList to construct the arguments
25120         instead of the ParameterCollection, and then cast that to a
25121         Parameter[] array.
25122
25123         * parameter.cs: Drop the use of ParameterCollection and use
25124         instead arrays of Parameters.
25125
25126         (GetParameterInfo): Use the Type, not the Name when resolving
25127         types. 
25128
25129 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25130
25131         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25132         and instead use public readonly fields.
25133
25134         * class.cs: Put back walking code for type containers.
25135
25136 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25137
25138         * class.cs (MakeConstant): Code to define constants.
25139
25140         * rootcontext.cs (LookupType): New function.  Used to locate types 
25141
25142
25143 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25144
25145         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25146         this System.Reflection code is.  Kudos to Microsoft
25147
25148         * typemanager.cs: Implement a type cache and avoid loading all
25149         types at boot time.  Wrap in LookupType the internals.  This made
25150         the compiler so much faster.  Wow.  I rule!
25151
25152         * driver.cs: Make sure we always load mscorlib first (for
25153         debugging purposes, nothing really important).
25154
25155         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25156         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25157
25158         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25159         on namespaces that have been imported using the `using' keyword.
25160
25161         * class.cs (TypeContainer::TypeAttr): Virtualize.
25162         (Class::TypeAttr): Return attributes suitable for this bad boy.
25163         (Struct::TypeAttr): ditto.
25164         Handle nested classes.
25165         (TypeContainer::) Remove all the type visiting code, it is now
25166         replaced with the rootcontext.cs code
25167
25168         * rootcontext.cs (GetClassBases): Added support for structs. 
25169
25170 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25171
25172         * interface.cs, statement.cs, class.cs, parameter.cs,
25173         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25174         Drop use of TypeRefs, and use strings instead.
25175
25176 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25177
25178         * rootcontext.cs: 
25179
25180         * class.cs (Struct::Struct): set the SEALED flags after
25181         checking the modifiers.
25182         (TypeContainer::TypeAttr): new property, returns the
25183         TypeAttributes for a class.  
25184
25185         * cs-parser.jay (type_list): Oops, list production was creating a
25186         new list of base types.
25187
25188         * rootcontext.cs (StdLib): New property.
25189         (GetInterfaceTypeByName): returns an interface by type name, and
25190         encapsulates error handling here.
25191         (GetInterfaces): simplified.
25192         (ResolveTree): Encapsulated all the tree resolution here.
25193         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25194         types. 
25195
25196         * driver.cs: Add support for --nostdlib, to avoid loading the
25197         default assemblies.
25198         (Main): Do not put tree resolution here. 
25199
25200         * rootcontext.cs: Beginning of the class resolution.
25201
25202 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25203
25204         * rootcontext.cs: Provide better error reporting. 
25205
25206         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25207
25208         * rootcontext.cs (CreateInterface): Handle the case where there
25209         are no parent interfaces.
25210
25211         (CloseTypes): Routine to flush types at the end.
25212         (CreateInterface): Track types.
25213         (GetInterfaces): Returns an array of Types from the list of
25214         defined interfaces.
25215
25216         * typemanager.c (AddUserType): Mechanism to track user types (puts
25217         the type on the global type hash, and allows us to close it at the
25218         end). 
25219
25220 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25221
25222         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25223         RecordInterface instead.
25224
25225         * cs-parser.jay: Updated to reflect changes above.
25226
25227         * decl.cs (Definition): Keep track of the TypeBuilder type that
25228         represents this type here.  Not sure we will use it in the long
25229         run, but wont hurt for now.
25230
25231         * driver.cs: Smaller changes to accomodate the new code.
25232
25233         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25234         when done. 
25235
25236         * rootcontext.cs (CreateInterface):  New method, used to create
25237         the System.TypeBuilder type for interfaces.
25238         (ResolveInterfaces): new entry point to resolve the interface
25239         hierarchy. 
25240         (CodeGen): Property, used to keep track of the code generator.
25241
25242 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25243
25244         * cs-parser.jay: Add a second production for delegate_declaration
25245         with `VOID'.
25246
25247         (enum_body): Put an opt_comma here instead of putting it on
25248         enum_body or enum_member_declarations so we can handle trailing
25249         commas on enumeration members.  Gets rid of a shift/reduce.
25250
25251         (type_list): Need a COMMA in the middle.
25252
25253         (indexer_declaration): Tell tokenizer to recognize get/set
25254
25255         * Remove old targets.
25256
25257         * Re-add the parser target.
25258
25259 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25260
25261         * cs-parser.jay: Add precendence rules for a number of operators
25262         ot reduce the number of shift/reduce conflicts in the grammar.
25263
25264 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25265
25266         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25267         and put it here.
25268
25269         Get rid of old crufty code.
25270
25271         * rootcontext.cs: Use this to keep track of the parsed
25272         representation and the defined types available to the program. 
25273
25274         * gen-treedump.cs: adjust for new convention.
25275
25276         * type.cs: Split out the type manager, and the assembly builder
25277         from here. 
25278
25279         * typemanager.cs: the type manager will live here now.
25280
25281         * cil-codegen.cs: And the code generator here. 
25282
25283 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25284
25285         * makefile: Fixed up for easy making.
25286
25287 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25288
25289         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25290         the 
25291
25292         (unary_expression): Expand pre_increment_expression and
25293         post_decrement_expression to reduce a shift/reduce.
25294
25295 2001-07-11  Simon Cozens
25296
25297         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25298
25299         Improve allow_keyword_as_indent name.
25300
25301 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25302
25303         * Adjustments for Beta2. 
25304
25305 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25306
25307         * decl.cs: Added `Define' abstract method.
25308         (InTransit): new property, used to catch recursive definitions. 
25309
25310         * interface.cs: Implement `Define'. 
25311
25312         * modifiers.cs: Map Modifiers.constants to
25313         System.Reflection.TypeAttribute flags.
25314
25315         * class.cs: Keep track of types and user-defined types.
25316         (BuilderInit): New method for creating an assembly
25317         (ResolveType): New function to launch the resolution process, only
25318         used by interfaces for now.
25319
25320         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25321         that are inserted into the name space. 
25322
25323 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25324
25325         * ARGH.  I have screwed up my tree so many times due to the use of
25326         rsync rather than using CVS.  Going to fix this at once. 
25327
25328         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25329         load types.
25330
25331 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25332
25333         * Experiment successful: Use System.Type rather that our own
25334         version of Type.  
25335
25336 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25337
25338         * cs-parser.jay: Removed nsAliases from here.
25339
25340         Use new namespaces, handle `using XXX;' 
25341
25342         * namespace.cs: Reimplemented namespace handling, use a recursive
25343         definition of the class.  Now we can keep track of using clauses
25344         and catch invalid using clauses.
25345
25346 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25347
25348         * gen-treedump.cs: Adapted for all the renaming.
25349
25350         * expression.cs (Expression): this class now has a Type property
25351         which returns an expression Type.
25352
25353         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25354         `Type', as this has a different meaning now in the base
25355
25356 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25357
25358         * interface.cs, class.cs: Removed from all the sources the
25359         references to signature computation, as we can not do method
25360         signature computation during the parsing time, as we are not
25361         trying to solve at that point distinguishing:
25362
25363         class X {
25364                 void a (Blah x) {}
25365                 void a (NS.Blah x) {}
25366         }
25367
25368         Which depending on the context might be valid or not, as we do not
25369         know if Blah is the same thing as NS.Blah at that point.
25370
25371         * Redid everything so the code uses TypeRefs now instead of
25372         Types.  TypeRefs are just temporary type placeholders, that need
25373         to be resolved.  They initially have a pointer to a string and the
25374         current scope in which they are used.  This is used later by the
25375         compiler to resolve the reference to an actual Type. 
25376
25377         * DeclSpace is no longer a CIR.Type, and neither are
25378         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25379         are all DeclSpaces, but no Types. 
25380
25381         * type.cs (TypeRefManager): This implements the TypeRef manager,
25382         which keeps track of all the types that need to be resolved after
25383         the parsing has finished. 
25384
25385 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25386
25387         * ARGH.  We are going to have to store `foreach' as a class rather
25388         than resolving it, as we need to verify error 1579 after name
25389         resolution.   *OR* we could keep a flag that says `This request to
25390         IEnumerator comes from a foreach statement' which we can then use
25391         to generate the error.
25392
25393 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25394
25395         * class.cs (TypeContainer.AddMethod): we now add methods to the
25396         MethodGroup instead of the method hashtable.  
25397
25398         * expression.cs: Add MethodGroup abstraction, which gets us one
25399         step closer to the specification in the way we handle method
25400         declarations.  
25401
25402         * cs-parser.jay (primary_expression): qualified_identifier now
25403         tried to match up an identifier to a local variable reference or
25404         to a parameter reference.
25405
25406         current_local_parameters is now a parser global variable that
25407         points to the current parameters for the block, used during name
25408         lookup.
25409
25410         (property_declaration): Now creates an implicit `value' argument to
25411         the set accessor.
25412
25413 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25414
25415         * parameter.cs: Do not use `param' arguments as part of the
25416         signature, per the spec.
25417
25418 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25419
25420         * decl.cs: Base class for classes, structs and interfaces.  This
25421         is the "Declaration Space" 
25422
25423         * cs-parser.jay: Use CheckDef for checking declaration errors
25424         instead of having one on each function.
25425
25426         * class.cs: Factor out some code for handling error handling in
25427         accordance to the "Declarations" section in the "Basic Concepts"
25428         chapter in the ECMA C# spec.
25429
25430         * interface.cs: Make all interface member classes derive from
25431         InterfaceMemberBase.
25432
25433 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25434
25435         * Many things: all interfaces are parsed and generated in
25436         gen-treedump.  Support for member variables, constructors,
25437         destructors, properties, constants is there.
25438
25439         Beginning of the IL backend, but very little done, just there for
25440         testing purposes. 
25441
25442 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25443
25444         * cs-parser.jay: Fix labeled statement.
25445
25446         * cs-tokenizer.cs (escape): Escape " and ' always.
25447         ref_line, ref_name: keep track of the line/filename as instructed
25448         by #line by the compiler.
25449         Parse #line.
25450
25451 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25452
25453         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25454         to match the values in System.CodeDOM.
25455
25456         Divid renamed to Divide.
25457
25458         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25459         statements. 
25460         (Statements.set): remove.
25461
25462         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25463         statements. 
25464
25465         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25466         falseStatements always have valid values. 
25467
25468         * cs-parser.jay: Use System.CodeDOM now.
25469