**** Merged r40971 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2
3         Fix #69949
4         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5         argument. Call ResolveAttributeUsage for unresolved.
6         when types doesn't match ctor arguments.
7         
8         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9         for nested attribute classes.
10         (Class.attribute_usage): Removed.
11         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12         for attribute class.
13         
14         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15         
16         * rootcontext.cs (RegisterAttribute): Removed, attributes are
17         now normal types.
18         (attribute_types): Removed.
19         (EmitCode): Global attributes are emited as the latest.
20
21 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
22
23         * class.cs (EmitFieldInitializers): Don't emit field initializer
24         for default values when optimilization is on.
25         
26         * constant.cs (Constant.IsDefaultValue): New property.
27         
28         * driver.cs: Add /optimize handling.
29         
30         * constant.cs,
31         * ecore.cs,
32         * literal.cs: Implement new IsDefaultValue property.
33         
34         * rootcontext.cs (Optimize): New field, holds /optimize option.
35
36 2005-02-18  Raja R Harinath  <rharinath@novell.com>
37
38         Fix crasher in re-opened #72347.
39         * namespace.cs (Namespace.Lookup): Return null if
40         DeclSpace.DefineType returns null.
41
42         Fix #72678.
43         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
44
45 2005-02-18  Raja R Harinath  <rharinath@novell.com>
46
47         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
48         now returns null if it cannot resolve to an lvalue.
49         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
50         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
51         returned null.  Remove check for SimpleName.
52         (EventExpr.DoResolveLValue): New.
53         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
54         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
55         error from ...
56         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
57         avoid CS0131 error.
58         (Unary.ResolveOperator): Move CS0211 check ...
59         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
60         CS0131 error.
61         (Unary.DoResolveLValue): Simplify.
62         (AddressOf.DoResolveLValue): New.
63         (ArrayAccess.DoResolveLValue): New.
64
65 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
66
67         * attribute.cs (Attribute.Resolve): Add arguments casting for
68         when types doesn't match ctor arguments.
69
70 2005-02-16  Raja R Harinath  <rharinath@novell.com>
71
72         Fix parts of #63202.
73         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
74         lookup of operator in base type.  Ensure that all checks happen
75         when the operator resolves to an "op_..." method.
76
77 2005-02-15  Raja R Harinath  <rharinath@novell.com>
78
79         Fix #71992.
80         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
81         'ignore_cs0104' parameter.  Pass it to ...
82         (NamespaceEntry.Lookup): ... this.
83         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
84         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
85         (TypeLookupExpression.DoResolveAsTypeStep): Update.
86         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
87         Update.  Request that cs0104 errors be ignored.
88         (ComposedCast.ResolveAsTypeStep): Update.
89
90 2005-02-14  Raja R Harinath  <rharinath@novell.com>
91
92         Fix #59209.
93         * expression.cs (Invocation.BetterFunction): Remove support for
94         comparing virtual functions and their overrides.
95         (Invocation.IsOverride): New.
96         (Invocation.OverloadResolve): Don't consider 'override' functions
97         during candidate selection.  Store them in a lookaside list.
98         If the selected method is a 'virtual' function, use the list to
99         find any overrides that are closer to the LHS type.
100
101 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
102
103         * expression.cs (New.DoResolve): Add complex core type reduction.
104         (New.Constantify): Converts complex core type syntax like 'new int ()'
105         to simple constant.
106         
107 2005-02-14  Raja R Harinath  <rharinath@novell.com>
108
109         * decl.cs (EntryType.EntryType): New constructor to create an
110         updated copy of a cache entry.
111         (MemberCache.AddMethods): Use it.
112         (MemberCache.ClearDeclaredOnly): Remove.
113         (MemberCache.MemberCache): Update.
114
115 2005-02-11  Miguel de Icaza  <miguel@novell.com>
116
117         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
118         variable.  This one is represents the actual low-level declaration
119         of the method, as opposed to the semantic level `IsStatic'.   
120
121         An anonymous method which is hosted into a static method might be
122         actually an instance method.  IsStatic would reflect the
123         container, while MethodIsStatic represents the actual code
124         generated.
125
126         * expression.cs (ParameterReference): Use the new MethodIsStatic
127         instead of IsStatic.
128
129         * anonymous.cs (AnonymousMethod.Compatible): Pass the
130         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
131         set on the current EmitContext. 
132
133         * expression.cs (Cast): Overload DoResolveLValue so we can pass
134         resolve our casted expression as an LValue.  This triggers the
135         proper LValue processing that is later required by Assign.
136
137         This fixes 72347.
138
139         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
140
141 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
142
143         C# 2.0 Fixed buffer implementation
144
145         * anonymous.cs: Update after RegisterHelperClass renaming.
146
147         * attribute.cs (AttributeTester.fixed_buffer_cache):
148         Cache of external fixed buffers.
149         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
150         implementation if field is fixed buffer else null.
151
152         * class.cs
153         (TypeContainer.AddField): Accept FieldMember instead of Field.
154         (FieldBase.IsFieldClsCompliant): Extracted code from
155         VerifyClsCompliance descendant customization.
156         (FixedField): New class handles fixed buffer fields.
157         (FixedFieldExternal): Keeps information about imported fixed
158         buffer.
159         (IFixedField): Make access to internal or external fixed buffer
160         same.
161
162         * cs-parser.jay: Add fixed buffer parsing.
163
164         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
165         buffer.
166
167         * expression.cs (Indirection): Extended implementation to accept
168         fixed buffer field.
169         (PointerArithmetic.Emit): Get element from fixed buffer as well.
170         (ElementAccess.MakePointerAccess): Get type as parameter.
171         (DoResolve): Add fixed buffer field expression conversion.
172         (DoResolveLValue): Ditto.
173         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
174         (ArrayPtr): Derives from FixedBufferPtr.
175         (ArrayPtr.Emit): Add extra emit for array elements.
176
177         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
178
179         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
180         for compiler generated types.
181         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
182
183         * statement.cs (Fixed): Refactored to be easier add fixed buffer
184         and consume less memory.
185         (Fixed.Resolve): Add fixed buffer case.
186
187         * typemanager.cs (compiler_generated_attr_ctor,
188         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
189         (HasElementType): Add our own implementation to work on every
190         runtime.
191
192 2005-02-11  Miguel de Icaza  <miguel@novell.com>
193
194         * anonymous.cs (CaptureContext): Track whether `this' has been
195         referenced.   
196
197         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
198         only captured `this' if it was implicitly done (instance
199         methods/variables were used). 
200
201         * codegen.cs (EmitContext.CaptureThis): New method to flag that
202         `this' must be captured.
203
204 2005-01-30  Miguel de Icaza  <miguel@novell.com>
205  
206         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
207         is null it means that there has been no need to capture anything,
208         so we just create a sibling.
209
210         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
211
212         Just a partial fix.  The other half is fairly elusive.
213         
214 2005-02-10  Raja R Harinath  <rharinath@novell.com>
215
216         Fix #52586, cs0121-4.cs.
217         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
218         and return a hashtable.
219         (MemberCache.ClearDeclaredOnly): New.
220         (MemberCache.MemberCache): Update to change.  Make a deep copy of
221         the method_hash of a base type too.
222         (MemberCache.AddMethods): Adapt to having a deep copy of the base
223         type methods.  Overwrite entries with the same MethodHandle so
224         that the ReflectedType is correct.  The process leaves in base
225         virtual functions and their overrides as distinct entries.
226         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
227         matters since it was boxed in a ArrayList before.
228         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
229         modifier.
230         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
231         case of a virtual function and its override (choose the overload
232         as better).
233         (Invocation.OverloadResolve): Avoid 'override' members during
234         'applicable_type' calculation.
235
236 2005-02-09  Raja R Harinath  <rharinath@novell.com>
237
238         Combine two near-redundant caches.
239         * typemanager.cs (method_params): Rename from method_internal_params.
240         (TypeManager.GetParameterData): New.  Replace
241         Invocation.GetParameterData.
242         (TypeManager.LookupParametersByBuilder): Remove.
243         * expression.cs (Invocation.method_parameter_cache): Remove.
244         (Invocation.GetParameterData): Remove.
245         Update to changes.
246         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
247         Update to changes.
248
249 2005-02-08  Raja R Harinath  <rharinath@novell.com>
250
251         Fix #72015.
252         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
253         TypeManager.multicast_delegate_type is null, resolve it by looking
254         up "System.MulticastDelegate".
255         * rootcontext.cs (RootContext.ResolveCore): Simplify.
256
257 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
258             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
259             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
260
261         Fix cs0164.cs.
262         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
263         (LabeledStatement.AddReference): New.  Set 'referenced'.
264         (Goto.Resolve): Use it.
265
266 2005-02-05  John Luke  <john.luke@gmail.com>
267
268         * driver.cs: remove duplicate -doc line in Usage ()
269
270 2005-02-04  Raja R Harinath  <rharinath@novell.com>
271
272         * location.cs (Location.AddFile): Fix CS2002 error report.
273
274 2005-02-02  Martin Baulig  <martin@ximian.com>
275
276         * delegate.cs (Delegate.DefineType): Report an internal error if
277         TypeManager.multicast_delegate_type is null.  See bug #72015 for
278         details.        
279
280 2005-02-02  Raja R Harinath  <rharinath@novell.com>
281
282         Fix a crasher in a variant of #31984.
283         * const.cs (Constant.CheckBase): New override that defers the
284         new-or-override check in case the base type hasn't been populated
285         yet.
286         (Constant.Define): Ensure the new-or-override check is performed.
287
288 2005-02-01  Duncan Mak  <duncan@ximian.com>
289
290         * const.cs (LookupConstantValue): Check that `ce' is not null
291         before calling GetValue ().
292
293 2005-02-01  Raja R Harinath  <rharinath@novell.com>
294
295         Fix test-334.cs (#69519).
296         * cs-parser.jay (using_alias_directive): Pass in an expression to
297         NamespaceEntry.UsingAlias.
298         (using_namespace_directive): Pass in an expression to
299         NamespaceEntry.Using.
300         (namespace_name): Don't flatten to a string.
301         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
302         (NamespaceEntry.AliasEntry.Resolve): Lookup using
303         ResolveAsTypeStep.
304         (NamespaceEntry.UsingEntry): Likewise.
305         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
306         changes.
307         (NamespaceEntry.LookupForUsing): Remove.
308         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
309         names.
310         (NamespaceEntry.Lookup): Remove support for dotted names.
311
312 2005-02-01  Raja R Harinath  <rharinath@novell.com>
313
314         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
315         split into two.
316         (NamespaceEntry.ImplicitParent): Compute on demand.
317         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
318         parallels the current.
319         (NamespaceEntry.LookupForUsing): Use it.
320         (NamespaceEntry.Lookup): If the current namespace-entry is
321         implicit, don't search aliases and using tables.
322
323 2005-02-01  Raja R Harinath  <rharinath@novell.com>
324
325         Fix #31984.
326         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
327         BaseCache here.
328         (TypeContainer.BaseCache): Compute on demand.
329         (TypeContainer.FindMembers): Define constants and types if they're
330         not already created.
331         (FieldMember.Define): Move resetting of ec.InUnsafe before error
332         check.
333         * const.cs (Constant.Define): Make idempotent.
334
335 2005-01-29  Miguel de Icaza  <miguel@novell.com>
336
337         * pending.cs: Produce better code (no nops produced by using Ldarg
338         + value).
339         
340         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
341         i - 1' it should be arg + 1.
342
343         Fixes bug #71819.
344
345 2005-01-28  Raja R Harinath  <rharinath@novell.com>
346
347         * attribute.cs (Attribute.CheckAttributeType): Make private
348         non-virtual.
349         (Attribute.ResolveType): Make virtual.
350         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
351         handling of RootContext.Tree.Types.
352
353 2005-01-27  Raja R Harinath  <rharinath@novell.com>
354
355         Update attribute-handling to use the SimpleName/MemberAccess
356         mechanisms.
357         * cs-parser.jay (attribute): Pass in an expression to the
358         constructors of Attribute and GlobalAttribute.
359         * attribute.cs (Attribute): Take an expression for the name.
360         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
361         passed in attribute name expression.
362         (Attribute.CheckAttributeType): Use it.
363         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
364         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
365         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
366         argument to prevent error messages if the lookup fails.
367
368 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
369
370         * expression.cs (Indirection): Implemented IVariable interface
371         to support indirection in AddressOf operator.
372         (PointerArithmetic.Emit): Add optimalization for case where
373         result can be precomputed.
374
375 2005-01-26  Martin Baulig  <martin@ximian.com>
376
377         * class.cs (TypeContainer.AttributeTargets): Return the correct
378         AttributeTargets depending on our `Kind' instead of throwing an
379         exception; fixes #71632.
380
381 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
382
383         Fix #71257
384         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
385         constant members.
386
387 2005-03-17  Martin Baulig  <martin@ximian.com>
388
389         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
390         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
391
392 2005-03-17  Martin Baulig  <martin@ximian.com>
393
394         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
395         to bool so we can return an error condition.
396         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
397         returned an error.
398
399 2005-03-17  Martin Baulig  <martin@ximian.com>
400
401         * generic.cs (TypeMananager.IsIEnumerable): New public method.
402
403         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
404         converting from an array-type of T to `IEnumerable<T>'.
405
406 2005-03-16  Martin Baulig  <martin@ximian.com>
407
408         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
409         (Nullable.LiftedUnaryMutator): New public class.
410
411         * expression.cs (UnaryMutator.DoResolve): Added support for
412         Nullable Types.
413
414 2005-03-14  Martin Baulig  <martin@ximian.com>
415
416         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
417
418 2005-03-14  Martin Baulig  <martin@ximian.com>
419
420         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
421         the comparision operators `<', `>', `<=' and `>='.
422
423 2005-03-13  Martin Baulig  <martin@ximian.com>
424
425         * generic.cs
426         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
427         avoid confusion with the `NullLiteral'.
428         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
429
430 2005-03-13  Martin Baulig  <martin@ximian.com>
431
432         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
433         comparing arbitrary types with the null literal.
434
435 2005-03-13  Martin Baulig  <martin@ximian.com>
436
437         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
438         boolean operators '&&', '||', '&' and '|'.
439         (Nullable.OperatorTrueOrFalse): New public class.
440
441         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
442         instead of a `StaticCallExpr'; added support for nullables.
443
444 2005-03-10  Martin Baulig  <martin@ximian.com>
445
446         * expression.cs
447         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
448         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
449
450 2005-03-07  Martin Baulig  <martin@ximian.com>
451
452         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
453         it work if `expr' is not an IMemoryLocation.
454         (Nullable.Lifted): Implement IMemoryLocation.
455         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
456         target type.
457
458 2005-03-05  Martin Baulig  <martin@ximian.com>
459
460         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
461         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
462         (Nullable): Added support for lifted unary and binary operators.
463
464         * expression.cs (Unary.DoResolve): Added support for nullable types.
465         (Binary.DoResolve): Likewise.
466         (Conditional.DoResolve): Likewise.
467
468 2005-03-02  Martin Baulig  <martin@ximian.com>
469
470         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
471
472         * class.cs (ClassPart.SetParameterInfo): Override this.
473         (PartialContainer.SetParameterInfo): Override this.
474         (TypeContainer.CheckConstraints): New protected method.
475         (PartialContainer.CheckConstraints): Override this and check
476         whether the same contraints were specified in all parts of a
477         partial generic type definition.
478         (PartialContainer.UpdateConstraints): New public method.
479
480         * generic.cs (TypeParameter.UpdateConstraints): New public method.
481
482 2005-03-02  Martin Baulig  <martin@ximian.com>
483
484         Committing a patch from Carlos Alberto Cortez to fix #72887.
485
486         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
487         casts from `T []' to `int []'.
488
489 2005-03-02  Martin Baulig  <martin@ximian.com>
490
491         * generic.cs (TypeManager.IsEqual): Make this symmetric.
492
493         * expression.cs (Binary.ResolveOperator): When resolving a
494         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
495         `=='.  Fixes #71866.  See gen-127.cs.
496
497 2005-03-02  Martin Baulig  <martin@ximian.com>
498
499         * class.cs (TypeContainer.DoDefineMembers): We also need a default
500         static constructor in static classes.
501
502 2005-03-02  Martin Baulig  <martin@ximian.com>
503
504         * generic.cs
505         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
506         (Nullable.LiftedConversion): Added support for user-defined
507         conversions.
508
509         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
510
511         * cs-parser.jay: Use ComposedCast everywhere instead of
512         NullableType, so we don't need to check for NullableType
513         everywhere.
514         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
515         case where we'll be resolved into a `parenthesized_expression_0'
516         afterwards.
517
518         * convert.cs
519         (Convert.UserDefinedConversion): Added nullable conversions.
520
521 2005-02-28  Martin Baulig  <martin@ximian.com>
522
523         * generic.cs (TypeManager.IsNullableType): New static method.
524         (Nullable): New abstract class.
525         (Nullable.NullLiteral): New public class.
526         (Nullable.LiftedConversion): New public class.
527
528         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
529         `builtin_types opt_nullable'.
530
531         * convert.cs
532         (Convert.ImplicitConversionStandard): Added nullable conversions.
533         (Convert.ExplicitConversionStandard): Likewise.
534         (Convert.ExplicitConversion): Likewise.
535
536 2005-02-26  Martin Baulig  <martin@ximian.com>
537
538         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
539         begin with a "?", for instance "?[]".  Don't do a type lookup if
540         `dim' is empty.
541
542 2005-02-25  Martin Baulig  <martin@ximian.com>
543
544         The first part of Nullable Types :-)
545
546         * generic.cs (NullableType): New public class.
547         (NullCoalescingOperator): New public class.
548         (TypeArguments.Resolve): Add a CS0306 check.
549
550         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
551         (opt_nullable): New rule.
552         (type): Added `opt_nullable' to `namespace_or_type_name',
553         `builtin_types' and `pointer_type'.
554         (array_type): Added `opt_nullable'.
555         (opt_rank_specifier_or_nullable): New rule; this is the
556         combination of `opt_rank_specifier' and `opt_nullable'.
557         (opt_error): New rule; catch errors here.
558         (nullable_type_or_conditional): New rule; we use this to check for
559         nullable and still detect the conditional operator.
560         (local_variable_type): Use `opt_rank_specifier_or_nullable'
561         instead `opt_rank_specifier'.
562
563         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
564         for nullables.
565
566 2005-02-24  Martin Baulig  <martin@ximian.com>
567
568         * README, README.Changes: Removed; they're old and obsolete.
569
570 2005-02-22  Martin Baulig  <martin@ximian.com>
571
572         * generic.cs (TypeParameter.Resolve): If resolving the constraints
573         returned an error, set `constraints' to null to avoid a crash
574         later on.
575         (TypeParameter.ResolveType): Likewise.
576
577 2005-02-22  Martin Baulig  <martin@ximian.com>
578
579         * generic.cs
580         (Constraints.ResolveTypes): Protect against being called twice.
581         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
582         (TypeParameter.ResolveType): New public method; calls
583         constraints.ResolveTypes().
584         (TypeParameter.DefineType): Moved constraints.ResolveType() out
585         into the new ResolveType().
586         (GenericMethod.Define): Call ResolveType() on all our
587         TypeParameter's.        
588
589 2005-02-21  Martin Baulig  <martin@ximian.com>
590
591         * generic.cs
592         (TypeManager.generic_nullable_type): New static public field.
593         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
594
595         * rootcontext.cs
596         (RootContext.ResolveCore): Resolve "System.Nullable`1".
597
598 2005-02-15  Martin Baulig  <martin@ximian.com>
599
600         * generic.cs (ConstructedType.Constraints): Correctly check
601         constraints if the argument type is a type parameter; fixes
602         #72326. 
603
604 2005-02-02  Martin Baulig  <martin@ximian.com>
605
606         * delegate.cs (Delegate.DefineType): Report an internal error if
607         TypeManager.multicast_delegate_type is null.  See bug #72015 for
608         details.        
609
610 2005-01-29  Miguel de Icaza  <miguel@novell.com>
611
612         * pending.cs: Produce better code (no nops produced by using Ldarg
613         + value).
614         
615         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
616         i - 1' it should be arg + 1.
617
618         Fixes bug #71819.
619         
620 2005-01-26  Martin Baulig  <martin@ximian.com>
621
622         * cs-parser.jay (indexer_declarator): Don't report an error if we
623         have type parameters since we can be an explicit interface
624         implementation; fixes #71449.
625
626 2005-01-26  Martin Baulig  <martin@ximian.com>
627
628         * class.cs (TypeContainer.AttributeTargets): Return the correct
629         AttributeTargets depending on our `Kind' instead of throwing an
630         exception; fixes #71632.
631
632 2005-01-26  Martin Baulig  <martin@ximian.com>
633
634         * delegate.cs (Delegate.DefineType): Correctly define our type
635         parameters.  Fixes #71483.
636
637 2005-01-25  Raja R Harinath  <rharinath@novell.com>
638
639         Fix #71602.
640         * expression.cs (MemberAccess.DoResolve): Don't complain with
641         cs0572 when the LHS of a member access has identical name and type
642         name.
643
644 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
645
646         Fix #71651, #71675
647         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
648         CreatePermission.
649         Create custom PermissionSet only for PermissionSetAttribute.
650
651 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
652
653         Fix #71649
654         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
655         delegates in static class.
656
657 2005-01-24  Martin Baulig  <martin@ximian.com>
658
659         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
660         merging an implicit block, just use its reachability.
661
662         * statement.cs (Block.Resolve): Make the unreachable code check
663         work wrt. implicit blocks; see test-337 from #63842.
664
665 2005-01-21  Alp Toker  <alp@atoker.com>
666  
667         * cs-parser.jay: destructor_declaration's container is PartialContainer
668         not Class when partial types are used, so use Kind prop instead of
669         'is'.
670         
671 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
672
673         * cs-parser.jay: Improve error reporting when an interface
674         declares new types.
675
676 2005-01-20  Dick Porter  <dick@ximian.com>
677
678         * support.cs: SeekableStreamReader fix from Sandor Dobos
679         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
680         chars are read.  Fixes bug 70369.
681
682 2005-01-20  Raja R Harinath  <rharinath@novell.com>
683
684         * cs-parser.jay (catch_clause): Simplify current_block handling
685         somewhat.
686
687 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
688
689         * convert.cs (ImplicitStandardConversionExists): Synchronize the
690         code with ImplicitStandardConversion to handle the implicit
691         conversion of method groups into valid delegate invocations. 
692
693         The problem is that in parameter handling we were using this code
694         path.  Fixes bug #64698
695
696 2005-01-19  Raja R Harinath  <rharinath@novell.com>
697
698         * cs-parser.jay: Fix several infelicities.
699         - Avoid assigning to the parser value stack.  Code like 
700           '$3 = null' is unclean.  Synthesize a value for the code block
701           instead. 
702         - Avoid using oob_stack for storing location information.  Use ...
703         (_mark_): ... this.  New (empty) rule.  Saves the current location
704         in $$.
705         (foreach_statement): Avoid using oob_stack for current_block
706         handling.  Use technique used in for_statement and
707         using_statement.  Synthesize a value for the code block to store
708         additional intermediate information.
709
710 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
711
712         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
713         of a different type is only allowed to private fields of a
714         containing type, not on fields of a base class.
715
716         See test-174.cs and error cs0122-9.cs
717
718 2005-01-13  Raja R Harinath  <rharinath@novell.com>
719
720         Fix test-335.cs (bug #58126).
721         * cs-parser.jay (argument): Split out non-expression parts of the
722         rule into 'non_simple_argument'.
723         (invocation_expression): Support parenthesized invocations with
724         multiple arguments, and with single non-simple arguments.
725
726 2005-01-13  Raja R Harinath  <rharinath@novell.com>
727
728         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
729         places.
730
731 2005-01-12  Raja R Harinath  <rharinath@novell.com>
732
733         Fix cs0038-1.cs, cs1640-6.cs.
734         * ecore.cs (Expression.Resolve): Remove special-case for
735         SimpleName in error-handling.
736         (Expression.almostMatchedMembers): Relax access permission to
737         protected.
738         (Expression.MemberLookupFailed): Handle duplicates in
739         almostMatchedMembers list.
740         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
741         * expression.cs (New.DoResolve): Report CS1540 for more cases.
742         * typemanager.cs (GetFullNameSignature): Use the MethodBase
743         overload if the passed in MemberInfo is a MethodBase.
744
745 2005-01-25  Martin Baulig  <martin@ximian.com>
746
747         * doc.cs
748         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
749
750 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
751
752         Fix #70749
753         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
754         for non-CAS & merge permission sets properly.
755
756 2005-01-11  Raja R Harinath  <rharinath@novell.com>
757
758         Improve standard-compliance of simple name and member access 
759         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
760         * ecore.cs (FullNamedExpression): New abstract base class 
761         for Namespaces and TypeExpressions.
762         (ResolveFlags.SimpleName): Remove.
763         (SimpleName): Remove support for dotted names.
764         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
765         DeclSpace.FindType and DeclSpace.LookupType.
766         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
767         (Expression.ExprClassName): Make member function.
768         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
769         a namespace.  Remove creation of dotted "SimpleName"s.
770         (MemberAccess.DoResolve): Likewise.
771         * decl.cs (DeclSpace.Cache): Make private.
772         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
773         (DeclSpace.FindType): Update.
774         (DeclSpace.LookupType): Move here from RootContext.  Return a 
775         FullNamedExpression.
776         * namespace.cs (Namespace): Derive from FullNamedExpression
777         so that it can be part of expression resolution.
778         (Namespace.Lookup): Return an FullNamedExpression.
779         (NamespaceEntry.LookupAlias): Lookup aliases only in current
780         namespace.
781         * rootcontext.cs (NamespaceLookup): Remove.
782         (LookupType): Move to DeclSpace.
783         * attribute.cs (CheckAttributeType): Update.
784         * doc.cs (FindDocumentedType): Remove allowAlias argument.
785         (FindDocumentedTypeNonArray): Likewise.
786
787 2005-01-11  Raja R Harinath  <rharinath@novell.com>
788
789         Fix cs0509.cs, cs1632.cs.
790         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
791         is the same as IsInterface.
792         (TypeContainer.GetClassBases): Likewise.
793         * statement.cs (LabeledStatement.ig): New field.
794         (LabeledStatement.LabelTarget): Save ILGenerator which created the
795         label.
796         (LabeledStatement.DoEmit): Check that the label was created with
797         the same ILGenerator.
798
799 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
800
801         Fix #71058
802         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
803         accessors to its properties.
804
805         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
806         from accessors to property.
807         
808 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
809
810         Fix #70722
811         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
812         only for overrides.
813         
814 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
815
816         * attribute.cs: Check for null and empty strings.  
817
818         I have lost another battle to Paolo.
819
820 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
821
822         Fix #70942
823         * class.cs (PropertyMethod): Set Parent field in ctors.
824         (SetMethod.InternalParameters): Add unsafe switch hack.
825         Override MarkForDuplicationCheck where it is appropriate.
826
827         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
828         It says whether container allows members with the same name.
829         Base default is no.
830         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
831         Removed is_method parameter.
832
833 2005-01-06  Duncan Mak  <duncan@ximian.com>
834
835         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
836         because the previous change led to incorrect reporting of CS1032
837         ("Cannot define/undefine preprocessor symbols after first token in
838         file"). Instead of using `tokens_seen' as the only flag that
839         triggers CS1040, introduce `comments_seen'. This new flag is used
840         to signify having seen comments on the current line, so it is
841         unset after a newline.
842
843 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
844
845         * doc.cs : When searching for a type, find nested type too.
846           This fixes bug #71040.
847
848 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
849
850         * doc.cs :
851           - Warn missing member comment on those classes which also does not
852             have doc comments. Fixed bug #71041.
853           - Don't warn missing doc comment on default constructor.
854             Fixed bug #71042.
855
856 2005-01-06  Duncan Mak  <duncan@ximian.com>
857
858         * cs-tokenizer.cs (xtoken): After handling traditional C-style
859         comments, set `tokens_seen' to true. This allows us to detect
860         misplaced preprocessor directives (i.e. not at the beginning of
861         the a line, nor after whitespaces). In that case, report error
862         CS1040. This fixes bug #56460.
863
864         * cs-parser.jay (interface_member_declaration): Add checks for
865         IsExplicitImpl, and report CS0541 error if an interface member is
866         defined as an explicit interface declaration.
867
868 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
869
870         Fix #70817
871         * class.cs (PropertyMethod): Set Parent field in ctors.
872         (SetMethod.InternalParameters): Add unsafe switch hack.
873         
874         * decl.cs (MemberCore.Parent): Cannot be readonly.
875
876 2005-01-06  Raja R Harinath  <rharinath@novell.com>
877
878         * decl.cs (DeclSpace.ResolveType): Remove.
879         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
880         Merge in code from ...
881         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
882         * class.cs, enum.cs: Update to changes.
883
884 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
885
886         * anonymous.cs: Ensure that we init the scope of our parent if it
887         has not been initialized yet.
888
889 2004-12-30  Duncan Mak  <duncan@ximian.com>
890
891         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
892         if field.FieldBuilder is null. Fixes #70758.
893
894         * convert.cs: Fixed some typos and updated some of the comments.
895         (ImplicitStandardConversionExists):
896         (TryImplicitIntConversion): If `target_type' is an interface and
897         the type of `ic' implements this interface, return true or a new
898         BoxedCast instead of null. This fixes #70468.
899
900 2004-12-29  Duncan Mak  <duncan@ximian.com>
901
902         * expression.cs (Argument.Emit): Check that Expr is
903         IMemoryLocation before casting to it, and report CS1510 otherwise.
904
905         This fixes #70402.
906
907 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
908
909         * statement.cs (Block.ThisVariable): remove the recursion here, to
910         make the --profile more sane.
911
912 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
913
914         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
915         assembly, by JB Evain.
916
917 2004-12-17  Raja R Harinath  <rharinath@novell.com>
918
919         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
920           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
921         "parent" refers to enclosing type/class.  "base" refers to superclass.
922
923 2004-12-17  Raja R Harinath  <rharinath@novell.com>
924
925         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
926         Ensure that we only have GlobalAttributes.
927         * attribute.cs (Attribute.Emit): Make non-virtual.
928         (GlobalAttribute.Emit): Remove.
929         (Attribute.Resolve): Make virtual.
930         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
931         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
932         the argument. Don't create one.
933         (Attribute.GetObsoleteAttribute): Likewise.
934         (Attribute.GetClsCompliantAttributeValue): Likewise.
935         * class.cs, decl.cs: Update to changes.
936
937 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
938
939         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
940         
941         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
942         
943         * statement.cs (Foreach.Resolve): Add error 186 report.
944
945 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
946
947         * expression.cs (Conditional.DoResolve): Add warning 429.
948         
949         * statement.cs (If.Resolve): Add warning 665.
950
951 2004-12-16  Raja R Harinath  <rharinath@novell.com>
952
953         New invariant: RootContext.Tree.Types.NamespaceEntry == null
954         except when in the parser, and in GlobalAttribute.
955         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
956         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
957         RootContext.Tree.Types.NamespaceEntry once work is done.
958         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
959         and resets RootContext.Tree.Types.NamespaceEntry.
960
961 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
962
963         * cs-parser.jay: Don't create a block for every variable.
964
965 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
966
967         * location.cs: Provide extra information.
968
969         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
970         variables from the captured environment, it is the ldarg_0.
971
972 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
973
974         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
975         find a conclusion.
976         
977         * class.cs: Changed warning level for 169 to avoid developer
978         displeasure from warning flooding. It will be changed back when they
979         fix most of current BCL warnings.
980         
981         * RootContext.cs: Pushed default WarningLevel to 3.
982         
983         * statement.cs: Removed unused variable.
984
985 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
986
987         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
988         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
989         Add error 502 report.
990         (StaticClass.DefineType): Add error 441 report.
991         (Class.AllowedModifiersProp): New virtual property as temporary
992         extension to AllowedModifiers.
993         (Class.DefineType): Add error 418 report. Moved ModFlags check here
994         to share implementation with StaticClass and don't call virtual
995         methods from ctor.
996         
997         * driver.cs (MainDriver): Add error 1558 test.
998
999         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1000         report. Moved error 36 test here.
1001
1002         * statement.cs (Throw.Resolve): Add error 724 report.
1003
1004         * typemanager.cs: Add out_attribute_type core type.
1005         
1006 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
1007
1008         * class.cs (TypeContainer.VerifyClsCompliance): Add error
1009         3018 report.
1010         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1011
1012         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1013         3017 report.
1014         
1015         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1016
1017         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
1018         Add error 3023 report.
1019         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1020
1021         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1022         implementation.
1023
1024 2004-12-12  John Luke  <john.luke@gmail.com>
1025
1026         * driver.cs (AddArgs): take -- into account when
1027         adding arguments, fixes bug 65710 
1028
1029 2004-12-12  Martin Baulig  <martin@ximian.com>
1030
1031         * expression.cs (Unary.TryReduceNegative): Added support for
1032         SByteConstant and ByteConstant.
1033         (Unary.Reduce): Check error values from TryReduceNegative().
1034
1035 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1036
1037         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1038         and report exception as error 182.
1039
1040 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1041
1042         * driver.cs (Main): Fix message when there are warnings.
1043
1044 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1045
1046         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1047
1048 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1049
1050         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1051         Reduced number of warnings.
1052         
1053         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1054
1055 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1056
1057         * driver.cs: Removed message.
1058
1059         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1060
1061 2004-12-08    <vargaz@freemail.hu>
1062
1063         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1064
1065 2004-12-08  Martin Baulig  <martin@ximian.com>
1066
1067         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1068         instead of a CS3002 for properties and indexer.
1069
1070 2004-12-08  Martin Baulig  <martin@ximian.com>
1071
1072         * decl.cs (MemberName.ToString): Make this work again.
1073
1074 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * attribute.cs (Resolve): Add error 591 detection.
1077
1078         * class.cs (FieldMember.Define): Add error 1547 detection.
1079         (Indexer.Define): Add error 620 detection.
1080         (Operator.Define): Add error 590 detection.
1081
1082         * ecore.cs: Missing argument for error 79.
1083
1084         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1085         detection.
1086
1087 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1088
1089         Fix #70106
1090         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1091         only.
1092
1093 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1094
1095         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1096           Some operator comments were suppressed.
1097         * doc.cs : Implicit/explicit operator name in doc comments are like
1098           "op_Explicit(type)~returnType", so added suffix handling.
1099
1100 2005-01-21  Alp Toker  <alp@atoker.com>
1101
1102         * cs-parser.jay: destructor_declaration's container is PartialContainer
1103         not Class when partial types are used, so use Kind prop instead of 'is'.
1104
1105 2004-12-12  Martin Baulig  <martin@ximian.com>
1106
1107         * expression.cs (Unary.TryReduceNegative): Added support for
1108         SByteConstant and ByteConstant.
1109         (Unary.Reduce): Check error values from TryReduceNegative().
1110
1111 2004-12-11  Martin Baulig  <martin@ximian.com>
1112
1113         * support.cs (ReflectionParameters.ParameterName): If we have a
1114         `gpd', call `ParameterName' on it.
1115
1116         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1117
1118         * pending.cs (PendingImplementation.DefineProxy): Call
1119         DefineParameter() for all of the MethodBuilder's arguments.
1120
1121 2004-12-09  Martin Baulig  <martin@ximian.com>
1122
1123         * doc.cs (DocUtil): Make this a static class.
1124
1125 2004-12-09  Martin Baulig  <martin@ximian.com>
1126
1127         * expression.cs (Invocation.InferType): Moved the type inference
1128         implementation into TypeManager.
1129
1130         * generics.cs (TypeManager): Moved the type inference
1131         implementation here.
1132
1133 2004-12-09  Martin Baulig  <martin@ximian.com>
1134
1135         * typemanager.cs (TypeManager): Make this a partial class.
1136
1137         * generics.cs
1138         (TypeManager): Move the generics part of `TypeManager' here.
1139
1140 2004-12-08  Martin Baulig  <martin@ximian.com>
1141
1142         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1143         instead of a CS3002 for properties and indexer.  Added CS3024
1144         check for generic interfaces.
1145
1146         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1147         instances are not CLS-compliant.
1148
1149 2004-12-08  Martin Baulig  <martin@ximian.com>
1150
1151         * cs-parser.jay
1152         (void_pointer_expression): New rule for `void*', `void**' etc.
1153         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1154
1155 2004-12-08  Martin Baulig  <martin@ximian.com>
1156
1157         * expression.cs (Invocation.InferType): Removed the hack for
1158         MethodCore.MayUnify().  
1159
1160         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1161         this actually work.
1162
1163         * class.cs (MethodCore.MayUnify): Use
1164         TypeManager.MayBecomeEqualGenericTypes().       
1165
1166 2004-12-08  Martin Baulig  <martin@ximian.com>
1167
1168         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1169         parameter, box it.  Fixes #69233.
1170
1171 2004-12-08  Martin Baulig  <martin@ximian.com>
1172
1173         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1174         have the ctor constraint.  Fixes #68326.
1175
1176 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1177
1178         * cs-parser.jay : interface comment was not consumed because of
1179           extra opt_semicolon before doc handling.
1180
1181 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1182
1183         Fix test-327.cs, test-328.cs, and put in early infrastructure
1184         for eventually fixing #52697.
1185         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1186         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1187         from other methods.
1188         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1189         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1190         (VerifyUsing, error246): Update.
1191         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1192         'NamespaceEntry.LookupNamespaceOrType'.
1193
1194 2004-12-07  Martin Baulig  <martin@ximian.com>
1195
1196         * driver.cs: Call it "BETA SOFTWARE" :-)
1197
1198 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1199
1200         Fix crash on cs0657-17.cs.
1201         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1202         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1203         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1204         the case where the NamespaceEntry gets overwritten.
1205
1206 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1207
1208         Fixed #69195, #56821
1209         * ecore.cs (ResolveBoolean): Tiny refactoring.
1210
1211         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1212         of right expression resolving when left is false constant and
1213         operator is LogicalAnd OR true constant and operator is LogicalOr.
1214
1215         * statement.cs (ResolveUnreachable): Always reports warning.
1216
1217 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1218
1219         * class.cs: Distinguish between 1721 and 1722 (just a little help
1220         for the programmer).
1221
1222 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1223
1224         * delegate.cs: Only allow this on new versions of the language. 
1225
1226 2004-12-02  Duncan Mak  <duncan@ximian.com>
1227
1228         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1229         Expression class.
1230         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1231         here as a static method. Take an additional bool out parameter
1232         `must_do_cs1540_check' for signaling to InstanceResolve.
1233         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1234         member field from PropertyExpr class and made it an argument of
1235         the method instead.
1236         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1237         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1238         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1239         and `remove_accessor' as well as InstanceResolve: report CS0122
1240         where applicable.
1241
1242         Fixes #70129.
1243
1244 2004-12-07  Martin Baulig  <martin@ximian.com>
1245
1246         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1247         and CS0692 where appropriate.
1248
1249 2004-12-06  Martin Baulig  <martin@ximian.com>
1250
1251         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1252         IsDuplicateImplementation() and improved it.
1253
1254         * expression.cs (Invocation.InferTypeArguments): Added
1255         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1256         and removed the "ref" modifier from `infered_types'.
1257
1258         * decl.cs (MemberName.ToString): Removed the exception.
1259
1260 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1261
1262         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1263           comments are allowed.
1264
1265 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1266
1267         * delegate.cs: Add checks for subtypes in paramaters and return values
1268         in VerifyMethod () to add support for Covariance/Contravariance
1269         in delegates.
1270         
1271 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1272
1273         * report.cs: Remove extra closing parenthesis.
1274
1275         * convert.cs (Error_CannotImplicitConversion): If the name of the
1276         types are the same, provide some extra information.
1277
1278 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1279
1280         Fix bug #70102
1281         * attribute.cs (Resolve): Improved implementation of params
1282         attribute arguments.
1283
1284         * support.cs (ParameterData): Add HasParams to be faster.
1285
1286 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1287
1288         all things are for /doc support:
1289
1290         * doc.cs: new file that supports XML documentation generation.
1291         * mcs.exe.sources: added doc.cs.
1292         * driver.cs:
1293           Handle /doc command line option.
1294           Report error 2006 instead of 5 for missing file name for /doc.
1295           Generate XML documentation when required, after type resolution.
1296         * cs-tokenizer.cs:
1297           Added support for picking up documentation (/// and /** ... */),
1298           including a new XmlCommentState enumeration.
1299         * cs-parser.jay:
1300           Added lines to fill Documentation element for field, constant,
1301           property, indexer, method, constructor, destructor, operator, event
1302           and class, struct, interface, delegate, enum.
1303           Added lines to warn incorrect comment.
1304         * rootcontext.cs :
1305           Added Documentation field (passed only when /doc was specified).
1306         * decl.cs:
1307           Added DocComment, DocCommentHeader, GenerateDocComment() and
1308           OnGenerateDocComment() and some supporting private members for
1309           /doc feature to MemberCore.
1310         * class.cs:
1311           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1312         * delegate.cs:
1313           Added overriden DocCommentHeader.
1314         * enum.cs:
1315           Added overriden DocCommentHeader and GenerateDocComment().
1316
1317 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1318
1319         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1320         unwrapping the enumeration values, chain to
1321         DoConstantNumericPromotions again, so we can promote things to the
1322         fundamental types (takes care of enums that are bytes, sbytes).
1323
1324         Fixes bug #62054.
1325
1326 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1327
1328         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1329         Fix long-standing bug in type-lookup.  Use FindType instead of
1330         LookupType when ec.ResolvingTypeTree.
1331         (Attribute.ResolveType, Attribute.Resolve)
1332         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1333         Update to changes.
1334         (Attributes.Search): Remove internal version.  Update.
1335         (Attributes.SearchMulti): Update.
1336         (Attributes.GetClsCompliantAttribute): Remove.
1337         (Attributes.GetIndexerNameAttribute): Remove.
1338         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1339         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1340         * class.cs (Indexer.Define): Likewise.
1341
1342 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1343
1344         Fix bug #68790
1345         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1346         MarshallByReference members access.
1347
1348         * expression.cs: Use CheckMarshallByRefAccess;
1349         Better error CS0197 message.
1350
1351         * report.cs: Print whole related error message.
1352
1353 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1354
1355         * class (GetClassBases): Better error 60 report.
1356         (EventProperty): Disabled warning 67 detection.
1357
1358 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1359
1360         Fix bug #60324
1361         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1362
1363         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1364         precise values.
1365
1366 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1367
1368         Fix bug #49488
1369         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1370
1371         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1372
1373 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1374
1375         * attribute.cs (Attribute.Resolve): Refine error reporting and
1376         report a cs0117 if the identifier does not exist, to distinguish
1377         from 0617 which is a miss-use of the actual identifier.
1378
1379         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1380         between cs0070 and cs0079.
1381
1382         * class.cs (MemberBase.DoDefine): When reporting a wrong
1383         accessibility level, we use MethodCore to compare instead of
1384         Method (this was a regression in some refactoring effort).
1385
1386         So now we correctly report cs0056 again.
1387
1388         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1389         testing the target_type (which was known to be object_type) and
1390         not the source type (which is anonymous_method).
1391
1392         Fixed reporting of error cs1660.
1393
1394         * expression.cs (UserCast.Source): Expose the underlying cast.
1395
1396         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1397         allowed types to find a match to int32 first (most common).
1398
1399         In addition, it ignores any ImplicitUserConversions that did an
1400         internal implicit conversion (as the switch statement allows only
1401         one integral conversion to exist).
1402
1403         * class.cs (PartialContainer.Create): rename `name' to
1404         `member_name' for clarity.  Then replace the string calls with a
1405         call to MemberName.GetPartialName, as now using
1406         MemberName.ToString is an error (this is due to the side effects
1407         it had, that were fixed in the past).
1408
1409         This will restore the error reporting on a number of partial class
1410         errors that were missusing this (and getting an exception as a
1411         results, which is now just a plain textual warning, because
1412         yyparse debug output would crash otherwise).
1413
1414 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1415
1416         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1417
1418 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1419
1420         * rootcontext.cs (LookupType): Make sure to cache lookups that
1421         don't give us a negative result. This saves about 5% of corlib
1422         compilation time.
1423
1424 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1425
1426         * report.cs (AbstractMessage.Print): messages are sent to stderr
1427
1428         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1429         non-interface in the list of interfaces (at this point, either
1430         parent was properly set, or a base class is being listed in the
1431         interfaces section).
1432
1433         This flags error 1722, and resolves the crash from bug 69259.
1434
1435 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1436
1437         * statement.cs (Using.EmitExpressionFinally): make this work right
1438         for valuetypes. Fixes 69926.
1439
1440 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1441
1442         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1443         converted to an enum" here, before we try to change the underlying
1444         type.  This code exists, but it is a different code path than the
1445         one used while encoding constants.
1446
1447         (ImplicitReferenceConversionExists): In addition, resynchronized
1448         the code here, so it matches the same code in
1449         ImplicitReferenceConversionExists for the `from any class-type S
1450         to any interface-type T'.       
1451
1452 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1453
1454         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1455
1456 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1457
1458         * cs-parser.jay: Use verbosity accordingly. 
1459
1460 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1461
1462         * expression.cs (Unary.ResolveOperator): Do not report warning;
1463         AddressOf reads from variable.
1464         
1465         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1466
1467 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1468
1469         Fix bug #69462
1470
1471         * attribute.cs (Attributable): Removed CheckTargets.
1472         (Attributes.Emit): Explicit attribute targets are tested here.
1473
1474         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1475         not enabled for interfaces.
1476
1477         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1478         (GetAssemblyName): Ouch next bug there.
1479
1480 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1481
1482         * expression.cs: Error 275 added.
1483         
1484 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1485
1486         Fix bug #69177 (Implemented decimal constant support)
1487
1488         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1489         (BinaryFold): Add DecimalConstant.
1490
1491         * const.cs (Define): Decimal constant 
1492         (is not constant.
1493         (ChangeType): Add decimal type handling.
1494         (LookupConstantValue): Don't set value for decimal type but
1495         emit DecimalConstantAttribute. Needed for constant optimization.
1496
1497         * constant.cs (ToDecimal): New method.
1498         (ConvertToDecimal): New method.
1499         (IntConstant): Implemented ConvertToDecimal.
1500         (DecimalConstant.Emit): Emit optimized version for decimals in
1501         int range.
1502
1503         * expression.cs (ResolveOperator): Changed order of constant
1504         reduction to work correctly with native types which have
1505         overloaded operators.
1506         (ResolveMemberAccess): Extract constant value from attribute
1507         for decimal type.
1508
1509         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1510
1511         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1512         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1513         (ChangeType): Decimal is special.
1514         (TypeToCoreType): Add decimal type.
1515
1516 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1517
1518         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1519         decimal types.
1520
1521 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1522
1523         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1524         test cs1667-5.cs.
1525
1526 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1527
1528         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1529
1530         * pending.cs (PendingImplementation): Grab only interfaces.
1531
1532 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1533
1534         * statement.cs (ForeachHelperMethods): Add location member and
1535         error 202 detection.
1536
1537 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1538
1539         * expression.cs (DoResolveBase): Fixed wrong warning for out
1540         variables.
1541
1542 2004-12-04  Martin Baulig  <martin@ximian.com>
1543
1544         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1545         to check whether the conversion is ok.
1546
1547         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1548         `Type.EmptyTypes' if we're not a generic TypeContainer.
1549
1550 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1551
1552         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1553         old bug: when converting from the null literal to a pointer,
1554         return an EmptyCast, not the NullLiteral.
1555
1556         This fixes #69921, the recent null_type changes probably made this
1557         bug more prominent.
1558
1559 2004-12-03  Martin Baulig  <martin@ximian.com>
1560
1561         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1562         method as our child, call AnonymousMethod.Compatible() on it.
1563
1564 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1565
1566         * class.cs (FieldBase): Use an unused bit field from the field to
1567         encode the `has_offset' property from the FieldMember.  This saves
1568         a couple of Ks on bootstrap compilation.
1569
1570         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1571         method as our child, return the AnonymousMethod resolved
1572         expression.
1573
1574         * expression.cs (New.DoResolve): Allow return values from
1575         NewDelegate to also include AnonymousMethods.
1576
1577         Fixes #70150.
1578
1579 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1580
1581         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1582         cs1648 report.
1583         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1584         System.Runtime.InteropServices._Exception, since it's a base
1585         interface of the core type System.Exception in the net_2_0 profile.
1586
1587 2004-11-27  Martin Baulig  <martin@ximian.com>
1588
1589         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1590
1591 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1592
1593         * Makefile: Convert to use executable.make.
1594         * gmcs.exe.sources: New.
1595
1596 2004-11-25  Martin Baulig  <martin@ximian.com>
1597
1598         * expression.cs (Invocation.InferType): Added support for byref types.
1599
1600 2004-11-25  Martin Baulig  <martin@ximian.com>
1601
1602         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1603         in TypeManager.TypeToCoreType().
1604
1605 2004-11-25  Martin Baulig  <martin@ximian.com>
1606
1607         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1608         "Dispose" method from the `current_type'.
1609         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1610         DoDefineMembers() instead of using the MethodBuilder; this is
1611         required for generic iterators.
1612
1613         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1614
1615 2004-11-24  Martin Baulig  <martin@ximian.com>
1616
1617         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1618
1619 2004-11-20  Martin Baulig  <martin@ximian.com>
1620
1621         * expression.cs (Invocation.InferType): Correctly infer generic
1622         instances; see gen-103.cs.
1623         (Invocation.InferTypeArguments): If a generic method doesn't have
1624         any unbound type parameters, we don't need to infer anything.
1625
1626 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1627
1628         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1629
1630 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1631
1632         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1633         (TypeHandle.GetMemberCache): New.
1634         (TypeHandle.TypeHandle): Update.
1635         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1636         (TypeManager.LookupParentInterfacesCache):
1637         Rename from LookupInterfaceCache.  Optimize slightly.
1638         (TypeManager.MemberLookup_FindMembers): Update.
1639         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1640         multi-type variant.
1641         (AddCacheContents): Rename from AddHashtable.
1642         * class.cs (TypeContainer.parent_container): Remove.
1643         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1644         (TypeContainer.DoDefineMembers): Don't initialize it.
1645         Update to name changes.
1646         
1647 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1648
1649         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1650         that factors the code to check access modifiers on override.  
1651
1652         (PropertyBase): Use the code here.
1653
1654         Patch from Lluis S'anchez, fixes bug #69361.
1655
1656 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1657
1658         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1659         routine that is used to report the use of a captured variable
1660         whose address has been taken.
1661
1662         There are two checks: one when variables are being captured and
1663         the other check is when the address of a variable is taken. 
1664         
1665         (because an anonymous methods might be resolved before *or* after
1666         the address has been taken) and 
1667
1668         * expression.cs (Conditional.DoResolve): Remove the special
1669         casing that Martin added to trueExpr and falseExpr being both
1670         NullLiteral.  We get the right behavior now just by introducing
1671         the null_type into the compiler. 
1672
1673         * convert.cs (ExplicitConversion): Change the code to use
1674         null_type instead of testing `expr is NullLiteral'.
1675         (ImplicitConversionStandard): use null_type too.
1676         (ImplicitReferenceConversionExists): use null_type too.
1677         (ImplicitReferenceConversion): use null_type too.
1678
1679         * literal.cs: The type of `NullLiteral' is now null_type instead
1680         of object_type. 
1681         (Resolve): Set the type here.
1682
1683         * typemanager.cs: Introduce null_type.
1684
1685 2004-11-18  Martin Baulig  <martin@ximian.com>
1686
1687         * rootcontext.cs
1688         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1689
1690 2004-11-18  Martin Baulig  <martin@ximian.com>
1691
1692         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1693
1694 2004-11-18  Martin Baulig  <martin@ximian.com>
1695
1696         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1697         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1698         call ResolveConstructedType() on it to resolve it without checking
1699         constraints.
1700         (Constraints.ResolveTypes): Check them here.
1701         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1702         but don't check constraints.
1703         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1704         check constraints here.
1705         (ConstructedType.ResolveConstructedType): New public method.  This
1706         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1707         resolve ourselves without checking constraints.
1708
1709         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1710
1711 2004-11-18  Martin Baulig  <martin@ximian.com>
1712
1713         * decl.cs
1714         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1715
1716         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1717
1718 2004-11-18  Martin Baulig  <martin@ximian.com>
1719
1720         * ecore.cs (TypeExpr.ResolveType): Removed.
1721         (Expression.ResolveAsTypeTerminal): We always return a fully
1722         resolved `TypeExpr', so we can just access its `Type'.
1723
1724         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1725
1726 2004-11-17  Martin Baulig  <martin@ximian.com>
1727
1728         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1729         sure we don't return any unresolved TypeExpr's.
1730         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1731         a `TypeExpr'.
1732         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1733
1734         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1735         unresolved `ConstructedType's.
1736
1737 2004-11-17  Martin Baulig  <martin@ximian.com>
1738
1739         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1740
1741 2004-11-17  Martin Baulig  <martin@ximian.com>
1742
1743         * ecore.cs
1744         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1745
1746         * decl.cs (DeclSpace.ResolveType): Removed.
1747         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1748
1749 2004-11-17  Martin Baulig  <martin@ximian.com>
1750
1751         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1752         direction, like FindMembers() does.  Fixes #69546, testcase is in
1753         test-315.cs.    
1754
1755 2004-11-16  Martin Baulig  <martin@ximian.com>
1756
1757         This is based on a patch from Marek Safar, see bug #69082.
1758         Fixes bugs #63705 and #67130.
1759
1760         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1761         method; create a MemberCache for an interface type and cache the
1762         result.
1763
1764         * decl.cs (IMemberContainer.ParentContainer): Removed.
1765         (IMemberContainer.ParentCache): New property.
1766         (MemberCache.SetupCacheForInterface): Removed.
1767         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1768         to create a cache for an interface's "parent".
1769
1770         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1771         interfaces too.
1772
1773 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1774
1775         * statement.cs: Avoid adding bools to a hashtable.
1776
1777 2004-11-15  Martin Baulig  <martin@ximian.com>
1778
1779         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1780
1781 2004-11-11  Martin Baulig  <martin@ximian.com>
1782
1783         * typemanager.cs (TypeManager.GetMethodName): New method.
1784
1785         * class.cs (MethodData.Define): Include the generic arity in the
1786         name of an explicit interface; also add it to the method name.
1787
1788         * pending.cs (PendingImplementation.InterfaceMethod): The method
1789         name now includes the generic arity.
1790
1791 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1792
1793         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1794         calling an unsafe method from a safe location.
1795
1796 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1797
1798         Fix #69167
1799         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1800
1801 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1802
1803         * namespace.cs (VerifyUsing): use GetPartialName instead of
1804         ToString. 
1805
1806 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1807
1808         * statement.cs (Return.Resolve): Fix regression in typo: if
1809         `in_exc', we have to request a NeedReturnLabel, this was a typo
1810         introduced in the anonymous method check-in.  Fixes #69131.
1811
1812         * Indexers were using the ShortName when defining themselves,
1813         causing a regression in the compiler bootstrap when applying the
1814         patch from 2004-11-02 (first part), now they use their full name
1815         and the bug is gone.
1816
1817 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1818
1819         * driver.cs: Strip the path from the names of embedded resources. Fixes
1820         #68519.
1821
1822 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1823
1824         Fix error message regression: cs0104-2.cs.
1825         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1826         (AliasEntry.Resolve): Update.
1827         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1828         'silent' flag.
1829         (RootContext.LookupType): Update.
1830
1831 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1832
1833         * cs-parser.jay: Add support for handling accessor modifiers
1834         * class: Add support port accessor modifiers and error checking,
1835         define PropertyMethod.Define as virtual (not abstract anymore)
1836         * ecore.cs: Add checking for proeprties access with access modifiers
1837         * iterators.cs: Modify Accessor constructor call based in the modified
1838         constructor
1839 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1840
1841         * expression.cs (StringConcat): Handle being called twice,
1842         as when we have a concat in a field init with more than two
1843         ctors in the class
1844
1845 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1846
1847         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1848         special case explicit implementations, we should always produce
1849         the .property or .event declaration.
1850         
1851         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1852         since it will not return correct data if people use this
1853         unresolved in the presence of using statements (see test-313).
1854
1855         * class.cs (MethodData.Define): If we are an explicit interface
1856         implementation, set the method name to the full name of the
1857         interface plus the name of the method.  
1858
1859         Notice that using the method.MethodName.GetFullName() does not
1860         work, as it will only contain the name as declared on the source
1861         file (it can be a shorthand in the presence of using statements)
1862         and not the fully qualifed type name, for example:
1863
1864         using System;
1865
1866         class D : ICloneable {
1867                 object ICloneable.Clone ()  {
1868                 }
1869         }
1870
1871         Would produce a method called `ICloneable.Clone' instead of
1872         `System.ICloneable.Clone'.
1873
1874         * namespace.cs (Alias.Resolve): Use GetPartialName.
1875         
1876 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1877
1878         * cs-parser.jay: Add error 1055 report.
1879
1880 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1881
1882         * assign.cs (Assign.DoResolve): Only do the transform of
1883         assignment into a New if the types are compatible, if not, fall
1884         through and let the implicit code deal with the errors and with
1885         the necessary conversions. 
1886
1887 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1888
1889         * cs-parser.jay: Add error 1031 report.
1890
1891         * cs-tokenizer.cs: Add location for error 1038.
1892
1893 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1894
1895         * cs-parser.jay: Add error 1016 report.
1896
1897 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1898
1899         * cs-parser.jay: Add errors 1575,1611 report.
1900
1901 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1902
1903         * cs-parser.jay: Add error 1001 report.
1904
1905 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1906
1907         Fix #68850
1908         * attribute.cs (GetMarshal): Add method argument for
1909         caller identification.
1910
1911         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1912         agument for GetMarshal and RuntimeMissingSupport.
1913
1914 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1915
1916         * attribute.cs (ExtractSecurityPermissionSet): Removed
1917         TypeManager.code_access_permission_type.
1918
1919         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1920
1921 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1922
1923         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1924         for obsolete use of a variable here.   Fixes regression on errors
1925         cs0619-25 and cs0619-26.
1926
1927 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1928
1929         Fix #62358, implemented security attribute encoding.
1930
1931         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1932         Tests permitted SecurityAction for assembly or other types.
1933         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1934         data from SecurityPermissionAttribute to PermisionSet class.
1935
1936         * class.cs (ApplyAttributeBuilder): Added special handling
1937         for System.Security.Permissions.SecurityAttribute based types.
1938
1939         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1940         special handling for System.Security.Permissions.SecurityAttribute
1941         based types.
1942
1943         * enum.cs (ApplyAttributeBuilder): Added special handling
1944         for System.Security.Permissions.SecurityAttribute based types.
1945
1946         * parameter.cs (ApplyAttributeBuilder): Added special handling
1947         for System.Security.Permissions.SecurityAttribute based types.
1948
1949         * rootcontext.cs: Next 2 core types.
1950
1951         * typemanager.cs (TypeManager.security_permission_attr_type):
1952         Built in type for the SecurityPermission Attribute.
1953         (code_access_permission_type): Build in type.
1954
1955 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1956
1957         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1958         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1959         all of this information into
1960         EmitContext.EmitCapturedVariableInstance.
1961         
1962         * codegen.cs (EmitCapturedVariableInstance): move here the
1963         funcionality of emitting an ldarg.0 in the presence of a
1964         remapping.   This centralizes the instance emit code.
1965
1966         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1967         then emit a load of this: it means that we have reached the
1968         topmost ScopeInfo: the one that contains the pointer to the
1969         instance of the class hosting the anonymous method.
1970
1971         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1972         captures to the topmost CaptureContext.
1973
1974 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1975
1976         * expression.cs (LocalVariableReference): Move the knowledge about
1977         the iterators into codegen's EmitCapturedVariableInstance.
1978
1979 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1980
1981         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1982         all code paths return a value from an anonymous method (it is the
1983         same as the 161 error, but for anonymous methods).
1984
1985 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1986
1987         The introduction of anonymous methods in the compiler changed
1988         various ways of doing things in the compiler.  The most
1989         significant one is the hard split between the resolution phase
1990         and the emission phases of the compiler.
1991
1992         For instance, routines that referenced local variables no
1993         longer can safely create temporary variables during the
1994         resolution phase: they must do so from the emission phase,
1995         since the variable might have been "captured", hence access to
1996         it can not be done with the local-variable operations from the runtime.
1997         
1998         * statement.cs 
1999
2000         (Block.Flags): New flag `IsTopLevel' to indicate that this block
2001         is a toplevel block.
2002
2003         (ToplevelBlock): A new kind of Block, these are the blocks that
2004         are created by the parser for all toplevel method bodies.  These
2005         include methods, accessors and anonymous methods.
2006
2007         These contain some extra information not found in regular blocks:
2008         A pointer to an optional CaptureContext (for tracking captured
2009         local variables and parameters).  A pointer to the parent
2010         ToplevelBlock.
2011         
2012         (Return.Resolve): Catch missmatches when returning a value from an
2013         anonymous method (error 1662).
2014         Invoke NeedReturnLabel from the Resolve phase instead of the emit
2015         phase.
2016
2017         (Break.Resolve): ditto.
2018
2019         (SwitchLabel): instead of defining the labels during the
2020         resolution phase, we now turned the public ILLabel and ILLabelCode
2021         labels into methods called GetILLabelCode() and GetILLabel() that
2022         only define the label during the Emit phase.
2023
2024         (GotoCase): Track the SwitchLabel instead of the computed label
2025         (its contained therein).  Emit the code by using
2026         SwitchLabel.GetILLabelCode ().
2027
2028         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2029         whether the Local has been captured or not.
2030
2031         (LocalInfo.IsCaptured): New property, used to tell whether the
2032         local has been captured.
2033         
2034         * anonymous.cs: Vastly updated to contain the anonymous method
2035         support.
2036
2037         The main classes here are: CaptureContext which tracks any
2038         captured information for a toplevel block and ScopeInfo used to
2039         track the activation frames for various local variables.   
2040
2041         Each toplevel block has an optional capture context associated
2042         with it.  When a method contains an anonymous method both the
2043         toplevel method and the anonymous method will create a capture
2044         context.   When variables or parameters are captured, they are
2045         recorded on the CaptureContext that owns them, for example:
2046
2047         void Demo () {
2048              int a;
2049              MyDelegate d = delegate {
2050                  a = 1;
2051              }
2052         }
2053
2054         Here `a' will be recorded as captured on the toplevel
2055         CapturedContext, the inner captured context will not have anything
2056         (it will only have data if local variables or parameters from it
2057         are captured in a nested anonymous method.
2058
2059         The ScopeInfo is used to track the activation frames for local
2060         variables, for example:
2061
2062         for (int i = 0; i < 10; i++)
2063                 for (int j = 0; j < 10; j++){
2064                    MyDelegate d = delegate {
2065                         call (i, j);
2066                    }
2067                 }
2068
2069         At runtime this captures a single captured variable `i', but it
2070         captures 10 different versions of the variable `j'.  The variable
2071         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2072         recorded on a child.  
2073
2074         The toplevel ScopeInfo will also track information like the `this'
2075         pointer if instance variables were referenced (this is necessary
2076         as the anonymous method lives inside a nested class in the host
2077         type of the method). 
2078
2079         (AnonymousMethod): Expanded to track the Toplevel, implement
2080         `AnonymousMethod.Compatible' to tell whether an anonymous method
2081         can be converted to a target delegate type. 
2082
2083         The routine now also produces the anonymous method content
2084
2085         (AnonymousDelegate): A helper class that derives from
2086         DelegateCreation, this is used to generate the code necessary to
2087         produce the delegate for the anonymous method that was created. 
2088
2089         * assign.cs: API adjustments for new changes in
2090         Convert.ImplicitStandardConversionExists.
2091
2092         * class.cs: Adjustments to cope with the fact that now toplevel
2093         blocks are of type `ToplevelBlock'. 
2094
2095         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2096         insteda of standard blocks.
2097
2098         Flag errors if params arguments are passed to anonymous methods.
2099
2100         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2101         `CurrentAnonymousMethod' which points to the current Anonymous
2102         Method.  The variable points to the AnonymousMethod class that
2103         holds the code being compiled.  It is set in the new EmitContext
2104         created for the anonymous method.
2105
2106         (EmitContext.Phase): Introduce a variable and an enumeration to
2107         assist in enforcing some rules about when and where we are allowed
2108         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2109         only one that enfonces this right now).
2110
2111         (EmitContext.HaveCaptureInfo): new helper method that returns
2112         whether we have a CapturedContext initialized.
2113
2114         (EmitContext.CaptureVariable): New method used to register that a
2115         LocalInfo must be flagged for capturing. 
2116
2117         (EmitContext.CapturedParameter): New method used to register that a
2118         parameters must be flagged for capturing. 
2119         
2120         (EmitContext.CapturedField): New method used to register that a
2121         field must be flagged for capturing. 
2122
2123         (EmitContext.HaveCapturedVariables,
2124         EmitContext.HaveCapturedFields): Return whether there are captured
2125         variables or fields. 
2126
2127         (EmitContext.EmitMethodHostInstance): This is used to emit the
2128         instance for the anonymous method.  The instance might be null
2129         (static methods), this (for anonymous methods that capture nothing
2130         and happen to live side-by-side with the current method body) or a
2131         more complicated expression if the method has a CaptureContext.
2132
2133         (EmitContext.EmitTopBlock): Routine that drives the emission of
2134         code: it will first resolve the top block, then emit any metadata
2135         and then emit the code.  The split is done so that we can extract
2136         any anonymous methods and flag any captured variables/parameters.
2137         
2138         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2139         during this phase, the ILGenerator should not be used as labels
2140         and local variables declared here might not be accessible to any
2141         code that is part of an anonymous method.  
2142
2143         Exceptions to this include the temporary variables that are
2144         created by some statements internally for holding temporary
2145         variables. 
2146         
2147         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2148         metadata for a cb
2149
2150         (EmitContext.TemporaryReturn): This method is typically called
2151         from the Emit phase, and its the only place where we allow the
2152         ReturnLabel to be defined other than the EmitMeta.  The reason is
2153         that otherwise we would have to duplicate a lot of logic in the
2154         Resolve phases of various methods that today is on the Emit
2155         phase. 
2156
2157         (EmitContext.NeedReturnLabel): This no longer creates the label,
2158         as the ILGenerator is not valid during the resolve phase.
2159
2160         (EmitContext.EmitThis): Extended the knowledge in this class to
2161         work in anonymous methods in addition to iterators. 
2162
2163         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2164         code is necessary on the stack to access the instance to a local
2165         variable (the variable will be accessed as a field).
2166
2167         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2168         EmitContext.EmitAddressOfParameter): Routines to support
2169         parameters (not completed at this point). 
2170         
2171         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2172         will also remove the parameters.
2173
2174         * convert.cs (Convert): Define a `ConstantEC' which points to a
2175         null.  This is just to prefity some code that uses
2176         ImplicitStandardConversion code and do not have an EmitContext
2177         handy.
2178
2179         The idea is to flag explicitly that at that point in time, it is
2180         known that the conversion will not trigger the delegate checking
2181         code in implicit conversions (which requires a valid
2182         EmitContext). 
2183
2184         Everywhere: pass new EmitContext parameter since
2185         ImplicitStandardConversionExists now requires it to check for
2186         anonymous method conversions. 
2187
2188         (Convert.ImplicitStandardConversionExists): If the type of an
2189         expression is the anonymous_method_type, and the type is a
2190         delegate, we invoke the AnonymousMethod.Compatible method to check
2191         whether an implicit conversion is possible. 
2192
2193         (Convert.ImplicitConversionStandard): Only do implicit method
2194         group conversions if the language level is not ISO_1.
2195
2196         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2197         MethodInfo for the Invoke method.  used by Delegate and
2198         AnonymousDelegate.
2199
2200         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2201         method conversions if the target type is a delegate.
2202
2203         Removed extra debugging nops.
2204
2205         (LocalVariableReference): Turn the `local_info' into a public
2206         field. 
2207
2208         Add `prepared' field, the same hack used for FieldExprs to cope
2209         with composed assignments, as Local variables do not necessarily
2210         operate purely on the stack as they used to: they can be captured
2211         fields. 
2212
2213         Add `temp' for a temporary result, like fields.
2214
2215         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2216
2217         It now copes with Local variables that are captured and emits the
2218         proper instance variable to load it from a field in the captured
2219         case. 
2220
2221         (ParameterReference.DoResolveBase): During the resolve phase,
2222         capture parameters if we are in an anonymous method.
2223
2224         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2225         anonymous method, use the EmitContext helper routines to emit the
2226         parameter reference.
2227
2228         * iterators.cs: Set RemapToProxy to true/false during the
2229         EmitDispose class.
2230
2231         * parameters.cs (GetParameterByName): New helper method. 
2232
2233         * typemanager.cs (anonymous_method_type) a new type that
2234         represents an anonyous method.  This is always an internal type,
2235         used as a fencepost to test against the anonymous-methodness of an
2236         expression. 
2237         
2238 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2239
2240         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2241         561 report.
2242         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2243
2244 2004-11-10  Martin Baulig  <martin@ximian.com>
2245
2246         * expression.cs (Invocation.BetterFunction): If two methods have
2247         equal parameter types, but only one of them is generic, the
2248         non-generic one wins.
2249         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2250         instance; just use `Type.IsValueType' to determine whether
2251         something is a struct or not.
2252         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2253         so we can be called multiple times.
2254
2255 2004-11-10  Martin Baulig  <martin@ximian.com>
2256
2257         * generic.cs (TypeParameter.DefineConstraints): New public method.
2258         (TypeParameter.CheckAccessLevel): Override this and return true.
2259         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2260         override ResolveType() anymore.
2261         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2262
2263 2004-11-10  Martin Baulig  <martin@ximian.com>
2264
2265         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2266         call DeclSpace.ResolveNestedType() on it.
2267
2268 2004-11-10  Martin Baulig  <martin@ximian.com>
2269
2270         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2271         non-null, call ParameterModifier() on it.
2272
2273 2004-11-10  Martin Baulig  <martin@ximian.com>
2274
2275         * iterators.cs
2276         (Iterators): Added `current_type' and `this_type' fields.
2277         (Iterators.DefineIterator): Create a new EmitContext and store it
2278         in `ec'; compute `this_type'.
2279
2280 2004-11-10  Martin Baulig  <martin@ximian.com>
2281
2282         * typemanager.cs
2283         (TypeManager.IsPrivateAccessible): New public method.
2284         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2285
2286 2004-11-10  Martin Baulig  <martin@ximian.com>
2287
2288         * class.cs (TypeContainer.DefineType): Call
2289         TypeBuilder.DefineGenericParameters() before resolving the type
2290         parameters.
2291         (MethodData.parent_method): New protected field.
2292         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2293         (MethodData.Define): Compute `parent_method'.
2294
2295         * decl.cs
2296         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2297         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2298         (DeclSpace.ec): New protected field; store the EmitContext here.
2299         (DeclSpace.EmitContext): New public property.
2300         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2301         (DeclSpace.ResolveNestedType): New public method.
2302         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2303         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2304         (DeclSpace.FamilyAccessible): Likewise.
2305         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2306         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2307         EmitContext.
2308
2309         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2310         field.
2311
2312         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2313         (Enum.Emit): Don't create a new EmitContext.
2314
2315 2004-10-18  Martin Baulig  <martin@ximian.com>
2316
2317         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2318         `Type' directly, but call ResolveType() on it.
2319         (Catch.Resolve): Likewise.
2320         (Foreach.Resolve): Likewise.
2321
2322 2004-10-18  Martin Baulig  <martin@ximian.com>
2323
2324         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2325         `Type' directly, but call ResolveType() on it.
2326         (Probe.DoResolve): Likewise.
2327         (ArrayCreation.LookupType): Likewise.
2328         (TypeOf.DoResolve): Likewise.
2329         (SizeOf.DoResolve): Likewise.
2330
2331 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2332
2333         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2334         the ResolveType.
2335
2336 2004-10-17  John Luke  <john.luke@gmail.com>
2337
2338         * class.cs (Operator.GetSignatureForError): use CSharpName
2339
2340         * parameter.cs (Parameter.GetSignatureForError): Returns
2341         correct name even if was not defined.
2342
2343 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2344
2345         Fix #65816.
2346         * class.cs (TypeContainer.EmitContext): New property.
2347         (DefineNestedTypes): Create an emitcontext for each part.
2348         (MethodCore.DoDefineParameters): Use container's emitcontext.
2349         Pass type array to InternalParameters.
2350         (MemberBase.DoDefine): Use container's emitcontext.
2351         (FieldMember.Define): Likewise.
2352         (Event.Define): Likewise.
2353         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2354         Pass type array to InternalParameters.
2355         (SetIndexerMethod.GetParameterInfo): Likewise.
2356         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2357         * delegate.cs (Define): Pass emitcontext to
2358         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2359         array to InternalParameters.
2360         * expression.cs (ParameterReference.DoResolveBase): Pass
2361         emitcontext to GetParameterInfo.
2362         (ComposedCast.DoResolveAsTypeStep): Remove check on
2363         ec.ResolvingTypeTree.
2364         * parameter.cs (Parameter.Resolve): Change argument to
2365         EmitContext.  Use ResolveAsTypeTerminal.
2366         (Parameter.GetSignature): Change argument to EmitContext.
2367         (Parameters.ComputeSignature): Likewise.
2368         (Parameters.ComputeParameterTypes): Likewise.
2369         (Parameters.GetParameterInfo): Likewise.
2370         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2371         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2372         * support.cs (InternalParameters..ctor): Remove variant that takes
2373         a DeclSpace.
2374         * typemanager.cs (system_intptr_expr): New.
2375         (InitExpressionTypes): Initialize it.
2376
2377 2004-10-12  Chris Toshok  <toshok@ximian.com>
2378
2379         * cs-parser.jay: fix location for try_statement and catch_clause.
2380
2381 2004-10-18  Martin Baulig  <martin@ximian.com>
2382
2383         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2384         `Type' directly, but call ResolveType() on it.
2385         (MemberBase.DoDefine): Likewise.
2386
2387         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2388         `Type' directly, but call ResolveType() on it.
2389         (ComposedCast.DoResolveAsTypeStep): Likewise.
2390
2391         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2392         `Type' directly, but call ResolveType() on it.
2393
2394 2004-10-17  John Luke  <john.luke@gmail.com>
2395
2396         * class.cs (Operator.GetSignatureForError): use CSharpName
2397
2398         * parameter.cs (Parameter.GetSignatureForError): Returns
2399         correct name even if was not defined.
2400
2401 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2402
2403         Fix #65816.
2404         * class.cs (TypeContainer.EmitContext): New property.
2405         (DefineNestedTypes): Create an emitcontext for each part.
2406         (MethodCore.DoDefineParameters): Use container's emitcontext.
2407         Pass type array to InternalParameters.
2408         (MemberBase.DoDefine): Use container's emitcontext.
2409         (FieldMember.Define): Likewise.
2410         (Event.Define): Likewise.
2411         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2412         Pass type array to InternalParameters.
2413         (SetIndexerMethod.GetParameterInfo): Likewise.
2414         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2415         * delegate.cs (Define): Pass emitcontext to
2416         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2417         array to InternalParameters.
2418         * expression.cs (ParameterReference.DoResolveBase): Pass
2419         emitcontext to GetParameterInfo.
2420         (ComposedCast.DoResolveAsTypeStep): Remove check on
2421         ec.ResolvingTypeTree.
2422         * parameter.cs (Parameter.Resolve): Change argument to
2423         EmitContext.  Use ResolveAsTypeTerminal.
2424         (Parameter.GetSignature): Change argument to EmitContext.
2425         (Parameters.ComputeSignature): Likewise.
2426         (Parameters.ComputeParameterTypes): Likewise.
2427         (Parameters.GetParameterInfo): Likewise.
2428         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2429         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2430         * support.cs (InternalParameters..ctor): Remove variant that takes
2431         a DeclSpace.
2432         * typemanager.cs (system_intptr_expr): New.
2433         (InitExpressionTypes): Initialize it.
2434
2435 2004-10-12  Chris Toshok  <toshok@ximian.com>
2436
2437         * cs-parser.jay: fix location for try_statement and catch_clause.
2438
2439 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2440
2441         More DeclSpace.ResolveType avoidance.
2442         * decl.cs (MemberCore.InUnsafe): New property.
2443         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2444         with newly created EmitContext.
2445         (FieldMember.Define): Likewise.
2446         * delegate.cs (Delegate.Define): Likewise.
2447         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2448         only if normal name-lookup fails.
2449         (TypeExpr.DoResolve): Enable error-checking.
2450         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2451         (SizeOf.DoResolve): Likewise.
2452         (ComposedCast.DoResolveAsTypeStep): Likewise.
2453         (StackAlloc.DoResolve): Likewise.
2454         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2455         (Block.Unsafe): New property.
2456         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2457         (Unsafe): Set 'unsafe' flag of contained block.
2458         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2459         (Fixed.Resolve): Likewise.
2460         (Catch.Resolve): Likewise.
2461         (Using.ResolveLocalVariableDecls): Likewise.
2462         (Foreach.Resolve): Likewise.
2463
2464 2004-10-05  John Luke <john.luke@gmail.com>
2465
2466         * cs-parser.jay: add location to error CS0175
2467
2468 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2469
2470         * ecore.cs (Expression.Constantity): Add support for turning null
2471         into a constant.
2472
2473         * const.cs (Const.Define): Allow constants to be reference types
2474         as long as the value is Null.
2475
2476 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2477
2478         * namespace.cs (NamespaceEntry.Using): No matter which warning
2479         level is set, check if this namespace name has already been added.
2480
2481 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2482
2483         * expression.cs: reftype [!=]= null should always use br[true,false].
2484         # 67410
2485
2486 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2487
2488         Fix #67108
2489         * attribute.cs: Enum conversion moved to 
2490         GetAttributeArgumentExpression to be applied to the all
2491         expressions.
2492
2493 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2494
2495         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2496         * class.c (TypeContainer.DefineType): Flag error if
2497         base types aren't accessible due to access permissions.
2498         * decl.cs (DeclSpace.ResolveType): Move logic to
2499         Expression.ResolveAsTypeTerminal.
2500         (DeclSpace.ResolveTypeExpr): Thin layer over
2501         Expression.ResolveAsTypeTerminal.
2502         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2503         Refactor code into NestedAccess.  Use it.
2504         (DeclSpace.NestedAccess): New.
2505         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2506         argument to silence errors.  Check access permissions.
2507         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2508         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2509         (Cast.DoResolve): Likewise.
2510         (New.DoResolve): Likewise.
2511         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2512         (TypeOf.DoResolve): Likewise.
2513
2514         * expression.cs (Invocation.BetterConversion): Return the Type of
2515         the better conversion.  Implement section 14.4.2.3 more faithfully.
2516         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2517         section 14.4.2.2 explicit.
2518         (Invocation.OverloadResolve): Update.
2519         (Invocation): Remove is_base field.
2520         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2521         (Invocation.Emit): Likewise.
2522
2523 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2524
2525         * cs-parser.jay: Reverted 642 warning fix.
2526
2527 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2528
2529         Fix bug #66615
2530         * decl.cs (FindMemberWithSameName): Indexer can have more than
2531         1 argument.
2532
2533 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2534
2535         * expression.cs (LocalVariableReference.DoResolveLValue):
2536         Do not report warning 219 for out values.
2537         (EmptyExpression.Null): New member to avoid extra allocations.
2538
2539 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2540
2541         * cs-parser.jay: Fix wrong warning 642 report.
2542
2543         * cs-tokenizer.cs (CheckNextToken): New helper;
2544         Inspect next character if is same as expected.
2545
2546 2004-09-23  Martin Baulig  <martin@ximian.com>
2547
2548         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2549         (Convert.ImplicitReferenceConversionExists): Likewise.
2550
2551 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2552
2553         * Makefile (DISTFILES): Comment out a few missing files.
2554
2555 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2556
2557         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2558         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2559         (gmcs.exe): Invoke bootstrap-libs.
2560         (clean-local): Clean the net_2_0_bootstrap profile too.
2561         (PROGRAM_INSTALL_DIR): New.
2562         (install-local): Use it.
2563
2564 2004-10-13  Martin Baulig  <martin@ximian.com>
2565
2566         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2567         (TypeParameter.DefineType): If we're a method type parameter and
2568         that method is overriding something, "inflate" its constraints.
2569
2570 2004-10-12  Martin Baulig  <martin@ximian.com>
2571
2572         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2573         and have type arguments, create and resolve a ConstructedType.
2574
2575 2004-10-12  Martin Baulig  <martin@ximian.com>
2576
2577         * decl.cs (MemberCache.FindMemberToOverride): Use
2578         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2579         to compare the invocationType.
2580
2581         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2582         When comparing two type parameters, only do the signature-only
2583         comparision for method type parameters.
2584
2585 2004-10-11  Martin Baulig  <martin@ximian.com>
2586
2587         * report.cs: Don't make --fatal abort on warnings, we have
2588         -warnaserror for that.
2589
2590 2004-10-11  Martin Baulig  <martin@ximian.com>
2591
2592         * typemanager.cs
2593         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2594         (TypeManager.IsEqual): Call ourself recursively instead of using
2595         Type.IsEqual(). 
2596
2597 2004-10-11  Martin Baulig  <martin@ximian.com>
2598
2599         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2600         on our own type parameters, not on the ones we inherit from a containing
2601         class.
2602
2603         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2604         the comparision.
2605
2606         * generic.cs (TypeParameter.Define): We may only be called once.
2607
2608         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2609         instead of TypeManager.IsEqual().
2610
2611 2004-09-28  Martin Baulig  <martin@ximian.com>
2612
2613         * generic.cs
2614         (GenericConstraints.EffectiveBaseClass): New public property.
2615         (TypeParameter.GenericConstraints): New public property.
2616         (ConstructedType.CheckConstraints): Improved.
2617
2618         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2619         (Convert.TypeParameterConversion): New private method; use this in
2620         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2621         for all conversions related to type parameters.
2622
2623 2004-09-24  Martin Baulig  <martin@ximian.com>
2624
2625         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2626         type parameter conversions for type parameters which are known to
2627         be reference types.
2628
2629 2004-09-24  Martin Baulig  <martin@ximian.com>
2630
2631         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2632         `IsValueType' properties.
2633
2634         * support.cs (ReflectionConstraints): Use
2635         Type.GetGenericParameterConstraints() instead of the old hack.
2636
2637 2004-09-24  Martin Baulig  <martin@ximian.com>
2638
2639         * generic.cs (GenericConstraints): Moved here and made it an
2640         abstract class.
2641
2642         * support.cs (GenericConstraints): Moved to generic.cs.
2643
2644 2004-09-24  Martin Baulig  <martin@ximian.com>
2645
2646         * support.cs
2647         (ReflectionConstraints): Un-nested this class and made it public.
2648
2649         * typemanager.cs
2650         (TypeManager.GetTypeParameterConstraints): New public method.
2651         (TypeManager.HasConstructorConstraint): Use the attributes.
2652
2653 2004-09-24  Martin Baulig  <martin@ximian.com>
2654
2655         * support.cs (GenericConstraints): Replaced `HasConstructor',
2656         `IsReferenceType' and `IsValueType' with `Attributes'.
2657         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2658         method and made the .ctor public.
2659
2660         * generic.cs (Constraints.Attributes): New public property.
2661         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2662         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2663         `IsValueType' -> `HasValueTypeConstraint'.
2664
2665 2004-09-23  Martin Baulig  <martin@ximian.com>
2666
2667         * generic.cs (Constraints): Reflect latest runtime changes.
2668
2669 2004-09-23  Martin Baulig  <martin@ximian.com>
2670
2671         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2672         (Convert.ImplicitReferenceConversionExists): Likewise.
2673
2674 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2675
2676         * class.cs (Operator.Define): Add error 448 and 559 report.
2677         
2678 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2679
2680         * class.cs (MemberBase.IsTypePermitted): New protected
2681         method for checking error CS0610.
2682
2683 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2684
2685         * class.cs (TypeContainer.HasExplicitLayout): New property
2686         Returns whether container has StructLayout attribute set Explicit.
2687         (FieldMember): New abstract class for consts and fields.
2688         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2689         (Field): Reuse FieldMember.
2690
2691         * const.cs (Const): Reuse FieldMember.
2692
2693         * rootcontext.cs: EmitConstants call moved to class.
2694
2695 2004-09-22  Martin Baulig  <martin@ximian.com>
2696
2697         Marek and me just fixed one of our oldest bugs: #28562 :-)
2698
2699         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2700
2701         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2702         we're an EnumConstant, just return that.
2703         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2704         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2705         to get the value which'll actually be written into the attribute.
2706         However, we have to use GetValue() to access the attribute's value
2707         in the compiler.        
2708
2709 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2710
2711         * constant.cs (Constant.IsNegative): New abstract property
2712         IsNegative.
2713
2714         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2715         (StackAlloc.DoResolve): Reused IsNegative.
2716
2717 2004-09-22  Martin Baulig  <martin@ximian.com>
2718
2719         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2720         public method; like LookupTypeContainer, but also works for
2721         generic instances.
2722
2723         * report.cs (Report.SymbolRelatedToPreviousError): Use
2724         TypeManager.LookupGenericTypeContainer().       
2725
2726 2004-09-22  Martin Baulig  <martin@ximian.com>
2727
2728         Thanks to Peter Sestoft for this bug report.
2729
2730         * expression.cs (Conditional): If both the `trueExpr' and the
2731         `falseExpr' is a NullLiteral, return a NullLiteral.
2732
2733 2004-09-22  Martin Baulig  <martin@ximian.com>
2734
2735         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2736         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2737         for the "get_Current" call.
2738
2739 2004-09-21  Martin Baulig  <martin@ximian.com>
2740
2741         * convert.cs (Convert.ImplicitReferenceConversion): When
2742         converting to an interface type, first check whether we're
2743         converting from a reference type.
2744
2745 2004-09-14  Martin Baulig  <martin@ximian.com>
2746
2747         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2748
2749 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2750
2751         Fixed bug #61902
2752         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2753         called and is obsolete then this member suppress message
2754         when call is inside next [Obsolete] method or type.
2755
2756         * expression.cs: Use TestObsoleteMethodUsage member.
2757
2758 2004-09-14  Martin Baulig  <martin@ximian.com>
2759
2760         * genericparser.cs: Removed.
2761
2762 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2763
2764         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2765
2766 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2767
2768         * attribute.cs (Attribute.Resolve): Add error 653 report.
2769
2770         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2771         report.
2772         (Method.ApplyAttributeBuilder): Add error 685 report.
2773         (Operator.Define): Add error 564 report.
2774
2775         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2776
2777         * expression.cs (Invocation.DoResolve): Add error
2778         245 and 250 report.
2779
2780         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2781         error 674 report.
2782
2783 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2784
2785         * class.cs (ConstructorInitializer.Resolve):
2786         Wrong error number (515->516).
2787
2788 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2789
2790         * class.cs (Indexer.Define): Add error 631 report.
2791
2792 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2793
2794         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2795
2796 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2797
2798         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2799
2800 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2801
2802         * cs-parser.jay: Added error CS0241 report.
2803
2804 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2805
2806         * cs-parser.jay (fixed_statement): Introduce a scope for the
2807         declaration in the 'fixed' statement.
2808
2809 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2810
2811         * cs-parser.jay: Added CS0230 error report.
2812
2813 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2814
2815         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2816
2817 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2818
2819         * expression.cs (Argument.Resolve): Added error CS0192 and
2820         CS0199 report.
2821
2822 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2823
2824         C# 2.0 #pragma warning feature
2825
2826         * cs-tokenizer.cs (PreProcessPragma): New method; 
2827         Handles #pragma directive.
2828
2829         * report.cs (WarningRegions): New class; Support
2830         class for #pragma warning directive. It tests whether
2831         warning is enabled for a given line.
2832
2833 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2834
2835         * const.cs: Add more descriptive error report, tahnks to
2836         Sebastien. 
2837
2838 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2839
2840         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2841
2842 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2843
2844         * expression.cs: Apply patch from Ben: Remove dead code from
2845         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2846         as that code just threw an exception anwyays.
2847
2848         * const.cs: Remove the call to the turnintoconstant, for details
2849         see bug: #63144
2850         
2851         * literal.cs: The type of the null-literal is the null type;  So
2852         we use a placeholder type (literal.cs:System.Null, defined here)
2853         for it.
2854
2855         * expression.cs (Conditional.DoResolve): Remove some old code that
2856         is no longer needed, conversions have been fixed.
2857
2858         (ArrayCreationExpression.DoResolve): Return false if we fail to
2859         resolve the inner expression.
2860
2861 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2862
2863         Fix test-290.cs.
2864         * cs-parser.jay (delegate_declaration): Record a delegate
2865         declaration as a type declaration.
2866         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2867
2868 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2869
2870         * parameter.cs: Do not crash if the type can not be resolved. 
2871
2872         * expression.cs: Report errors with unsafe pointers, fixes #64896
2873
2874 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2875
2876         * expression.cs: Pointer arith always needs to do a conv.i
2877         if the operand is a long. fix 65320
2878
2879 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2880
2881         Fixed cs0619-37.cs, cs0619-38.cs
2882
2883         * enum.cs (GetObsoleteAttribute): Removed.
2884
2885         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2886         on Enum member is double staged. The first is tested member
2887         and then enum.
2888
2889 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2890
2891         Fixed #56986, #63631, #65231
2892
2893         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2894         adds member to name container.
2895         (TypeContainer.AddToTypeContainer): New method, adds type to
2896         name container.
2897         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2898         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2899         AddOperator): Simplified by reusing AddToMemberContainer.
2900         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2901         instead of field.
2902         (Method.CheckForDuplications): Fixed implementation to test all
2903         possibilities.
2904         (MemberBase): Detection whether member is explicit interface
2905         implementation is now in constructor.
2906         (MemberBase.UpdateMemberName): Handles IndexerName.
2907         (Accessor): Changed to keep also location information.
2908         (AbstractPropertyEventMethod): Is derived from MemberCore.
2909         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2910         will be emited or not.
2911         (PropertyBase.AreAccessorsDuplicateImplementation):
2912         Tests whether accessors are not in collision with some method.
2913         (Operator): Is derived from MethodCore to simplify common
2914         operations.
2915
2916         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2917         must be performed.
2918         (DeclSpace.AddToContainer): Adds the member to defined_names
2919         table. It tests for duplications and enclosing name conflicts.
2920
2921         * enum.cs (EnumMember): Clean up to reuse the base structures
2922
2923 2004-09-03  Martin Baulig  <martin@ximian.com>
2924
2925         Merged latest changes into gmcs.  Please keep this comment in
2926         here, it makes it easier for me to see what changed in MCS since
2927         the last time I merged.
2928
2929 2004-09-03  Martin Baulig  <martin@ximian.com>
2930
2931         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2932         into TypeContainer, to make partial classes work again.
2933
2934 2004-09-03  Martin Baulig  <martin@ximian.com>
2935
2936         * rootcontext.cs (RootContext.V2): Removed.
2937
2938 2004-03-23  Martin Baulig  <martin@ximian.com>
2939
2940         * expression.cs (Invocation.OverloadResolve): Added `bool
2941         may_fail' argument and use it instead of the Location.IsNull() hack.
2942
2943 2004-09-09  Martin Baulig  <martin@ximian.com>
2944
2945         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2946
2947 2004-09-09  Martin Baulig  <martin@ximian.com>
2948
2949         * generic.cs (TypeParameter.DefineType): Added support for
2950         explicit interface methods.
2951
2952 2004-09-09  Martin Baulig  <martin@ximian.com>
2953
2954         * README.Changes: New document.  Started to list important changes
2955         between MCS and GMCS here.
2956
2957 2004-09-08  Martin Baulig  <martin@ximian.com>
2958
2959         * class.cs
2960         (TypeContainer.CheckRecursiveDefinition): New protected method.
2961         (TypeContainer.DefineType): Move the CS0146 check into
2962         CheckRecursiveDefinition().     
2963
2964 2004-09-06  Martin Baulig  <martin@ximian.com>
2965
2966         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2967         types for the constructor constraint.
2968
2969 2004-09-03  Martin Baulig  <martin@ximian.com>
2970
2971         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2972         into TypeContainer, to make partial classes work again.
2973
2974 2004-09-03  Martin Baulig  <martin@ximian.com>
2975
2976         * rootcontext.cs (RootContext.V2): Removed.
2977
2978 2004-03-23  Martin Baulig  <martin@ximian.com>
2979
2980         * expression.cs (Invocation.OverloadResolve): Added `bool
2981         may_fail' argument and use it instead of the Location.IsNull() hack.
2982
2983 2004-09-03  Martin Baulig  <martin@ximian.com>
2984
2985         Merged latest changes into gmcs.  Please keep this comment in
2986         here, it makes it easier for me to see what changed in MCS since
2987         the last time I merged.
2988
2989 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2990
2991         Fix #61128.
2992         * expression.cs (BetterConversion): Don't allow either conversion 
2993         to be null.  Remove redundant implicit conversion test when 'q ==
2994         null' -- when this function is invoked, we already know that the
2995         implicit conversion exists.
2996         (BetterFunction): Assume that 'best' is non-null.  Remove
2997         redundant reimplementation of IsApplicable when 'best' is null.
2998         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2999         number of arguments.
3000         (IsAncestralType): Extract from OverloadResolve.
3001         (OverloadResolve): Make robust to the MethodGroupExpr being
3002         unsorted.  Implement all the logic of Section 14.5.5.1, and
3003         support overloading of methods from multiple applicable types.
3004         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
3005
3006         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3007         (RealError, Warning): Append type of report to related symbol.
3008
3009 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
3010
3011         * enum.cs: Fixed CLS-Compliance checks for enum members.
3012         Error tests cs3008-8.cs, cs3014-8.cs
3013
3014 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3015
3016         Fixed bug #62342, #63102
3017         * class.cs: ImplementIndexer uses member.IsExplicitImpl
3018         like ImplementMethod.
3019
3020 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3021
3022         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3023         Fixed bug #65170.
3024
3025 2004-09-02  Martin Baulig  <martin@ximian.com>
3026
3027         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3028         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3029         on the MethodBase.
3030
3031 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3032
3033         C# 2.0 Static classes implemented
3034
3035         * class.cs (TypeContainer): instance_constructors,
3036         initialized_fields, initialized_static_fields,
3037         default_constructor, base_inteface_types are protected to be
3038         accessible from StaticClass.
3039         (TypeContainer.DefineDefaultConstructor): New virtual method
3040         for custom default constructor generating
3041         (StaticClass): New class to handle "Static classes" feature.
3042
3043         * cs-parser.jay: Handle static keyword on class like instance
3044         of StaticClass.
3045
3046         * driver.cs: Added "/langversion" command line switch with two
3047         options (iso-1, default).
3048
3049 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3050
3051         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3052
3053 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3054
3055         * delegate.cs: Style.
3056
3057 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3058
3059         * delegate.cs: Add seperate instance expr field for miguel.
3060
3061 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3062
3063         * PointerArithmetic (Resolve): make sure we are not doing
3064         pointer arith on void*. Also, make sure we are resolved
3065         by not setting eclass until resolve.
3066
3067         All callers: Make sure that PointerArithmetic gets resolved.
3068
3069 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3070
3071         * ArrayCreation (LookupType): If the type does not resolve 
3072         to an array, give an error.
3073
3074 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3075
3076         * statement.cs (Try.Resolve): Fixed bug #64222
3077
3078 2004-08-27  Martin Baulig  <martin@ximian.com>
3079
3080         * class.cs
3081         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3082         crash here.     
3083
3084 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3085
3086         * ecore.cs (Constantify): Get underlying type via
3087         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3088         Windows in special cases.
3089
3090 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3091
3092         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3093         for obtaining also private methods.
3094         (GetRemoveMethod): Used GetRemoveMethod (true)
3095         for obtaining also private methods.
3096
3097 2004-09-02  Martin Baulig  <martin@ximian.com>
3098
3099         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3100         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3101         on the MethodBase.
3102
3103 2004-08-27  Martin Baulig  <martin@ximian.com>
3104
3105         * class.cs
3106         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3107         crash here.     
3108
3109 2004-08-25  Martin Baulig  <martin@ximian.com>
3110
3111         * support.cs (ReflectionParameters..ctor): If this is a generic
3112         method, retrieve and store its type parameters.
3113         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3114         (ReflectionParameters.GenericConstraints): The argument specifies
3115         the type parameter, not the method parameter.
3116         (InternalParameters.GenericConstraints): Likewise.
3117
3118         * generic.cs (TypeParameter.DefineType): Correctly handle
3119         constraints wrt. generic methods in interfaces and their
3120         implementations.        
3121
3122 2004-08-24  Martin Baulig  <martin@ximian.com>
3123
3124         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3125         (Constraints.IsSubclassOf): New internal method.
3126
3127         * typemanager.cs (TypeManager.FindMembers): Added special support
3128         for GenericTypeParameterBuilder's.      
3129         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3130         type parameters.
3131
3132 2004-08-24  Martin Baulig  <martin@ximian.com>
3133
3134         * typemanager.cs
3135         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3136         this for accessibility checks.
3137         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3138         IsNestedFamilyAccessible.
3139         (TypeManager.IsSubclassOf): New method, do what the name actually
3140         says.   
3141
3142 2004-08-24  Martin Baulig  <martin@ximian.com>
3143
3144         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3145         as a SimpleName, include the generic arity.
3146
3147 2004-08-24  Martin Baulig  <martin@ximian.com>
3148
3149         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3150         MethodAttributes.HideBySig for operators.
3151
3152 2004-08-23  Martin Baulig  <martin@ximian.com>
3153
3154         Back to the old error reporting system :-)
3155
3156         * report.cs (Message): Removed.
3157         (Report.MessageData, ErrorData, WarningData): Removed.
3158         (Report.Error, Warning): Back to the old system.
3159
3160 2004-08-23  Martin Baulig  <martin@ximian.com>
3161
3162         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3163
3164         * class.cs (TypeContainer.ParentContainer): New public virtual
3165         method; replaces the explicit interface implementation.
3166         (ClassPart.ParentContainer): Override.
3167
3168 2004-08-23  Martin Baulig  <martin@ximian.com>
3169
3170         * statement.cs (Switch): Added support for constant switches; see
3171         #59428 or test-285.cs.
3172
3173 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3174
3175         Fixed bug #62740.
3176         * statement.cs (GetEnumeratorFilter): Removed useless
3177         logic because C# specs is strict. GetEnumerator must be
3178         public.
3179
3180 2004-08-22  Martin Baulig  <martin@ximian.com>
3181
3182         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3183         a switch and may break, reset the barrier.  Fixes #59867.
3184
3185 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3186
3187         CLS-Compliance speed up (~5% for corlib)
3188
3189         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3190         New method. Tests container for CLS-Compliant names
3191
3192         * class.cs (TypeContainer.VerifyClsName): New method.
3193         Checks whether container name is CLS Compliant.
3194         (Constructor): Implements IMethodData.
3195
3196         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3197         low-case table for CLS Compliance test.
3198         (MemberCache.VerifyClsParameterConflict): New method.
3199         Checks method parameters for CS3006 error.
3200
3201         * enum.cs (EnumMember): Is derived from MemberCore.
3202         (Enum.VerifyClsName): Optimized for better performance.
3203
3204 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3205
3206         * report.cs: Renamed Error_T to Error and changed all
3207         references.
3208
3209 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3210
3211         * class.cs (TypeContainer.IndexerArrayList): New inner class
3212         container for indexers.
3213         (TypeContainer.DefaultIndexerName): New constant for default
3214         indexer name. Replaced all "Item" with this constant.
3215         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3216
3217         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3218         DefaultMemberAttribute constructor.
3219
3220 2004-08-05  Martin Baulig  <martin@ximian.com>
3221
3222         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3223         Fix bug #59429.
3224
3225 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3226
3227         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3228         multi platforms problem.
3229
3230         * compiler.csproj: Included shared files.
3231
3232 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3233
3234         Fix bug 60333, 55971 in the more general way
3235         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3236         Added arg_type argument for constant conversion.
3237         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3238
3239 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3240
3241         Fix bug #59760
3242         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3243         OperatorArrayList, MethodCoreArrayList for typecontainer
3244         containers. Changed class member types to these new types.
3245         (MethodArrayList.DefineMembers): Added test for CS0659.
3246
3247 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3248
3249         * cfold.cs: Synchronize the folding with the code in expression.cs
3250         Binary.DoNumericPromotions for uint operands.
3251
3252         * attribute.cs: Revert patch from Raja, it introduced a regression
3253         while building Blam-1.2.1 (hard to isolate a test case).
3254
3255 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3256
3257         Fix for #55382
3258         * class.cs:
3259         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3260         name collision.
3261         (MethodCore.parent_method): New member. The method we're overriding
3262         if this is an override method.
3263         (MethodCore.CheckBase): Moved from Method class and made common.
3264         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3265         private.
3266         (MethodCore.CheckForDuplications): New abstract method. For custom
3267         member duplication search in a container
3268         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3269         method and its return type.
3270         (Event.conflict_symbol): New member. Symbol with same name in the
3271         parent class.
3272
3273         * decl.cs:
3274         (MemberCache.FindMemberWithSameName): New method. The method
3275         is looking for conflict with inherited symbols.
3276
3277 2004-08-04  Martin Baulig  <martin@ximian.com>
3278
3279         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3280
3281         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3282
3283 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3284
3285         * report.cs (Message): New enum for better error, warning reference in
3286         the code.
3287         (MessageData): New inner abstract class. It generally handles printing of
3288         error and warning messages.
3289         Removed unused Error, Warning, Message methods.
3290
3291 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3292
3293         Fix for cs0592-8.cs test
3294         * attribute.cs
3295         (Attributable.ValidAttributeTargets): Made public.
3296         (Attribute.ExplicitTarget): New member for explicit target value.
3297         (Attribute.CheckTargets): Now we translate explicit attribute
3298         target to Target here.
3299
3300 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3301
3302         * ecore.cs (MethodGroupExpr): new IsBase property.
3303
3304         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3305
3306         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3307         rather than an instance expr.
3308
3309         (DelegateCreation.Emit): Use the method group rather than
3310         the instance expression. Also, if you have base.Foo as the
3311         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3312
3313         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3314
3315         (NewDelegate.DoResolve): Only check for the existance of Invoke
3316         if the method is going to be needed. Use MethodGroupExpr.
3317
3318         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3319
3320         * expression.cs: For pointer arith., make sure to use
3321         the size of the type, not the size of the pointer to
3322         the type.
3323
3324 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3325
3326         Fix for #60722
3327         * class.cs (Class): Added error CS0502 test.
3328
3329 2004-08-03  John Luke  <jluke@cfl.rr.com>
3330             Raja R Harinath  <rharinath@novell.com>
3331
3332         Fix for #60997.
3333         * attribute.cs (Attribute.complained_before): New flag.
3334         (Attribute.ResolveType, Attribute.Resolve),
3335         (Attribute.DefinePInvokeMethod): Set it.
3336         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3337         
3338 2004-08-03  Martin Baulig  <martin@ximian.com>
3339
3340         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3341         use a user-defined operator; we still need to do numeric
3342         promotions in case one argument is a builtin type and the other
3343         one has an implicit conversion to that type.  Fixes #62322.
3344
3345 2004-08-18  Martin Baulig  <martin@ximian.com>
3346
3347         * class.cs (Method.Define): Use the correct method name when
3348         creating the MethodBuilder for a generic method.
3349
3350 2004-08-17  Martin Baulig  <martin@ximian.com>
3351
3352         * generic.cs (Constraints): Support type parameter constraints.
3353
3354 2004-08-16  Martin Baulig  <martin@ximian.com>
3355
3356         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3357         (Token.GENERIC_DIMENSION): New token; this is returned if we
3358         encounter an unbound generic type in a typeof() expression.
3359
3360         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3361         this token is only generated while parsing a typeof() expression.
3362         (typeof_expression): Removed the old unbound_type hack.
3363
3364         * generic.cs (TypeArguments.IsUnbound): New public property.
3365
3366         * decl.cs (MemberName): Added support for unbound types.
3367
3368 2004-08-14  Martin Baulig  <martin@ximian.com>
3369
3370         * typemanager.cs
3371         (TypeManager.IsEqualGenericInstance): New static method.
3372         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3373         just used to check accessibility, so follow the rules of 26.1.6.        
3374
3375         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3376         ConstructedType instead of a TypeExpression if we have type arguments.
3377
3378         * cs-parser.jay (typeof_expression): Support unbound generic types.
3379
3380         * ecore.cs (UnboundTypeExpression): New public class.
3381
3382 2004-08-12  Martin Baulig  <martin@ximian.com>
3383
3384         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3385         TypeManager.IsEqual() rather than `=='.
3386
3387         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3388         generic instances as well.
3389
3390 2004-08-12  Martin Baulig  <martin@ximian.com>
3391
3392         * expression.cs (Invocation.InferType): We can only infer method
3393         type parameters.  Fixes #62647.
3394
3395 2004-08-11  Martin Baulig  <martin@ximian.com>
3396
3397         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3398         before resolving the base classes.
3399
3400 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3401
3402         * Makefile: install .mdb file too.
3403
3404 2004-08-05  Martin Baulig  <martin@ximian.com>
3405
3406         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3407         initializer, the current type is just the TypeBuilder, not the
3408         instantiated generic type.
3409         (FieldExpr.IsFieldInitializer): New public property.
3410
3411 2004-08-04  Martin Baulig  <martin@ximian.com>
3412
3413         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3414
3415         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3416
3417 2004-08-03  Martin Baulig  <martin@ximian.com>
3418
3419         * class.cs (MethodData.Define): If we're an explicit
3420         implementation, remove the generic arity from the type name.
3421
3422 2004-08-03  Martin Baulig  <martin@ximian.com>
3423
3424         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3425         use a user-defined operator; we still need to do numeric
3426         promotions in case one argument is a builtin type and the other
3427         one has an implicit conversion to that type.  Fixes #62322.
3428
3429 2004-08-02  Martin Baulig  <martin@ximian.com>
3430
3431         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3432         `TypeExpr[]' array.
3433         (TypeContainer.GetClassBases): Return the unexpanded list of
3434         interfaces; we expand them later.
3435         (TypeContainer.DefineType): After creating the TypeBuilder, call
3436         TypeManager.ExpandInterfaces() to get an expanded and resolved
3437         list of interfaces.
3438
3439         * ecore.cs (TypeExpr.GetInterfaces): Removed
3440
3441         * generics.cs (Constraints.InterfaceConstraints): Remove.
3442         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3443         register the interface constraints.
3444
3445         * typemanager.cs
3446         (TypeManager.AddUserType): Removed the `ifaces' argument.
3447         (TypeManager.AddTypeParameter): Likewise.
3448         (TypeManager.AddUserInterface): Removed, was unused.
3449         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3450         `TypeExpr[]' array for the interfaces.
3451         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3452         has been defined, returns a list of the resolved interfaces types.
3453         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3454         (TypeManager.GetExplicitInterfaces): Likewise.  
3455
3456 2004-08-02  Martin Baulig  <martin@ximian.com>
3457
3458         * expression.cs (Invocation.EmitCall): If we're invoking a method
3459         on a type parameter, use the new `Constrained' prefix opcode.
3460
3461 2004-08-02  Martin Baulig  <martin@ximian.com>
3462
3463         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3464         (LocalInfo.IsThis): New public property.
3465         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3466
3467 2004-08-01  Martin Baulig  <martin@ximian.com>
3468
3469         * class.cs (TypeContainer.GetClassBases): Don't set the default
3470         here since we may get called from GetPartialBases().
3471         (TypeContainer.DefineType): If GetClassBases() didn't return a
3472         parent, use the default one.
3473
3474 2004-07-30  Martin Baulig  <martin@ximian.com>
3475
3476         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3477
3478         * class.cs (SourceMethod): New public class, derive from the
3479         symbol writer's ISourceMethod.
3480         (Method): Use the new symbol writer API.
3481
3482         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3483         as argument and use the new symbol writer.
3484
3485         * location.cs
3486         (SourceFile): Implement the symbol writer's ISourceFile.
3487         (Location.SymbolDocument): Removed.
3488         (Location.SourceFile): New public property.
3489
3490         * symbolwriter.cs: Use the new symbol writer API.
3491
3492 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3493
3494         * Makefile (install-local): Remove.  Functionality moved to
3495         executable.make.
3496
3497 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3498
3499         * Makefile: Install mcs.exe.config file together with mcs.exe.
3500         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3501         correct runtime version.
3502         
3503 2004-07-25  Martin Baulig  <martin@ximian.com>
3504
3505         * class.cs
3506         (TypeContainer.RegisterOrder): Removed, this was unused.
3507         (TypeContainer, interface_order): Removed.
3508         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3509         TypeContainer as argument since we can also be called with a
3510         `PartialContainer' for a partial class/struct/interface.
3511         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3512         of checking whether we're an `Interface' - we could be a
3513         `PartialContainer'.
3514         (PartialContainer.Register): Override; call
3515         AddClass()/AddStruct()/AddInterface() on our parent.
3516
3517         * cs-parser.jay (interface_member_declaration): Add things to the
3518         `current_container', not the `current_class'.
3519
3520         * rootcontext.cs (RegisterOrder): The overloaded version which
3521         takes an `Interface' was unused, removed.
3522
3523         * typemanager.cs (TypeManager.LookupInterface): Return a
3524         `TypeContainer', not an `Interface'.
3525         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3526         contain a `PartialContainer' for an interface, so check it's
3527         `Kind' to figure out what it is.
3528
3529 2004-07-25  Martin Baulig  <martin@ximian.com>
3530
3531         * class.cs (Class.DefaultTypeAttributes): New public constant.
3532         (Struct.DefaultTypeAttributes): Likewise.
3533         (Interface.DefaultTypeAttributes): Likewise.
3534         (PartialContainer.TypeAttr): Override this and add the
3535         DefaultTypeAttributes.
3536
3537 2004-07-25  Martin Baulig  <martin@ximian.com>
3538
3539         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3540         we can just use the `Parent' field instead.
3541
3542 2004-07-25  Martin Baulig  <martin@ximian.com>
3543
3544         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3545
3546 2004-07-25  Martin Baulig  <martin@ximian.com>
3547
3548         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3549         our parts before defining any methods.
3550         (TypeContainer.VerifyImplements): Make this virtual.
3551         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3552         on our PartialContainer.
3553
3554 2004-07-25  Martin Baulig  <martin@ximian.com>
3555
3556         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3557
3558         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3559         argument, we can just use the `Parent' field instead.
3560
3561         * class.cs
3562         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3563         (MemberBase.DoDefine): Likewise.
3564
3565 2004-07-24  Martin Baulig  <martin@ximian.com>
3566
3567         * decl.cs (MemberCore.Parent): New public field.
3568         (DeclSpace.Parent): Moved to MemberCore.
3569
3570         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3571         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3572         parent's .ctor.
3573         (FieldBase, Field, Operator): Likewise.
3574         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3575         (EventField, Event): Likewise.
3576
3577 2004-07-23  Martin Baulig  <martin@ximian.com>
3578
3579         * class.cs (PartialContainer): New public class.
3580         (ClassPart): New public class.
3581         (TypeContainer): Added support for partial classes.
3582         (TypeContainer.GetClassBases): Splitted some of the functionality
3583         out into GetNormalBases() and GetPartialBases().
3584
3585         * cs-tokenizer.cs (Token.PARTIAL): New token.
3586         (Tokenizer.consume_identifier): Added some hacks to recognize
3587         `partial', but only if it's immediately followed by `class',
3588         `struct' or `interface'.
3589
3590         * cs-parser.jay: Added support for partial clases.
3591
3592 2004-07-23  Martin Baulig  <martin@ximian.com>
3593
3594         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3595         a `DeclSpace' and also made it readonly.
3596         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3597         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3598         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3599
3600         * cs-parser.jay: Pass the `current_class', not the
3601         `current_container' (at the moment, this is still the same thing)
3602         to a new Method, Property, Event, Indexer or Constructor.
3603
3604 2004-07-23  Martin Baulig  <martin@ximian.com>
3605
3606         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3607         and removed the `current_interface' one.
3608         (struct_declaration, class_declaration, interface_declaration):
3609         Set `current_class' to the newly created class/struct/interface;
3610         set their `Bases' and call Register() before parsing their body.
3611
3612 2004-07-23  Martin Baulig  <martin@ximian.com>
3613
3614         * class.cs (Kind): New public enum.
3615         (TypeContainer): Made this class abstract.
3616         (TypeContainer.Kind): New public readonly field.
3617         (TypeContainer.CheckDef): New public method; moved here from
3618         cs-parser.jay.
3619         (TypeContainer.Register): New public abstract method.
3620         (TypeContainer.GetPendingImplementations): New public abstract
3621         method.
3622         (TypeContainer.GetClassBases): Removed the `is_class' and
3623         `is_iface' parameters.
3624         (TypeContainer.DefineNestedTypes): Formerly known as
3625         DoDefineType().
3626         (ClassOrStruct): Made this class abstract.
3627
3628         * tree.cs (RootTypes): New public type. 
3629
3630 2004-07-20  Martin Baulig  <martin@ximian.com>
3631
3632         * tree.cs (Tree.RecordNamespace): Removed.
3633         (Tree.Namespaces): Removed.
3634
3635         * rootcontext.cs (RootContext.IsNamespace): Removed.
3636
3637         * cs-parser.jay (namespace_declaration): Just create a new
3638         NamespaceEntry here.
3639
3640 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3641
3642         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3643         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3644         entry to make sure it runs in the correct runtime version.
3645         
3646 2004-07-18  Martin Baulig  <martin@ximian.com>
3647
3648         * generic.cs (ConstructedType.CheckConstraints): Improved
3649         constraints checking.
3650
3651 2004-07-18  Martin Baulig  <martin@ximian.com>
3652
3653         * expression.cs (Invocation.BetterMethod): Call
3654         TypeManager.TypeToCoreType() on all types and removed my previous
3655         hack; we're already doig the right thing here.
3656
3657 2004-07-17  Martin Baulig  <martin@ximian.com>
3658
3659         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3660
3661 2004-07-16  Martin Baulig  <martin@ximian.com>
3662
3663         * iterators.cs: Added generics support.
3664
3665 2004-07-16  Martin Baulig  <martin@ximian.com>
3666
3667         * iterators.cs: Rewrote this.  We're now using one single Proxy
3668         class for both the IEnumerable and the IEnumerator interface and
3669         `Iterator' derives from Class so we can use the high-level API.
3670
3671         * class.cs (TypeContainer.AddIterator): New method.
3672         (TypeContainer.DoDefineType): New protected virtual method, which
3673         is called from DefineType().
3674         (TypeContainer.DoDefineMembers): Call DefineType() and
3675         DefineMembers() on all our iterators.
3676         (TypeContainer.Emit): Call Emit() on all our iterators.
3677         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3678
3679         * codegen.cs (EmitContext.CurrentIterator): New public field.
3680
3681 2004-07-15  Martin Baulig  <martin@ximian.com>
3682
3683         * typemanager.cs
3684         (TypeManager.not_supported_exception_type): New type.   
3685
3686 2004-07-14  Martin Baulig  <martin@ximian.com>
3687
3688         * typemanager.cs
3689         (TypeManager.generic_ienumerable_type): New type.
3690         (TypeManager.generic_ienumerator_type): New type.
3691
3692         * rootcontext.cs
3693         (RootContext.interfaces_first_stage): Added
3694         "System.Collections.Generic.IEnumerator`1" and
3695         "System.Collections.Generic.IEnumerable`1".     
3696
3697 2004-07-14  Martin Baulig  <martin@ximian.com>
3698
3699         * iterators.cs: Use real error numbers.
3700
3701 2004-07-14  Martin Baulig  <martin@ximian.com>
3702
3703         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3704         requires this to be a System.Collection.IEnumerable and not a
3705         class implementing that interface.
3706         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3707
3708 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3709
3710         * class.cs: Fixed previous fix, it broke some error tests.
3711
3712 2004-07-12  Martin Baulig  <martin@ximian.com>
3713
3714         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3715         Fixes #61293.
3716
3717 2004-07-14  Martin Baulig  <martin@ximian.com>
3718
3719         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3720         an exclamation mark (!) for the generic arity to reflect the
3721         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3722
3723 2004-07-13  Martin Baulig  <martin@ximian.com>
3724
3725         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3726         specifiers being part of a type argument.
3727
3728 2004-07-13  Martin Baulig  <martin@ximian.com>
3729
3730         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3731         name for generic types.
3732
3733 2004-07-13  Martin Baulig  <martin@ximian.com>
3734
3735         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3736         bit to fix #60119.
3737
3738 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3739
3740         * assign.cs (LocalTemporary): Add new argument: is_address,If
3741         `is_address' is true, then the value that we store is the address
3742         to the real value, and not the value itself.
3743         
3744         * ecore.cs (PropertyExpr): use the new local temporary
3745         stuff to allow us to handle X.Y += z (where X is a struct)
3746
3747 2004-07-08  Martin Baulig  <martin@ximian.com>
3748
3749         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3750         not always return, just like we're doing in Using.Resolve().
3751
3752 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3753
3754         * cs-parser.jay (fixed_statement): flag this as Pinned.
3755
3756 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3757
3758         * typemanager.cs (TypeManager): Removed MakePinned method, this
3759         mechanism is replaced with the .NET 2.x compatible mechanism of
3760         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3761
3762         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3763         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3764         `IsFixed' property which has a different meaning.
3765
3766 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3767
3768         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3769         visible from inside a nested class, not just the names of the
3770         immediately enclosing class.
3771         Fix for bug #60730.
3772
3773 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3774
3775         * expression.cs (BetterConversion): Remove buggy special-case
3776         handling of "implicit constant expression conversions".  At this
3777         point, we already know that the conversion is possible -- we're
3778         only checking to see which is better.
3779
3780 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3781
3782         * cs-parser.jay: Added error CS0210 test.
3783
3784 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3785
3786         * cs-parser.jay: Added error CS0134 test.
3787
3788 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3789
3790         Fix bug #52507
3791         * cs-parser.jay: Added error CS0145 test.
3792
3793 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3794
3795         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3796
3797 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3798         
3799         * expression.cs (StackAlloc.Resolve): The argument may not
3800         be a constant; deal with this case.
3801         
3802 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3803
3804         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3805         GetIndexerAttributeValue.
3806         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3807
3808         * class.cs (Indexer.Define): Added error tests for CS0415,
3809         CS0609.
3810
3811 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3812
3813         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3814         property code.
3815
3816 2004-06-23  Martin Baulig  <martin@ximian.com>
3817
3818         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3819         neither return nor throw, reset the barrier as well.  Fixes #60457.
3820
3821 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3822
3823         * class.cs : EventAttributes is now set to None by default.
3824           This fixes bug #60459.
3825
3826 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3827
3828         Fix bug #60219
3829         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3830         Don't throw exception but return null (it's sufficient now).
3831
3832 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3833
3834         * typemanager.cs (GetArgumentTypes): Faster implementation.
3835
3836 2004-06-18  Martin Baulig  <martin@ximian.com>
3837
3838         * attribute.cs (Attribute.Resolve): Check whether we're an
3839         EmptyCast which a Constant child.  Fixes #60333.
3840
3841 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3842
3843         * statement.cs (EmitCollectionForeach): Account for the fact that
3844         not all valuetypes are in areas which we can take the address of.
3845         For these variables, we store to a temporary variable. Also, make
3846         sure that we dont emit a `callvirt' on a valuetype method.
3847
3848 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3849
3850         * expression.cs (StackAlloc.DoReSolve): Added test for
3851         negative parameter (CS0247).
3852
3853 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3854
3855         Fix bug #59792
3856         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3857
3858 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3859
3860         Fix bug #59781
3861         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3862         ulong.
3863
3864 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3865
3866         Fix bug #58254 & cs1555.cs, cs1556.cs
3867         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3868
3869 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3870
3871         * cs-parser.jay: Added error CS1669 test for indexers.
3872
3873 2004-06-18  Martin Baulig  <martin@ximian.com>
3874
3875         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3876         argument.  Fixes #60441.
3877
3878 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3879         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3880         The name needs to have the actual name of the method in order
3881         for other tests (such as the one in OverloadResolve for Invoke
3882         on a delegate) to work. As well, it does not really help
3883         error reporting because the method group had multiple methods.
3884         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3885         Make profiling work.
3886         
3887 2004-06-13  Martin Baulig  <martin@ximian.com>
3888
3889         * cs-parser.jay: Don't allow generic attributes.
3890
3891 2004-06-13  Martin Baulig  <martin@ximian.com>
3892
3893         * class.cs (MemberBase.DoDefineBase): New protected method.
3894         (MemberBase.DoDefine): Compute the `flags' in the new
3895         DoDefineBase() which must be called first.
3896         (Method.Define): Call DoDefineBase() first so we have the flags
3897         when defining the generic method.
3898
3899         * cs-parser.jay (interface_method_declaration): Support generic methods.
3900
3901 2004-06-13  Martin Baulig  <martin@ximian.com>
3902
3903         * decl.cs (TypeName): Removed.
3904         (MemberName): Removed TypeName and MemberNow; now we just have
3905         MemberName.
3906
3907         * cs-parser.jay: Don't distinguish between type arguments and type
3908         parameters in the grammar and simplified the rules a bit.  The
3909         reduce/reduce conflicts are now gone (except the one we inherited
3910         from mcs).
3911
3912 2004-06-11  Martin Baulig  <martin@ximian.com>
3913
3914         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3915         call this twice: for params and varargs methods.
3916
3917 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3918
3919         * class.cs:
3920         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3921
3922 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3923
3924         * attribute.cs (Attribute.GetValidTargets): Made public.
3925
3926         * class.cs: 
3927         (AbstractPropertyEventMethod): New class for better code sharing.
3928         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3929         CS1667 report.
3930         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3931
3932 2004-06-09  Martin Baulig  <martin@ximian.com>
3933
3934         * cs-parser.jay: Removed a reduce/reduce conflict.
3935
3936 2004-06-03  Martin Baulig  <martin@ximian.com>
3937
3938         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3939         GetSimpleName() and return a SimpleName.
3940
3941         * ecore.cs (SimpleName.Arguments): New public field.
3942         (SimpleName): Added overloaded ctor which takes an additional
3943         TypeArguments argument.
3944         (SimpleName.SimpleNameResolve): Added support for generic methods.
3945         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3946         formerly in MemberAccess.DoResolve(), but we also need it in
3947         SimpleNameResolve().
3948
3949         * expression.cs (MemberAccess.DoResolve): Use the new
3950         MethodGroupExpr.ResolveGeneric().       
3951
3952 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3953
3954         * decl.cs: If possible, use lookuptypedirect here. We can only do
3955         this if there is no `.' after the namespace. Avoids using
3956         LookupType, which does lots of slow processing.
3957         (FindNestedType) New method, does what it says :-).
3958         * namespace.cs: use LookupTypeDirect.
3959         * rootcontext.cs: use membercache, if possible.
3960         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3961
3962 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3963
3964         * expression.cs:
3965         According to the spec, 
3966
3967         In a member access of the form E.I, if E is a single identifier,
3968         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3969         field, property, localvariable, or parameter with the same type as
3970         the meaning of E as a type-name (§3.8), then both possible
3971         meanings of E are permitted.
3972
3973         We did not check that E as a simple-name had the same type as E as
3974         a type name.
3975
3976         This trivial check gives us 5-7% on bootstrap time.
3977
3978 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3979
3980         * expression.cs (Invocation.OverloadResolve): Avoid the
3981         use of hashtables and boxing here by allocating on demand.
3982
3983 2004-05-30  Martin Baulig  <martin@ximian.com>
3984
3985         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3986         we're doing a silent lookup.  Don't try to lookup nested types in
3987         TypeManager.object_type (thanks to Ben Maurer).
3988
3989 2004-05-30  Martin Baulig  <martin@ximian.com>
3990
3991         Committing a patch from Ben Maurer.
3992
3993         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3994
3995 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3996
3997         * convert.cs: add a trivial cache for overload operator resolution.
3998
3999 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
4000
4001         * attribute.cs
4002         (AttributeTester.GetObsoleteAttribute): Returns instance of
4003         ObsoleteAttribute when type is obsolete.
4004
4005         * class.cs
4006         (TypeContainer.VerifyObsoleteAttribute): Override.
4007         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4008         (MethodCode.VerifyObsoleteAttribute): Override.
4009         (MemberBase.VerifyObsoleteAttribute): Override.
4010
4011         * decl.cs
4012         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4013         and report proper error.
4014
4015         *delegate.cs
4016         (Delegate.VerifyObsoleteAttribute): Override.
4017
4018         * ecore.cs
4019         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4020         and report proper error.
4021         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4022
4023         * enum.cs
4024         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4025         and enum member.
4026
4027         * expression.cs
4028         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4029         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4030         Added test for ObsoleteAttribute.
4031
4032         * statement.cs
4033         (Catch): Derived from Statement.
4034
4035 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4036
4037         * decl.cs: If possible, use lookuptypedirect here. We can only do
4038         this if there is no `.' after the namespace. Avoids using
4039         LookupType, which does lots of slow processing.
4040         (FindNestedType) New method, does what it says :-).
4041         * namespace.cs: use LookupTypeDirect.
4042         * rootcontext.cs: use membercache, if possible.
4043         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4044
4045 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4046
4047         * expression.cs:
4048         According to the spec, 
4049
4050         In a member access of the form E.I, if E is a single identifier,
4051         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4052         field, property, localvariable, or parameter with the same type as
4053         the meaning of E as a type-name (§3.8), then both possible
4054         meanings of E are permitted.
4055
4056         We did not check that E as a simple-name had the same type as E as
4057         a type name.
4058
4059         This trivial check gives us 5-7% on bootstrap time.
4060
4061 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4062
4063         Fixed bug #59071 & cs0160.cs
4064         * statement.cs (Try.Resolve): Check here whether order of catch
4065         clauses matches their dependencies.
4066
4067 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4068
4069         Fixed bug #58624
4070         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
4071         unsafe type.
4072
4073 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4074
4075         * expression.cs (Invocation.OverloadResolve): Avoid the
4076         use of hashtables and boxing here by allocating on demand.
4077
4078 2004-05-30  Martin Baulig  <martin@ximian.com>
4079
4080         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4081         we're doing a silent lookup.  Don't try to lookup nested types in
4082         TypeManager.object_type (thanks to Ben Maurer).
4083
4084 2004-05-30  Martin Baulig  <martin@ximian.com>
4085
4086         Committing a patch from Ben Maurer.
4087
4088         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4089
4090 2004-05-29  Martin Baulig  <martin@ximian.com>
4091
4092         * class.cs (IMethodData.ShouldIgnore): New method.
4093
4094         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4095         `Location' argument, we don't need it anywhere.  Use
4096         `IMethodData.ShouldIgnore ()' instead of
4097         `MethodData.GetMethodFlags ()'.
4098         (TypeManager.AddMethod): Removed.
4099         (TypeManager.AddMethod2): Renamed to AddMethod.
4100
4101 2004-05-29  Martin Baulig  <martin@ximian.com>
4102
4103         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4104
4105         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4106         converting from a class type S to an interface type and we already
4107         have an object on the stack, don't box it again.  Fixes #52578.
4108
4109 2004-05-29  Martin Baulig  <martin@ximian.com>
4110
4111         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4112         Added support for `params' parameters.  Fixes #59267.
4113
4114 2004-05-29  Martin Baulig  <martin@ximian.com>
4115
4116         * literal.cs (NullPointer): Provide a private .ctor which sets
4117         `type' to TypeManager.object_type.  Fixes #59048.
4118
4119 2004-05-29  Martin Baulig  <martin@ximian.com>
4120
4121         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4122         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4123
4124         * ecore.cs (EventExpr.instance_expr): Make the field private.
4125
4126 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4127
4128         Fixed bug #50080 & cs0214-2.cs
4129         * expression.cs (Cast.DoResolve): Check unsafe context here.
4130         
4131         * statement.cs (Resolve.DoResolve): Likewise.
4132
4133 2004-05-26  Martin Baulig  <martin@ximian.com>
4134
4135         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4136
4137         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4138         (RootContext.LookupType): Pass down the `silent' flag.
4139
4140 2004-05-25  Martin Baulig  <martin@ximian.com>
4141
4142         * expression.cs
4143         (MethodGroupExpr.IdenticalTypeName): New public property.
4144         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4145         expression actually refers to a type.
4146
4147 2004-05-25  Martin Baulig  <martin@ximian.com>
4148
4149         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4150         for #56176 and made it actually work.
4151
4152 2004-05-25  Martin Baulig  <martin@ximian.com>
4153
4154         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4155         (FieldExpr, PropertyExpr): Override and implement
4156         CacheTemporaries.  Fixes #52279.
4157
4158 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4159
4160         * location.cs: In the new compiler listing a file twice is a
4161         warning, not an error.
4162
4163 2004-05-24  Martin Baulig  <martin@ximian.com>
4164
4165         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4166         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4167
4168 2004-05-24  Martin Baulig  <martin@ximian.com>
4169
4170         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4171         walking the `using' list.  Fixes #53921.
4172
4173 2004-05-24  Martin Baulig  <martin@ximian.com>
4174
4175         * const.cs (Const.LookupConstantValue): Added support for
4176         EmptyCast's; fixes #55251.
4177
4178 2004-05-24  Martin Baulig  <martin@ximian.com>
4179
4180         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4181         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4182         which does the CS0135 check.  The reason is that we first need to
4183         check whether the variable actually exists.
4184
4185 2004-05-24  Martin Baulig  <martin@ximian.com>
4186
4187         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4188         than RootContext.LookupType() to find the explicit interface
4189         type.  Fixes #58584.
4190
4191 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4192
4193         * Makefile: Simplify.  Use executable.make.
4194         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4195
4196 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4197
4198         * decl.cs:
4199         * enum.cs:
4200         Use the invariant culture when doing String.Compare for CLS case
4201         sensitivity.
4202         
4203 2004-05-23  Martin Baulig  <martin@ximian.com>
4204
4205         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4206         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4207
4208         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4209
4210 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4211
4212         * class.cs (MemberBase.Define): Reuse MemberType member for 
4213         resolved type. Other methods can use it too.
4214
4215 2004-05-23  Martin Baulig  <martin@ximian.com>
4216
4217         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4218         the variable also exists in the current block (otherwise, we need
4219         to report a CS0103).  Fixes #58670.
4220
4221 2004-05-23  Martin Baulig  <martin@ximian.com>
4222
4223         * flowanalysis.cs (Reachability.Reachable): Compute this
4224         on-the-fly rather than storing it as a field.
4225
4226 2004-05-23  Martin Baulig  <martin@ximian.com>
4227
4228         * flowanalysis.cs (Reachability.And): Manually compute the
4229         resulting `barrier' from the reachability.      
4230        
4231 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4232
4233         Fix bug #57835
4234         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4235         instance of ObsoleteAttribute when symbol is obsolete.
4236
4237         * class.cs
4238         (IMethodData): Extended interface for ObsoleteAttribute support.
4239
4240 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4241
4242         * attribute.cs: Fix bug #55970
4243
4244 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4245
4246         Fix bug #52705
4247         * attribute.cs
4248         (GetObsoleteAttribute): New method. Creates the instance of
4249         ObsoleteAttribute.
4250         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4251         ObsoleteAttribute when member is obsolete.
4252         (AttributeTester.Report_ObsoleteMessage): Common method for
4253         Obsolete error/warning reporting.
4254
4255         * class.cs
4256         (TypeContainer.base_classs_type): New member for storing parent type.
4257
4258         * decl.cs
4259         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4260         for this MemberCore.
4261
4262 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4263
4264         * attribute.cs, const.cs: Fix bug #58590
4265
4266 2004-05-21  Martin Baulig  <martin@ximian.com>
4267
4268         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4269         out parameters if the end of the method is unreachable.  Fixes
4270         #58098. 
4271
4272 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4273
4274         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4275         Hari was right, why extra method.
4276
4277 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4278
4279         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4280
4281 2004-05-20  Martin Baulig  <martin@ximian.com>
4282
4283         * delegate.cs: Convert this file to Unix mode - like the original
4284         version in mcs is.
4285
4286 2004-05-20  Martin Baulig  <martin@ximian.com>
4287
4288         * attribute.cs: Convert this file to Unix mode - like the original
4289         version in mcs is.
4290
4291 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4292
4293        Fix bug #58688 (MCS does not report error when the same attribute
4294        is assigned twice)
4295
4296        * attribute.cs (Attribute.Emit): Distinction between null and default.
4297
4298 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4299
4300        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4301        of a top-level attribute without an attribute target.
4302        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4303        Make non-static.
4304        (Attribute.Conditional_GetConditionName), 
4305        (Attribute.Obsolete_GetObsoleteMessage): Update.
4306        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4307        part of ScanForIndexerName.
4308        (Attribute.CanIgnoreInvalidAttribute): New function.
4309        (Attribute.ScanForIndexerName): Move to ...
4310        (Attributes.ScanForIndexerName): ... here.
4311        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4312        (Attributes.Search): New internal variant that can choose not to
4313        complain if types aren't resolved.  The original signature now
4314        complains.
4315        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4316        complaints suppressed.
4317        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4318        only if it not useful.
4319        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4320        top-level for attributes that are shared between the assembly
4321        and a top-level class.
4322        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4323        * class.cs: Update to reflect changes.
4324        (DefineIndexers): Fuse loops.
4325        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4326        a couple more variants of attribute names.
4327
4328 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4329
4330         Fix bug #52585 (Implemented explicit attribute declaration)
4331
4332         * attribute.cs:
4333         (Attributable.ValidAttributeTargets): New abstract method. It gets
4334         list of valid attribute targets for explicit target declaration.
4335         (Attribute.Target): It holds target itself.
4336         (AttributeSection): Removed.
4337         (Attribute.CheckTargets): New method. It checks whether attribute
4338         target is valid for the current element.
4339
4340         * class.cs:
4341         (EventProperty): New class. For events that are declared like
4342         property (with add and remove accessors).
4343         (EventField): New class. For events that are declared like field.
4344         class.cs
4345
4346         * cs-parser.jay: Implemented explicit attribute target declaration.
4347
4348         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4349         Override ValidAttributeTargets.
4350
4351         * parameter.cs:
4352         (ReturnParameter): Class for applying custom attributes on 
4353         the return type.
4354         (ParameterAtribute): New class. Class for applying custom
4355         attributes on the parameter type.
4356
4357 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4358
4359         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4360         definitions. 
4361
4362         (Method): Allow UNSAFE here.
4363
4364         * modifiers.cs: Support unsafe reporting.
4365
4366 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4367
4368         * decl.cs: Fix bug #58478.
4369
4370 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4371
4372         * statement.cs: When checking for unreachable code on an EmptyStatement,
4373         set the location. Fixes bug #58488.
4374
4375 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4376
4377         * driver.cs: Add -pkg handling.
4378
4379         From Gonzalo: UseShelLExecute=false
4380
4381 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4382
4383         * attribute.cs:
4384         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4385         for attribute.
4386         (Attribute.IsClsCompliaceRequired): Moved to base for better
4387         accesibility.
4388         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4389         when attribute is AttributeUsageAttribute.
4390         (Attribute.GetValidTargets): Simplified.
4391         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4392         attribute for this type.
4393         (Attribute.ApplyAttributes): Method renamed to Emit and make
4394         non-static.
4395         (GlobalAttributeSection): New class for special handling of global
4396         attributes (assembly, module).
4397         (AttributeSection.Emit): New method.
4398
4399         * class.cs: Implemented Attributable abstract methods.
4400         (MethodCore.LabelParameters): Moved to Parameter class.
4401         (Accessor): Is back simple class.
4402         (PropertyMethod): Implemented Attributable abstract class.
4403         (DelegateMethod): Implemented Attributable abstract class.
4404         (Event): New constructor for disctintion between normal Event
4405         and Event with accessors.
4406
4407         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4408
4409         * codegen.cs, const.cs, decl.cs, delegate.cs:
4410         (CommonAssemblyModulClass): Implemented Attributable abstract class
4411         and simplified.
4412
4413         * enum.cs: Implement IAttributeSupport interface.
4414         (EnumMember): New class for emum members. Implemented Attributable
4415         abstract class
4416
4417         * parameter.cs:
4418         (ParameterBase): Is abstract.
4419         (ReturnParameter): New class for easier [return:] attribute handling.
4420
4421         * typemanager.cs: Removed builder_to_attr.
4422
4423 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4424
4425         Fix bug #57151.
4426         * attribute.cs (Attribute.GetPositionalValue): New function.
4427         * class.cs (TypeContainer.VerifyMembers): New function.
4428         (TypeContainer.Emit): Use it.
4429         (ClassOrStruct): New base class for Class and Struct.
4430         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4431         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4432         class.
4433         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4434         then each non-static field should have a FieldOffset attribute.
4435         Otherwise, none of the fields should have a FieldOffset attribute.
4436         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4437         and FieldOffset attributes.
4438         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4439         (TypeManager.field_offset_attribute_type): New core types.
4440         (TypeManager.InitCoreTypes): Initialize them.
4441
4442 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4443
4444         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4445         Return correct type.
4446         From bug #58270.
4447
4448 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4449
4450         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4451         be implicitly converted to ulong.
4452         
4453         * expression.cs: The logic for allowing operator &, | and ^ worked
4454         was wrong, it worked before because we did not report an error in
4455         an else branch.  Fixes 57895.
4456
4457         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4458         allow volatile fields to be reference types.
4459
4460 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4461
4462         * driver.cs: Add support for /debug-
4463
4464 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4465
4466         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4467         Add a 'complain' parameter to silence errors.
4468         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4469         silently overlooked type-resolutions.
4470         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4471         to reflect changes.
4472         (Attributes.Search): New function.
4473         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4474         (Attributes.GetAttributeFullName): Remove hack.
4475         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4476         Update to reflect changes.
4477         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4478         Use Attributes.Search instead of nested loops.
4479
4480 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4481
4482         * decl.cs:
4483         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4484         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4485         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4486
4487         * report.cs: (Report.Warning): Renamed to Warning_T because of
4488         parameter collision.
4489
4490 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4491
4492         * expression.cs (MemberAccess.ResolveMemberAccess):
4493         Exit with non-zero status after Report.Error.
4494         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4495         Likewise.
4496         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4497
4498 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4499
4500         * support.cs: Don't hang when the file is empty.
4501
4502 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4503
4504         * support.cs: In SeekableStreamReader, compute the preamble size of the
4505           underlying stream. Position changes should take into account that initial
4506           count of bytes.
4507
4508 2004-05-03  Todd Berman  <tberman@sevenl.net>
4509
4510         * driver.cs: remove unused GetSysVersion function.
4511
4512 2004-05-03  Todd Berman  <tberman@sevenl.net>
4513
4514         * driver.cs: Remove the hack from saturday, as well as the hack
4515         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4516         link_paths to get that bit proper.
4517
4518 2004-05-01  Todd Berman  <tberman@sevenl.net>
4519
4520         * driver.cs: Try a LoadFrom before a Load, this checks the current
4521         path. This is currently a bug in mono that is be fixed, however, this
4522         provides a workaround for now. This will be removed when the bug
4523         is fixed.
4524
4525 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4526
4527         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4528         incomplete key pairs (#57941).
4529
4530 2004-05-01  Todd Berman  <tberman@sevenl.net>
4531
4532         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4533         from the GAC
4534
4535 2004-04-30  Jackson Harper  <jackson@ximian.com>
4536
4537         * codegen.cs: Open keys readonly.
4538         
4539 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4540
4541         * typemanager.cs: don't report cyclic struct layout when a struct
4542         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4543         which has 2 Pango.Rectangle fields.
4544
4545 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4546
4547         * expression.cs: Handle IntPtr comparisons with IL code
4548         rather than a method call.
4549
4550 2004-04-29  Martin Baulig  <martin@ximian.com>
4551
4552         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4553         the list of PropertyInfo's in class hierarchy and find the
4554         accessor.  Fixes #56013.
4555
4556 2004-04-29  Martin Baulig  <martin@ximian.com>
4557
4558         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4559
4560 2004-04-29  Martin Baulig  <martin@ximian.com>
4561
4562         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4563
4564         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4565
4566 2004-04-29  Martin Baulig  <martin@ximian.com>
4567
4568         * class.cs (ConstructorInitializer.Resolve): Check whether the
4569         parent .ctor is accessible.  Fixes #52146.
4570
4571 2004-04-29  Martin Baulig  <martin@ximian.com>
4572
4573         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4574
4575         * statement.cs (Using.EmitLocalVariableDecls): Use
4576         TypeManager.idisposable_type, not typeof (IDisposable).
4577         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4578
4579 2004-04-29  Martin Baulig  <martin@ximian.com>
4580
4581         * class.cs (Event.Define): Don't emit the field and don't set
4582         RTSpecialName and SpecialName for events on interfaces.  Fixes
4583         #57703. 
4584
4585 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4586
4587         Refactor Attribute.ApplyAttributes.
4588         * attribute.cs (Attributable): New base class for objects that can
4589         have Attributes applied on them.
4590         (Attribute): Make AttributeUsage fields public.
4591         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4592         (Attribute.IsInternalCall): New property.
4593         (Attribute.UsageAttr): Convert to a public read-only property.
4594         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4595         (Attribute.ResolveType, Attribute.Resolve)
4596         (Attribute.ScanForIndexerName): Update to reflect changes.
4597         (Attribute.CheckAttributeTarget): Re-format.
4598         (Attribute.ApplyAttributes): Refactor, to various
4599         Attributable.ApplyAttributeBuilder methods.
4600         * decl.cs (MemberCore): Make Attributable.
4601         * class.cs (Accessor): Make Attributable.
4602         (MethodData.ApplyAttributes): Use proper attribute types, not
4603         attribute names.
4604         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4605         (TypeContainer.ApplyAttributeBuilder)
4606         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4607         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4608         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4609         (Operator.ApplyAttributeBuilder): New factored-out methods.
4610         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4611         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4612         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4613         * parameter.cs (ParameterBase): New Attributable base class
4614         that can also represent Return types.
4615         (Parameter): Update to the changes.
4616
4617 2004-04-29  Jackson Harper  <jackson@ximian.com>
4618
4619         * driver.cs: Prefer the corlib system version when looking for
4620         assemblies in the GAC. This is still a hack, but its a better hack
4621         now.
4622         
4623 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4624
4625         * decl.cs, enum.cs: Improved error 3005 reporting.
4626   
4627         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4628         (related_symbols): New private member for list of symbols
4629         related to reported error/warning.
4630         
4631         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4632
4633 2004-04-29  Martin Baulig  <martin@ximian.com>
4634
4635         * ecore.cs (Expression.Constantify): If we're an enum and
4636         TypeManager.TypeToCoreType() doesn't give us another type, use
4637         t.UnderlyingSystemType.  Fixes #56178.  
4638
4639 2004-04-29  Martin Baulig  <martin@ximian.com>
4640
4641         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4642         interfaces and for each interface, only add members directly
4643         declared in that interface.  Fixes #53255.
4644
4645 2004-04-28  Martin Baulig  <martin@ximian.com>
4646
4647         * expression.cs (ConditionalLogicalOperator): Use a temporary
4648         variable for `left' to avoid that we evaluate it more than once;
4649         bug #52588.
4650
4651 2004-04-28  Martin Baulig  <martin@ximian.com>
4652
4653         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4654         `void[]' (CS1547).
4655
4656 2004-04-28  Martin Baulig  <martin@ximian.com>
4657
4658         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4659         void (CS1547).
4660
4661         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4662         whether the type is not void (CS1547).
4663
4664 2004-04-28  Martin Baulig  <martin@ximian.com>
4665
4666         * expression.cs (Unary.DoResolveLValue): Override this and report
4667         CS0131 for anything but Operator.Indirection.
4668
4669 2004-04-28  Martin Baulig  <martin@ximian.com>
4670
4671         Committing a patch from Ben Maurer; see bug #50820.
4672
4673         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4674         check for classes.
4675
4676         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4677         classes.        
4678
4679 2004-04-28  Martin Baulig  <martin@ximian.com>
4680
4681         Committing a patch from Ben Maurer; see bug #50820.
4682
4683         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4684         check for classes.
4685
4686         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4687         classes.        
4688
4689 2004-04-28  Martin Baulig  <martin@ximian.com>
4690
4691         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4692         (Block.AddLabel): Call DoLookupLabel() to only search in the
4693         current block.
4694
4695 2004-04-28  Martin Baulig  <martin@ximian.com>
4696
4697         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4698         comparing StringConstants and NullLiterals in Equality and Inequality.
4699
4700 2004-04-28  Jackson Harper  <jackson@ximian.com>
4701
4702         * driver.cs: Attempt to load referenced assemblies from the
4703         GAC. This is the quick and dirty version of this method that
4704         doesnt take into account versions and just takes the first
4705         canidate found. Will be good enough for now as we will not have more
4706         then one version installed into the GAC until I update this method.
4707
4708 2004-04-28  Martin Baulig  <martin@ximian.com>
4709
4710         * typemanager.cs (TypeManager.CheckStructCycles): New public
4711         static method to check for cycles in the struct layout.
4712
4713         * rootcontext.cs (RootContext.PopulateTypes): Call
4714         TypeManager.CheckStructCycles() for each TypeContainer.
4715         [Note: We only need to visit each type once.]
4716
4717 2004-04-28  Martin Baulig  <martin@ximian.com>
4718
4719         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4720
4721         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4722         success and added `out object value'.  Use a `bool resolved' field
4723         to check whether we've already been called rather than
4724         `ConstantValue != null' since this breaks for NullLiterals.
4725
4726 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4727
4728         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4729         setting of this flag, since the 'set' method may be non-public.
4730
4731 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4732
4733         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4734         check on current_vector.Block.
4735
4736 2004-04-27  Martin Baulig  <martin@ximian.com>
4737
4738         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4739         a field initializer.  Fixes #56459.
4740
4741 2004-04-27  Martin Baulig  <martin@ximian.com>
4742
4743         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4744         we're not attempting to use an indexer.  Fixes #52154.
4745
4746 2004-04-27  Martin Baulig  <martin@ximian.com>
4747
4748         * statement.cs (Return): Don't create a return label if we don't
4749         need it; reverts my change from January 20th.  Thanks to Ben
4750         Maurer for this.
4751
4752 2004-04-27  Martin Baulig  <martin@ximian.com>
4753
4754         According to the spec, `goto' can only leave a nested scope, but
4755         never enter it.
4756
4757         * statement.cs (Block.LookupLabel): Only lookup in the current
4758         block, don't recurse into parent or child blocks.
4759         (Block.AddLabel): Check in parent and child blocks, report
4760         CS0140/CS0158 if we find a duplicate.
4761         (Block): Removed this indexer for label lookups.
4762         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4763         this already does the error reporting for us.
4764
4765         * flowanalysis.cs
4766         (FlowBranching.UsageVector.Block): New public variable; may be null.
4767         (FlowBranching.CreateSibling): Added `Block' argument.
4768         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4769         label for the target of a `goto' and check whether we're not
4770         leaving a `finally'.
4771
4772 2004-04-27  Martin Baulig  <martin@ximian.com>
4773
4774         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4775         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4776         just for returns).
4777
4778 2004-04-27  Martin Baulig  <martin@ximian.com>
4779
4780         * statement.cs (Block.AddLabel): Also check for implicit blocks
4781         and added a CS0158 check.
4782
4783 2004-04-27  Martin Baulig  <martin@ximian.com>
4784
4785         * flowanalysis.cs (FlowBranchingLoop): New class.
4786         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4787         UsageVector's instead of an ArrayList.
4788         (FlowBranching.Label): Likewise.
4789         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4790         (FlowBranching.AddBreakVector): New method.
4791
4792 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4793
4794         * attribute.cs: Small regression fix: only convert the type if we
4795         the type is different, fixes System.Drawing build.
4796
4797 2004-04-27  Martin Baulig  <martin@ximian.com>
4798
4799         * attribute.cs (Attribute.Resolve): If we have a constant value
4800         for a named field or property, implicity convert it to the correct
4801         type.
4802
4803 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4804
4805         * statement.cs (Block.Block): Implicit blocks share
4806         'child_variable_names' fields with parent blocks.
4807         (Block.AddChildVariableNames): Remove.
4808         (Block.AddVariable): Mark variable as "used by a child block" in
4809         every surrounding block.
4810         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4811         been used in a child block, complain about violation of "Invariant
4812         meaning in blocks" rule.
4813         * cs-parser.jay (declare_local_variables): Don't use
4814         AddChildVariableNames.
4815         (foreach_statement): Don't create an implicit block: 'foreach'
4816         introduces a scope.
4817
4818 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4819
4820         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4821         converting from 0L to ulong.  Fixes 57522.
4822
4823 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4826         derived class hides via 'new' keyword field from base class (test-242.cs).
4827         TODO: Handle this in the more general way.
4828         
4829         * class.cs (CheckBase): Ditto.
4830
4831 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4832
4833         * decl.cs (caching_flags): New member for storing cached values
4834         as bit flags.
4835         (MemberCore.Flags): New enum where bit flags for caching_flags
4836         are defined.
4837         (MemberCore.cls_compliance): Moved to caching_flags.
4838         (DeclSpace.Created): Moved to caching_flags.
4839
4840         * class.cs: Use caching_flags instead of DeclSpace.Created
4841         
4842 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4843
4844         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4845         if we are only a derived class, not a nested class.
4846
4847         * typemanager.cs: Same as above, but do this at the MemberLookup
4848         level (used by field and methods, properties are handled in
4849         PropertyExpr).   Allow for the qualified access if we are a nested
4850         method. 
4851
4852 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4853
4854         * class.cs: Refactoring.
4855         (IMethodData): New inteface; Holds links to parent members
4856         to avoid member duplication (reduced memory allocation).
4857         (Method): Implemented IMethodData interface.
4858         (PropertyBase): New inner classes for get/set methods.
4859         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4860         (Event): New inner classes for add/remove methods.
4861         (Event.DelegateMethod): Implemented IMethodData interface.
4862
4863         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4864         EmitContext (related to class.cs refactoring).
4865
4866 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4867
4868         * delegate.cs (Delegate.VerifyApplicability): If the number of
4869         arguments are the same as the number of parameters, first try to
4870         verify applicability ignoring  any 'params' modifier on the last
4871         parameter.
4872         Fixes #56442.
4873
4874 2004-04-08  Martin Baulig  <martin@ximian.com>
4875
4876         Merged latest changes into gmcs.  Please keep this comment in
4877         here, it makes it easier for me to see what changed in MCS since
4878         the last time I merged.
4879
4880 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4881
4882         * class.cs (TypeContainer.AddIndexer): Use
4883         'ExplicitInterfaceName' to determine if interface name was
4884         explicitly specified.  'InterfaceType' is not initialized at this time.
4885         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4886         Indexers array is already in the required order.  Initialize
4887         'IndexerName' only if there are normal indexers.
4888         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4889         (TypeContainer.Emit): Emit DefaultMember attribute only if
4890         IndexerName is initialized.
4891         Fixes #56300.
4892
4893 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4894
4895         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4896         Fixes #57007
4897
4898 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4899
4900         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4901         attributes.
4902         Fix for #56456.
4903
4904         * attribute.cs (Attribute.Resolve): Check for duplicate named
4905         attributes.
4906         Fix for #56463.
4907
4908 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4909
4910         * iterators.cs (MarkYield): track whether we are in an exception,
4911         and generate code accordingly.  Use a temporary value to store the
4912         result for our state.
4913
4914         I had ignored a bit the interaction of try/catch with iterators
4915         since their behavior was not entirely obvious, but now it is
4916         possible to verify that our behavior is the same as MS .NET 2.0
4917
4918         Fixes 54814
4919
4920 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4921
4922         * iterators.cs: Avoid creating temporaries if there is no work to
4923         do. 
4924
4925         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4926         Enumerations, use TypeManager.EnumToUnderlying and call
4927         recursively. 
4928
4929         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4930         bug #57013
4931
4932         (This.Emit): Use EmitContext.EmitThis to emit our
4933         instance variable.
4934
4935         (This.EmitAssign): Ditto.
4936
4937         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4938         codepaths, we will move all the functionality into
4939         Mono.CSharp.This 
4940
4941         (FieldExpr.EmitAssign): Ditto.
4942
4943         This fixes several hidden bugs that I uncovered while doing a code
4944         review of this today.
4945
4946         * codegen.cs (EmitThis): reworked so the semantics are more clear
4947         and also support value types "this" instances.
4948
4949         * iterators.cs: Changed so that for iterators in value types, we
4950         do not pass the value type as a parameter.  
4951
4952         Initialization of the enumerator helpers is now done in the caller
4953         instead of passing the parameters to the constructors and having
4954         the constructor set the fields.
4955
4956         The fields have now `assembly' visibility instead of private.
4957
4958 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4959
4960         * expression.cs (Argument.Resolve): Check if fields passed as ref
4961         or out are contained in a MarshalByRefObject.
4962
4963         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4964         another compiler type.
4965
4966 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4967
4968         * class.cs (Indexer.Define): use the new name checking method.
4969         Also, return false on an error.
4970         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4971         (is_identifier_[start/part]_character): make static.
4972
4973 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4974
4975         * expression.cs (Binary.ResolveOperator): Do no append strings
4976         twice: since we can be invoked more than once (array evaluation)
4977         on the same concatenation, take care of this here.  Based on a fix
4978         from Ben (bug #56454)
4979
4980 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4981
4982         * codegen.cs: Fix another case where CS1548 must be reported (when 
4983         delay-sign isn't specified and no private is available #56564). Fix
4984         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4985         error when MCS is used on the MS runtime and we need to delay-sign 
4986         (which seems unsupported by AssemblyBuilder - see #56621).
4987
4988 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4989
4990         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4991         (TypeManager.ComputeNamespaces): Faster implementation for
4992         Microsoft runtime.
4993
4994         * compiler.csproj: Updated AssemblyName to mcs.
4995
4996 2004-05-11  Jackson Harper  <jackson@ximian.com>
4997
4998         * Makefile: Preserve MONO_PATH
4999         
5000 2004-05-11  Jackson Harper  <jackson@ximian.com>
5001
5002         * Makefile: Use mono and mcs to build gmcs
5003         
5004 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
5005
5006         * codegen.cs: Add patch from Robert Shade
5007         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
5008         sync with mcs.
5009
5010 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
5011
5012         * CryptoConvert.cs: Updated to latest version. Fix issue with 
5013         incomplete key pairs (#57941).
5014
5015 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5016
5017         * codegen.cs: Fix another case where CS1548 must be reported (when 
5018         delay-sign isn't specified and no private is available #56564). Fix
5019         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
5020         error when MCS is used on the MS runtime and we need to delay-sign 
5021         (which seems unsupported by AssemblyBuilder - see #56621).
5022
5023 2004-04-29  Jackson Harper  <jackson@ximian.com>
5024
5025         * Makefile: Set MONO_PATH to use the bootstrap corlib
5026         * driver.cs: Check the GAC for referenced assemblies.
5027                 
5028 2004-04-29  Martin Baulig  <martin@ximian.com>
5029
5030         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
5031
5032 2004-04-07  Martin Baulig  <martin@ximian.com>
5033
5034         * expression.cs (Binary.ResolveOperator): Added special case for
5035         Equality/Inequality between a type parameter and a null literal.
5036
5037 2004-04-07  Martin Baulig  <martin@ximian.com>
5038
5039         * convert.cs: Check null literal -> type parameter conversions.
5040
5041 2004-04-07  Martin Baulig  <martin@ximian.com>
5042
5043         * generic.cs (ConstructedType.CheckConstraints): Enforce the
5044         `class' and `struct' constraints.
5045
5046 2004-04-07  Martin Baulig  <martin@ximian.com>
5047
5048         * generic.cs (SpecialConstraint): New public enum.
5049         (Constraints.Resolve): Added support for the `class' and `struct'
5050         constraints.
5051
5052         * cs-parser.jay (type_parameter_constraint): Added support for the
5053         `class' and `struct' constraints.
5054
5055 2004-04-07  Martin Baulig  <martin@ximian.com>
5056
5057         * support.cs (GenericConstraints): Replaced `Types' by
5058         `ClassConstraint' and `InterfaceConstraints'; added
5059         `HasClassConstraint'.   
5060
5061 2004-04-07  Martin Baulig  <martin@ximian.com>
5062
5063         * generic.cs
5064         (Constraints.InterfaceConstraints): New public property.
5065         (Constraints.Types): Make this property public
5066         (TypeParameter): Implement IMemberContainer.
5067         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
5068         instead of a TypeBuilder/MethodBuilder; pass the interface
5069         constraints to TypeManager.AddTypeParameter().
5070         (TypeParameter.DefineType): Just take an EmitContext and no
5071         TypeBuilder/MethodBuilder.  Use the new public API.
5072
5073         * typemanager.cs (TypeManager.AddTypeParameter): Added
5074         `TypeExpr[]' argument; add the interfaces to the
5075         `builder_to_ifaces' hash.
5076         (TypeManager.LookupMemberContainer): For
5077         GenericTypeParameterBuilders, get the TypeParameter from the
5078         `builder_to_type_param'.
5079         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5080         the TypeParameter and call FindMembers on it.
5081
5082 2004-04-07  Martin Baulig  <martin@ximian.com>
5083
5084         * class.cs
5085         (MethodCore.GenericMethod): Moved this field here from Method.
5086         (MethodCore.IsDuplicateImplementation): Take the number of type
5087         parameters into account if we're a generic method.
5088
5089         * expression.cs (Invocation.InferTypeArguments): Don't return true
5090         if `arguments' is null; we still need to check whether we actually
5091         don't need to infer anything in this case.
5092         (MemberAccess): Merged the functionality from GenericMemberAccess
5093         into this class.
5094
5095         * generic.cs (GenericMemberAccess): Removed.
5096
5097 2004-04-05  Martin Baulig  <martin@ximian.com>
5098
5099         * decl.cs (MemberCore): For generic classes, interfaces and
5100         structs, `Name' now includes the number of type parameters
5101         ("Stack!1.Node!1").
5102         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5103         encode the number of type arguments in the type name.
5104
5105         * expression.cs (Expression.MemberLookup): Removed the
5106         `num_type_args' argument; we now encode the number of type
5107         arguments in the type name.
5108
5109         * ecore.cs (SimpleName): Encode the number of type arguments in
5110         the type name itself.
5111
5112         * generic.cs (ConstructedType): Likewise.
5113
5114         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5115         `MemberName'; we now include the number of type parameters in the
5116         type name.
5117
5118         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5119         (TypeManager.MemberLookup): Removed the
5120         `num_type_args' argument; we now encode the number of type
5121         arguments in the type name.     
5122
5123 2004-04-03  Martin Baulig  <martin@ximian.com>
5124
5125         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5126         (MemberCore.MemberName): Moved here from MemberBase.
5127         (DeclSpace.SetParameterInfo): Just take the constraints as an
5128         ArrayList; we already have the type parameters in our
5129         `MemberName'; also do the CS0080 reporting here.
5130
5131         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5132         `IDENTIFIER opt_type_parameter_list'; when constructing our
5133         `MemberName', it'll already include our type parameters.
5134         (class_declaration, interface_declaration): Likewise.
5135         (delegate_declaration): Likewise.
5136         (MakeName): Take a MemberName and return a MemberName.
5137         The following two changes are required to avoid shift/reduce conflicts:
5138         (member_name): Don't include a TypeName anymore; ie. this is now
5139         just 'IDENTIFIER opt_type_parameter_list'.
5140         (property_declaration, event_declaration): Use a
5141         `namespace_or_type_name' instead of a `member_name'.            
5142
5143 2004-04-03  Martin Baulig  <martin@ximian.com>
5144
5145         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5146         `MemberName' class.
5147         (TypeName): Formerly known as MemberName.
5148
5149         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5150         instead of a `MemberName'.
5151
5152         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5153         (member_name): New rule; create a MemberName.
5154
5155 2004-04-02  Martin Baulig  <martin@ximian.com>
5156
5157         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5158         (CS0305 and CS0308).
5159
5160 2004-04-02  Martin Baulig  <martin@ximian.com>
5161
5162         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5163         support for nested types.
5164
5165 2004-04-02  Martin Baulig  <martin@ximian.com>
5166
5167         * ecore.cs (IAlias): New public interface.
5168         (TypeExpr, TypeExpression): Implement IAlias.
5169         (TypeAliasExpression): New public class.
5170
5171         * namespace.cs (Namespace): Implement IAlias.
5172         (Namespace.Lookup): Return an IAlias instead on an object.
5173         (Namespace.DefineName): Take an IAlias instead of an object.
5174         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5175         an object.
5176         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5177         Expression.
5178         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5179         object.
5180         (NamespaceEntry.Lookup): Likewise.
5181
5182         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5183         instead of a Type.      
5184
5185         * decl.cs (DeclSpace): Implement IAlias.
5186         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5187
5188         * generic.cs (ConstructedType): Improved error checking.
5189
5190 2004-04-02  Martin Baulig  <martin@ximian.com>
5191
5192         * convert.cs: Added type parameter conversions.
5193
5194         * ecore.cs
5195         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5196         (ClassCast.Emit): If the source type is a type parameter, box it.
5197         If the target type is a type parameter, emit an `unbox.any'
5198         instead of a `classcast'.1      
5199
5200 2004-04-01  Martin Baulig  <martin@ximian.com>
5201
5202         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5203
5204 2004-04-01  Martin Baulig  <martin@ximian.com>
5205
5206         * generic.cs (ConstructedType.CheckConstraints): Use
5207         Convert.ImplicitStandardConversionExists(); user-defined implicit
5208         conversions are not allowed according to the spec.
5209
5210 2004-03-30  Martin Baulig  <martin@ximian.com>
5211
5212         * expression.cs (New): Added support for type parameters.
5213
5214         * typemanager.cs
5215         (TypeManager.activator_type): New public static field.
5216         (TypeManager.activator_create_instance): Likewise.
5217
5218 2004-03-30  Martin Baulig  <martin@ximian.com>
5219
5220         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5221         public method.
5222
5223 2004-03-30  Martin Baulig  <martin@ximian.com>
5224
5225         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5226         the spec here: the argument type must be convertible to the
5227         constraints.
5228
5229 2004-03-30  Martin Baulig  <martin@ximian.com>
5230
5231         * generic.cs
5232         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5233         TypeManager.AddTypeParameter().
5234         (ConstructedType.CheckConstraints): Re-enable this and actually
5235         check whether we have a constructor constraint.
5236
5237         * typemanager.cs
5238         (TypeManager.builder_to_type_param): New static field.
5239         (TypeManager.AddTypeParameter): New static method.
5240         (TypeManager.LookupTypeParameter): New public method.
5241
5242 2004-03-30  Martin Baulig  <martin@ximian.com>
5243
5244         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5245         the new API to actually define the constructor constraint.
5246
5247         * typemanager.cs
5248         (TypeManager.new_constraint_attr_type): New static field.
5249         (TypeManager.InitCoreTypes): Initialize it.
5250
5251 2004-03-30  Martin Baulig  <martin@ximian.com>
5252
5253         * generic.cs (Constraints): Completed error checking, use correct
5254         error numbers.
5255
5256 2004-03-29  Martin Baulig  <martin@ximian.com>
5257
5258         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5259
5260         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5261         public version which takes a `ParameterData pd' instead of an
5262         `ArrayList args'.
5263
5264 2004-03-29  Martin Baulig  <martin@ximian.com>
5265
5266         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5267         not a MethodInfo.       
5268
5269 2004-03-29  Martin Baulig  <martin@ximian.com>
5270
5271         * expression.cs (Argument.ResolveMethodGroup): If we're a
5272         ConstructedType, call GetMemberAccess() on it.  
5273
5274 2004-03-29  Martin Baulig  <martin@ximian.com>
5275
5276         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5277         (MethodCore.CheckGenericOverride): When overriding a generic
5278         method, check whether the constraints match.
5279
5280         * support.cs (GenericConstraints): New public interface.
5281         (ParameterData.GenericConstraints): New public method.
5282
5283         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5284         method parameter and compute our constraints if appropriate.
5285         (Parameter.GenericConstraints): New public property.
5286
5287         * generic.cs (Constraints): Implement GenericConstraints.
5288
5289 2004-03-29  Martin Baulig  <martin@ximian.com>
5290
5291         * decl.cs (MemberCache.FindMemberToOverride): Use
5292         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5293
5294 2004-03-29  Martin Baulig  <martin@ximian.com>
5295
5296         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5297
5298 2004-03-29  Martin Baulig  <martin@ximian.com>
5299
5300         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5301         not allowed on non-generic declarations").
5302
5303 2004-03-29  Martin Baulig  <martin@ximian.com>
5304
5305         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5306         public version of this method.
5307
5308         * class.cs (MethodCore.IsDuplicateImplementation): Use
5309         Invocation.InferTypeArguments() to check this.
5310
5311 2004-03-29  Martin Baulig  <martin@ximian.com>
5312
5313         * convert.cs: Use TypeManager.IsDelegateType() instead of
5314         comparing types correctly.
5315
5316 2004-03-29  Martin Baulig  <martin@ximian.com>
5317
5318         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5319         types directly to make it work for generic instances.
5320
5321         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5322
5323 2004-03-29  Martin Baulig  <martin@ximian.com>
5324
5325         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5326         support for arrays.     
5327
5328 2004-03-24  Martin Baulig  <martin@ximian.com>
5329
5330         * decl.cs (DeclSpace.FindType): Also use
5331         TypeManager.CheckGeneric() for types from the using clauses.
5332
5333 2004-03-23  Martin Baulig  <martin@ximian.com>
5334
5335         * expression.cs (Invocation.OverloadResolve): Added `bool
5336         may_fail' argument and use it instead of the Location.IsNull() hack.
5337
5338 2004-03-23  Martin Baulig  <martin@ximian.com>
5339
5340         * expression.cs (Invocation.InferType): Use correct type inference
5341         rules here.     
5342
5343 2004-03-23  Martin Baulig  <martin@ximian.com>
5344
5345         * ecore.cs (MethodGroupExpr.Name): Use
5346         TypeManager.CSharpSignature() instead of just the name.
5347
5348         * expression.cs (Invocation.OverloadResolve): Provide better error
5349         reporting.
5350         (Invocation.DoResolve): OverloadResolve() never returns null
5351         without reporting an error, so removed the error -6 reporting here.
5352
5353 2004-03-23  Martin Baulig  <martin@ximian.com>
5354
5355         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5356         generic methods.
5357
5358         * cs-parser.jay (delegate_declaration): Support generic delegates.
5359
5360         * delegate.cs: Support generic delegates.
5361
5362 2004-03-22  Martin Baulig  <martin@ximian.com>
5363
5364         * expression.cs (Invocation.InferParamsTypeArguments): New static
5365         method; does type inference for params arguments.
5366
5367 2004-03-21  Martin Baulig  <martin@ximian.com>
5368
5369         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5370         method; checks whether a method is a generic method.    
5371
5372         * expression.cs (Invocation.InferTypeArguments): New static method;
5373         infer type arguments for generic method invocation.
5374
5375         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5376         property; we set this to true if we're resolving a generic method
5377         invocation and the user specified type arguments, ie. we're not
5378         doing type inference.
5379
5380 2004-03-20  Martin Baulig  <martin@ximian.com>
5381
5382         * class.cs (MethodData.DeclaringType): New public property.
5383         (MethodData.Define): Set DeclaringType here.
5384         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5385         instead of OperatorMethodBuilder.DeclaringType.
5386
5387 2004-03-20  Martin Baulig  <martin@ximian.com>
5388
5389         * cs-tokenizer.cs (xtoken): Return a special
5390         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5391
5392         * cs-parser.jay (default_value_expression): Switch to the new
5393         syntax (14.5.13).
5394
5395 2004-03-19  Martin Baulig  <martin@ximian.com>
5396
5397         * decl.cs (MemberName): New class.  We use this to "construct"
5398         namespace_or_type_name's.
5399
5400         * generics.cs (TypeArguments.GetDeclarations): New public method;
5401         returns the type arguments as a string[] and reports a CS0081 if
5402         one of them is not an identifier.
5403
5404         * class.cs (MemberBase): The .ctor now takes the name as a
5405         MemberName instead of a string.
5406         (MemberBase.ExplicitInterfaceName): Changed type from string to
5407         Expression.
5408         (MemberBase.DoDefine): If we're an explicit implementation, the
5409         InterfaceType may be a generic instance.
5410
5411         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5412         (namespace_name): Call MemberName.GetName () to transform the
5413         MemberName into a string and ensure we don't have any type
5414         arguments.
5415         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5416         MemberName into an expression.
5417         (method_header): Use namespace_or_type_name instead of member_name.     
5418
5419 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5420
5421         * rootcontext.cs: Add new types to the boot resolution.
5422
5423         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5424         MulticastDelegate is not allowed.
5425
5426         * typemanager.cs: Add new types to lookup: System.TypedReference
5427         and ArgIterator.
5428
5429         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5430         check for TypedReference or ArgIterator, they are not allowed. 
5431
5432         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5433         makes us properly catch 1510 in some conditions (see bug 56016 for
5434         details). 
5435
5436 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5437
5438         * CryptoConvert.cs: update from corlib version
5439         with endian fixes.
5440
5441 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5442
5443         * class.cs (Indexer.Define): Check indexername declaration
5444
5445 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5446
5447         * attribute.cs (IsClsCompliant): Fixed problem with handling
5448         all three states (compliant, not-compliant, undetected).
5449
5450 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5451
5452         * attribute.cs (Attribute): Location is now public.
5453         (Resolve): Store resolved arguments (pos_values) in attribute class.
5454         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5455         (GetClsCompliantAttributeValue): New method that gets
5456         CLSCompliantAttribute value.
5457         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5458         if exists else null.
5459         (AttributeTester): New class for CLS-Compliant verification routines.
5460
5461         * class.cs (Emit): Add CLS-Compliant verification.
5462         (Method.GetSignatureForError): Implemented.
5463         (Constructor.GetSignatureForError): Implemented
5464         (Constructor.HasCompliantArgs): Returns if constructor has
5465         CLS-Compliant arguments.
5466         (Constructor.Emit): Override.
5467         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5468         is needed to test only parameters.
5469         (FieldBase.GetSignatureForError): Implemented.
5470         (TypeContainer): New member for storing base interfaces.
5471         (TypeContainer.FindMembers): Search in base interfaces too.
5472
5473         * codegen.cs (GetClsComplianceAttribute): New method that gets
5474         assembly or module CLSCompliantAttribute value.
5475         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5476         for assembly.
5477         (ModuleClass.Emit): Add error 3012 test.
5478
5479         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5480
5481         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5482         state for all decl types.
5483         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5484         if CLS-Compliant tests are required.
5485         (IsClsCompliaceRequired): New method. Analyze whether code
5486         must be CLS-Compliant.
5487         (IsExposedFromAssembly): New method. Returns true when MemberCore
5488         is exposed from assembly.
5489         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5490         value or gets cached value.
5491         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5492         is explicitly marked with CLSCompliantAttribute.
5493         (IsIdentifierClsCompliant): New abstract method. This method is
5494         used to testing error 3005.
5495         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5496         for identifier and parameters CLS-Compliant testing.
5497         (VerifyClsCompliance): New method. The main virtual method for
5498         CLS-Compliant verifications.
5499         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5500         null. I don't know why is null (too many public members !).
5501         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5502         and get value of first CLSCompliantAttribute that found.
5503
5504         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5505         (VerifyClsCompliance): Override and add extra tests.
5506
5507         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5508         clscheck- disable CLS-Compliant verification event if assembly is has
5509         CLSCompliantAttribute(true).
5510
5511         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5512         ApllyAttribute is now called in emit section as in the other cases.
5513         Possible future Emit integration.
5514         (IsIdentifierClsCompliant): New override.
5515         (VerifyClsCompliance): New override.
5516         (GetEnumeratorName): Returns full enum name.
5517
5518         * parameter.cs (GetSignatureForError): Implemented.
5519
5520         * report.cs (WarningData): New struct for Warning message information.
5521         (LocationOfPreviousError): New method.
5522         (Warning): New method. Reports warning based on the warning table.
5523         (Error_T): New method. Reports error based on the error table.
5524
5525         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5526         verifications are done here.
5527
5528         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5529
5530         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5531         CLSCompliantAttribute.
5532         (all_imported_types): New member holds all imported types from other
5533         assemblies.
5534         (LoadAllImportedTypes): New method fills static table with exported types
5535         from all referenced assemblies.
5536         (Modules): New property returns all assembly modules.
5537
5538 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5539
5540         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5541         throwing a parser error.
5542
5543         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5544         which removes the hardcoded get_/set_ prefixes for properties, as
5545         IL allows for the properties to be named something else.  
5546
5547         Bug #56013
5548
5549         * expression.cs: Do not override operand before we know if it is
5550         non-null.  Fix 56207
5551
5552 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5553
5554         * typemanager.cs: support for pinned variables.
5555
5556 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5557
5558         * decl.cs, typemanager.cs: Avoid using an arraylist
5559         as a buffer if there is only one result set.
5560
5561 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5562
5563         * expression.cs: Make sure you cant call a static method
5564         with an instance expression, bug #56174.
5565
5566 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5567
5568         * class.cs (IsDuplicateImplementation): Improve error reporting to
5569         flag 663 (method only differs in parameter modifier).
5570
5571         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5572         in preprocessor directives.
5573
5574         * location.cs (LookupFile): Allow for the empty path.
5575
5576         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5577         better approach for some of that patch, but its failing with the
5578         CharSet enumeration.  For now try/catch will do.
5579
5580         * typemanager.cs: Do not crash if a struct does not have fields.
5581         Fixes 56150.
5582
5583 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5584
5585         * expression.cs: cs0213, cant fix a fixed expression.
5586         fixes 50231.
5587
5588 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5589
5590         * cs-parser.jay: detect invalid embeded statements gracefully.
5591         bug #51113.
5592
5593 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5594
5595         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5596         As a regex:
5597         s/
5598         the invocation type may not be a subclass of the tye of the item/
5599         The type of the item must be a subclass of the invocation item.
5600         /g
5601
5602         Fixes bug #50820.
5603
5604 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5605
5606         * attribute.cs: Added methods to get a string and a bool from an
5607         attribute. Required to information from AssemblyKeyFileAttribute,
5608         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5609         * codegen.cs: Modified AssemblyName creation to include support for
5610         strongnames. Catch additional exceptions to report them as CS1548.
5611         * compiler.csproj: Updated include CryptoConvert.cs.
5612         * compiler.csproj.user: Removed file - user specific configuration.
5613         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5614         Mono.Security assembly. The original class is maintained and tested in
5615         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5616         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5617         like CSC 8.0 (C# v2) supports.
5618         * Makefile: Added CryptoConvert.cs to mcs sources.
5619         * rootcontext.cs: Added new options for strongnames.
5620
5621 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5622
5623         * driver.cs: For --expect-error, report error code `2'
5624         if the program compiled with no errors, error code `1' if
5625         it compiled with an error other than the one expected.
5626
5627 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5628
5629         * compiler.csproj: Updated for Visual Studio .NET 2003.
5630         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5631         * compiler.sln: Updated for Visual Studio .NET 2003.
5632
5633 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5634
5635         * expression.cs: Fix bug #47234. We basically need to apply the
5636         rule that we prefer the conversion of null to a reference type
5637         when faced with a conversion to 'object' (csc behaviour).
5638
5639 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5640
5641         * statement.cs: Shorter form for foreach, eliminates
5642         a local variable. r=Martin.
5643
5644 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5645
5646         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5647         checks if we can use brtrue/brfalse to test for 0.
5648         * expression.cs: use the above in the test for using brtrue/brfalse.
5649         cleanup code a bit.
5650
5651 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5652
5653         * expression.cs: Rewrite string concat stuff. Benefits:
5654
5655         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5656         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5657         rather than a concat chain.
5658
5659         * typemanager.cs: Add lookups for more concat overloads.
5660
5661 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5662
5663         * expression.cs: Emit shorter il code for array init.
5664
5665         newarr
5666         dup
5667         // set 1
5668
5669         // set 2
5670
5671         newarr
5672         stloc.x
5673
5674         ldloc.x
5675         // set 1
5676
5677         ldloc.x
5678         // set 2
5679
5680 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5681
5682         * statement.cs: Before, two switch blocks would be merged if the
5683         total size of the blocks (end_item - begin_item + 1) was less than
5684         two times the combined sizes of the blocks.
5685
5686         Now, it will only merge if after the merge at least half of the
5687         slots are filled.
5688
5689         fixes 55885.
5690
5691 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5692
5693         * class.cs : csc build fix for GetMethods(). See bug #52503.
5694
5695 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5696
5697         * expression.cs: Make sure fp comparisons work with NaN.
5698         This fixes bug #54303. Mig approved this patch a long
5699         time ago, but we were not able to test b/c the runtime
5700         had a related bug.
5701
5702 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5703
5704         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5705
5706 2004-03-19  Martin Baulig  <martin@ximian.com>
5707
5708         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5709         two overloads may unify for some type parameter substitutions and
5710         report a CS0408 if appropriate.
5711
5712 2004-03-19  Martin Baulig  <martin@ximian.com>
5713
5714         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5715         error here and not in our caller.
5716
5717 2004-03-19  Martin Baulig  <martin@ximian.com>
5718
5719         * interface.cs: Completely killed this file.
5720         (Interface): We're now a TypeContainer and live in class.cs.
5721
5722         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5723         argument; we're now also called for interfaces.
5724         (TypeContainer.DefineMembers): Allow this method being called
5725         multiple times.
5726         (TypeContainer.GetMethods): New public method; formerly known as
5727         Interface.GetMethod().  This is used by PendingImplementation.
5728         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5729         it's now private and non-static.
5730         (Interface): Moved this here; it's now implemented similar to
5731         Class and Struct.
5732         (Method, Property, Event, Indexer): Added `bool is_interface'
5733         argument to their .ctor's.
5734         (MemberBase.IsInterface): New public field.
5735
5736         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5737         instances instead of InterfaceMethod, InterfaceProperty, etc.
5738         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5739         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5740
5741 2004-03-19  Martin Baulig  <martin@ximian.com>
5742
5743         * class.cs (MethodCore.IsDuplicateImplementation): New private
5744         method which does the CS0111 checking.
5745         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5746         Use IsDuplicateImplementation().
5747
5748 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5749
5750         * decl.cs (FindMemberToOverride): New method to find the correct
5751         method or property to override in the base class.
5752         * class.cs
5753             - Make Method/Property use the above method to find the
5754               version in the base class.
5755             - Remove the InheritableMemberSignatureCompare as it is now
5756               dead code.
5757
5758         This patch makes large code bases much faster to compile, as it is
5759         O(n) rather than O(n^2) to do this validation.
5760
5761         Also, it fixes bug 52458 which is that nested classes are not
5762         taken into account when finding the base class member.
5763
5764         Reviewed/Approved by Martin.
5765
5766 2004-03-17  Martin Baulig  <martin@ximian.com>
5767
5768         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5769         of type arguments into account; use the `real_num_type_args'
5770         approach like in DoResolveAsTypeStep().
5771
5772         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5773         nested types.
5774
5775 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5776
5777         * interface.cs: In all interface classes removed redundant
5778         member initialization.
5779
5780 2004-03-16  Martin Baulig  <martin@ximian.com>
5781
5782         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5783
5784 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5785
5786         * decl.cs (DefineTypeAndParents): New helper method to define a
5787         type's containers before the type itself is defined;  This is a
5788         bug exposed by the recent changes to Windows.Forms when an
5789         implemented interface was defined inside a class that had not been
5790         built yet.   
5791
5792         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5793
5794         (Check): Loop correctly to report errors modifiers
5795         (UNSAFE was not in the loop, since it was the same as TOP).
5796
5797         * interface.cs: Every interface member now takes a ModFlags,
5798         instead of a "is_new" bool, which we set on the base MemberCore. 
5799
5800         Every place where we called "UnsafeOk" in the interface, now we
5801         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5802         the unsafe settings from the member declaration instead of the
5803         container interface. 
5804
5805         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5806
5807         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5808         `set_indexer_name' to the pending bits (one per type).
5809
5810         We fixed a bug today that was picking the wrong method to
5811         override, since for properties the existing InterfaceMethod code
5812         basically ignored the method name.  Now we make sure that the
5813         method name is one of the valid indexer names.
5814
5815 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5816  
5817         * support.cs (SeekableStreamReader): Keep track of stream byte
5818         positions and don't mix them with character offsets to the buffer.
5819
5820         Patch from Gustavo Giráldez
5821
5822 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5823
5824         * interface.cs (InterfaceSetGetBase): Removed double member
5825         initialization, base class does it as well.
5826
5827 2004-03-13  Martin Baulig  <martin@ximian.com>
5828
5829         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5830         when compiling corlib.
5831
5832 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5833
5834         * convert.cs (ExplicitConversion): We were reporting an error on
5835         certain conversions (object_type source to a value type, when the
5836         expression was `null') before we had a chance to pass it through
5837         the user defined conversions.
5838
5839         * driver.cs: Replace / and \ in resource specifications to dots.
5840         Fixes 50752
5841
5842         * class.cs: Add check for duplicate operators.  Fixes 52477
5843
5844 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5845
5846         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5847         that are in the middle of the statements, not only at the end.
5848         Fixes #54987
5849
5850         * class.cs (TypeContainer.AddField): No longer set the
5851         `HaveStaticConstructor' flag, now we call it
5852         `UserDefineStaticConstructor' to diferentiate the slightly
5853         semantic difference.
5854
5855         The situation is that we were not adding BeforeFieldInit (from
5856         Modifiers.TypeAttr) to classes that could have it.
5857         BeforeFieldInit should be set to classes that have no static
5858         constructor. 
5859
5860         See:
5861
5862         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5863
5864         And most importantly Zoltan's comment:
5865
5866         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5867
5868         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5869          before its static fields are used', i.e. initialization does not need
5870          to be triggered by the first access to the type. Setting this flag
5871          helps the JIT to compile better code, since it can run the static
5872          constructor at JIT time, and does not need to generate code to call it
5873          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5874          this flag for lots of classes like String. 
5875          
5876          csc sets this flag if the type does not have an explicit static 
5877          constructor. The reasoning seems to be that if there are only static
5878          initalizers for a type, and no static constructor, then the programmer
5879          does not care when this initialization happens, so beforefieldinit
5880          can be used.
5881          
5882          This bug prevents the AOT compiler from being usable, since it 
5883          generates so many calls to mono_runtime_class_init that the AOT code
5884          is much slower than the JITted code. The JITted code is faster, 
5885          because it does not generate these calls if the vtable is type is
5886          already initialized, which is true in the majority of cases. But the
5887          AOT compiler can't do this."
5888
5889 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5890
5891         * class.cs (MethodData.Emit): Refactor the code so symbolic
5892         information is generated for destructors;  For some reasons we
5893         were taking a code path that did not generate symbolic information
5894         before. 
5895
5896 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5897
5898         * class.cs: Create a Constructor.CheckBase method that
5899         takes care of all validation type code. The method
5900         contains some code that was moved from Define.
5901
5902         It also includes new code that checks for duplicate ctors.
5903         This fixes bug #55148.
5904
5905 2004-03-09  Joshua Tauberer <tauberer@for.net>
5906
5907         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5908         a { ... }-style array creation invokes EmitStaticInitializers
5909         which is not good for reference-type arrays.  String, decimal
5910         and now null constants (NullCast) are not counted toward
5911         static initializers.
5912
5913 2004-03-05  Martin Baulig  <martin@ximian.com>
5914
5915         * location.cs (SourceFile.HasLineDirective): New public field;
5916         specifies whether the file contains or is referenced by a "#line"
5917         directive.
5918         (Location.DefineSymbolDocuments): Ignore source files which
5919         either contain or are referenced by a "#line" directive.        
5920
5921 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5922
5923         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5924         direct access to our parent, so check the method inline there.
5925
5926 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5927
5928         * expression.cs (Invocation.EmitCall): Miguel's last commit
5929         caused a regression. If you had:
5930
5931             T t = null;
5932             t.Foo ();
5933
5934         In Foo the implict this would be null.
5935
5936 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5937
5938         * expression.cs (Invocation.EmitCall): If the method is not
5939         virtual, do not emit a CallVirt to it, use Call.
5940
5941         * typemanager.cs (GetFullNameSignature): Improve the method to
5942         cope with ".ctor" and replace it with the type name.
5943
5944         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5945         as an argument the ConstructorBuilder where it is being defined,
5946         to catch the recursive constructor invocations.
5947
5948 2004-03-16  Martin Baulig  <martin@ximian.com>
5949
5950         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5951         ConstructedType, call ResolveType() on it to get the type rather
5952         than just using `expr.Type'.
5953
5954 2004-03-16  Martin Baulig  <martin@ximian.com>
5955
5956         * generics.cs (ConstructedType.GetMemberAccess): Take the
5957         EmitContext instead on the TypeExpr and use
5958         ec.TypeContainer.CurrentType/ec.ContainerType.
5959
5960 2004-03-16  Martin Baulig  <martin@ximian.com>
5961
5962         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5963         parameters before aliases.
5964
5965 2004-03-16  Martin Baulig  <martin@ximian.com>
5966
5967         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5968         New oublic function; checks whether two generic instances may become
5969         equal under some instantiations (26.3.1).
5970
5971         * class.cs (TypeContainer.Define): Call
5972         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5973         error.
5974
5975 2004-03-16  Martin Baulig  <martin@ximian.com>
5976
5977         * class.cs (TypeContainer.GetClassBases): Moved
5978         Error_TypeParameterAsBase() here and also check whether the base
5979         class is not an attribute.
5980
5981 2004-03-16  Martin Baulig  <martin@ximian.com>
5982
5983         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5984
5985 2004-03-16  Martin Baulig  <martin@ximian.com>
5986
5987         * class.cs (Error_TypeParameterAsBase): Use correct error number
5988         here (CS0689).  
5989
5990 2004-03-16  Martin Baulig  <martin@ximian.com>
5991
5992         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5993         for generics.
5994
5995         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5996         error reporting.
5997
5998 2004-03-15  Martin Baulig  <martin@ximian.com>
5999
6000         * typemanager.cs (TypeManager.GetFullName): New public method.
6001         (TypeManager.MemberLookup): Added `int_num_type_arguments'
6002         argument; only return members with the correct number of type
6003         arguments.
6004         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
6005         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
6006         whether the number of type arguments matches.
6007
6008         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
6009         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
6010
6011         * expression.cs (MemberAccess): Added public `NumTypeArguments'
6012         field; it's set by the protected .ctor when we're actually a
6013         GenericMemberAccess.
6014         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
6015         arguments and pass it to MemberLookupFinal ().
6016
6017         * ecore.cs (Expression.MemberLookup): Added `int
6018         num_type_arguments' argument; only return members with the correct
6019         number of type arguments.
6020         (Expression.MemberLookupFailed): Check whether the MemberLookup
6021         failed because we did not have the correct number of type
6022         arguments; report CS0305 in this case.
6023
6024         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
6025         `e.ResolveAsTypeTerminal()' already did so.
6026
6027 2004-03-15  Martin Baulig  <martin@ximian.com>
6028
6029         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
6030         we're a ConstructedType; in this case, the caller must report an
6031         error (for instance CS0131).
6032
6033         * generic.cs (TypeArguments): Added Location argument to the .ctor.
6034         (TypeArguments.Resolve): Actually report errors here.
6035
6036 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6037
6038         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6039         `set_indexer_name' to the pending bits (one per type).
6040
6041         We fixed a bug today that was picking the wrong method to
6042         override, since for properties the existing InterfaceMethod code
6043         basically ignored the method name.  Now we make sure that the
6044         method name is one of the valid indexer names.
6045
6046 2004-03-15  Martin Baulig  <martin@ximian.com>
6047
6048         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
6049         for generic instances.
6050
6051 2004-03-13  Martin Baulig  <martin@ximian.com>
6052
6053         * class.cs (TypeContainer.DefineType): Call
6054         TypeManager.AddUserType() immediately after creating the
6055         TypeBuilder; pass all type parameters when creating the
6056         CurrentType.
6057
6058         * decl.cs (DeclSpace.FindNestedType): New public method.
6059         (DeclSpace.FindType): Added `int num_type_args' argument; only
6060         return types with the correct number of type parameters.
6061         (DeclSpace.CountTypeParams): New public property.
6062
6063         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
6064         the number of type parameters; defaults to zero.
6065
6066         * generic.cs (TypeArguments.Count): New public property.
6067         (ConstructedType.DoResolveAsTypeStep): First call
6068         ds.FindNestedType() to find out whether we're nested in the
6069         current generic type; in this case, we inherit all type parameters
6070         from the current class.
6071
6072         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
6073         num_type_args' argument.
6074         (RootContext.LookupType): Added overloaded version which takes the
6075         number of type arguments; only return types with the correct
6076         number of type arguments.
6077
6078         * typemanager.cs (TypeManager.CheckGeneric): New public function;
6079         checks whether `Type t' has `int num_type_args'.
6080
6081 2004-03-13  Martin Baulig  <martin@ximian.com>
6082
6083         * generic.cs (GenericMethod.DefineType): New method; calls
6084         DefineType() on all the type parameters.
6085
6086         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6087         (MethodData.Define): If we're a generic method, call
6088         GenericMethod.DefineType() to define the type parameters.       
6089
6090 2004-03-10  Martin Baulig  <martin@ximian.com>
6091
6092         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6093         instead of IsAssignableFrom.    
6094
6095 2004-03-10  Martin Baulig  <martin@ximian.com>
6096
6097         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6098
6099         * support.cs (ParameterData.HasArrayParameter): New property.
6100         (ReflectionParameters.ctor): Take a MethodBase instead of a
6101         ParameterInfo[].  If we have any type parameters, get the generic
6102         method definition and ask it whether we have variable arguments.
6103
6104 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6105
6106         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6107         routines to check if a type is an enumerable/enumerator allow
6108         classes that implement the IEnumerable or IEnumerator interfaces.
6109
6110         * class.cs (Property, Operator): Implement IIteratorContainer, and
6111         implement SetYields.
6112
6113         (Property.Define): Do the block swapping for get_methods in the
6114         context of iterators.   We need to check if Properties also
6115         include indexers or not.
6116
6117         (Operator): Assign the Block before invoking the
6118         OperatorMethod.Define, so we can trigger the Iterator code
6119         replacement. 
6120
6121         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6122         Property and Operator classes are not created when we parse the
6123         declarator but until we have the block completed, so we use a
6124         singleton SimpleIteratorContainer.Simple to flag whether the
6125         SetYields has been invoked.
6126
6127         We propagate this setting then to the Property or the Operator to
6128         allow the `yield' to function.
6129
6130 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6131
6132         * codegen.cs: Implemented attribute support for modules.
6133         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6134         Assembly/Module functionality.
6135
6136         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6137         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6138         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6139
6140 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6141
6142         * interface.cs (FindMembers): The operation is performed on all base
6143         interfaces and not only on the first. It is required for future CLS Compliance patch.
6144
6145 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6146
6147         * statement.cs, codegen.cs:
6148         This patch deals with patterns such as:
6149
6150         public class List : IEnumerable {
6151
6152                 public MyEnumerator GetEnumerator () {
6153                         return new MyEnumerator(this);
6154                 }
6155
6156                 IEnumerator IEnumerable.GetEnumerator () {
6157                         ...
6158                 }
6159                 
6160                 public struct MyEnumerator : IEnumerator {
6161                         ...
6162                 }
6163         }
6164
6165         Before, there were a few things we did wrong:
6166         1) we would emit callvirt on a struct, which is illegal
6167         2) we emited ldarg when we needed to emit ldarga
6168         3) we would mistakenly call the interface methods on an enumerator
6169         type that derived from IEnumerator and was in another assembly. For example:
6170
6171         public class MyEnumerator : IEnumerator
6172
6173         Would have the interface methods called, even if there were public impls of the
6174         method. In a struct, this lead to invalid IL code.
6175
6176 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6177
6178         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6179           renamed to Emit.
6180
6181         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6182
6183 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6184
6185         * cs-parser.jay: Fix small regression: we were not testing V2
6186         compiler features correctly.
6187
6188         * interface.cs: If the emit context is null, then create one
6189
6190 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6191
6192         * decl.cs (GetSignatureForError): New virtual method to get full name
6193           for error messages.
6194
6195         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6196           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6197
6198         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6199           Duplicated members and code in these classes has been removed.
6200           Better encapsulation in these classes.
6201
6202 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6203
6204         * assign.cs (Assign.DoResolve): When dealing with compound
6205         assignments, there is a new rule in ECMA C# 2.4 (might have been
6206         there before, but it is documented here) that states that in:
6207
6208         a op= b;
6209
6210         If b is of type int, and the `op' is a shift-operator, then the
6211         above is evaluated as:
6212
6213         a = (int) a op b 
6214
6215         * expression.cs (Binary.ResolveOperator): Instead of testing for
6216         int/uint/long/ulong, try to implicitly convert to any of those
6217         types and use that in pointer arithmetic.
6218
6219         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6220         method to print information for from the type, not from the
6221         null-method we were given.
6222
6223 2004-02-01  Duncan Mak  <duncan@ximian.com>
6224
6225         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6226         parsing for cmd, fixes bug #53694.
6227
6228 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6229
6230         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6231         in the member name duplication tests. Property and operator name duplication
6232         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6233
6234 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6235
6236         * interface.cs (PopulateMethod): Fixed crash when interface method
6237         returns not existing type (error test cs0246-3.cs).
6238
6239 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6240
6241         * cs-parser.jay (interface_accessors): Re-write actions to also
6242         store attributes attached to get and set methods. Fix spelling
6243         while at it.
6244
6245         (inteface_property_declaration): Modify accordingly.
6246
6247         (InterfaceAccessorInfo): New helper class to store information to pass
6248         around between rules that use interface_accessors.
6249
6250         * interface.cs (Emit): Apply attributes on the get and set
6251         accessors of properties and indexers too.
6252
6253         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6254         right MethodBuilder when applying attributes to the get and set accessors.
6255
6256 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6257
6258         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6259
6260 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6261
6262         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6263
6264 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6265
6266         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6267         changes that treat `yield' specially when present before `break'
6268         or `return' tokens.
6269
6270         * cs-tokenizer.cs: yield is no longer a keyword.
6271
6272 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6273
6274         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6275         setting for default constructors.
6276         For default constructors are almost every time set wrong Modifier. The
6277         generated IL code has been alright. But inside mcs this values was
6278         wrong and this was reason why several of my CLS Compliance tests
6279         failed.
6280
6281 2004-02-27  Martin Baulig  <martin@ximian.com>
6282
6283         * generics.cs (ConstructedType.ResolveType): Make the nested type
6284         stuff actually work.
6285
6286 2004-02-25  Martin Baulig  <martin@ximian.com>
6287
6288         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6289         property; returns the type parameters just from the current type,
6290         ie. with the ones from outer classes.
6291         (DeclSpace.LookupGeneric): First search in the current class, then
6292         in outer classes.
6293         (DeclSpace.initialize_type_params): When hiding a type parameter
6294         from an outer class, put it into the `type_param_list' anyways.
6295
6296         * expression.cs (MemberAccess.expr): Made this field protected.
6297
6298         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6299         the type parameters from the current class.
6300
6301         * generic.cs (ConstructedType.ResolveType): Support nested generic
6302         types by taking the type parameters which we inherit from outer
6303         classes into account.
6304         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6305         support for nested generic types.
6306
6307 2004-02-23  Martin Baulig  <martin@ximian.com>
6308
6309         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6310         field and check whether we're nested inside a generic type.
6311         (DeclSpace.ResolveType): If we're resolving to a generic type
6312         definition, create a ConstructedType and return its resolved type.
6313         (DeclSpace.initialize_type_params): New private method;
6314         initializes the `type_param_list' field from the type parameters
6315         from this and all enclosing classes.
6316         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6317         we're already initialized.
6318
6319 2004-02-23  Martin Baulig  <martin@ximian.com>
6320
6321         * class.cs (Method.Define): Create the generic method before
6322         calling DoDefine().
6323         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6324         the TypeContainer one); we use this for generic methods.
6325
6326         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6327         parent's TypeBuilder.
6328
6329 2004-02-18  Martin Baulig  <martin@ximian.com>
6330
6331         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6332         to check for equality.
6333
6334 2004-02-05  Martin Baulig  <martin@ximian.com>
6335
6336         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6337         `ec.TypeContainer.CurrentType', use it instead of
6338         `ec.ContainerType' to check whether we're in the type's ctor.
6339
6340 2004-01-29  Martin Baulig  <martin@ximian.com>
6341
6342         * expression.cs (Invocation.DoResolve): If we're a
6343         `ConstructedType', then we're actually a generic method, so
6344         rewrite the expr as a GenericMemberAccess.
6345
6346         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6347         here; manually parse it into a string.
6348
6349 2004-01-28  Martin Baulig  <martin@ximian.com>
6350
6351         * typemanager.cs (TypeManager.IsEqual): New static method.
6352         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6353         check for equality instead of using `=='.
6354
6355 2004-01-26  Martin Baulig  <martin@ximian.com>
6356
6357         * decl.cs (DeclSpace.CurrentType): New public field.
6358
6359         * expression.cs (This.ResolveBase): If we have an
6360         `ec.TypeContainer.CurrentType', use it instead of
6361         `ec.ContainerType'.
6362
6363         * class.cs (TypeContainer.DefineType): If we're a generic type,
6364         create the `CurrentType' (unresolved).
6365         (TypeContainer.GenericType): New private field.
6366         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6367         it and store it in `GenericType' before creating the MemberCache.
6368         (TypeContainer.GetMembers): If we have a `GenericType', call
6369         TypeManager.FindMembers() on it.
6370
6371         * interface.cs (Interface.GenericType): New private field.
6372         (Interface.DefineType): If we're a generic type, create the
6373         `CurrentType' (unresolved).
6374         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6375         and store it in `GenericType' before creating the MemberCache.
6376         (Interface.GetMembers): If we have a `GenericType', call
6377         TypeManager.FindMembers() on it.
6378
6379 2004-01-22  Martin Baulig  <martin@ximian.com>
6380
6381         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6382         not a QualifiedIdentifier.  This is what `type_name_expression'
6383         was previously doing.
6384         (type_name_expression): Removed; the code is now in
6385         `namespace_or_type_name'.
6386         (qualified_identifier): Removed, use `namespace_or_type_name'
6387         instead.
6388         (QualifiedIdentifier): Removed this class.      
6389
6390 2004-01-22  Martin Baulig  <martin@ximian.com>
6391
6392         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6393         not a string as alias name.
6394
6395 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6396
6397         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6398         #52730 bug, and instead compute correctly the need to use a
6399         temporary variable when requesting an address based on the
6400         static/instace modified of the field and the constructor.
6401  
6402 2004-01-21  Martin Baulig  <martin@ximian.com>
6403
6404         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6405         class and namespace before looking up aliases.  Fixes #52517.
6406
6407 2004-01-21  Martin Baulig  <martin@ximian.com>
6408
6409         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6410         assinged in a 'try'; fixes exception4.cs.
6411
6412 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6413         * class.cs : Implemented parameter-less constructor for TypeContainer
6414
6415         * decl.cs: Attributes are now stored here. New property OptAttributes
6416
6417         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6418
6419         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6420
6421 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6424           (CSharpSignature): New method for indexer and property signature.
6425
6426 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6427
6428         * pending.cs (IsVirtualFilter): Faster implementation.
6429
6430 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6431
6432         * typemanager.cs: Avoid inclusion of same assembly more than once.
6433
6434 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6435
6436         * cs-parser.jay: Fixed problem where the last assembly attribute
6437           has been applied also to following declaration (class, struct, etc.)
6438           
6439 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6440
6441         * class.cs: Added error CS0538, CS0539 reporting.
6442         Fixed crash on Microsoft runtime when field type is void.
6443
6444         * cs-parser.jay: Added error CS0537 reporting.
6445
6446         * pending.cs: Added error CS0535 reporting.
6447         Improved error report for errors CS0536, CS0534.
6448
6449 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6450
6451         Merge a few bits from the Anonymous Method MCS tree.
6452
6453         * statement.cs (ToplevelBlock): New class for toplevel methods,
6454         will hold anonymous methods, lifted variables.
6455
6456         * cs-parser.jay: Create toplevel blocks for delegates and for
6457         regular blocks of code. 
6458
6459 2004-01-20  Martin Baulig  <martin@ximian.com>
6460
6461         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6462         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6463         and `NeedExplicitReturn'; added `IsLastStatement'.
6464         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6465         have a `ReturnLabel' or we're not unreachable.
6466
6467         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6468         child's reachability; don't just override ours with it.  Fixes
6469         #58058 (lluis's example).
6470         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6471         InFinally(), InLoop(), InSwitch() and
6472         BreakCrossesTryCatchBoundary() methods.
6473
6474         * statement.cs (Return): Do all error checking in Resolve().
6475         Unless we are the last statement in a top-level block, always
6476         create a return label and jump to it.
6477         (Break, Continue): Do all error checking in Resolve(); also make
6478         sure we aren't leaving a `finally'.
6479         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6480         statement in a top-level block.
6481         (Block.Flags): Added `IsDestructor'.
6482         (Block.IsDestructor): New public property.
6483
6484 2004-01-20  Martin Baulig  <martin@ximian.com>
6485
6486         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6487
6488 2004-01-20  Martin Baulig  <martin@ximian.com>
6489
6490         * statement.cs (Statement.ResolveUnreachable): New public method.
6491         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6492         (Block.Resolve): Resolve unreachable statements.
6493
6494 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6495
6496         * expression.cs: We need to fix the case where we do
6497         not have a temp variable here.
6498
6499         * assign.cs: Only expression compound assignments need
6500         temporary variables.
6501
6502 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6503
6504         * flowanalysis.cs: Reduce memory allocation in a few ways:
6505           - A block with no variables should not allocate a bit
6506             vector for itself.
6507           - A method with no out parameters does not need any tracking
6508             for assignment of the parameters, so we need not allocate
6509             any data for it.
6510           - The arrays:
6511                 public readonly Type[] VariableTypes;
6512                 public readonly string[] VariableNames;
6513             Are redundant. The data is already stored in the variable
6514             map, so we need not allocate another array for it.
6515           - We need to add alot of checks for if (params | locals) == null
6516             due to the first two changes.
6517
6518 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6519
6520         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6521         implement IMemoryLocation, we store a copy on a local variable and
6522         take the address of it.  Patch from Benjamin Jemlich
6523
6524         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6525         to use a special "type_name_expression" rule which reduces the
6526         number of "QualifiedIdentifier" classes created, and instead
6527         directly creates MemberAccess expressions.
6528
6529 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6530
6531         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6532         that fixes #52853.  Null literal assignment to ValueType
6533
6534         * class.cs (MethodData.Emit): Instead of checking the name of the
6535         method to determine if its a destructor, create a new derived
6536         class from Method called Destructor, and test for that.  
6537
6538         * cs-parser.jay: Create a Destructor object instead of a Method.  
6539
6540         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6541
6542         Fixes: 52933
6543
6544 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6545
6546         * expression.cs (Binary.ResolveOperator): Perform an implicit
6547         conversion from MethodGroups to their delegate types on the
6548         Addition operation.
6549
6550         * delegate.cs: Introduce a new class DelegateCreation that is the
6551         base class for `NewDelegate' and `ImplicitDelegateCreation',
6552         factor some code in here.
6553
6554         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6555         conversion from MethodGroups to compatible delegate types. 
6556
6557         * ecore.cs (Expression.Resolve): Do not flag error 654
6558         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6559         we allow conversions from MethodGroups to delegate types now.
6560
6561         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6562         assignments in v2 either.
6563
6564 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6565
6566         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6567         static read-only fields in ctors.
6568
6569         Applied patch from Benjamin Jemlich 
6570
6571         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6572
6573 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6574
6575         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6576         here to return true, as they can be used like this:
6577
6578                 (XXX) int.MEMBER ()
6579
6580         Fixed 49836 and all the other dups
6581
6582 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6583
6584         * driver.cs: Implement /win32res and /win32icon.
6585
6586 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6587
6588         * cs-parser.jay: Add a rule to improve error handling for the
6589         common mistake of placing modifiers after the type.
6590
6591 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6592
6593         * cs-parser.jay (interface_event_declaration): Catch
6594         initialization of events on interfaces, and report cs0068
6595
6596         * cs-parser.jay (interface_event_declaration): Catch
6597         initialization of events. 
6598
6599         * ecore.cs: Better report missing constructors.
6600
6601         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6602         the error reporting done in the wrong place.  Fix.
6603
6604         * expression.cs (Binary.ResolveOperator): Catch the 
6605         operator + (E x, E y) error earlier, and later allow for implicit
6606         conversions in operator +/- (E e, U x) from U to the underlying
6607         type of E.
6608
6609         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6610         52596, if the container class is abstract, the default constructor
6611         is protected otherwise its public (before, we were always public).
6612
6613         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6614         fixed statement.
6615
6616         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6617         Jemlich that fixes bug #52597, MCS was generating invalid code for
6618         idisposable structs.   Thanks to Ben for following up with this
6619         bug as well.
6620
6621 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6622
6623         * driver.cs: Allow assemblies without code to be generated, fixes
6624         52230.
6625
6626 2004-01-07  Nick Drochak <ndrochak@gol.com>
6627
6628         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6629
6630 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6631
6632         * cs-parser.jay: Add rules to improve error reporting if fields or
6633         methods are declared at the namespace level (error 116)
6634
6635         * Add rules to catch event add/remove
6636
6637 2004-01-04  David Sheldon <dave-mono@earth.li>
6638
6639   * expression.cs: Added matching ")" to error message for 
6640   CS0077
6641
6642 2004-01-03 Todd Berman <tberman@gentoo.org>
6643
6644         * ecore.cs, attribute.cs:
6645         Applying fix from #52429.
6646
6647 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6648
6649         * ecore.cs, expression.cs, statement.cs:
6650         Total rewrite of how we handle branching. We
6651         now handle complex boolean expressions with fewer
6652         jumps. As well if (x == 0) no longer emits a ceq.
6653
6654         if (x is Foo) is much faster now, because we generate
6655         better code.
6656
6657         Overall, we get a pretty big improvement on our benchmark
6658         tests. The code we generate is smaller and more readable.
6659
6660         I did a full two-stage bootstrap. The patch was reviewed
6661         by Martin and Miguel.
6662
6663 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6664
6665         * cs-parser.jay: Make primary_expression not take a QI.
6666         we dont need this because the member_access rule covers
6667         us here. So we replace the rule with just IDENTIFIER.
6668
6669         This has two good effects. First, we remove a s/r conflict.
6670         Second, we allocate many fewer QualifiedIdentifier objects.
6671
6672 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6673
6674         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6675         set the correct information via SRE. This prevents
6676         hanging on the MS runtime. Fixes #29374.
6677
6678 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6679
6680         * convert.cs: correctly handle conversions to value types
6681         from Enum and ValueType as unboxing conversions.
6682
6683         Fixes bug #52569. Patch by Benjamin Jemlich.
6684
6685 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6686
6687         * expression.cs (BetterConversion): Prefer int -> uint
6688         over int -> ulong (csc's behaviour). This fixed bug #52046.
6689
6690 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6691
6692         * decl.cs (MemberCache.FindMembers): now returns a
6693         MemberInfo [].
6694
6695         * typemanager.cs: In general, go with with ^^.
6696         (CopyNewMethods): take an IList.
6697         (RealMemberLookup): Only allocate an arraylist
6698         if we copy from two sets of methods.
6699
6700         This change basically does two things:
6701         1) Fewer array lists allocated due to CopyNewMethods.
6702         2) the explicit cast in MemberList costed ALOT.
6703
6704 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6705
6706         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6707         a hashtable to avoid needless string allocations when an identifier is
6708         used more than once (the common case).
6709
6710 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6711
6712         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6713         is broken, it will not return anything. So, we
6714         have to use the information we have in mcs to
6715         do the task.
6716
6717         * typemanager.cs: Add a cache for GetInterfaces,
6718         since this will now be used more often (due to ^^)
6719
6720         (GetExplicitInterfaces) New method that gets the
6721         declared, not effective, interfaces on a type
6722         builder (eg, if you have interface IFoo, interface
6723         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6724         { IBar }.
6725
6726         This patch makes MCS able to bootstrap itself on
6727         Windows again.
6728
6729 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6730
6731         * expression.cs: Remove the Nop's that Miguel put
6732         in by mistake.
6733
6734 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6735
6736         * report.cs, codegen.cs: Give the real stack trace to
6737         the error when an exception is thrown.
6738
6739 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6740
6741         * decl.cs: only allocate hashtables for ifaces if 
6742         it is an iface!
6743
6744 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6745
6746         * expression.cs: fix the error from cs0121-2.cs
6747         (a parent interface has two child interfaces that
6748         have a function with the same name and 0 params
6749         and the function is called through the parent).
6750
6751 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6752
6753         * class.cs, rootcontext.cs, typmanager.cs: do not
6754         leak pointers.
6755
6756 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6757
6758         * codegen.cs: remove stack for the ec flow branching.
6759         It is already a linked list, so no need.
6760
6761 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6762
6763         * Makefile: Allow custom profiler here.
6764
6765 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6766
6767         * typemanager.cs (LookupType):
6768           - Use a static char [], because split takes
6769             a param array for args, so it was allocating
6770             every time.
6771           - Do not store true in a hashtable, it boxes.
6772
6773 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6774
6775         * flowanalysis.cs: bytify common enums.
6776
6777 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6778
6779         * modifiers.cs: Add a new set of flags for the
6780         flags allowed on explicit interface impls.
6781         * cs-parser.jay: catch the use of modifiers in
6782         interfaces correctly.
6783         * class.cs: catch private void IFoo.Blah ().
6784
6785         All related to bug #50572.
6786
6787 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6788
6789         * decl.cs: Rewrite the consistant accessability checking.
6790         Accessability is not linear, it must be implemented in
6791         a tableish way. Fixes #49704.
6792
6793 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6794
6795         * expression.cs: Handle negation in a checked context.
6796         We must use subtraction from zero. Fixes #38674.
6797
6798 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6799
6800         * class.cs: Ignore static void main in DLLs.
6801         * rootcontext.cs: Handle the target type here,
6802         since we are have to access it from class.cs
6803         * driver.cs: account for the above.
6804
6805 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6806
6807         * report.cs: Give line numbers and files if available.
6808
6809 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6810
6811         * driver.cs: Implement /addmodule.
6812
6813         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6814         ModuleBuilders.
6815
6816 2003-12-20  Martin Baulig  <martin@ximian.com>
6817
6818         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6819         (FieldBase.IsAssigned): Removed this field.
6820         (FieldBase.SetAssigned): New public method.
6821         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6822
6823 2003-12-20  Martin Baulig  <martin@ximian.com>
6824
6825         * expression.cs (LocalVariableReference.DoResolve): Don't set
6826         `vi.Used' if we're called from DoResolveLValue().
6827
6828         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6829         returns the usage vector it just merged into the current one -
6830         pass this one to UsageWarning().
6831         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6832         of the `EmitContext', don't call this recursively on our children.
6833
6834 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6835
6836         * driver.cs: Implement /target:module.
6837
6838 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6839
6840         * support.cs (CharArrayHashtable): New helper class.
6841
6842         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6843         char arrays, not strings, so we can avoid creating a string in
6844         consume_identifier if the identifier is a keyword.
6845
6846 2003-12-16  Martin Baulig  <martin@ximian.com>
6847
6848         * statement.cs (LocalInfo.Assigned): Removed this property.
6849         (LocalInfo.Flags): Removed `Assigned'.
6850         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6851         and uses flow analysis.
6852         (Block.UsageWarning): Made this method private.
6853         (Block.Resolve): Call UsageWarning() if appropriate.
6854
6855         * expression.cs (LocalVariableReference.DoResolve): Always set
6856         LocalInfo.Used here.
6857
6858 2003-12-13  Martin Baulig  <martin@ximian.com>
6859
6860         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6861         any value here; we're now using flow analysis to figure out
6862         whether a statement/block returns a value.
6863
6864 2003-12-13  Martin Baulig  <martin@ximian.com>
6865
6866         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6867         working again.
6868         (FlowBranching.MergeFinally): Don't call
6869         `branching.CheckOutParameters()' here, this is called in
6870         MergeTopBlock().
6871         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6872         when adding the `finally' vector.       
6873
6874 2003-12-13  Martin Baulig  <martin@ximian.com>
6875
6876         * flowanalysis.cs
6877         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6878         actually work and also fix #48962.
6879
6880 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6881
6882         * decl.cs: Do not check System.Object for nested types,
6883         since we know it does not have any. Big bang for buck:
6884
6885         BEFORE:
6886            Run 1:   8.35 seconds
6887            Run 2:   8.32 seconds
6888            corlib:  17.99 seconds
6889         AFTER:
6890            Run 1:   8.17 seconds
6891            Run 2:   8.17 seconds
6892            corlib:  17.39 seconds
6893
6894 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6895
6896         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6897         time we are returning 0 members, so we save alot here.
6898
6899 2003-12-11  Martin Baulig  <martin@ximian.com>
6900
6901         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6902         `MergeChild()', also just take the `FlowBranching' as argument;
6903         call Merge() on it and return the result.
6904         (FlowBranching.Merge): We don't need to do anything if we just
6905         have one sibling.
6906
6907 2003-12-11  Martin Baulig  <martin@ximian.com>
6908
6909         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6910         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6911         Maurer for this idea.
6912
6913 2003-12-11  Martin Baulig  <martin@ximian.com>
6914
6915         * flowanalysis.cs (MergeResult): This class is now gone; we now
6916         use the `UsageVector' for this.  The reason for this is that if a
6917         branching just has one sibling, we don't need to "merge" them at
6918         all - that's the next step to do.
6919         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6920         `MergeResult'.
6921
6922 2003-12-11  Martin Baulig  <martin@ximian.com>
6923
6924         Reworked flow analyis and made it more precise and bug-free.  The
6925         most important change is that we're now using a special `Reachability'
6926         class instead of having "magic" meanings of `FlowReturns'.  I'll
6927         do some more cleanups and optimizations and also add some more
6928         documentation this week.
6929
6930         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6931         largely reworked this class.
6932         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6933         the new `Reachability' class instead of having "magic" values here.
6934         (FlowBranching): We're now using an instance of `Reachability'
6935         instead of having separate `Returns', `Breaks' etc. fields.
6936
6937         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6938         based on flow analysis; ignore the return value of block.Emit ().
6939
6940 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6941
6942         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6943         if they are private.
6944
6945 2003-12-09  Martin Baulig  <martin@ximian.com>
6946
6947         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6948         call them directly on the UsageVector.
6949
6950 2003-12-09  Martin Baulig  <martin@ximian.com>
6951
6952         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6953         Changed return type from `FlowReturns' to `Reachability'.
6954
6955 2003-12-09  Martin Baulig  <martin@ximian.com>
6956
6957         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6958         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6959         `Reachable' fields with a single `Reachability' one.
6960
6961 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6962
6963         * class.cs (FindMembers): Remove foreach's.
6964
6965         Bootstrap times:
6966
6967         BEFORE
6968                 Run 1:   8.74 seconds
6969                 Run 2:   8.71 seconds
6970
6971         AFTER
6972                 Run 1:   8.64 seconds
6973                 Run 2:   8.58 seconds
6974
6975
6976 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6977
6978         * cs-parser.jay:
6979         * gen-treedump.cs:
6980         * statement.cs:
6981         This patch does a few things:
6982                 1. EmptyStatement is now a singleton, so it is never reallocated.
6983                 2. All blah is EmptyStatement constructs have been changed to
6984                    blah == EmptyStatement.Value, which is much faster and valid
6985                    now that EmptyStatement is a singleton.
6986                 3. When resolving a block, rather than allocating a new array for
6987                    the non-empty statements, empty statements are replaced with
6988                    EmptyStatement.Value
6989                 4. Some recursive functions have been made non-recursive.
6990         Mainly the performance impact is from (3), however (1) and (2) are needed for
6991         this to work. (4) does not make a big difference in normal situations, however
6992         it makes the profile look saner.
6993
6994         Bootstrap times:
6995
6996         BEFORE
6997         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6998         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6999         Total memory allocated: 56397 KB
7000
7001         AFTER
7002         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
7003         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
7004         Total memory allocated: 55666 KB
7005
7006 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7007
7008         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
7009         than the hashtable in a hashtable version
7010
7011         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
7012         we always end up concating a string. This results in a huge perf
7013         loss, because many strings have to be tracked by the GC. In this
7014         patch, we first use a hashtable that works with two keys, so that
7015         the strings do not need to be concat'ed.
7016
7017         Bootstrap times:
7018         BEFORE
7019                 Run 1:   8.74 seconds
7020                 Run 2:   8.71 seconds
7021
7022         AFTER
7023                 Run 1:   8.65 seconds
7024                 Run 2:   8.56 seconds
7025
7026 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7027
7028         * Makefile: Add a new target `do-time' that does a quick and simple
7029         profile, leaving easy to parse output.
7030
7031 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7032
7033         * codegen.cs (Init): Create the dynamic assembly with 
7034         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7035
7036 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7037
7038         * support.cs: Make the PtrHashtable use only one
7039         instance of its comparer.
7040
7041 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7042
7043         * typemanager.cs: Fix lookup of GetNamespaces.
7044
7045 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7046
7047         * expression.cs: Removed redundant line.
7048
7049         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7050         ArrayLists, use for loops with bounds.  
7051
7052         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7053         arraylist.
7054
7055         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7056         arraylists, use for loop with bounds.
7057
7058         The above three changes give us a 0.071 second performance
7059         improvement out of 3.294 seconds down to 3.223.  On my machine
7060         the above changes reduced the memory usage by 1,387 KB during
7061         compiler bootstrap.
7062
7063         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7064         QualifiedIdentifiers.  Before we created a new string through
7065         concatenation, and mostly later on, the result would be
7066         manipulated by DecomposeQI through string manipulation.
7067
7068         This reduced the compiler memory usage for bootstrapping from
7069         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7070         compile times in 0.05 seconds.
7071
7072 2003-11-28  Dick Porter  <dick@ximian.com>
7073
7074         * support.cs: Do string compares with the Invariant culture.
7075
7076         * rootcontext.cs: 
7077         * gen-treedump.cs: 
7078         * expression.cs: 
7079         * driver.cs: 
7080         * decl.cs: 
7081         * codegen.cs: 
7082         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7083         the comparison is done with the Invariant culture.
7084
7085 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7086
7087         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7088         GetEnumerator method.
7089
7090         (ProbeCollectionType): Iterate starting at the most specific type
7091         upwards looking for a GetEnumerator
7092
7093         * expression.cs: Shift count can be up to 31 for int/uint and 63
7094         for long/ulong.
7095
7096 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7097
7098         * statement.cs (Block.LookupLabel): Also look for the label on the
7099         children blocks.  Use a hash table to keep track of visited
7100         nodes. 
7101
7102         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7103         we actually did transform the other operand, otherwise fall back
7104         to the common codepath that casts to long.
7105
7106         * cs-tokenizer.cs: Use the same code pattern as the int case.
7107         Maybe I should do the parsing myself, and avoid depending on the
7108         Parse routines to get this done.
7109
7110 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7111
7112         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7113         which fixes bug 51347.  This time test it.
7114
7115         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7116         attributes for example can not tell the difference between these.
7117         The difference was only a syntax feature of the language. 
7118
7119         * attribute.cs: Apply attributes to delegates.
7120
7121         * delegate.cs: Call the apply attributes method.
7122
7123 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7124
7125         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7126         comparing 0 vs Byte.MinValue, not the value
7127
7128         (ImplicitConversionRequired): When reporting a conversion error,
7129         use error 31 to print out the constant error instead of the
7130         simpler 29.
7131
7132         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7133         which fixes bug 51347.
7134
7135 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7136
7137         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7138         which fixes the -warnaserror command line option.
7139
7140 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7141
7142         * cfold.cs (DoNumericPromotions): During constant folding of
7143         additions on UIntConstant, special case intconstants with
7144         IntConstants like we do on the expression binary operator. 
7145
7146 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7147
7148         * convert.cs (ImplicitReferenceConversion): We were missing a case
7149         (System.Enum are not value types or class types, so we need to
7150         classify them separatedly).
7151
7152         * driver.cs: We do not support error 2007.
7153
7154 2003-11-12 Jackson Harper <jackson@ximian.com>
7155
7156         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7157         system directory. Also use the full file name so users can
7158         libraries names mscorlib-o-tron.dll in a non system dir.
7159         
7160 2004-01-04  David Sheldon <dave-mono@earth.li>
7161
7162         * expression.cs: Added matching ")" to error message for CS0077.
7163
7164 2003-12-19  Martin Baulig  <martin@ximian.com>
7165
7166         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7167         static method; see documentation in the method.
7168         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7169
7170         * convert.cs (Convert.ImplicitReferenceConversion,
7171         Convert.ImplicitReferenceConversionExists): Add support for
7172         generic type declarations; see gen-36.cs.
7173
7174 2003-12-19  Martin Baulig  <martin@ximian.com>
7175
7176         * pending.cs (Pending.InterfaceMethod): Use
7177         `Type.IsAssignableFrom()' instead of `=='.
7178
7179 2003-12-18  Martin Baulig  <martin@ximian.com>
7180
7181         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7182         byref types first.
7183
7184         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7185         `expr_type.Equals (target_type)' instead of `=='.
7186
7187 2003-12-08  Martin Baulig  <martin@ximian.com>
7188
7189         * generics.cs (Constraints.Types): Removed.
7190         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7191         to Type's.
7192         (Constraints.ResolveTypes): New public method; resolves the
7193         TypeExpr's to Type's.
7194         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7195         longer takes the constraints.
7196         (TypeParameter.DefineMethod): Likewise.
7197         (TypeParameter.DefineType): New public method.  Calls
7198         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7199         the constraints.
7200
7201 2003-12-08  Martin Baulig  <martin@ximian.com>
7202
7203         * convert.cs (Convert.ImplicitConversionStandard): Use
7204         `expr_type.Equals (target_type)' instead of `=='.
7205
7206 2003-12-08  Martin Baulig  <martin@ximian.com>
7207
7208         * typemanager.cs (TypeManager.GetReferenceType): Call
7209         `Type.MakeByRefType ()'.
7210
7211 2003-12-08  Martin Baulig  <martin@ximian.com>
7212
7213         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7214         just has some special meaning in some situations.  For instance,
7215         it is allowed to use `where' as the name of a variable etc.
7216
7217 2003-12-04  Martin Baulig  <martin@ximian.com>
7218
7219         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7220         `Type.MakeArrayType()' for array types.
7221
7222 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7223
7224         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7225         debugging message.
7226
7227         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7228         corlib to compile.
7229
7230 2003-11-16  Martin Baulig  <martin@ximian.com>
7231
7232         * codegen.cs (EmitContext.IsGeneric): Removed.
7233
7234         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7235         ResolveGeneric() on the DeclSpace.
7236
7237 2003-11-16  Martin Baulig  <martin@ximian.com>
7238
7239         * generic.cs (TypeArguments.Resolve):
7240         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7241         `ResolveType()' on it to get the Type.
7242
7243 2003-11-15  Martin Baulig  <martin@ximian.com>
7244
7245         * generic.cs (ConstructedType.GetInterfaces): Override this.
7246
7247 2003-11-14  Martin Baulig  <martin@ximian.com>
7248
7249         * interface.cs (Interface.DefineType): Define all type parameters
7250         before adding the interfaces we inherit.
7251
7252 2003-11-11  Martin Baulig  <martin@ximian.com>
7253
7254         * generic.cs (ConstructedType.ResolveType): Always call
7255         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7256
7257 2003-11-10  Martin Baulig  <martin@ximian.com>
7258
7259         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7260         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7261         calling `ResolveType()' on them, directly assign their `Type'.
7262
7263 2003-11-08  Martin Baulig  <martin@ximian.com>
7264
7265         * generic.cs (ConstructedType): Override `IsClass' etc.
7266
7267 2003-11-08  Martin Baulig  <martin@ximian.com>
7268
7269         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7270         return value and the `out parent' parameter.
7271         (TypeContainer.DefineType): Moved the CS0644 check into
7272         GetClassBases().  Don't pass the interface types to the
7273         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7274         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7275
7276         * ecore.cs (TypeExpr.IsAttribute): New property.
7277         (TypeExpr.GetInterfaces): New method.
7278
7279         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7280         TypeExpr instead of a Type.
7281         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7282         (Interface.DefineType): Don't pass the interface types to the
7283         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7284         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7285
7286         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7287         instead of a `Type[]'.
7288         (TypeManager.RegisterBuilder): Likewise.
7289         (TypeManager.AddUserInterface): Likewise.
7290         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7291         `Type[]' and also return a `TypeExpr[]'.
7292         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7293
7294 2003-11-08  Martin Baulig  <martin@ximian.com>
7295
7296         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7297         Expression.     
7298
7299 2003-11-08  Martin Baulig  <martin@ximian.com>
7300
7301         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7302         TypeManager.ResolveExpressionTypes().
7303
7304         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7305         instead of an Expression.
7306         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7307         (TypeExpression): New public class; formerly known as `TypeExpr'.
7308
7309         * expression.cs (ComposedCast): Derive from TypeExpr.
7310
7311         * typemanager.cs (TypeManager.system_*_expr): These are now
7312         TypExpr's instead of Expression's.
7313         (TypeManager.ResolveExpressionTypes): New public static function;
7314         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7315         of them.        
7316
7317 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7318
7319         * expression.cs (New.DoResolve): Do not dereference value that
7320         might be a null return.
7321
7322         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7323         sure that the constant value has the right type.  Fixes an
7324         unreported bug, similar to 50425.
7325
7326         * const.cs (Const.LookupConstantValue): Call
7327         ImplicitStandardConversionExists before doing a conversion to
7328         avoid havng the TypeManager.ChangeType do conversions.
7329
7330         Reduced the number of casts used
7331
7332         (Const.ChangeType): New routine to enable reuse of the constant
7333         type changing code from statement.
7334
7335         * typemanager.cs (ChangeType): Move common initialization to
7336         static global variables.
7337
7338         Fixes #50425.
7339
7340         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7341         every value type to go through, even if it was void.  Fix that. 
7342
7343         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7344         character of the define, and the is_identifier_part_character for
7345         the rest of the string.
7346
7347 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7348
7349         * expression.cs (UnaryMutator.EmitCode): When I updated
7350         LocalVariableReference.DoResolve, I overdid it, and dropped an
7351         optimization done on local variable references.
7352
7353 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7354
7355         * ecore.cs: Convert the return from Ldlen into an int.
7356
7357 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7358
7359         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7360         the accessibility, this is a special case for toplevel non-public
7361         classes (internal for instance).
7362
7363 2003-10-20  Nick Drochak <ndrochak@gol.com>
7364
7365         * ecore.cs: Fix typo and build.  Needed another right paren.
7366
7367 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7368
7369         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7370         `internal' case regular and protected, but not allowing protected
7371         to be evaluated later.  Bug 49840
7372
7373 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7374
7375         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7376         to kb.Nlast, and not the kb.nFirst to isolate the switch
7377         statement.
7378
7379         Extract the underlying type, so enumerations of long/ulong are
7380         treated like long/ulong.
7381
7382 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7383
7384         * expression.cs (New): Overload the meaning of RequestedType to
7385         track the possible creation of the NewDelegate type, since
7386         DoResolve is invoked more than once for new constructors on field
7387         initialization.
7388
7389         See bugs: #48800 and #37014
7390
7391         * cs-parser.jay (declare_local_constants): Take an arraylist
7392         instead of a single constant.
7393
7394         (local_constant_declaration): It should take a
7395         constant_declarators, not a constant_declarator.  Fixes 49487
7396
7397         * convert.cs: Fix error report.
7398
7399 2003-10-13 Jackson Harper <jackson@ximian.com>
7400
7401         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7402         bug #49611
7403         
7404 2003-11-03  Martin Baulig  <martin@ximian.com>
7405
7406         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7407         `out bool has_type_arg'; if set, we need to pass the type to
7408         ig.Emit().
7409         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7410         Stelem_Any/Ldelem_Any for generic parameters.   
7411
7412 2003-11-02  Martin Baulig  <martin@ximian.com>
7413
7414         * expression.cs (Invocation.EmitCall): Use
7415         `TypeManager.IsValueType()' to check whether it's a value type.
7416         Don't set `struct_call' when calling a method on a type parameter.
7417
7418 2003-11-02  Martin Baulig  <martin@ximian.com>
7419
7420         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7421         and removed the TypeBuilder argument.
7422
7423         * typemanager.cs (TypeManager.IsValueType): Return
7424         `t.IsGenericParameter || t.IsValueType'.
7425
7426 2003-10-25  Martin Baulig  <martin@ximian.com>
7427
7428         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7429         call ConstructedType.Resolve() on it.
7430
7431         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7432
7433 2003-10-25  Martin Baulig  <martin@ximian.com>
7434
7435         * class.cs (TypeContainer.GetClassBases): Changed
7436         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7437         CS8214 reporting here.
7438         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7439         instead of a `Type' for our parent.  In case of a recursive
7440         declaration (see tests/gen-23.cs for an example), our parent is a
7441         ConstructedType and it doesn't have its type set.  So, first
7442         create our own TypeBuilder, then call constructed.Resolve() to get
7443         the parent's type and finally TypeBuilder.SetParent() it.
7444
7445         * ecore.cs (TypeExpr.Name): New public virtual property.
7446
7447         * generic.cs
7448         (ConstructedType): We're now a TypeExpr and not just an Expression.
7449         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7450         arguments here; this is done later.
7451         (ConstructedType.Resolve): New public method to resolve the type
7452         arguments and bind them.
7453
7454 2003-10-21  Martin Baulig  <martin@ximian.com>
7455
7456         * convert.cs: Use `TypeManager.IsValueType' instead of
7457         'type.IsValueType' everywhere.
7458
7459         * typemanager.cs (TypeManager.IsValueType): Return true for type
7460         parameters.  The reason for this is that we need to box a type
7461         parameter when converting it to a reference type.
7462
7463         * cs-parser.jay: Added support for default value expressions.
7464
7465         * generics.cs (DefaultValueExpression): New public class.       
7466
7467 2003-10-17  Martin Baulig  <martin@ximian.com>
7468
7469         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7470         TypeContainer so we can also use this for Interfaces.
7471         (TypeParameter.Resolve): Likewise.
7472
7473         * interface.cs (Interface.DefineType): Added support for generic
7474         interfaces.
7475
7476         * cs-parser.jay: Added support for generic structs and interfaces.
7477
7478 2003-10-17  Martin Baulig  <martin@ximian.com>
7479
7480         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7481         call generic methods :-)
7482
7483 2003-10-16  Martin Baulig  <martin@ximian.com>
7484
7485         * cs-parser.jay (namespace_or_type_name): Only create a
7486         GenericMemberAccess if we actually have type arguments.
7487
7488 2003-10-13  Martin Baulig  <martin@ximian.com>
7489
7490         * class.cs (Method.Define): If we're a generic method, call
7491         TypeBuilder.DefineGenericMethod () before resolving
7492         the parameters.
7493         (MethodData): Added .ctor which takes an additional MethodBuilder
7494         argument; this is used for generic methods.
7495         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7496         we already have a MethodBuilder.
7497
7498 2003-10-10  Martin Baulig  <martin@ximian.com>
7499
7500         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7501         instead of a `DeclSpace'.  This is used for generic methods.
7502
7503         * cs-parser.jay (method_header): Added support for generic
7504         methods; create a `GenericMethod' instance and pass it to the
7505         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7506         parameters and locals.
7507
7508         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7509         since we already have the location.  Check whether we're a generic
7510         type declaration or a generic method and create the correct type
7511         parameter.
7512
7513         * generic.cs (TypeParameter.DefineMethod): New public method.
7514         (GenericMethod): New public class; derives from DeclSpace and is
7515         used for generic methods.       
7516
7517 2003-10-09  Martin Baulig  <martin@ximian.com>
7518
7519         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7520         to the .ctor.
7521         (MethodCore.DoDefineParameters): Removed the TypeContainer
7522         argument; use the DeclSpace which was passed to the .ctor instead.
7523         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7524         TypeContainer; we only need a DeclSpace here.
7525
7526 2003-10-09  Martin Baulig  <martin@ximian.com>
7527
7528         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7529         to the .ctor.
7530         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7531         EmitContext's .ctor.    
7532
7533 2003-10-09  Martin Baulig  <martin@ximian.com>
7534
7535         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7536         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7537         AsAccessible(), moved them as well.
7538
7539         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7540
7541 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7542
7543         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7544         generation for >=, as spotted by Paolo, bug 48679.  
7545         Patch from David Waite.
7546
7547         * cs-tokenizer.cs: Add handling for #pragma.
7548
7549         * cs-parser.jay: Allow for both yield and yield return in the
7550         syntax.  The anti-cobolization of C# fight will go on!
7551
7552         * class.cs (TypeBuilder.DefineType): Catch error condition here
7553         (Parent.DefineType erroring out and returning null).
7554
7555         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7556         coping with enumerations variables, we were mistakenly processing
7557         them as a regular value type instead of built-in types.  Fixes the
7558         bug #48063
7559
7560         * typemanager.cs (IsBuiltinOrEnum): New method.
7561
7562 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7563
7564         * cs-parser.jay: Upgrade: yield now needs the return clause.
7565
7566 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7567
7568         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7569
7570 2003-09-29  Martin Baulig  <martin@ximian.com>
7571
7572         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7573         inflated generic methods.
7574
7575         * generics.cs (ConstructedType): Distinguish between open and
7576         closed constructed types; correctly resolve the arguments.
7577
7578 2003-09-22  Martin Baulig  <martin@ximian.com>
7579
7580         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7581         all type arguments meet their constraints.
7582
7583 2003-09-19  Martin Baulig  <martin@ximian.com>
7584
7585         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7586         `MemberCache parent' argument.  Normally, an interface doesn't
7587         have a parent type except System.Object, but we use this in gmcs
7588         for generic type parameters.
7589
7590 2003-09-18  Martin Baulig  <martin@ximian.com>
7591
7592         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7593         on `type.IsInterface'; don't check whether the type has a parent
7594         to determine whether it's an interface.
7595
7596 2003-09-17  Martin Baulig  <martin@ximian.com>
7597
7598         * generic.cs (ConstructedType.ToString): Always use `name' as the
7599         type name.
7600
7601 2003-09-15  Martin Baulig  <martin@ximian.com>
7602
7603         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7604
7605         * generic.cs (Constraints.Resolve): New public method; this is
7606         called to resolve the constraint types and to check whether all
7607         the constraints are correct.
7608         (Constraints.Types): New public property.
7609         (TypeParameter.Resolve): New public method; resolves all the
7610         type's constraints.
7611
7612         * class.cs (TypeContainer.DefineType): Call
7613         TypeParameter.Resolve() before actually defining the type.
7614
7615 2003-09-15  Martin Baulig  <martin@ximian.com>
7616
7617         * class.cs (TypeContainer.DefineType): Added an error flag to
7618         avoid reporting duplicate CS0146's ("class definition is
7619         circular.").
7620
7621         * driver.cs (Driver.MainDriver): Abort if
7622         RootContext.ResolveTree() reported any errors.
7623
7624 2003-09-07  Martin Baulig  <martin@ximian.com>
7625
7626         * report.cs (Error, Warning): Added overloaded versions which take
7627         a `params object[] args' and call String.Format().
7628
7629 2003-09-07  Martin Baulig  <martin@ximian.com>
7630
7631         * decl.cs (DeclSpace..ctor): Don't call
7632         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7633         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7634         (DeclSpace.RecordDecl): New method.
7635
7636         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7637
7638 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7639
7640         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7641         value attributes to be applied to ParameterBuilders.
7642
7643         * class.cs (MethodCore.LabelParameters): Make static and more
7644         generic so that it can be used from other places - like interface
7645         methods, for instance.
7646
7647         * interface.cs (Interface.Emit): Call LabelParameters before
7648         emitting attributes on the InterfaceMethod.
7649
7650 2003-09-07  Martin Baulig  <martin@ximian.com>
7651
7652         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7653         if the number of type parameters doesn't match.
7654
7655 2003-09-04  Martin Baulig  <martin@ximian.com>
7656
7657         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7658         for arrays of generic type params (ie. `!0[]').
7659
7660 2003-09-04  Martin Baulig  <martin@ximian.com>
7661
7662         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7663         for the moment.
7664
7665 2003-09-04  Martin Baulig  <martin@ximian.com>
7666
7667         * decl.cs (DeclSpace.LookupGeneric): New method.
7668         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7669         moment.
7670
7671         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7672         argument, not just a string.
7673         (TypeParameter.Define): New public method; this is called to
7674         actually define the generic parameter; after this, you can use the
7675         new `Type' property to get the type.
7676
7677 2003-09-04  Martin Baulig  <martin@ximian.com>
7678
7679         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7680         is now an ArrayList; initialize the result of the `TypeParameters'
7681         property here.
7682         (DeclSpace.GetGenericData): Removed.
7683         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7684         implement this in a different way.
7685         (DeclSpace.GetTypeParameters): Removed; there's now a
7686         `TypeParameters' property.
7687         (DeclSpace.TypeParameters): New public property.
7688
7689         * generic.cs (Constraints): Make this class public.
7690         (TypeParameter): New public class.
7691
7692 2003-09-04  Martin Baulig  <martin@ximian.com>
7693
7694         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7695         generic parameters.
7696
7697         * class.cs (TypeContainer.DefineType): Call
7698         TypeBuilder.DefineGenericParameter () on all generic parameters if
7699         this is a generic type.
7700
7701 2003-08-28  Martin Baulig  <martin@ximian.com>
7702
7703         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7704         sample-stack.il".
7705
7706         * sample-hello.cs: Compile this with gmcs: "gmcs
7707         /r:sample-stack.dll sample-hello.cs".
7708
7709 2003-08-28  Martin Baulig  <martin@ximian.com>
7710
7711         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7712         the parameters to the generic type.
7713
7714 2003-08-28  Martin Baulig  <martin@ximian.com>
7715
7716         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7717
7718 2003-08-28  Martin Baulig  <martin@ximian.com>
7719
7720         * cs-parser.jay (opt_type_argument_list): Use
7721         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7722         (primary_expression): Replace `qualified_identifier' with `type_name'.
7723         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7724
7725         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7726         parser to check whether it is syntactically a type parameter list;
7727         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7728         this case.
7729
7730 2003-08-26  Martin Baulig  <martin@ximian.com>
7731
7732         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7733         resolving aliases; fixes #47927.
7734
7735 2003-08-26  Martin Baulig  <martin@ximian.com>
7736
7737         * statement.cs (Using.DoResolve): This is internally emitting a
7738         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7739         do not always return.  Fixes #47681.
7740
7741 2003-08-26  Martin Baulig  <martin@ximian.com>
7742
7743         * decl.cs (MemberCore): Moved WarningNotHiding(),
7744         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7745         into MemberBase.
7746         (AdditionResult): Make this nested in DeclSpace.
7747         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7748         argument; call NamespaceEntry.Define() unless we're nested in a
7749         class or struct.
7750
7751         * namespace.cs (Namespace.DefineName): New public function.  This
7752         is called from DeclSpace's .ctor to add 
7753         (Namespace.Lookup): Include DeclSpaces in the lookup.
7754
7755         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7756
7757         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7758
7759 2003-08-25  Martin Baulig  <martin@ximian.com>
7760
7761         * convert.cs (Convert.ExplicitReferenceConversion): When
7762         converting from an interface type to a class, unbox if the target
7763         type is a struct type.  Fixes #47822.
7764
7765 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7766
7767         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7768         #47854.
7769
7770 2003-08-22  Martin Baulig  <martin@ximian.com>
7771
7772         * class.cs (TypeManager.DefineType): When defining a nested type,
7773         call DefineType() on our parent; fixes #47801.
7774
7775 2003-08-22  Martin Baulig  <martin@ximian.com>
7776
7777         * class.cs (MethodData.Define): While checking if a method is an
7778         interface implementation, improve the test a bit more to fix #47654.
7779
7780 2003-08-22  Martin Baulig  <martin@ximian.com>
7781
7782         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7783         correctly; fixes #47722.
7784
7785 2003-08-22  Martin Baulig  <martin@ximian.com>
7786
7787         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7788         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7789
7790         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7791
7792 2003-08-22  Martin Baulig  <martin@ximian.com>
7793
7794         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7795         can only be assigned in static constructors.  Fixes #47161.
7796
7797 2003-08-22  Martin Baulig  <martin@ximian.com>
7798
7799         Rewrote and improved the flow analysis code.
7800
7801         * flowbranching.cs (FlowBranching): Make this class abstract.
7802         (FlowBranching.CreateBranching): New static function to create a
7803         new flow branching.
7804         (FlowBranchingBlock, FlowBranchingException): New classes.
7805         (FlowBranching.UsageVector.Type): New public readonly field.
7806         (FlowBranching.UsageVector.Breaks): Removed the setter.
7807         (FlowBranching.UsageVector.Returns): Removed the setter.
7808         (FlowBranching.UsageVector): Added Break(), Return(),
7809         NeverReachable() and Throw() methods to modify the reachability.
7810         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7811         done by FlowBranching.Merge().
7812         (FlowBranching.UsageVector.MergeChild): New method; merges the
7813         merge result into the current vector.
7814         (FlowBranching.Merge): New abstract method to merge a branching.
7815
7816 2003-08-12  Martin Baulig  <martin@ximian.com>
7817
7818         * expression.cs (Indirection.CacheTemporaries): Create the
7819         LocalTemporary with the pointer type, not its element type.
7820
7821 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7822
7823         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7824         token was a keyword or not.
7825
7826         Add `error' options where an IDENTIFIER was expected;  Provide
7827         CheckToken and CheckIdentifierToken convenience error reporting
7828         functions. 
7829
7830         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7831
7832         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7833         NameSpaceEntry NameSpaceEntry.
7834
7835         (LookupInterfaceOrClass): Avoid creating a full qualified name
7836         from namespace and name: avoid doing lookups when we know the
7837         namespace is non-existant.   Use new Tree.LookupByNamespace which
7838         looks up DeclSpaces based on their namespace, name pair.
7839
7840         * driver.cs: Provide a new `parser verbose' to display the
7841         exception thrown during parsing.  This is turned off by default
7842         now, so the output of a failure from mcs is more graceful.
7843
7844         * namespace.cs: Track all the namespaces defined in a hashtable
7845         for quick lookup.
7846
7847         (IsNamespace): New method
7848
7849 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7850
7851         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7852         we know that we need to concatenate (full typename can never be
7853         null). 
7854
7855         * class.cs: ditto.
7856
7857         * statement.cs: Use a bitfield;  Do not initialize to null things
7858         which are done by the constructor by default.
7859
7860         * cs-parser.jay: bug fix, parameter was 4, not 3.
7861
7862         * expression.cs: Just use the property;
7863
7864         * statement.cs: No need for GetVariableInfo method.
7865
7866 2003-08-08  Martin Baulig  <martin@ximian.com>
7867
7868         * flowanalysis.cs (FlowReturns): This is now nested in the
7869         `FlowBranching' class.
7870         (MyBitVector): Moved this here from statement.cs.
7871         (FlowBranching.SiblingType): New enum type.
7872         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7873
7874 2003-08-07  Martin Baulig  <martin@ximian.com>
7875
7876         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7877         `FlowBranching' class and called `BranchingType'.
7878
7879 2003-08-07  Martin Baulig  <martin@ximian.com>
7880
7881         * flowanalysis.cs: Moved all the control flow analysis code into
7882         its own file.
7883
7884 2003-08-07  Martin Baulig  <martin@ximian.com>
7885
7886         * assign.cs (Assign.DoResolve): `target' must either be an
7887         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7888         #37319.
7889
7890 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7891
7892         * expression.cs (BinaryMethod): This kind of expression is created by the
7893         Binary class if it determines that the operator has to be handled
7894         by a method.
7895
7896         (BinaryDelegate): This kind of expression is created if we are
7897         dealing with a + or - operator on delegates.
7898
7899         (Binary): remove method, argumetns, and DelegateOperator: when
7900         dealing with methods, 
7901
7902         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7903
7904         * statement.cs (Block): use bitfields for the three extra booleans
7905         we had in use.   Remove unused topblock parameter.
7906
7907         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7908
7909         * assign.cs: Drop extra unneeded tests.
7910
7911 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7912
7913         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7914
7915         * statement.cs (Foreach): Use VariableStorage instead of
7916         LocalBuilders.   
7917
7918         * codegen.cs (VariableStorage): New class used by clients that
7919         require a variable stored: locals or fields for variables that
7920         need to live across yield.
7921
7922         Maybe provide a convenience api for EmitThis+EmitLoad?
7923
7924         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7925         these bad boys.
7926
7927 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7928
7929         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7930         RemapParameterLValue): New methods that are used to turn a
7931         precomputed FieldInfo into an expression like this:
7932
7933                 instance.FieldInfo
7934
7935         The idea is to use this instead of making LocalVariableReference
7936         have more than one meaning.
7937
7938         * cs-parser.jay: Add error production to BASE.
7939
7940         * ecore.cs: Deal with TypeManager.GetField returning null, which
7941         is now a valid return value.
7942
7943         (FieldExprNoAddress): New expression for Fields whose address can
7944         not be taken.
7945
7946         * expression.cs (LocalVariableReference): During the resolve
7947         phases, create new expressions if we are in a remapping context.
7948         Remove code that dealt with remapping here.
7949
7950         (ParameterReference): same.
7951
7952         (ProxyInstance): New expression, like the `This' expression, but
7953         it is born fully resolved.  We know what we are doing, so remove
7954         the errors that are targeted to user-provided uses of `this'.
7955
7956         * statement.cs (Foreach): our variable is now stored as an
7957         Expression;  During resolution, follow the protocol, dont just
7958         assume it will return this.
7959
7960 2003-08-06  Martin Baulig  <martin@ximian.com>
7961
7962         * support.cs (SeekableStreamReader.cs): New public class.
7963
7964         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7965         SeekableStreamReader instead of the normal StreamReader.
7966
7967 2003-08-04  Martin Baulig  <martin@ximian.com>
7968
7969         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7970         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7971         deambiguate casts and delegate invocations.
7972         (parenthesized_expression): Use the new tokens to ensure this is
7973         not a cast of method invocation.
7974
7975         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7976         when reading a `)' and Deambiguate_CloseParens () was previously
7977         called.
7978
7979         * expression.cs (ParenthesizedExpression): New class.  This is
7980         just used for the CS0075 test.
7981         (Binary.DoResolve): Check for CS0075.   
7982
7983 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7984
7985         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7986         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7987         reference comparison.
7988
7989         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7990         examine the ReturnType for equality - this is necessary in the
7991         cases of implicit and explicit operators whose signature also
7992         includes the return type.
7993
7994 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7995
7996         * namespace.cs: Cache the result of the namespace computation,
7997         instead of computing it every time.
7998
7999 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8000
8001         * decl.cs: Use a global arraylist that we reuse over invocations
8002         to avoid excesive memory consumption.  Reduces memory usage on an
8003         mcs compile by one meg (45 average).
8004
8005         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8006         private, work around that.
8007
8008 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8009
8010         * literal.cs (IntLiteral): Define Zero and One static literals. 
8011
8012         * cs-parser.jay (integer_literal): use static literals to reduce
8013         memory usage for the most used literals (0, 1 and -1).  211kb
8014         reduced in memory usage.
8015
8016         Replace all calls to `new ArrayList' with `new
8017         ArrayList(4)' which is a good average number for most allocations,
8018         and also requires only 16 bytes of memory for its buffer by
8019         default. 
8020
8021         This reduced MCS memory usage in seven megabytes for the RSS after
8022         bootstrapping.
8023
8024 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8025
8026         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8027         handle params methods the correct way by forming only one
8028         applicable set with params and normal methods in them. Earlier we
8029         were looking at params methods only if we found no normal methods
8030         which was not the correct thing to do.
8031
8032         (Invocation.BetterFunction): Take separate arguments indicating
8033         when candidate and the best method are params methods in their
8034         expanded form.
8035
8036         This fixes bugs #43367 and #46199.
8037
8038         * attribute.cs: Documentation updates.
8039
8040         (CheckAttribute): Rename to CheckAttributeTarget.
8041         (GetValidPlaces): Rename to GetValidTargets.
8042
8043         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8044         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8045
8046         Fixes bug #44468.
8047
8048 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
8049
8050         * codegen.cs: Compute IsGeneric correctly.
8051
8052         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
8053         resolution. 
8054
8055         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
8056         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
8057         regressions, and I was chasing more bugs than I required.
8058
8059         * interface.cs: Use expressions for base type names (like classes
8060         and structs have been doing for a while now), and resolve that.
8061         This patch should probably go into head as well.
8062
8063         This makes it one less user of FindType.
8064
8065 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8066
8067         This compiler can not self host currently.  Need to fix that.
8068         
8069         * Makefile: compile to `gmcs.exe'
8070
8071         * driver.cs: Turn on v2 by default on gmcs.
8072
8073         * generic.cs (ConstructedType): Does no longer take a container
8074         type argument;  That will be taken care of later.
8075
8076         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8077         Use SimpleName to resolve for now, so we can continue the work on
8078         the parser, until we get Type.GetType that understands generics.
8079
8080         (ConstructedType.ToString): Implement
8081
8082         (TypeArguments.Resolve): Resolve the child expressions as types. 
8083         
8084         * cs-parser.jay: Rename interface_constraints to
8085         type_parameter_constraints
8086
8087         (namespace_or_type_name): Only use constructed types for the basic
8088         construction, we will deal with identifier<...> later.
8089
8090         (type/type_name): No longer call DecomposeQI, as
8091         namespace_or_type_name is always decoded now.
8092         
8093 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8094
8095         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8096         closely: we eliminate methods in base types when we have an
8097         applicable method in a top-level type.
8098
8099         Please see section 14.5.5.1 for an exact description of what goes
8100         on. 
8101
8102         This fixes bug #45127 and a host of other related to corlib compilation.
8103
8104         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8105         array is the method corresponding to the top-level type (this is
8106         because of the changes made to icall.c) so we change this
8107         accordingly.
8108
8109         (MethodGroupExpr.Name): This too.
8110
8111         * typemanager.cs (GetElementType): New method which does the right
8112         thing when compiling corlib. 
8113
8114         * everywhere: Make use of the above in the relevant places.
8115
8116 2003-07-22  Martin Baulig  <martin@ximian.com>
8117
8118         * cs-parser.jay (invocation_expression): Moved
8119         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8120         `cast_expression', but create a InvocationOrCast which later
8121         resolves to either an Invocation or a Cast.
8122
8123         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8124         method; call this before EmitStatement() to make sure that this
8125         expression can be used as a statement.
8126
8127         * expression.cs (InvocationOrCast): New class; resolves to either
8128         an Invocation or a Cast.
8129
8130         * statement.cs (StatementExpression): Call ResolveStatement() on
8131         the ExpressionStatement before emitting it.
8132
8133 2003-07-21  Martin Baulig  <martin@ximian.com>
8134
8135         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8136         `ref' and `out' attributes match; fixes #46220.
8137         (MemberAccess.ResolveMemberAccess): You can't reference a type
8138         through an expression; fixes #33180.
8139         (Indexers.GetIndexersForType): Don't return the indexers from
8140         interfaces the class implements; fixes #46502.
8141
8142 2003-07-21  Martin Baulig  <martin@ximian.com>
8143
8144         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8145         CS0661 checks; fixes bug #30442.
8146
8147 2003-07-21  Martin Baulig  <martin@ximian.com>
8148
8149         * decl.cs (AdditionResult): Added `Error'.
8150
8151         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8152
8153         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8154         cs0031.cs actually work.
8155
8156  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8157  
8158         * cs-parser.jay (namespace_name): do not use
8159         namespace_or_type_name, use qualified_identifier, because
8160         namespace_or_type_name will soon return a composed expression
8161         instead of a string.
8162  
8163         (namespace_or_type_name): Instead of returning a string, now this
8164         production returns an expression.
8165  
8166         * codegen.cs (EmitContext): Setup IsGeneric property based on
8167         whether our DeclSpace is generic, our the method is generic.
8168  
8169         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8170         the method is generic.
8171  
8172         * cs-parser.jay (type_arguments, opt_type_argument_list,
8173         type_parameters, type_parameter_list, opt_type_parameter_list,
8174         type_parameter,, opt_type_parameter_constraints_clauses,
8175         type_parameter_constraints_clauses,
8176         type_parameter_constraint_clause, type_parameter_constraint,
8177         interface_constraints): Add new production
8178  
8179         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8180         DeclSpace is generic or not.
8181  
8182         (DeclSpace.SetParameterInfo): New routine, used to set the
8183         parameter info for a type.
8184  
8185         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8186         returns a GenericTypeExpr
8187  
8188         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8189         generic, lookup the generic argument.
8190  
8191         * attribute.cs: Do not allow TypeParameterExpressions in
8192         Attributes.
8193  
8194         * class.cs: Do not allow the Main method to be defined in a
8195         Generic container.
8196  
8197         * expression.cs (SizeOf): Do not allow generic types to be used as
8198         arguments to sizeof.
8199  
8200         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8201         it: whether a type is generic or not.  Only works for types we are
8202         currently building for now.
8203         
8204 2003-07-20  Martin Baulig  <martin@ximian.com>
8205
8206         * namespace.cs: Fixed that bug which caused a crash when compiling
8207         the debugger's GUI.
8208
8209 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8210
8211         * typemanager.cs (LookupTypeReflection): Never expose types which
8212         are NotPublic, NestedPrivate, NestedAssembly, or
8213         NestedFamANDAssem.  We used to return these, and later do a check
8214         that would report a meaningful error, but the problem is that we
8215         would not get the real match, if there was a name override.
8216
8217 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8218
8219         * namespace.cs (Namespace, Name): Do not compute the namespace
8220         name dynamically, compute it in the constructor.  This reduced
8221         memory usage by 1697 KB.
8222
8223         * driver.cs: Use --pause to pause at the end.
8224
8225 2003-07-17  Peter Williams  <peter@newton.cx>
8226
8227         * Makefile: Change the name of the test target so that it doesn't
8228         conflict with the recursive test target.
8229
8230 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8231
8232         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8233         AddressOf): Do not use EmitThis, that was wrong, use the actual
8234         this pointer.
8235
8236 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8237
8238         * class.cs (MethodData.Define): While checking if a method is an
8239         interface implementation, improve the test: If we are not public
8240         (use new test here: use the computed MethodAttributes directly,
8241         instead of the parsed modifier flags) check if the `implementing'
8242         method comes from an interface or not.
8243
8244         * pending.cs (VerifyPendingMethods): Slightly better error
8245         message.
8246
8247         * makefile: add test target that does the mcs bootstrap.
8248
8249 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8250
8251         * interface.cs (Define): Do nothing here since there are no
8252         members to populate etc. Move the attribute emission out of here
8253         since this was just totally the wrong place to put it. Attribute
8254         application happens during the 'Emit' phase, not in the 'Define'
8255         phase.
8256
8257         (Emit): Add this method and move the attribute emission here
8258
8259         * rootcontext.cs (EmitCode): Call the Emit method on interface
8260         types too.
8261
8262 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8263
8264         * expression.cs (OverloadResolve): Report error only if Location
8265         is not 'Null' which means that there was a probe going on.
8266
8267 2003-07-14  Martin Baulig  <martin@ximian.com>
8268
8269         * expression.cs (ConditionalLogicalOperator): New public class to
8270         implement user defined conditional logical operators.
8271         This is section 14.11.2 in the spec and bug #40505.
8272
8273 2003-07-14  Martin Baulig  <martin@ximian.com>
8274
8275         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8276
8277 2003-07-14  Martin Baulig  <martin@ximian.com>
8278
8279         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8280
8281         * ecore.cs (IVariable.VerifyFixed): New interface method.
8282
8283         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8284         operator, check whether the variable is actually fixed.  Fixes bug
8285         #36055.  Set a variable definitely assigned when taking its
8286         address as required by the spec.
8287
8288         * statement.cs (LocalInfo.IsFixed): New field.
8289         (LocalInfo.MakePinned): Set `IsFixed' to true.
8290
8291 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8292
8293         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8294         for .ctors, ensure that we only ask for members declared in the
8295         attribute type (BindingFlags.DeclaredOnly).
8296
8297         Fixes bug #43632.
8298
8299         * expression.cs (Error_WrongNumArguments): Report error 1501
8300         correctly the way CSC does.
8301
8302 2003-07-13  Martin Baulig  <martin@ximian.com>
8303
8304         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8305         lookup on the fully qualified name, to make things like "X.X" work
8306         where "X.X" is a fully qualified type name, but we also have a
8307         namespace "X" in the using list.  Fixes #41975.
8308
8309 2003-07-13  Martin Baulig  <martin@ximian.com>
8310
8311         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8312         function. If we're a CompoundAssign, we need to create an embedded
8313         CompoundAssign, not an embedded Assign.
8314         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8315         Fixes #45854.
8316
8317 2003-07-13  Martin Baulig  <martin@ximian.com>
8318
8319         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8320         work to fix bug #46088.
8321
8322 2003-07-13  Ravi Pratap <ravi@ximian.com>
8323
8324         * class.cs (Operator.Emit): Do not emit attributes here - it is
8325         taken care of by the Method class that we delegate too. This takes
8326         care of bug #45876.
8327
8328 2003-07-10  Martin Baulig  <martin@ximian.com>
8329
8330         * expression.cs (TypeOfVoid): New class.
8331         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8332
8333 2003-07-10  Martin Baulig  <martin@ximian.com>
8334
8335         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8336         bug #35957.
8337
8338 2003-07-10  Martin Baulig  <martin@ximian.com>
8339
8340         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8341         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8342
8343         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8344
8345         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8346
8347 2003-07-10  Martin Baulig  <martin@ximian.com>
8348
8349         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8350         of decimal.  Fixes #42850.
8351
8352         NOTE: I also fixed the created byte blob, but this doesn't work on
8353         the MS runtime and csc never produces any byte blobs for decimal
8354         arrays.
8355
8356 2003-07-10  Martin Baulig  <martin@ximian.com>
8357
8358         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8359         structs; fixes #32068.
8360         (Block.AddChildVariableNames): Fixed #44302.
8361
8362 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8363
8364         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8365
8366 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8367
8368         * attribute.cs: And this test is onger needed.
8369
8370 2003-07-08  Martin Baulig  <martin@ximian.com>
8371
8372         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8373         inaccessible types.  Fixes #36313.
8374
8375         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8376
8377         * namespace.cs (NamespaceEntry): Create implicit entries for all
8378         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8379         implicit entries for N1.N2 and N1.
8380
8381 2003-07-08  Martin Baulig  <martin@ximian.com>
8382
8383         Rewrote the handling of namespaces to fix a lot of the issues
8384         wrt. `using' aliases etc.
8385
8386         * namespace.cs (Namespace): Splitted this class into a
8387         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8388
8389         * typemanager.cs (TypeManager.IsNamespace): Removed.
8390         (TypeManager.ComputeNamespaces): Only compute namespaces from
8391         loaded assemblies here, not the namespaces from the assembly we're
8392         currently compiling.
8393
8394 2003-07-08  Martin Baulig  <martin@ximian.com>
8395
8396         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8397
8398 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8399
8400         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8401         already fixed it.  
8402
8403         I thought about the memory savings here, but LookupTypeReflection
8404         is used under already very constrained scenarios.  Compiling
8405         corlib or mcs only exposes one hit, so it would not really reduce
8406         any memory consumption.
8407
8408 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8409
8410         * typemanager.cs: fixes bug #45889 by only adding public types from
8411         other assemblies to the list of known types.
8412
8413 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8416         on the type we resolved.
8417
8418 2003-07-05  Martin Baulig  <martin@ximian.com>
8419
8420         * pending.cs (PendingImplementation.ParentImplements): Don't
8421         create the proxy if the parent is abstract.
8422
8423         * class.cs (TypeContainer.DefineIndexers): Process explicit
8424         interface implementations first.  Fixes #37714.
8425
8426 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8427
8428         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8429         defined recursively;  but since we modify the input parameters
8430         (left is set to `this' temporarily), we reset this value if the
8431         left_is_explicit is false, which gives the original semantics to
8432         the code.  
8433
8434         * literal.cs (NullPointer): new class used to represent a null
8435         literal in a pointer context.
8436
8437         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8438         type is a pointer, use a NullPointer object instead of a
8439         NullLiteral.   Closes 43687
8440
8441         (ExplicitConversion): Convert pointer values using
8442         the conv opcode to the proper type.
8443
8444         * ecore.cs (New): change ValueTypeVariable property into a method,
8445         that returns whether the valuetype is suitable for being used.
8446
8447         * expression.cs (Binary.DoNumericPromotions): Only return if we
8448         the int constant was a valid uint, and we can return both left and
8449         right as uints.  If not, we continue processing, to trigger the
8450         type conversion.  This fixes 39018.
8451
8452         * statement.cs (Block.EmitMeta): During constant resolution, set
8453         the CurrentBlock property on the emitcontext, so that we resolve
8454         constants propertly.
8455
8456 2003-07-02  Martin Baulig  <martin@ximian.com>
8457
8458         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8459         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8460
8461         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8462         than emitting it here.
8463
8464         * statement.cs: Fixed some more flow analysis bugs.
8465
8466 2003-07-02  Martin Baulig  <martin@ximian.com>
8467
8468         * class.cs (MethodData.Define): When implementing interface
8469         methods, set Final unless we're Virtual.
8470
8471         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8472         check work for interface methods.
8473
8474 2003-07-01  Martin Baulig  <martin@ximian.com>
8475
8476         * ecore.cs (EmitContext.This): Replaced this property with a
8477         GetThis() method which takes a Location argument.  This ensures
8478         that we get the correct error location for a CS0188.
8479
8480 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8481
8482         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8483         ImplicitStandardConversion.
8484
8485         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8486
8487 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8488
8489         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8490         optimization.
8491
8492 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8493
8494         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8495         constructors.
8496
8497         (MethodData.Define): Turn off initlocals for unsafe methods.
8498
8499 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8500
8501         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8502         complete;  Fixes #37521.
8503
8504         * delegate.cs: Use Modifiers.TypeAttr to compute the
8505         TypeAttributes, instead of rolling our own.  This makes the flags
8506         correct for the delegates.
8507
8508 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8509
8510         * class.cs (Constructor.Define): Set the private flag for static
8511         constructors as well.
8512
8513         * cs-parser.jay (statement_expression): Set the return value to
8514         null, to avoid a crash when we catch an error.
8515
8516 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8517
8518         * cs-parser.jay: Applied patch from Jackson that adds support for
8519         extern and unsafe modifiers to destructor declarations.
8520
8521         * expression.cs: Report error 21 if the user is trying to index a
8522         System.Array.
8523
8524         * driver.cs: Add an error message, suggested by the bug report.
8525
8526         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8527         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8528
8529 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8530
8531         * namespace.cs: Add some information to reduce FAQs.
8532
8533 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8534
8535         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8536         underlying enumeration types.  Fixes #43915.
8537
8538         * expression.cs: Treat ushort/short as legal values to be used in
8539         bitwise operations.
8540
8541 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8542
8543         * delegate.cs: transfer custom attributes for paramenters from
8544         the delegate declaration to Invoke and BeginInvoke.
8545
8546 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8547
8548         * attribute.cs: handle custom marshalers and emit marshal info
8549         for fields, too.
8550
8551 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8552
8553         * makefile.gnu: Added anonymous.cs to the compiler sources.
8554
8555 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8556
8557         * iterators.cs: Change the name of the proxy class to include two
8558         underscores.
8559
8560         * cs-parser.jay: Update grammar to include anonymous methods.
8561
8562         * anonymous.cs: new file.
8563
8564 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8565
8566         * class.cs (Field.Define): Add missing test for pointers and
8567         safety. 
8568
8569 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8570
8571         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8572         we use the stobj opcode.
8573
8574         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8575         since it wasn't the correct fix. 
8576
8577         It still is puzzling that we are required to use stobj for IntPtr
8578         which seems to be a ValueType.
8579
8580 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8581
8582         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8583         during regular simple name resolution.   Now, the trick is that
8584         instead of returning for processing the simplename, we do a
8585         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8586         contextual lookup type).   If a match is found, return that, if
8587         not, return for further composition.
8588
8589         This fixes long-standing 30485.
8590
8591         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8592         using the address to initialize an object, do an Stobj instead of
8593         using the regular Stelem.
8594
8595         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8596         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8597         Because if we are a BaseIndexerAccess that value will be true.
8598         Fixes 43643.
8599
8600         * statement.cs (GotoCase.Resolve): Return after reporting an
8601         error, do not attempt to continue. 
8602
8603         * expression.cs (PointerArithmetic.Emit): If our operand is a
8604         long, convert our constants to match the operand before
8605         multiplying.  Convert to I type before adding.   Fixes 43670.
8606
8607 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8608
8609         * enum.cs (ImplicitConversionExists) : Rename to
8610         ImplicitEnumConversionExists to remove ambiguity. 
8611
8612         * ecore.cs (NullCast): New type of cast expression class which
8613         basically is very similar to EmptyCast with the difference being
8614         it still is a constant since it is used only to cast a null to
8615         something else
8616         (eg. (string) null)
8617
8618         * convert.cs (ImplicitReferenceConversion): When casting a null
8619         literal, we return a NullCast.
8620
8621         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8622         should be around anymore.
8623
8624         The renaming (reported was slightly wrong). Corrections:
8625
8626         ConvertImplicitStandard -> ImplicitConversionStandard
8627         ConvertExplicitStandard -> ExplicitConversionStandard
8628
8629         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8630         before passing them in !
8631
8632         * convert.cs (ImplicitConversionStandard): When comparing for
8633         equal expr and target types, ensure that expr is not a
8634         NullLiteral.
8635
8636         In general, we must not be checking (expr_type ==
8637         target_type) in the top level conversion methods
8638         (ImplicitConversion, ExplicitConversion etc). This checking is
8639         done in the methods that they delegate to.
8640
8641 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8642
8643         * convert.cs: Move Error_CannotConvertType,
8644         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8645         ImplicitNumericConversion, ImplicitConversionExists,
8646         ImplicitUserConversionExists, StandardConversionExists,
8647         FindMostEncompassedType, FindMostSpecificSource,
8648         FindMostSpecificTarget, ImplicitUserConversion,
8649         ExplicitUserConversion, GetConversionOperators,
8650         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8651         TryImplicitIntConversion, Error_CannotConvertImplicit,
8652         ConvertImplicitRequired, ConvertNumericExplicit,
8653         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8654         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8655         its own file.
8656
8657         Perform the following renames:
8658
8659         StandardConversionExists -> ImplicitStandardConversionExists
8660         ConvertImplicit -> ImplicitConversion
8661         ConvertImplicitStandard -> ImplicitStandardConversion
8662         TryImplicitIntConversion -> ImplicitIntConversion
8663         ConvertImplicitRequired -> ImplicitConversionRequired
8664         ConvertNumericExplicit -> ExplicitNumericConversion
8665         ConvertReferenceExplicit -> ExplicitReferenceConversion
8666         ConvertExplicit -> ExplicitConversion
8667         ConvertExplicitStandard -> ExplicitStandardConversion
8668
8669 2003-05-19  Martin Baulig  <martin@ximian.com>
8670
8671         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8672         (TypeInfo): Added support for structs having structs as fields.
8673
8674         * ecore.cs (FieldExpr): Implement IVariable.
8675         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8676         VariableInfo for the field.
8677
8678 2003-05-18  Martin Baulig  <martin@ximian.com>
8679
8680         * expression.cs (This.DoResolve): Report a CS0027 if we're
8681         emitting a field initializer.
8682
8683 2003-05-18  Martin Baulig  <martin@ximian.com>
8684
8685         * expression.cs (This.ResolveBase): New public function.
8686         (This.DoResolve): Check for CS0188.
8687
8688         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8689         This.Resolve().
8690
8691         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8692         `instance_expression' to null if we don't have any non-static
8693         methods.
8694
8695 2003-05-18  Martin Baulig  <martin@ximian.com>
8696
8697         Reworked the way how local variables and parameters are handled by
8698         the flow analysis code.
8699
8700         * statement.cs (TypeInfo, VariableMap): New public classes.
8701         (VariableInfo): New public class.  This is now responsible for
8702         checking whether a variable has been assigned.  It is used for
8703         parameters and local variables.
8704         (Block.EmitMeta): Take the InternalParameters as argument; compute
8705         the layout of the flow vectors here.
8706         (Block.LocalMap, Block.ParameterMap): New public properties.
8707         (FlowBranching): The .ctor doesn't get the InternalParameters
8708         anymore since Block.EmitMeta() now computes the layout of the flow
8709         vector.
8710         (MyStructInfo): This class is now known as `StructInfo' and nested
8711         in `TypeInfo'; we don't access this directly anymore.
8712
8713         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8714         property and removed IsAssigned(), IsFieldAssigned(),
8715         SetAssigned() and SetFieldAssigned(); we now call them on the
8716         VariableInfo so we don't need to duplicate this code everywhere.
8717
8718         * expression.cs (ParameterReference): Added `Block block' argument
8719         to the .ctor.
8720         (LocalVariableReference, ParameterReference, This): The new
8721         VariableInfo class is now responsible for all the definite
8722         assignment stuff.
8723
8724         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8725         IsParameterAssigned, SetParameterAssigned): Removed.
8726
8727 2003-05-18  Martin Baulig  <martin@ximian.com>
8728
8729         * typemanager.cs (InitCoreTypes): Try calling
8730         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8731         the 3-args-version.  Corlib now also needs our `void_type'.
8732         (GetMethod): Added overloaded version which takes an optional
8733         `bool report_errors' to allow lookups of optional methods.
8734
8735 2003-05-12  Martin Baulig  <martin@ximian.com>
8736
8737         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8738         only used for locals and not for parameters.
8739
8740 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8741
8742         * support.cs (InternalParameters.ParameterType): Return the
8743         ExternalType of the parameter.
8744
8745         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8746         they were unused.
8747
8748 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8749
8750         * class.cs (MethodData.Define): Do not set the `newslot' on
8751         interface members, if they are also flagged as "override".
8752
8753         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8754         better code for ++i and i++.  This only works for static fields
8755         and local variables.
8756
8757         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8758         want to pull the DeclSpace out of the builder_to_declspace instead
8759         of the TypeBuilder (like in TypeContainer.FindMembers).
8760
8761         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8762         instead of LookupTypeContainer.  Fixes the crash on .NET for
8763         looking up interface members.
8764
8765         * const.cs: Create our own emit context during the Definition
8766         stage, so that constants are evaluated in the proper context, when
8767         a recursive definition happens.
8768
8769 2003-05-11  Martin Baulig  <martin@ximian.com>
8770
8771         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8772         new block for a switch section.
8773         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8774         the adding/lookup in the switch block.  Fixes #39828.
8775
8776 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8777
8778         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8779         functionality: I needed to convert the data after I had performed
8780         the add/sub operation into the operands type size.
8781
8782         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8783         pass the type for the box operation, otherwise the resulting
8784         object would have been of type object.
8785
8786         (BoxedCast): Add constructor to specify the type to box as.
8787
8788 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * iterators.cs: I was reusing the `count' variable inadvertently,
8791         take steps to not allow this to happen.
8792
8793 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8794
8795         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8796         by creating an array at the point where the params starts and
8797         putting all those arguments there, then adjusting the size of the
8798         array.
8799
8800 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8801
8802         * expression.cs (New.AddressOf): Implement interface
8803         IMemoryLocation.  This is used when the `new' operator is used in
8804         the context of an invocation to a method on a value type.
8805
8806         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8807         example. 
8808
8809         * namespace.cs: Also check the using aliases here.
8810
8811         * driver.cs: Move the test for using validity after the types have
8812         been entered, so we do a single pass that also includes the using
8813         aliases. 
8814
8815         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8816         in the regular case.   CreateSiblingForFinally is doing extra
8817         error checking.
8818
8819         * attribute.cs (GetAttributeArgumentExpression): Store the result
8820         on an out value, and use the return value to indicate failure
8821         instead of using null (which is a valid return for Constant.GetValue).
8822
8823         * statement.cs: Perform the analysis flow for the increment
8824         portion after the statement, because this will be the real flow of
8825         execution.  Fixes #42385
8826
8827         * codegen.cs (EmitContext.EmitArgument,
8828         EmitContext.EmitStoreArgument): New helper functions when the
8829         RemapToProxy flag is set.
8830
8831         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8832         function.
8833
8834         Add support for remapping parameters. 
8835
8836         * iterators.cs: Propagate parameter values;  Store parameter
8837         values in the proxy classes.
8838
8839 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8840
8841         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8842         need a proxy reference;  I do not know what I was thinking
8843
8844         * cs-parser.jay (constructor_initializer): catch another error,
8845         and display nice message.
8846
8847         (field_declaration): catch void field declaration
8848         to flag a better error. 
8849
8850         * class.cs (MemberBase.CheckBase): Report an error instead of a
8851         warning if a new protected member is declared in a struct. 
8852         (Field.Define): catch the error of readonly/volatile.
8853
8854         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8855
8856         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8857         volatile variable is taken
8858
8859 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8860
8861         * statement.cs (Fixed.Resolve): Report an error if we are not in
8862         an unsafe context.
8863
8864 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8865
8866         * typemanager.cs: reuse the code that handles type clashes for
8867         delegates and enumerations.
8868
8869         * class.cs (Report28): Always report.
8870
8871         * expression.cs (EncodeAsAttribute): Allow nulls here.
8872
8873 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8874
8875         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8876         the functionality for testing whether an expression is valid for
8877         an attribute here.  Also handle the case of arrays of elements
8878         being stored. 
8879
8880         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8881         encoding a linear array into an array of objects that are suitable
8882         to be passed to an CustomAttributeBuilder.
8883
8884         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8885
8886         * ecore.cs: (FieldExpr): Handle field remapping here.
8887
8888         * iteratators.cs: Pass the instance variable (if the method is an
8889         instance method) to the constructors, so we can access the field
8890         variables on the class.
8891
8892         TODO: Test this with structs.  I think the THIS variable on
8893         structs might have to be a pointer, and not a refenrece
8894
8895 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8896
8897         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8898         local variables to fields in a proxy class.
8899
8900         * iterators.cs (PopulateProxy): Rename our internal fields to
8901         <XXX>.  
8902         Create a <THIS> field if we are an instance method, so we can
8903         reference our parent container variables.
8904         (MapVariable): Called back from the EmitContext code to enter a
8905         new variable to field mapping into the proxy class (we just create
8906         a FieldBuilder).
8907
8908         * expression.cs
8909         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8910         for using the remapped locals to fields.
8911
8912         I placed the code here, because that gives the same semantics to
8913         local variables, and only changes the Emit code.
8914
8915         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8916         statements inside iterators.
8917         (VariableInfo): Add a FieldBuilder for the cases when we are
8918         remapping local variables to fields in a proxy class
8919
8920         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8921         current_block != null.
8922
8923         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8924         not cope with strings, as it has been moved to the
8925         TableSwitchEmit.  Fixed bug in switch generation.
8926
8927         * expression.cs (New.DoResolve): Provide more context for the user
8928         when reporting an error.
8929
8930         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8931         pointers. 
8932
8933         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8934         check the permissions for it.  Note than in a type-resolution
8935         context the check was already present in DeclSpace.ResolveType,
8936         but was missing from the MemberAccess.
8937
8938         (ArrayCreation.CheckIndices): warn if the user has
8939         more nested levels of expressions, but there are no more
8940         dimensions specified.  Avoids crash on bug 41906.
8941
8942 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8943
8944         * statement.cs (Block): replace Implicit bool, for a generic
8945         flags.   
8946         New flag: `Unchecked'.  This is used during the EmitMeta phase
8947         (which is out-of-line with the regular Resolve/Emit process for a
8948         statement, as this is done ahead of time, but still gets a chance
8949         to call constant resolve).
8950
8951         (Block.Flags): new enum for adding a new flag.
8952
8953         (Block.EmitMeta): track the state of unchecked.
8954
8955         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8956         to enable constant resolution to work there as well.
8957
8958 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8959
8960         * typemanager.cs (ienumerable_type): Also look up
8961         System.Collections.IEnumerable. 
8962
8963 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8964
8965         TODO: Test more than one conditional per method.
8966
8967         * class.cs (Indexer.Define): Report the location where the user is
8968         referencing the unsupported feature.
8969
8970         (MethodData): Overload the use of `conditionals' to
8971         minimize the creation of needless ArrayLists.   This saves roughly
8972         212kb on my machine.
8973
8974         (Method): Implement the new IIteratorContainer interface.
8975         (Method.SetYields): Implement the method by setting the ModFlags
8976         to contain METHOD_YIELDS.
8977
8978         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8979         which just got set to null.
8980
8981         * iterators.cs: New file.
8982
8983         (Yield, YieldBreak): New statements.
8984
8985         * statement.cs (Return.Resolve): Flag an error if we are used in
8986         an iterator method.
8987
8988         * codegen.cs (InIterator): New flag set if the code is being
8989         compiled in an iterator method.
8990
8991         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8992         internal modifier, and we just use it to avoid adding extra
8993         fields, as this is seldom used.  
8994
8995         * cs-parser.jay: Add yield_statement (yield and yield break).
8996
8997         * driver.cs: New flag -v2 to turn on version 2 features. 
8998
8999         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9000         hashtable when v2 is enabled.
9001
9002 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9003
9004         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9005         there is already a namespace defined with this name.
9006
9007         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9008         people upgraded their corlibs.
9009
9010         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9011         always use fully qualified types, no need to use the compiler
9012         front end.
9013
9014         (TypeManager.IsNamespace): Use binarysearch.
9015
9016         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9017         AddDelegate): I did not quite use the new IsValid API properly: I
9018         have to pass the short-name and the fullname.  I was passing only
9019         the basename instead of the fullname sometimes. 
9020
9021         (TypeContainer.DefineType): call NamespaceClash.
9022
9023         * interface.cs (Interface.DefineType): use NamespaceClash before
9024         defining the type.
9025
9026         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9027         defining the type.
9028
9029         * enum.cs: (Enum.DefineType): use NamespaceClash before
9030         defining the type.
9031
9032         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9033         speed increase.  First, use the negative_hits cache when we get a
9034         negative.  Second, add the type with its full original name
9035         instead of the new . and + encoded name (reflection uses + to
9036         separate type from a nested type).  Use LookupTypeReflection
9037         directly which bypasses the type->name hashtable (that we already
9038         know does not contain the type.
9039
9040         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9041         location/container type. 
9042
9043         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9044
9045 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9046
9047         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9048
9049         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9050         method is being referenced in the method group from a static
9051         context, and report error 120 if so.
9052
9053         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9054         Error118. 
9055
9056         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9057         is created, we create the A namespace).
9058
9059         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9060         Fixes #41591
9061
9062 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9063
9064         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9065         invocation to ModuleBuilder.GetType with the same values will
9066         return a new type instance, so we need to cache its return
9067         values. 
9068
9069         * expression.cs (Binary.ResolveOperator): Only allow the compare
9070         operators on enums if they are of the same type.
9071
9072         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9073         types of ValueType on their own case.  Before we were giving them
9074         the same treatment as objects.
9075
9076         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9077         fullname.  Short name is used to compare against container name.
9078         Fullname is used to check against defined namespace names.
9079
9080         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9081         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9082
9083         (Method.CheckBase): Call parent.
9084         (MemberBase.CheckBase): Check for protected members on sealed
9085         classes.
9086         (PropertyBase.CheckBase): Call parent.
9087         (Field.Define): Call parent.
9088
9089         * report.cs: Negative error codes are now mapped to 8000 - code,
9090         so that the display is render more nicely.
9091
9092         * typemanager.cs: Do not use try/catch, instead report a regular
9093         error. 
9094
9095         (GetPointerType, GetReferenceType): These methods provide
9096         mechanisms to obtain the T* and T& from a T.  We had the code
9097         previously scattered around the code base, and it also used
9098         TypeManager.LookupType that would go through plenty of caches.
9099         This one goes directly to the type source.
9100
9101         In some places we did the Type.GetType followed by
9102         ModuleBuilder.GetType, but not in others, so this unifies the
9103         processing as well.
9104
9105         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9106         statements now that we have namespace information.
9107
9108         * typemanager.cs (IsNamespace): New method, returns whether the
9109         string presented is a namespace or not.
9110
9111         (ComputeNamespaces): New public entry point, computes the list of
9112         available namespaces, using the GetNamespaces API call in Mono, or
9113         the slower version in MS.NET.   
9114
9115         Now before we start the semantic analysis phase, we have a
9116         complete list of namespaces including everything that the user has
9117         provided.
9118
9119         Deleted old code to cache namespaces in .nsc files.
9120
9121 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9122
9123         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9124         class/struct location definition Location for the implicit
9125         constructor location.
9126
9127         (Operator.Define): Use the location of the operator for the
9128         implicit Method definition.
9129
9130         (Constructor.Emit): use the constructor location for the implicit
9131         base initializer constructor.
9132
9133         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9134         and the Expression class now contains two new methods:
9135
9136         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9137         isolate type lookup from the rest of the resolution process.
9138
9139         Since we use Expressions to hold type definitions due to the way
9140         we parse the input we have historically overloaded Resolve to
9141         perform the Type lookups if a special flag is passed.  Now this is
9142         eliminated and two methods take their place. 
9143
9144         The differences in the two methods between xStep and xTerminal is
9145         that xStep is involved in our current lookup system that uses
9146         SimpleNames to compose a name, while xTerminal is used just to
9147         catch the case where the simplename lookup failed.
9148
9149 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9150
9151         * expression.cs (ResolveMemberAccess): Remove redundant code.
9152         TypeExpr expressions are always born fully resolved.
9153
9154         * interface.cs (PopulateMethod): Do not lookup the types twice.
9155         We were doing it once during SemanticAnalysis and once during
9156         PopulateMethod.
9157
9158         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9159         in local variable type definitions, were being returned as a
9160         SimpleName (we decomposed everything into a string), that is
9161         because primary_expression was being used instead of a type in the
9162         grammar (reduce/reduce conflicts).
9163
9164         The part that was wrong is that we converted the expression into a
9165         string (an oversimplification in one hand, compounded with primary
9166         expressions doing string concatenation).
9167
9168         So things like:
9169
9170         A.B.C [] x;
9171
9172         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9173         using clauses from working on this particular context.  And a type
9174         was being matched directly against "A.B.C[]".
9175
9176         We now use the correct approach, and allow for ComposedCast to be
9177         part of the unary expression.  So the "A.B.C []" become a composed
9178         cast of "A.B.C" (as a nested group of MemberAccess with a
9179         SimpleName at the end) plus the rank composition "[]". 
9180
9181         Also fixes 35567
9182
9183 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9184
9185         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9186         for the access level checking.
9187
9188         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9189         `TypeContainer container', because I kept getting confused when I
9190         was debugging this code.
9191
9192         * expression.cs (Indexers): Instead of tracking getters/setters,
9193         we now track them in parallel.  We create one arraylist less, but
9194         most importantly it is possible now for the LValue code to find a
9195         matching get for a set.
9196
9197         (IndexerAccess.DoResolveLValue): Update the code.
9198         GetIndexersForType has been modified already to extract all the
9199         indexers from a type.  The code assumed it did not.
9200
9201         Also make the code set the correct return type for the indexer.
9202         This was fixed a long time ago for properties, but was missing for
9203         indexers.  It used to be void_type.
9204
9205         (Binary.Emit): Test first for doubles instead of
9206         floats, as they are more common.
9207
9208         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9209         when dealing with floats and the <=, >= operators.  This fixes bug
9210         #39314 
9211
9212         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9213         to load the array value by emitting a load on the foreach variable
9214         type.  This was incorrect.  
9215
9216         We now emit the code to load an element using the the array
9217         variable type, and then we emit the conversion operator.
9218
9219         Fixed #40176
9220
9221 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9222
9223         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9224
9225 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9226
9227         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9228         test for protection before we test for signatures. 
9229
9230         (MethodSignature.ToString): implement.
9231
9232         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9233         to the case where we reduced into a LongConstant.
9234
9235         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9236         depend on whether the information is acurrate, because the
9237         Microsoft runtime will always claim that the array type is public,
9238         regardless of the real state.
9239
9240         If the type is a pointer, another problem happens: the type is
9241         reported as non-public in Microsoft.  
9242
9243         In both cases we have to call CheckAccessLevel recursively with
9244         the underlying type as the argument to be tested.
9245
9246 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9247
9248         * assign.cs (Assign.Emit): If we are dealing with a compound
9249         assignment expression, we should use the code path that stores the
9250         intermediate result in a temporary value.  This fixes #40903.
9251
9252         *expression.cs (Indirection.ToString): Provide ToString method for
9253         debugging. 
9254
9255 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9256
9257         * class.cs: Null out fields holding references to Block objects so
9258         they can be garbage collected.
9259
9260         * expression.cs (OverloadResolve): Remove unused local.
9261
9262 2003-04-07  Martin Baulig  <martin@ximian.com>
9263
9264         * codegen.cs (EmitContext.CurrentFile): New public field.
9265         (EmitContext.Mark): Use the CurrentFile to check whether the
9266         location is in the correct file.
9267         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9268
9269 2003-04-07  Martin Baulig  <martin@ximian.com>
9270
9271         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9272
9273         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9274         location.  [FIXME: The location argument which gets passed to this
9275         method is sometimes wrong!]
9276
9277 2003-04-07  Nick Drochak <ndrochak@gol.com>
9278
9279         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9280
9281 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9282
9283         * expression.cs (Indirection.EmitAssign): We were using the
9284         temporary, but returning immediately instead of continuing the
9285         EmitAssing flow.
9286
9287 2003-04-06  Martin Baulig  <martin@ximian.com>
9288
9289         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9290         if it's a nested child, but also deriving from the outer class.
9291         See test 190.cs.
9292
9293         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9294         nested child, but also deriving from the outer class.  See
9295         test-190.cs.
9296         (FilterWithClosure): We may access private members of the outer
9297         class if we're a nested child and deriving from the outer class.
9298         (RealMemberLookup): Only set `closure_private_ok' if the
9299         `original_bf' contained BindingFlags.NonPublic.
9300
9301 2003-04-05  Martin Baulig  <martin@ximian.com>
9302
9303         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9304         probe if its a type parameter, and if so, flag an error.
9305
9306         * decl.cs: Move here the SetParameterInfo code from class.cs.
9307         Handle IsGeneric here.
9308
9309         Handle a variety of errors in the parameter info definition.
9310
9311         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9312         type parameters here.
9313
9314         * cs-parser.jay (class_declaration): report errors for parameters
9315         here as well.
9316
9317 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9318
9319         * generic.cs: New file, contains support code for generics.
9320
9321         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9322         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9323
9324         Update parser for the above removals.
9325
9326         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9327         now taken care of in the parser.
9328
9329 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9330
9331         * class.cs (Event.Define): Do not allow abstract events to have
9332         initializers. 
9333
9334 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9335
9336         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9337         block in event declarations.
9338
9339         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9340         value type, get its address.
9341
9342         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9343         leaving a class on the stack instead of a boolean value (int
9344         0/1).  Change the code so we compare against null, and then the
9345         result against zero.
9346
9347         * class.cs (TypeContainer.GetClassBases): We were checking for the
9348         parent class being sealed too late.
9349
9350         * expression.cs (Binary.Emit): For <= and >= when dealing with
9351         floating point values, use cgt.un and clt.un instead of cgt and
9352         clt alone.
9353
9354 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9355
9356         * statement.cs: Apply the same optimization as MS: skip the 
9357         GetEnumerator returning an IEnumerator, and use the one returning a 
9358         CharEnumerator instead. This allows us to avoid the try-finally block 
9359         and the boxing.
9360
9361 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9362
9363         * cs-parser.jay: Attributes cannot be applied to
9364                          namespaces. Fixes #40473
9365
9366 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9367
9368         * class.cs:
9369         (Add*): check if the name is valid using the full name for constants,
9370         fields, properties and events.
9371
9372 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9373
9374         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9375         char constants to be part of the enumeration.
9376
9377         * expression.cs (Conditional.DoResolve): Add support for operator
9378         true. Implements the missing functionality from 14.12
9379
9380         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9381         operator true/false as required by the spec.
9382
9383         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9384         implicit conversion to boolean.
9385
9386         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9387         also one where the type implements `operator true'. 
9388
9389         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9390         get an expression that will invoke operator true based on an
9391         expression.  
9392
9393         (GetConversionOperators): Removed the hack that called op_True
9394         here.  
9395
9396         (Expression.ResolveBoolean): Move this from Statement.
9397
9398 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * ecore.cs (FieldExpr): do not allow initialization of initonly
9401         fields on derived classes
9402
9403 2003-03-13  Martin Baulig  <martin@ximian.com>
9404
9405         * statement.cs (Block.Emit): Call ig.BeginScope() and
9406         ig.EndScope() when compiling with debugging info; call
9407         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9408
9409 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9410
9411         * expression.cs (Indexers): Do not construct immediately, allow
9412         for new members to be appended as we go.  Fixes 38143
9413
9414 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9415
9416         * expression.cs: save/restore context when resolving an unchecked
9417         expression.
9418
9419 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9420
9421         * cfold.cs: Catch division by zero in modulus operator during
9422         constant folding.
9423
9424 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9425
9426         * interface.cs (Interface.DefineMembers): Avoid defining members
9427         twice. 
9428
9429 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9430
9431         * driver.cs: handle the +/- options for -noconfig
9432
9433         * statement.cs (Unckeched.Resolve): Also track the state of
9434         unchecked in the Resolve phase.
9435
9436 2003-02-27  Martin Baulig  <martin@ximian.com>
9437
9438         * ecore.cs (Expression.MemberLookup): Don't create a
9439         MethodGroupExpr for something which is not a method.  Fixes #38291.
9440
9441 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9442
9443         * class.cs (MemberBase.CheckParameters): Also check that the type
9444         is unmanaged if it is a pointer.
9445
9446         * expression.cs (SizeOf.Resolve): Add location information.
9447
9448         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9449         a managed type is declared.
9450
9451         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9452         parameter modifiers as well.  Fixes bug 38606
9453
9454         * class.cs: Very sad.  Am backing out the speed up changes
9455         introduced by the ArrayList -> Array in the TypeContainer, as they
9456         were not actually that much faster, and introduced a bug (no error
9457         reports on duplicated methods).
9458
9459         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9460         source first, this will guarantee that we have a valid expression
9461         before calling in lower levels functions that will require a
9462         resolved object.  Then use this original_source in the
9463         target.ResolveLValue instead of the original source that was
9464         passed to us.
9465
9466         Another change.  Use target.Resolve instead of LValueResolve.
9467         Although we are resolving for LValues, we will let the Assign code
9468         take care of that (it will be called again from Resolve).  This
9469         basically allows code like this:
9470
9471         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9472         class Y { void A (X x) { x [0] += o; }
9473
9474         The problem was that the indexer was trying to resolve for
9475         set_Item (idx, object o) and never finding one.  The real set_Item
9476         was set_Item (idx, X).  By delaying the process we get the right
9477         semantics. 
9478
9479         Fixes bug 36505
9480
9481 2003-02-23  Martin Baulig  <martin@ximian.com>
9482
9483         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9484         while calling DoEmit ().
9485
9486         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9487         source files; if you use the #line directive inside a method, the
9488         compiler stops emitting line numbers for the debugger until it
9489         reaches the end of the method or another #line directive which
9490         restores the original file.
9491
9492 2003-02-23  Martin Baulig  <martin@ximian.com>
9493
9494         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9495
9496 2003-02-23  Martin Baulig  <martin@ximian.com>
9497
9498         * statement.cs (Block.AddChildVariableNames): We need to call this
9499         recursively, not just for our immediate children.
9500
9501 2003-02-23  Martin Baulig  <martin@ximian.com>
9502
9503         * class.cs (Event.Define): Always make the field private, like csc does.
9504
9505         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9506         actually work, fixes bug #37521.
9507
9508 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9509
9510         * delegate.cs: When creating the various temporary "Parameters"
9511         classes, make sure that we call the ComputeAndDefineParameterTypes
9512         on those new parameters (just like we do with the formal ones), to
9513         allow them to be resolved in the context of the DeclSpace.
9514
9515         This fixes the bug that Dick observed in Bugzilla #38530.
9516
9517 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9518
9519         * expression.cs (ResolveMemberAccess): When resolving a constant,
9520         do not attempt to pull a constant if the value was not able to
9521         generate a valid constant.
9522
9523         * const.cs (LookupConstantValue): Do not report more errors than required.
9524
9525 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9526
9527         * expression.cs: fixes bug #38328.
9528
9529 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9530
9531         * class.cs: Changed all the various members that can be part of a
9532         class from being an ArrayList to be an Array of the right type.
9533         During the DefineType type_list, interface_list, delegate_list and
9534         enum_list are turned into types, interfaces, delegates and enums
9535         arrays.  
9536
9537         And during the member population, indexer_list, event_list,
9538         constant_list, field_list, instance_constructor_list, method_list,
9539         operator_list and property_list are turned into their real arrays.
9540
9541         Although we could probably perform this operation earlier, for
9542         good error reporting we need to keep the lists and remove the
9543         lists for longer than required.
9544
9545         This optimization was triggered by Paolo profiling the compiler
9546         speed on the output of `gen-sample-program.pl' perl script. 
9547
9548         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9549         not crash in methods like MemberLookupFailed that use this field.  
9550
9551         This problem arises when the compiler fails to resolve a type
9552         during interface type definition for example.
9553
9554 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9555
9556         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9557         inherit from System.Object, so we have to stop at null, not only
9558         when reaching System.Object.
9559
9560 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9561
9562         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9563         DeclaredOnly because the parent indexer might have had a different
9564         name, but did not loop until the top of the hierarchy was reached.
9565
9566         The problem this one fixes is 35492: when a class implemented an
9567         indexer from an interface, we were getting the interface method
9568         (which was abstract) and we were flagging an error (can not invoke
9569         abstract method).
9570
9571         This also keeps bug 33089 functioning, and test-148 functioning.
9572
9573         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9574         out if a method is special is to see if it is declared in a
9575         property or event, or whether it is one of the predefined operator
9576         names.   This should fix correctly #36804.
9577
9578 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9579
9580         The goal here is to remove the dependency on EmptyCast.Peel ().
9581         Killing it completely.
9582
9583         The problem is that currently in a number of places where
9584         constants are expected, we have to "probe" for an EmptyCast, and
9585         Peel, which is not the correct thing to do, as this will be
9586         repetitive and will likely lead to errors. 
9587
9588         The idea is to remove any EmptyCasts that are used in casts that
9589         can be reduced to constants, so we only have to cope with
9590         constants. 
9591
9592         This bug hunt was triggered by Bug 37363 and the desire to remove
9593         the duplicate pattern where we were "peeling" emptycasts to check
9594         whether they were constants.  Now constants will always be
9595         constants.
9596
9597         * ecore.cs: Use an enumconstant here instead of wrapping with
9598         EmptyCast.  
9599
9600         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9601         throwing me off.  By handling this we can get rid of a few hacks.
9602
9603         * statement.cs (Switch): Removed Peel() code.
9604
9605 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9606
9607         * class.cs: Location information for error 508
9608
9609         * expression.cs (New.DoResolve): Add a guard against double
9610         resolution of an expression.  
9611
9612         The New DoResolve might be called twice when initializing field
9613         expressions (see EmitFieldInitializers, the call to
9614         GetInitializerExpression will perform a resolve on the expression,
9615         and later the assign will trigger another resolution
9616
9617         This leads to bugs (#37014)
9618
9619         * delegate.cs: The signature for EndInvoke should contain any ref
9620         or out parameters as well.  We were not doing this in the past. 
9621
9622         * class.cs (Field.Define): Do not overwrite the type definition
9623         inside the `volatile' group.  Turns out that volatile enumerations
9624         were changing the type here to perform a validity test, which
9625         broke conversions. 
9626
9627 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9630         and structs, we do not want to load the instance variable
9631
9632         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9633         enum_type has to be handled like an object reference (implicit
9634         conversions exists from this to object), but the regular IsClass
9635         and IsValueType tests will never return true for this one.
9636
9637         Also we use TypeManager.IsValueType instead of type.IsValueType,
9638         just for consistency with the rest of the code (this is only
9639         needed if we ever use the construct exposed by test-180.cs inside
9640         corlib, which we dont today).
9641
9642 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9643
9644         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9645         just InternalCall.
9646
9647 2003-02-09  Martin Baulig  <martin@ximian.com>
9648
9649         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9650         (Namespace.DefineNamespaces): New static public method; this is
9651         called when we're compiling with debugging to add all namespaces
9652         to the symbol file.
9653
9654         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9655         pass it to the Namespace's .ctor.
9656
9657         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9658         and MethodBase arguments; pass the namespace ID to the symwriter;
9659         pass the MethodBase instead of the token to the symwriter.
9660         (SymbolWriter.DefineNamespace): New method to add a namespace to
9661         the symbol file.
9662
9663 2003-02-09  Martin Baulig  <martin@ximian.com>
9664
9665         * symbolwriter.cs: New file.  This is a wrapper around
9666         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9667         methods here in near future.
9668
9669 2003-02-09  Martin Baulig  <martin@ximian.com>
9670
9671         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9672         ILGenerator.MarkSequencePoint() which are actually used by the
9673         symbol writer.
9674
9675 2003-02-09  Martin Baulig  <martin@ximian.com>
9676
9677         * location.cs (SourceFile): New public sealed class.  This
9678         contains the name and an index which is used in the location's token.
9679         (Location): Reserve an appropriate number of bits in the token for
9680         the source file instead of walking over that list, this gives us a
9681         really huge performance improvement when compiling with debugging.
9682
9683         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9684         `SourceFile' argument instead of a string.
9685         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9686         but don't parse/tokenize here, we need to generate the list of all
9687         source files before we do that.
9688         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9689         the files.
9690
9691         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9692         instead of a string.
9693
9694         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9695         of a string.
9696
9697 2003-02-09  Martin Baulig  <martin@ximian.com>
9698
9699         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9700         filename on `#line default'.
9701
9702 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9703
9704         * statement.cs: don't clear the pinned var when the fixed statement
9705         returns from the method (fixes bug#37752).
9706
9707 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9708
9709         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9710         to IsValueType.
9711
9712 2003-02-07  Martin Baulig  <martin@ximian.com>
9713
9714         * driver.cs: Removed the `--debug-args' command line argument.
9715
9716         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9717         automatically by the AsssemblyBuilder.
9718         (CodeGen.InitializeSymbolWriter): We don't need to call any
9719         initialization function on the symbol writer anymore.  This method
9720         doesn't take any arguments.
9721
9722 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9723
9724         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9725         from referenced assemblies as well.
9726
9727 2003-02-02  Martin Baulig  <martin@ximian.com>
9728
9729         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9730
9731 2003-02-02  Martin Baulig  <martin@ximian.com>
9732
9733         * class.cs (Constructor.Emit): Open the symbol writer before
9734         emitting the constructor initializer.
9735         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9736         single-stepping through constructor initializers.
9737
9738 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9739
9740         * class.cs: Handle error 549: do not allow virtual methods in
9741         sealed classes. 
9742
9743 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9744
9745         * decl.cs: Check access levels when resolving types
9746
9747 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9748
9749         * statement.cs: Add parameters and locals set in catch blocks that might 
9750         return to set vector
9751
9752 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * class.cs (Operator): Set the SpecialName flags for operators.
9755
9756         * expression.cs (Invocation.DoResolve): Only block calls to
9757         accessors and operators on SpecialName methods.
9758
9759         (Cast.TryReduce): Handle conversions from char constants.
9760
9761
9762 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9763
9764         * statement.cs: small memory and time optimization in FlowBranching.
9765
9766 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9767
9768         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9769         problem that the last fix but in the other sid (Set).
9770
9771         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9772         access when there is no indexer in the hierarchy.
9773
9774 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9775
9776         * class.cs: Combine some if statements.
9777
9778 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9779
9780         * driver.cs: fixed bug #37187.
9781
9782 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9783
9784         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9785         any indexer, it's needed to build a list with all the indexers in the
9786         hierarchy (AllGetters), else we have problems. Fixes #35653.
9787
9788 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9789
9790         * class.cs (MethodData.Define): It is wrong for an interface
9791         implementation to be static in both cases: explicit and implicit.
9792         We were only handling this in one case.
9793
9794         Improve the if situation there to not have negations.
9795
9796         * class.cs (Field.Define): Turns out that we do not need to check
9797         the unsafe bit on field definition, only on usage.  Remove the test.
9798
9799 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9800
9801         * driver.cs: use assembly.Location instead of Codebase (the latest
9802         patch made mcs fail when using MS assemblies).
9803
9804 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9805
9806         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9807         get the path to *corlib.dll.
9808
9809 2003-01-21  Nick Drochak <ndrochak@gol.com>
9810
9811         * cs-tokenizer.cs:
9812         * pending.cs:
9813         * typemanager.cs: Remove compiler warnings
9814
9815 2003-01-20  Duncan Mak  <duncan@ximian.com>
9816
9817         * AssemblyInfo.cs: Bump the version number to 0.19.
9818
9819 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9820
9821         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9822
9823 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9824
9825         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9826
9827 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * cs-parser.jay: Small fix: we were not comparing the constructor
9830         name correctly.   Thanks to Zoltan for the initial pointer.
9831
9832 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9833
9834         * cs-tokenizer.cs: Set file name when specified with #line
9835
9836 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9837
9838         * cs-parser.jay: Only perform the constructor checks here if we
9839         are named like the class;  This will help provider a better
9840         error.  The constructor path is taken when a type definition is
9841         not found, but most likely the user forgot to add the type, so
9842         report that rather than the constructor error.
9843
9844 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9845
9846         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9847         allocations.
9848
9849 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9850
9851         * cs-parser.jay: Add cleanup call.
9852
9853 2003-01-13  Duncan Mak  <duncan@ximian.com>
9854
9855         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9856         consistent with other methods.
9857
9858 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9859
9860         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9861
9862 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9863
9864         * attribute.cs: only set GuidAttr to true when we have a
9865         GuidAttribute.
9866
9867 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9868
9869         * ecore.cs:
9870         * expression.cs:
9871         * typemanager.cs: fixes to allow mcs compile corlib with the new
9872         Type.IsSubclassOf fix.
9873
9874 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * expression.cs (LocalVariableReference.DoResolve): Classify a
9877         constant as a value, not as a variable.   Also, set the type for
9878         the variable.
9879
9880         * cs-parser.jay (fixed_statement): take a type instead of a
9881         pointer_type, so we can produce a better error message later.
9882
9883         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9884         as an error.  
9885
9886         (For.DoEmit): Make inifinite loops have a
9887         non-conditional branch back.
9888
9889         (Fixed.DoEmit): First populate the pinned variables, then emit the
9890         statement, then clear the variables.  Before I was emitting the
9891         code once for each fixed piece.
9892
9893
9894 2003-01-08  Martin Baulig  <martin@ximian.com>
9895
9896         * statement.cs (FlowBranching.MergeChild): A break in a
9897         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9898
9899 2003-01-08  Martin Baulig  <martin@ximian.com>
9900
9901         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9902         lives in the same number space than `param_map'.  Fixes #36154.
9903
9904 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9905
9906         * cs-parser.jay (constructor_declaration): Set the
9907         Constructor.ModFlags before probing for it.  This makes the
9908         compiler report 514, 515 and 132 (the code was there, but got
9909         broken). 
9910
9911         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9912         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9913         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9914
9915 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9916
9917         * enum.cs: create the enum static fields using the enum type.
9918
9919 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9920
9921         * class.cs: don't try to create the ParamBuilder for the return
9922         type if it's not needed (and handle it breaking for the ms runtime
9923         anyway).
9924
9925 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9926
9927         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9928
9929 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9930
9931         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9932         the command.   This showed up while compiling the JANET source
9933         code, which used \r as its only newline separator.
9934
9935 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9936
9937         * class.cs (Method.Define): If we are an operator (because it
9938         reuses our code), then set the SpecialName and HideBySig.  #36128
9939
9940 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9941
9942         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9943         exception, report error 120 `object reference required'.
9944
9945         * driver.cs: Add --pause option, used during to measure the size
9946         of the process as it goes with --timestamp.
9947
9948         * expression.cs (Invocation.DoResolve): Do not allow methods with
9949         SpecialName to be invoked.
9950
9951 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9952
9953         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9954         number before adding it.
9955
9956 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9957
9958         * ecore.cs (StandardImplicitConversion): When in an unsafe
9959         context, we allow conversion between void * to any other pointer
9960         type. This fixes bug #35973.
9961
9962 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9963
9964         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9965         is not thrown when extensionless outputs are used 
9966
9967 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9968
9969         * rootcontext.cs: fixed compilation of corlib.
9970
9971 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9972
9973         * attribute.cs (Attributes.Contains): Add new method.
9974
9975         * class.cs (MethodCore.LabelParameters): if the parameter is an
9976         `out' parameter, check that no attribute `[In]' has been passed.
9977
9978         * enum.cs: Handle the `value__' name in an enumeration.
9979
9980 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9981
9982         * decl.cs: Added special case to allow overrides on "protected
9983         internal" methods
9984
9985 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9986
9987         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9988         since it makes much more sense.
9989
9990         (Attributes.ctor): Don't require a Location parameter.
9991
9992         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9993
9994         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9995         since we already have that information per attribute.
9996
9997         * everywhere : make appropriate changes.
9998
9999         * class.cs (LabelParameters): Write the code which actually
10000         applies attributes to the return type. We can't do this on the MS
10001         .NET runtime so we flag a warning in the case an exception is
10002         thrown.
10003
10004 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10005
10006         * const.cs: Handle implicit null conversions here too.
10007
10008 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10009
10010         * class.cs (MethodCore.LabelParameters): Remove the extra
10011         Type [] parameter since it is completely unnecessary. Instead
10012         pass in the method's attributes so that we can extract
10013         the "return" attribute.
10014
10015 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10016
10017         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10018         of ignoring it and letting the compile continue.
10019
10020         * typemanager.cs (ChangeType): use an extra argument to return an
10021         error condition instead of throwing an exception.
10022
10023 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10024
10025         * expression.cs (Unary.TryReduce): mimic the code for the regular
10026         code path.  Perform an implicit cast in the cases where we can
10027         implicitly convert to one of the integral types, and then reduce
10028         based on that constant.   This fixes bug #35483.
10029
10030 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10031
10032         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10033
10034 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10035
10036         * namespace.cs: fixed bug #35489.
10037
10038 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10039
10040         * class.cs: Remove some dead code.
10041
10042         * cs-parser.jay: Estimate the number of methods needed
10043         (RootContext.MethodCount);
10044
10045         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10046         numbers instead of StringBuilders.
10047
10048         * support.cs (PtrHashtable): Add constructor with initial size;
10049         We can now reduce reallocations of the method table.
10050
10051 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10052
10053         * attribute.cs (ApplyAttributes): Keep track of the emitted
10054         attributes on a per-target basis. This fixes bug #35413.
10055
10056 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10057
10058         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10059         default to the Windows 1252 encoding.
10060
10061         (UnixParseOption): Support version, thanks to Alp for the missing
10062         pointer. 
10063
10064         * AssemblyInfo.cs: Add nice assembly information.
10065
10066         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10067         (bug 35169).
10068
10069         * cs-parser.jay: Allow a trailing comma before the close bracked
10070         in the attribute_section production.
10071
10072         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10073         address of the instance was being taken, I will take this out,
10074         because we take the address of the object immediately here.
10075
10076 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10077
10078         * typemanager.cs (AreMultipleAllowed): Take care of the most
10079         obvious case where attribute type is not in the current assembly -
10080         stupid me ;-)
10081
10082 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10083
10084         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10085         definitions, instead of doing that afterwards.  
10086
10087         Also we use a nice little hack, depending on the constructor, we
10088         know if we are a "composed" name or a simple name.  Hence, we
10089         avoid the IndexOf test, and we avoid 
10090
10091         * codegen.cs: Add code to assist in a bug reporter to track down
10092         the source of a compiler crash. 
10093
10094 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10095
10096         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10097         types have been emitted for a given element and flag an error
10098         if something which does not have AllowMultiple set is used more
10099         than once.
10100
10101         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10102         attribute types and their corresponding AllowMultiple properties
10103
10104         (AreMultipleAllowed): Check the property for a given type.
10105
10106         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10107         property in the case we have a TypeContainer.
10108
10109         (Attributes.AddAttribute): Detect duplicates and just skip on
10110         adding them. This trivial fix catches a pretty gross error in our
10111         attribute emission - global attributes were being emitted twice!
10112
10113         Bugzilla bug #33187 is now fixed.
10114
10115 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10116
10117         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10118         instead of pp_and).
10119
10120         * expression.cs (Binary.ResolveOperator): I can only use the
10121         Concat (string, string, string) and Concat (string, string,
10122         string, string) if the child is actually a concatenation of
10123         strings. 
10124
10125 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10126
10127         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10128         context where we need a 2-character lookahead.
10129
10130         * pending.cs (PendingImplementation): Rework so we can keep track
10131         of interface types all the time, and flag those which were
10132         implemented by parents as optional.
10133
10134 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10135
10136         * expression.cs (Binary.ResolveOperator): Use
10137         String.Concat(string,string,string) or
10138         String.Concat(string,string,string,string) when possible. 
10139
10140         * typemanager: More helper methods.
10141
10142
10143 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10144
10145         * pending.cs: remove the bogus return from GetMissingInterfaces()
10146         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10147
10148 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10149
10150         * namespace.cs: avoid duplicated 'using xxx' being added to
10151         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10152         when we get more than one 'using' statement for the same namespace.
10153         Report a CS0105 warning for it.
10154
10155 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10158         of calling getChar/putback, uses internal knowledge of it.    
10159
10160         (xtoken): Reorder tokenizer so most common patterns are checked
10161         first.  This reduces the compilation time in another 5% (from 8.11s
10162         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10163
10164         The parsing time is 22% of the compilation in mcs, and from that
10165         64% is spent on the tokenization process.  
10166
10167         I tried using a binary search for keywords, but this is slower
10168         than the hashtable.  Another option would be to do a couple of
10169         things:
10170
10171                 * Not use a StringBuilder, instead use an array of chars,
10172                   with a set value.  Notice that this way we could catch
10173                   the 645 error without having to do it *afterwards*.
10174
10175                 * We could write a hand-parser to avoid the hashtable
10176                   compares altogether.
10177
10178         The identifier consumption process takes 37% of the tokenization
10179         time.  Another 15% is spent on is_number.  56% of the time spent
10180         on is_number is spent on Int64.Parse:
10181
10182                 * We could probably choose based on the string length to
10183                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10184                   computations. 
10185
10186         Another 3% is spend on wrapping `xtoken' in the `token' function.
10187
10188         Handle 0xa0 as whitespace (#34752)
10189
10190 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10191
10192         * typemanager.cs (IsCLRType): New routine to tell whether a type
10193         is one of the builtin types.  
10194
10195         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10196         typecode in more places instead of doing pointer comparissions.
10197         We could leverage some knowledge about the way the typecodes are
10198         laid out.
10199
10200         New code to cache namespaces in assemblies, it is currently not
10201         invoked, to be used soon.
10202
10203         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10204
10205         * expression.cs (Binary.ResolveOperator): specially handle
10206         strings, and do not perform user-defined operator overloading for
10207         built-in types.
10208
10209 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10210
10211         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10212         internalcall as it is a pretty simple operation;  Avoid whenever
10213         possible to call Char.IsLetter.
10214
10215         (consume_identifier): Cut by half the number of
10216         hashtable calls by merging the is_keyword and GetKeyword behavior.
10217
10218         Do not short-circuit, because if we do, we
10219         report errors (ie, #if false && true would produce an invalid
10220         directive error);
10221
10222
10223 2002-11-24  Martin Baulig  <martin@ximian.com>
10224
10225         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10226         check constant ranges and report a CS0221.  Fixes #33186.
10227
10228 2002-11-24  Martin Baulig  <martin@ximian.com>
10229
10230         * cs-parser.jay: Make this work for uninitialized variable
10231         declarations in the `for' initializer.  Fixes #32416.
10232
10233 2002-11-24  Martin Baulig  <martin@ximian.com>
10234
10235         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10236         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10237
10238 2002-11-24  Martin Baulig  <martin@ximian.com>
10239
10240         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10241         argument; if true, we also check for user-defined conversions.
10242         This is only needed if both arguments are of a user-defined type.
10243         Fixes #30443, added test-175.cs.
10244         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10245
10246         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10247
10248 2002-11-24  Martin Baulig  <martin@ximian.com>
10249
10250         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10251         function to get the store opcode.
10252         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10253         only emit the Ldelema if the store opcode is Stobj.  You must run
10254         both test-34 and test-167 to test this.  Fixes #34529.
10255
10256 2002-11-23  Martin Baulig  <martin@ximian.com>
10257
10258         * ecore.cs (Expression.MemberLookup): Added additional
10259         `qualifier_type' argument which is used when we're being called
10260         from MemberAccess.DoResolve() and null if we're called from a
10261         SimpleName lookup.
10262         (Expression.MemberLookupFailed): New method to report errors; this
10263         does the CS1540 check and reports the correct error message.
10264
10265         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10266         argument for the CS1540 check and redone the way how we're dealing
10267         with private members.  See the comment in the source code for details.
10268         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10269         `closure_start_type' to `closure_qualifier_type' and check whether
10270         it's not null.  It was not this filter being broken, it was just
10271         being called with the wrong arguments.
10272
10273         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10274         and pass it the correct `qualifier_type'; this also does the error
10275         handling for us.
10276
10277 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * expression.cs (Invocation.EmitParams): If the we are dealing
10280         with a non-built-in value type, load its address as well.
10281
10282         (ArrayCreation): Use a a pretty constant instead
10283         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10284         static initializers.  
10285
10286         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10287         because they are not really value types, just glorified integers. 
10288
10289         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10290
10291         * ecore.cs: Remove redundant code for enumerations, make them use
10292         the same code path as everything else, fixes the casting issue
10293         with enumerations in Windows.Forms.
10294
10295         * attribute.cs: Do only cast to string if it is a string, the
10296         validation happens later.
10297
10298         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10299         people upgrade their corlibs.
10300
10301         * ecore.cs: Oops, enumerations were not following the entire code path
10302
10303 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10304
10305         * typemanager.cs (FilterWithClosure): Commented out the test for
10306         1540 in typemanager.cs, as it has problems when accessing
10307         protected methods from a parent class (see test-174.cs). 
10308
10309         * attribute.cs (Attribute.ValidateGuid): new method.
10310         (Attribute.Resolve): Use above.
10311
10312 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10315
10316         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10317         handling for enumerations, as we only needed the TypeContainer
10318         functionality to begin with (this is required for the fix below to
10319         work for enums that reference constants in a container class for
10320         example). 
10321
10322         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10323
10324         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10325         a valid TypeBuilder to perform lookups on.o
10326
10327         * class.cs (InheritableMemberSignatureCompare): Use true in the
10328         call to GetGetMethod and GetSetMethod, because we are comparing
10329         the signature, and we need to get the methods *even* if they are
10330         private. 
10331
10332         (PropertyBase.CheckBase): ditto.
10333
10334         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10335         GotoCase.Resolve): Use Peel on EmpytCasts.
10336
10337         * ecore.cs (EmptyCast): drop child, add Peel method.
10338
10339 2002-11-17  Martin Baulig  <martin@ximian.com>
10340
10341         * ecore.cs (EmptyCast.Child): New public property.
10342
10343         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10344         label resolved to an EmptyCast.  Fixes #34162.
10345         (GotoCase.Resolve): Likewise.
10346         (Block.EmitMeta): Likewise.
10347
10348 2002-11-17  Martin Baulig  <martin@ximian.com>
10349
10350         * expression.cs (Invocation.BetterConversion): Prefer int over
10351         uint; short over ushort; long over ulong for integer literals.
10352         Use ImplicitConversionExists instead of StandardConversionExists
10353         since we also need to check for user-defined implicit conversions.
10354         Fixes #34165.  Added test-173.cs.
10355
10356 2002-11-16  Martin Baulig  <martin@ximian.com>
10357
10358         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10359         with the `true' and `false' literals.  Fixes #33151.
10360
10361 2002-11-16  Martin Baulig  <martin@ximian.com>
10362
10363         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10364         October 22nd; don't do the cs1540 check for static members.
10365
10366         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10367         now using our own filter here and doing the cs1540 check again.
10368
10369 2002-11-16  Martin Baulig  <martin@ximian.com>
10370
10371         * support.cs (InternalParameters): Don't crash if we don't have
10372         any fixed parameters.  Fixes #33532.
10373
10374 2002-11-16  Martin Baulig  <martin@ximian.com>
10375
10376         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10377         when looking up static methods to make this work on Windows.
10378         Fixes #33773.
10379
10380 2002-11-16  Martin Baulig  <martin@ximian.com>
10381
10382         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10383         a setter rather than using PropertyInfo.CanWrite.
10384
10385 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10386
10387         * class.cs: Allow acces to block member by subclasses. Fixes build
10388         breaker.
10389
10390 2002-11-14  Martin Baulig  <martin@ximian.com>
10391
10392         * class.cs (Constructor.Emit): Added the extern/block check.
10393         Fixes bug #33678.
10394
10395 2002-11-14  Martin Baulig  <martin@ximian.com>
10396
10397         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10398         iteration while looking for indexers, this is needed because the
10399         indexer may have a different name in our base classes.  Fixed the
10400         error reporting (no indexers at all, not get accessor, no
10401         overloaded match).  Fixes bug #33089.
10402         (IndexerAccess.DoResolveLValue): Likewise.
10403
10404 2002-11-14  Martin Baulig  <martin@ximian.com>
10405
10406         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10407         indexers.  Fixes the first part of bug #33089.
10408         (MethodSignature.InheritableMemberSignatureCompare): Added support
10409         for properties.
10410
10411 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10412
10413         * attribute.cs (Attribute.Resolve): Catch the
10414         NullReferenceException and report it since it isn't supposed to
10415         happen. 
10416
10417 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10418
10419         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10420         LogicalOr and LogicalAnd that can benefit from recursively
10421         handling EmitBranchable.  The code now should be nice for Paolo.
10422
10423 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10424
10425         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10426         the Type lookups, as we perform quite a number of lookups on
10427         non-Types.  This can be removed once we can deterministically tell
10428         whether we have a type or a namespace in advance.
10429
10430         But this might require special hacks from our corlib.
10431
10432         * TODO: updated.
10433
10434         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10435         and double which avoids a conversion from an integer to a double.
10436
10437         * expression.cs: tiny optimization, avoid calling IsConstant,
10438         because it effectively performs the lookup twice.
10439
10440 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10441
10442         But a bogus return here to keep the semantics of the old code
10443         until the Mono runtime is fixed.
10444
10445         * pending.cs (GetMissingInterfaces): New method used to remove all
10446         the interfaces that are already implemented by our parent
10447         classes from the list of pending methods. 
10448
10449         * interface.cs: Add checks for calls after ResolveTypeExpr.
10450
10451 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10452
10453         * class.cs (Class.Emit): Report warning 67: event not used if the
10454         warning level is beyond 3.
10455
10456         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10457         being a NullLiteral.
10458
10459         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10460         specifiers. 
10461
10462         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10463         path that might fail if a type can not be resolved.
10464
10465         * expression.cs (Binary.Emit): Emit unsigned versions of the
10466         operators. 
10467
10468         * driver.cs: use error 5.
10469
10470 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10471
10472         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10473
10474 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * cs-parser.jay (switch_section): A beautiful patch from Martin
10477         Baulig that fixed 33094.
10478
10479 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10480
10481         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10482         Check whether the base is abstract and report an error if so.
10483
10484         * expression.cs (IndexerAccess.DoResolveLValue,
10485         IndexerAccess.DoResolve): ditto. 
10486
10487         (Invocation.DoResolve): ditto.
10488
10489         (Invocation.FullMethodDesc): Improve the report string.
10490
10491         * statement.cs (Block): Eliminate IsVariableDefined as it is
10492         basically just a wrapper for GetVariableInfo.
10493
10494         * ecore.cs (SimpleName): Use new 
10495
10496         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10497         type, as we return the actual parameter ref/unref state on a
10498         different call.
10499
10500 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10501
10502         * support.cs: Return proper flags REF/OUT fixing the previous
10503         commit.  
10504
10505         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10506         not used to mean `ref' but `ref or out' in ParameterReference
10507
10508         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10509         full type signature instead of calling TypeManger.CSharpName
10510         ourselves. 
10511
10512         * support.cs (InternalParameters.ParameterDesc): Do not compare
10513         directly to the modflags, because REF/OUT will actually be bitsets
10514         if set. 
10515
10516         * delegate.cs (VerifyMethod): Check also the modifiers.
10517
10518         * cs-tokenizer.cs: Fix bug where floating point values with an
10519         exponent where a sign was missing was ignored.
10520
10521         * driver.cs: Allow multiple assemblies to be specified in a single
10522         /r: argument
10523
10524 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10525
10526         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10527         because identifiers after a parenthesis would end up in this kind
10528         of production, and we needed to desamiguate it for having casts
10529         like:
10530
10531                 (UserDefinedType *) xxx
10532
10533 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10534
10535         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10536         we should set on the Bindingflags.NonPublic, but not turn on
10537         private_ok.  private_ok controls whether a Private member is
10538         returned (this is chekced on the filter routine), while the
10539         BindingFlags.NonPublic just controls whether private/protected
10540         will be allowed.   This fixes the problem part of the problem of
10541         private properties being allowed to be used in derived classes.
10542
10543         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10544         so we can call the children DoResolveLValue method (this will
10545         properly signal errors on lvalue assignments to base properties)
10546
10547         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10548         getter are null, and we have a property info, we know that this
10549         happened because the lookup failed, so we report an error 122 for
10550         protection level violation.
10551
10552         We also silently return if setter and getter are null in the
10553         resolve functions, this condition only happens if we have flagged
10554         the error before.  This is the other half of the problem. 
10555
10556         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10557         not have accessibility information, that is why we were returning
10558         true in the filter function in typemanager.cs.
10559
10560         To properly report 122 (property is inaccessible because of its
10561         protection level) correctly, we report this error in ResolveAccess
10562         by failing if both the setter and the getter are lacking (ie, the
10563         lookup failed). 
10564
10565         DoResolve and DoLResolve have been modified to check for both
10566         setter/getter being null and returning silently, the reason being
10567         that I did not want to put the knowledge about this error in upper
10568         layers, like:
10569
10570         int old = Report.Errors;
10571         x = new PropertyExpr (...);
10572         if (old != Report.Errors)
10573                 return null;
10574         else
10575                 return x;
10576
10577         So the property expr is returned, but it is invalid, so the error
10578         will be flagged during the resolve process. 
10579
10580         * class.cs: Remove InheritablePropertySignatureCompare from the
10581         class, as we no longer depend on the property signature to compute
10582         whether it is possible to implement a method or not.
10583
10584         The reason is that calling PropertyInfo.GetGetMethod will return
10585         null (in .NET, in Mono it works, and we should change this), in
10586         cases where the Get Method does not exist in that particular
10587         class.
10588
10589         So this code:
10590
10591         class X { public virtual int A { get { return 1; } } }
10592         class Y : X { }
10593         class Z : Y { public override int A { get { return 2; } } }
10594
10595         Would fail in Z because the parent (Y) would not have the property
10596         defined.  So we avoid this completely now (because the alternative
10597         fix was ugly and slow), and we now depend exclusively on the
10598         method names.
10599
10600         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10601         reference method, instead of using the property.
10602
10603         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10604         routines are gone now.
10605
10606         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10607         names, they were incorrectly named.
10608
10609         * cs-tokenizer.cs: Return are more gentle token on failure. 
10610
10611         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10612         had an out-of-sync index variable, which caused it to remove from
10613         the list of pending methods the wrong method sometimes.
10614
10615 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10616
10617         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10618         CanWrite, because those refer to this particular instance of the
10619         property, and do not take into account the fact that we can
10620         override single members of a property.
10621
10622         Constructor requires an EmitContext.  The resolution process does
10623         not happen here, but we need to compute the accessors before,
10624         because the resolution does not always happen for properties.
10625
10626         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10627         subclass, before we did not update this flag, but we did update
10628         bindingflags. 
10629
10630         (GetAccessors): Drop this routine, as it did not work in the
10631         presence of partially overwritten set/get methods. 
10632
10633         Notice that this broke the cs1540 detection, but that will require
10634         more thinking. 
10635
10636 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10637
10638         * class.cs:
10639         * codegen.cs:
10640         * driver.cs: issue a warning instead of an error if we don't support
10641         debugging for the platform. Also ignore a couple of errors that may
10642         arise when trying to write the symbols. Undo my previous patch.
10643
10644 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10645
10646         * driver.cs: ignore /debug switch except for Unix platforms.
10647
10648 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10649
10650         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10651
10652 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10653
10654         * driver.cs: Do not make mcs-debug conditional, so we do not break
10655         builds that use it.
10656
10657         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10658         review this patch.  But basically after all the children variables
10659         have been merged, the value of "Breaks" was not being set to
10660         new_breaks for Switch blocks.  I think that it should be set after
10661         it has executed.  Currently I set this to the value of new_breaks,
10662         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10663         conservative, but I do not understand this code very well.
10664
10665         I did not break anything in the build, so that is good ;-)
10666
10667         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10668
10669 2002-10-20  Mark Crichton  <crichton@gimp.org>
10670
10671         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10672
10673 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10674
10675         * cfold.cs: Fixed compile blocker.
10676
10677 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * driver.cs: I was chekcing the key, not the file.
10680
10681 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10682
10683         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10684         message that we were generating - we just need to silently return
10685         a null.
10686
10687 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10688
10689         * class.cs (Event.Define): Change my previous commit, as this
10690         breaks the debugger.  This is a temporary hack, as it seems like
10691         the compiler is generating events incorrectly to begin with.
10692
10693         * expression.cs (Binary.ResolveOperator): Added support for 
10694         "U operator - (E x, E y)"
10695
10696         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10697         y)".
10698
10699         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10700         init-only variables, but this path did not take into account that
10701         there might be also instance readonly variables.  Correct this
10702         problem. 
10703
10704         This fixes bug 32253
10705
10706         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10707         delegates as well.
10708
10709         * driver.cs: Change the extension for modules to `netmodule'
10710
10711         * cs-parser.jay: Improved slightly the location tracking for
10712         the debugger symbols.
10713
10714         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10715         modifiers that were specified instead of the hardcoded value
10716         (FamAndAssem).  This was basically ignoring the static modifier,
10717         and others.  Fixes 32429.
10718
10719         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10720         fixed a bug in the process (32476)
10721
10722         * expression.cs (ArrayAccess.EmitAssign): Patch from
10723         hwang_rob@yahoo.ca that fixes bug 31834.3
10724
10725 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10726
10727         * driver.cs: Make the module extension .netmodule.
10728
10729 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10730
10731         * driver.cs: Report an error if the resource file is not found
10732         instead of crashing.
10733
10734         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10735         false, like Emit does.
10736
10737 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10738
10739         * typemanager.cs: Remove unused private member.  Also reported mcs
10740         bug to report this as a warning like csc.
10741
10742 2002-10-15  Martin Baulig  <martin@gnome.org>
10743
10744         * statement.cs (Statement.Emit): Made this a virtual method; emits
10745         the line number info and calls DoEmit().
10746         (Statement.DoEmit): New protected abstract method, formerly knows
10747         as Statement.Emit().
10748
10749         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10750
10751 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10752
10753         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10754         have fixed a remaining problem: not every AddXXXX was adding a
10755         fully qualified name.  
10756
10757         Now everyone registers a fully qualified name in the DeclSpace as
10758         being defined instead of the partial name.  
10759
10760         Downsides: we are slower than we need to be due to the excess
10761         copies and the names being registered this way.  
10762
10763         The reason for this is that we currently depend (on the corlib
10764         bootstrap for instance) that types are fully qualified, because
10765         we dump all the types in the namespace, and we should really have
10766         types inserted into the proper namespace, so we can only store the
10767         basenames in the defined_names array.
10768
10769 2002-10-10  Martin Baulig  <martin@gnome.org>
10770
10771         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10772         from bug #31834, see the bug report for a testcase which is
10773         miscompiled.
10774
10775 2002-10-10  Martin Baulig  <martin@gnome.org>
10776
10777         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10778         flow analysis code for this.
10779
10780         * statement.cs (Do, While, For): Tell the flow analysis code about
10781         infinite loops.
10782         (FlowBranching.UsageVector): Added support for infinite loops.
10783         (Block.Resolve): Moved the dead code elimination here and use flow
10784         analysis to do it.
10785
10786 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10787
10788         * class.cs (Field.Define): Catch cycles on struct type
10789         definitions. 
10790
10791         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10792         fields if the fields are static.  We only need to check instance
10793         fields. 
10794
10795         * expression.cs (As.DoResolve): Test for reference type.
10796
10797         * statement.cs (Using.ResolveExpression): Use
10798         ConvertImplicitRequired, not ConvertImplicit which reports an
10799         error on failture
10800         (Using.ResolveLocalVariableDecls): ditto.
10801
10802         * expression.cs (Binary.ResolveOperator): Report errors in a few
10803         places where we had to.
10804
10805         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10806
10807 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10808
10809         * expression.cs: Use StoreFromPtr instead of extracting the type
10810         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10811
10812         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10813         an enumeration value to a System.Enum, but System.Enum is not a
10814         value type, but an class type, so we need to box.
10815
10816         (Expression.ConvertExplicit): One codepath could return
10817         errors but not flag them.  Fix this.  Fixes #31853
10818
10819         * parameter.cs (Resolve): Do not allow void as a parameter type.
10820
10821 2002-10-06  Martin Baulig  <martin@gnome.org>
10822
10823         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10824         if it's a class type and not a struct.  Fixes #31815.
10825
10826 2002-10-06  Martin Baulig  <martin@gnome.org>
10827
10828         * statement.cs: Reworked the flow analysis code a bit to make it
10829         usable for dead code elimination.
10830
10831 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10832
10833         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10834
10835 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10836
10837         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10838         to fix the test 165, will investigate deeper.
10839
10840 2002-10-04  Martin Baulig  <martin@gnome.org>
10841
10842         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10843         finally blocks actually work.
10844         (Try.Resolve): We don't need to create a sibling for `finally' if
10845         there is no finally block.
10846
10847 2002-10-04  Martin Baulig  <martin@gnome.org>
10848
10849         * class.cs (Constructor.Define): The default accessibility for a
10850         non-default constructor is private, not public.
10851
10852 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10853
10854         * class.cs (Constructor): Make AllowedModifiers public, add
10855         EXTERN.
10856
10857         * cs-parser.jay: Perform the modifiers test here, as the
10858         constructor for the Constructor class usually receives a zero
10859         because of the way we create it (first we create, later we
10860         customize, and we were never checking the modifiers).
10861
10862         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10863         is a version of LookupTypeReflection that includes the type-name
10864         cache.  This can be used as a fast path for functions that know
10865         the fully qualified name and are only calling into *.GetType() to
10866         obtain a composed type.
10867
10868         This is also used by TypeManager.LookupType during its type
10869         composition.
10870
10871         (LookupType): We now also track the real type name, as sometimes
10872         we can get a quey for the real type name from things like
10873         ComposedCast.  This fixes bug 31422.
10874
10875         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10876         complete type fullname, it does not have to go through the type
10877         resolution system to obtain the composed version of the type (for
10878         obtaining arrays or pointers).
10879
10880         (Conditional.Emit): Use the EmitBoolExpression to
10881         generate nicer code, as requested by Paolo.
10882
10883         (ArrayCreation.CheckIndices): Use the patch from
10884         hwang_rob@yahoo.ca to validate the array initializers. 
10885
10886 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10887
10888         * class.cs (ConstructorInitializer.Emit): simplify code by using
10889         Invocation.EmitCall, and at the same time, fix the bugs in calling
10890         parent constructors that took variable arguments. 
10891
10892         * ecore.cs (Expression.ConvertNumericExplicit,
10893         Expression.ImplicitNumericConversion): Remove the code that
10894         manually wrapped decimal (InternalTypeConstructor call is now gone
10895         as well).
10896
10897         * expression.cs (Cast.TryReduce): Also handle decimal types when
10898         trying to perform a constant fold on the type.
10899
10900         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10901
10902         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10903         that only turned off an error report, and did nothing else. 
10904
10905 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10906
10907         * driver.cs: Handle and ignore /fullpaths
10908
10909 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10910
10911         * expression.cs (Binary.ResolveOperator): Catch the case where
10912         DoNumericPromotions returns true, 
10913
10914         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10915
10916 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10917
10918         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10919         report error 70.
10920
10921 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10922
10923         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10924         conversion exists, but it is also required that the conversion be
10925         performed.  This manifested in "(Type64Enum) 2".  
10926
10927         * class.cs (TypeManager.AddMethod): The fix is not to change
10928         AddEnum, because that one was using a fully qualified name (every
10929         DeclSpace derivative does), but to change the AddMethod routine
10930         that was using an un-namespaced name.  This now correctly reports
10931         the duplicated name.
10932
10933         Revert patch until I can properly fix it.  The issue
10934         is that we have a shared Type space across all namespaces
10935         currently, which is wrong.
10936
10937         Options include making the Namespace a DeclSpace, and merge
10938         current_namespace/current_container in the parser.
10939
10940 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10941
10942         * cs-parser.jay: Improve error reporting when we get a different
10943         kind of expression in local_variable_type and
10944         local_variable_pointer_type. 
10945
10946         Propagate this to avoid missleading errors being reported.
10947
10948         * ecore.cs (ImplicitReferenceConversion): treat
10949         TypeManager.value_type as a target just like object_type.   As
10950         code like this:
10951
10952         ValueType v = 1;
10953
10954         Is valid, and needs to result in the int 1 being boxed before it
10955         is assigned to the value type v.
10956
10957         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10958         to validate the enumeration name.
10959
10960         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10961         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10962         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10963
10964         * ecore.cs (TryImplicitIntConversion): When doing an
10965         implicit-enumeration-conversion, check if the type is 64-bits and
10966         perform a conversion before passing to EnumConstant.
10967
10968 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10969
10970         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10971         report ambiguous type references.  Unlike the MS version, we
10972         report what the ambiguity is.   Innovation at work ;-)
10973
10974         (DeclSpace.FindType): Require a location argument to
10975         display when we display an ambiguous error.
10976
10977         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10978
10979         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10980
10981         * expression.cs (EmitDynamicInitializers): Apply patch from
10982         hwang_rob@yahoo.ca that fixes the order in which we emit our
10983         initializers. 
10984
10985 2002-09-21  Martin Baulig  <martin@gnome.org>
10986
10987         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10988         delegate takes no arguments.
10989
10990 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10991
10992         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10993         from integers.
10994
10995         * expression.cs: Extract the underlying type.
10996
10997         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10998
10999         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11000
11001 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11002
11003         * class.cs (TypeContainer.DefineType): We can not use the nice
11004         PackingSize with the size set to 1 DefineType method, because it
11005         will not allow us to define the interfaces that the struct
11006         implements.
11007
11008         This completes the fixing of bug 27287
11009
11010         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11011         means also structs.  This fixes part of the problem. 
11012         (Expresion.ImplicitReferenceConversionExists): ditto.
11013
11014         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11015         error if there were no errors reported during the type lookup
11016         process, to avoid duplicates or redundant errors.  Without this
11017         you would get an ambiguous errors plus a type not found.  We have
11018         beaten the user enough with the first error.  
11019
11020         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11021         reference. 
11022
11023         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11024         during the resolution process, stop the lookup, this avoids
11025         repeated error reports (same error twice).
11026
11027         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11028
11029         * typemanager.cs (LookupType): Redo the type lookup code to match
11030         the needs of System.Reflection.  
11031
11032         The issue is that System.Reflection requires references to nested
11033         types to begin with a "+" sign instead of a dot.  So toplevel
11034         types look like: "NameSpace.TopLevelClass", and nested ones look
11035         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11036         levels. 
11037
11038 2002-09-19  Martin Baulig  <martin@gnome.org>
11039
11040         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11041         says that a method always returns or always throws an exception,
11042         don't report the CS0161.
11043
11044         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11045         set `Returns = new_returns'.
11046
11047 2002-09-19  Martin Baulig  <martin@gnome.org>
11048
11049         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11050         to an enum constant, check for a CS0176.
11051
11052 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11055         for operators that must be in pairs and report errors.
11056
11057         * ecore.cs (SimpleName.DoResolveType): During the initial type
11058         resolution process, when we define types recursively, we must
11059         check first for types in our current scope before we perform
11060         lookups in the enclosing scopes.
11061
11062         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11063
11064         (Invocation.VerifyArgumentsCompat): Call
11065         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11066         I thought we were supposed to always call this, but there are a
11067         few places in the code where we dont do it.
11068
11069 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11070
11071         * driver.cs: Add support in -linkres and -resource to specify the
11072         name of the identifier.
11073
11074 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11075
11076         * ecore.cs (StandardConversionExists): Sync with the conversion
11077         code: allow anything-* to void* conversions.
11078
11079         (FindMostSpecificSource): Use an Expression argument
11080         instead of a Type, because we might be handed over a Literal which
11081         gets a few more implicit conversions that plain types do not.  So
11082         this information was being lost.
11083
11084         Also, we drop the temporary type-holder expression when not
11085         required.
11086
11087 2002-09-17  Martin Baulig  <martin@gnome.org>
11088
11089         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11090         this is an explicit interface implementation.
11091
11092 2002-09-17  Martin Baulig  <martin@gnome.org>
11093
11094         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11095         different `IndexerName' attributes.
11096
11097         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11098         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11099         virtual CommonResolve().
11100
11101 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11102
11103         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11104         and convert that to the UnderlyingType.
11105
11106         * statement.cs (Foreach.Resolve): Indexers are just like variables
11107         or PropertyAccesses.
11108
11109         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11110         inside quoted strings, we were not doing this before.
11111
11112 2002-09-16  Martin Baulig  <martin@gnome.org>
11113
11114         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11115         resolve it.  This is needed for the definite assignment check of the
11116         instance expression, fixes bug #29846.
11117         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11118
11119 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11120
11121         * parameter.cs: Fix compile error.  Cannot reference static member
11122         from an instance object.  Is this an mcs bug?
11123
11124 2002-09-14  Martin Baulig  <martin@gnome.org>
11125
11126         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11127         multiple times.  Fixes bug #30295, added test-166.cs.
11128
11129 2002-09-14  Martin Baulig  <martin@gnome.org>
11130
11131         * statement.cs (Block.Emit): Don't emit unreachable code.
11132         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11133         `break' statements.
11134         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11135
11136 2002-09-14  Martin Baulig  <martin@gnome.org>
11137
11138         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11139         is set.
11140
11141 2002-09-14  Martin Baulig  <martin@gnome.org>
11142
11143         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11144         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11145         be false on the ms runtime.
11146
11147 2002-09-13  Martin Baulig  <martin@gnome.org>
11148
11149         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11150         the CS0038 error message.
11151
11152 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11153
11154         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11155         constant inside, return it.
11156
11157 2002-09-12  Martin Baulig  <martin@gnome.org>
11158
11159         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11160         implicit conversion can be done between enum types.
11161
11162         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11163         check whether an implicit conversion to the current enum's UnderlyingType
11164         exists and report an error if not.
11165
11166         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11167         without debugging support.
11168
11169         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11170         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11171
11172 2002-09-12  Martin Baulig  <martin@gnome.org>
11173
11174         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11175
11176         * ecore.cs (IMemberExpr.DeclaringType): New property.
11177         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11178         nonstatic member of an outer type (CS0038).
11179
11180 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11181
11182         * driver.cs: Activate the using-error detector at warning level
11183         4 (at least for MS-compatible APIs).
11184
11185         * namespace.cs (VerifyUsing): Small buglett fix.
11186
11187         * pending.cs (PendingImplementation): pass the container pointer. 
11188
11189         * interface.cs (GetMethods): Allow for recursive definition.  Long
11190         term, I would like to move every type to support recursive
11191         definitions, not the current ordering mechanism that we have right
11192         now.
11193
11194         The situation is this: Attributes are handled before interfaces,
11195         so we can apply attributes to interfaces.  But some attributes
11196         implement interfaces, we will now handle the simple cases
11197         (recursive definitions will just get an error).  
11198
11199         * parameter.cs: Only invalidate types at the end if we fail to
11200         lookup all types.  
11201
11202 2002-09-09  Martin Baulig  <martin@gnome.org>
11203
11204         * ecore.cs (PropertyExpr.Emit): Also check for
11205         TypeManager.system_int_array_get_length so this'll also work when
11206         compiling corlib.  Fixes #30003.
11207
11208 2002-09-09  Martin Baulig  <martin@gnome.org>
11209
11210         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11211         and throw an exception if we can't get the type's size.  Fixed #30040,
11212         added test-165.cs.
11213
11214 2002-09-09  Martin Baulig  <martin@gnome.org>
11215
11216         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11217
11218         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11219         context.  Fixes bug #30027.
11220
11221         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11222         virtual functions.  Fixes bug #30043, added test-164.cs.
11223
11224 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11225
11226         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11227
11228 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11229
11230         * driver.cs: Use an object to get the windows codepage since it's not a
11231         static property.
11232
11233 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11234
11235         * statement.cs (For.Emit): for infinite loops (test == null)
11236         return whether there is a break inside, not always "true".
11237
11238         * namespace.cs (UsingEntry): New struct to hold the name of the
11239         using definition, the location where it is defined, and whether it
11240         has been used in a successful type lookup.
11241
11242         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11243         strings.
11244
11245         * decl.cs: ditto.
11246
11247 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11248
11249         * attribute.cs : Fix incorrect code which relied on catching
11250         a NullReferenceException to detect a null being passed in
11251         where an object was expected.
11252
11253 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11254
11255         * statement.cs (Try): flag the catch variable as assigned
11256
11257         * expression.cs (Cast): Simplified by using ResolveType instead of
11258         manually resolving.
11259
11260         * statement.cs (Catch): Fix bug by using ResolveType.
11261
11262 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11263
11264         * expression.cs (BetterConversion): Special case for when we have
11265         a NullLiteral as the argument and we have to choose between string
11266         and object types - we choose string the way csc does.
11267
11268         * attribute.cs (Attribute.Resolve): Catch the
11269         NullReferenceException and report error #182 since the Mono
11270         runtime no more has the bug and having this exception raised means
11271         we tried to select a constructor which takes an object and is
11272         passed a null.
11273
11274 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11275
11276         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11277         message (1502, 1503) when we can't locate a method after overload
11278         resolution. This is much more informative and closes the bug
11279         Miguel reported.
11280
11281         * interface.cs (PopulateMethod): Return if there are no argument
11282         types. Fixes a NullReferenceException bug.
11283
11284         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11285         expressions too. Previously we were checking only in one place for
11286         positional arguments leaving out named arguments.
11287
11288         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11289         type to the enum type is not allowed. Remove code corresponding to
11290         that.
11291
11292         (ConvertNumericExplicit): Allow explicit conversions from
11293         the underlying type to enum type. This precisely follows the spec
11294         and closes a bug filed by Gonzalo.
11295
11296 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11297
11298         * compiler.csproj:
11299         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11300
11301 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11302
11303         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11304         it was important that we stored the right value after the
11305         reduction in `converted'.
11306
11307 2002-09-04  Martin Baulig  <martin@gnome.org>
11308
11309         * location.cs (Location.SymbolDocument): Use full pathnames for the
11310         source files.
11311
11312 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11313
11314         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11315         of the expression resolve mechanism, because that will catch the
11316         SimpleName error failures.
11317
11318         (Conditional): If we can not resolve the
11319         expression, return, do not crash.
11320
11321 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11322
11323         * cs-tokenizer.cs:
11324         (location): display token name instead of its number.
11325
11326 2002-08-28  Martin Baulig  <martin@gnome.org>
11327
11328         * expression.cs (Binary.ResolveOperator): Don't silently return
11329         but return an error if an operator cannot be applied between two
11330         enum types.
11331
11332 2002-08-28  Martin Baulig  <martin@gnome.org>
11333
11334         * class.cs (Constructor.Define): Set the permission attributes
11335         correctly instead of making all constructors public.
11336
11337 2002-08-28  Martin Baulig  <martin@gnome.org>
11338
11339         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11340         for private members before reporting a CS0103; if we find anything,
11341         it's a CS0122.
11342
11343 2002-08-28  Martin Baulig  <martin@gnome.org>
11344
11345         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11346         to check whether `closure_start_type == closure_invocation_type',
11347         we also need to check whether `m.DeclaringType == closure_invocation_type'
11348         before bypassing the permission checks.  We might be accessing
11349         protected/private members from the base class.
11350         (TypeManager.RealMemberLookup): Only set private_ok if private
11351         members were requested via BindingFlags.NonPublic.
11352
11353         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11354
11355         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11356         MethodGroupExpr.IsExplicitImpl if appropriate.
11357         (Invocation.DoResolve): Don't report the CS0120 for explicit
11358         interface implementations.
11359
11360 2002-08-27  Martin Baulig  <martin@gnome.org>
11361
11362         * expression.cs (Invocation.DoResolve): If this is a static
11363         method and we don't have an InstanceExpression, we must report
11364         a CS0120.
11365
11366 2002-08-25  Martin Baulig  <martin@gnome.org>
11367
11368         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11369         `==' between a valuetype and an object.
11370
11371 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11372
11373         * ecore.cs (TypeExpr): Provide a ToString method.
11374
11375 2002-08-24  Martin Baulig  <martin@gnome.org>
11376
11377         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11378         now called proggie.dbg and it's a binary file.
11379
11380 2002-08-23  Martin Baulig  <martin@gnome.org>
11381
11382         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11383
11384 2002-08-23  Martin Baulig  <martin@gnome.org>
11385
11386         * struct.cs (MyStructInfo.ctor): Make this work with empty
11387         structs; it's not allowed to use foreach() on null.
11388
11389 2002-08-23  Martin Baulig  <martin@gnome.org>
11390
11391         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11392         writer the full pathname of the generated assembly.
11393
11394 2002-08-23  Martin Baulig  <martin@gnome.org>
11395
11396         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11397         A `finally' block never returns or breaks; improved handling of
11398         unreachable code.
11399
11400 2002-08-23  Martin Baulig  <martin@gnome.org>
11401
11402         * statement.cs (Throw.Resolve): Allow `throw null'.
11403
11404 2002-08-23  Martin Baulig  <martin@gnome.org>
11405
11406         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11407         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11408         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11409         MemberLookup would return a wrong event if this is an explicit
11410         interface implementation and the class has an event with the same
11411         name.
11412
11413 2002-08-23  Martin Baulig  <martin@gnome.org>
11414
11415         * statement.cs (Block.AddChildVariableNames): New public method.
11416         (Block.AddChildVariableName): Likewise.
11417         (Block.IsVariableNameUsedInChildBlock): Likewise.
11418         (Block.AddVariable): Check whether a variable name has already
11419         been used in a child block.
11420
11421         * cs-parser.jay (declare_local_variables): Mark all variable names
11422         from the current block as being used in a child block in the
11423         implicit block.
11424
11425 2002-08-23  Martin Baulig  <martin@gnome.org>
11426
11427         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11428         find the symbol writer.
11429
11430         * driver.cs: csc also allows the arguments to /define being
11431         separated by commas, not only by semicolons.
11432
11433 2002-08-23  Martin Baulig  <martin@gnome.org>
11434
11435         * interface.cs (Interface.GetMembers): Added static check for events.
11436
11437 2002-08-15  Martin Baulig  <martin@gnome.org>
11438
11439         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11440         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11441
11442         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11443         why the MethodData.EmitDestructor() change was necessary.
11444
11445 2002-08-20  Martin Baulig  <martin@gnome.org>
11446
11447         * class.cs (TypeContainer.FindMembers): Added static check for events.
11448
11449         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11450
11451         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11452         use Type.GetEvents(), not Type.FindMembers().
11453
11454 2002-08-20  Martin Baulig  <martin@gnome.org>
11455
11456         * decl.cs (MemberCache): Added a special method cache which will
11457         be used for method-only searched.  This ensures that a method
11458         search will return a MethodInfo with the correct ReflectedType for
11459         inherited methods.      
11460
11461 2002-08-20  Martin Baulig  <martin@gnome.org>
11462
11463         * decl.cs (DeclSpace.FindMembers): Made this public.
11464
11465 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11466
11467         * delegate.cs: fixed build on windows.
11468         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11469
11470 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11471
11472         * ecore.cs (StandardConversionExists): Return a false
11473         if we are trying to convert the void type to anything else
11474         since that is not allowed.
11475
11476         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11477         we flag error 70 in the event an event is trying to be accessed
11478         directly from outside the declaring type.
11479
11480 2002-08-20  Martin Baulig  <martin@gnome.org>
11481
11482         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11483         MemberCache from typemanager.cs to decl.cs.
11484
11485 2002-08-19  Martin Baulig  <martin@gnome.org>
11486
11487         * class.cs (TypeContainer): Implement IMemberContainer.
11488         (TypeContainer.DefineMembers): Create the MemberCache.
11489         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11490         return public members if BindingFlags.Public was given, check
11491         whether members are static.
11492
11493 2002-08-16  Martin Baulig  <martin@gnome.org>
11494
11495         * decl.cs (DeclSpace.Define): Splitted this in Define and
11496         DefineMembers.  DefineMembers is called first and initializes the
11497         MemberCache.
11498
11499         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11500         DefineMembers() on all our DeclSpaces.
11501
11502         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11503         but call DefineMembers() on all nested interfaces.  We call their
11504         Define() in our new Define() function.
11505
11506         * interface.cs (Interface): Implement IMemberContainer.
11507         (Interface.Define): Moved all code except the attribute stuf to
11508         DefineMembers().
11509         (Interface.DefineMembers): Initialize the member cache.
11510
11511         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11512         need this anymore since we can use MemberCache.FindMembers directly.
11513
11514 2002-08-19  Martin Baulig  <martin@gnome.org>
11515
11516         * typemanager.cs (MemberCache): When creating the cache for an
11517         interface type, add all inherited members.
11518         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11519         to `out bool used_cache' and documented it.
11520         (TypeManager.MemberLookup): If we already used the cache in the first
11521         iteration, we don't need to do the interfaces check.
11522
11523 2002-08-19  Martin Baulig  <martin@gnome.org>
11524
11525         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11526         here from IMemberFinder and don't implement this interface anymore.
11527         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11528
11529         * typemanager.cs (IMemberFinder): This interface is now only used by
11530         classes which actually support the member cache.
11531         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11532         since we only put DeclSpaces into this Hashtable.
11533         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11534         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11535
11536 2002-08-16  Martin Baulig  <martin@gnome.org>
11537
11538         * typemanager.cs (ICachingMemberFinder): Removed.
11539         (IMemberFinder.MemberCache): New property.
11540         (TypeManager.FindMembers): Merged this with RealFindMembers().
11541         This function will never be called from TypeManager.MemberLookup()
11542         so we can't use the cache here, just the IMemberFinder.
11543         (TypeManager.MemberLookup_FindMembers): Check whether the
11544         IMemberFinder has a MemberCache and call the cache's FindMembers
11545         function.
11546         (MemberCache): Rewrote larger parts of this yet another time and
11547         cleaned it up a bit.
11548
11549 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11550
11551         * driver.cs (LoadArgs): Support quoting.
11552
11553         (Usage): Show the CSC-like command line arguments.
11554
11555         Improved a few error messages.
11556
11557 2002-08-15  Martin Baulig  <martin@gnome.org>
11558
11559         * typemanager.cs (IMemberContainer.Type): New property.
11560         (IMemberContainer.IsInterface): New property.
11561
11562         The following changes are conditional to BROKEN_RUNTIME, which is
11563         defined at the top of the file.
11564
11565         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11566         class'es members, but add all members from TypeHandle.ObjectType
11567         if we're an interface.
11568         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11569         is the current type.
11570         (MemberCache.CacheEntry.Container): Removed this field.
11571         (TypeHandle.GetMembers): Include inherited members.
11572
11573 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11574
11575         * typemanager.cs: fixed compilation and added a comment on a field that
11576         is never used.
11577
11578 2002-08-15  Martin Baulig  <martin@gnome.org>
11579
11580         * class.cs (ConstructorInitializer.Resolve): In the
11581         Expression.MemberLookup call, use the queried_type as
11582         invocation_type.
11583
11584         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11585         declared' attribute, it's always true.
11586         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11587         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11588         temporary wrapper for FindMembers which tells MemberLookup whether
11589         members from the base classes are included in the return value.
11590         This will go away soon.
11591         (TypeManager.MemberLookup): Use this temporary hack here; once the
11592         new MemberCache is completed, we don't need to do the DeclaredOnly
11593         looping here anymore since the MemberCache will take care of this.
11594         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11595         (MemberCache): When creating the MemberCache for a class, get
11596         members from the current class and all its base classes.
11597         (MemberCache.CacheEntry.Container): New field.  This is a
11598         temporary hack until the Mono runtime is fixed to distinguish
11599         between ReflectedType and DeclaringType.  It allows us to use MCS
11600         with both the MS runtime and the unfixed Mono runtime without
11601         problems and without accecting performance.
11602         (MemberCache.SearchMembers): The DeclaredOnly looping from
11603         TypeManager.MemberLookup is now done here.      
11604
11605 2002-08-14  Martin Baulig  <martin@gnome.org>
11606
11607         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11608         Type.GetFields on dynamic types but get the fields from the
11609         corresponding TypeContainer.
11610         (MyStructInfo.GetStructInfo): Added check for enum types.
11611
11612         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11613         (MemberList.SyncRoot): Implemented.
11614         (TypeManager.FilterWithClosure): No need to check permissions if
11615         closure_start_type == closure_invocation_type, don't crash if
11616         closure_invocation_type is null.
11617
11618 2002-08-13  Martin Baulig  <martin@gnome.org>
11619
11620         Rewrote TypeContainer.FindMembers to use a member cache.  This
11621         gives us a speed increase of about 35% for the self-hosting MCS
11622         build and of about 15-20% for the class libs (both on GNU/Linux).
11623
11624         * report.cs (Timer): New class to get enhanced profiling.  This
11625         whole class is "TIMER" conditional since it remarkably slows down
11626         compilation speed.
11627
11628         * class.cs (MemberList): New class.  This is an IList wrapper
11629         which we're now using instead of passing MemberInfo[]'s around to
11630         avoid copying this array unnecessarily.
11631         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11632         (ICachingMemberFinder, IMemberContainer): New interface.
11633         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11634         has already been checked, otherwise use it for the name comparision.
11635         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11636         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11637         if possible.  Returns a MemberList, not a MemberInfo [].
11638         (TypeHandle): New class, implements IMemberContainer.  We create
11639         one instance of this class per type, it contains a MemberCache
11640         which is used to do the member lookups.
11641         (MemberCache): New class.  Each instance of this class contains
11642         all members of a type and a name-based hash table.
11643         (MemberCache.FindMembers): This is our new member lookup
11644         function.  First, it looks up all members of the requested name in
11645         the hash table.  Then, it walks this list and sorts out all
11646         applicable members and returns them.
11647
11648 2002-08-13  Martin Baulig  <martin@gnome.org>
11649
11650         In addition to a nice code cleanup, this gives us a performance
11651         increase of about 1.4% on GNU/Linux - not much, but it's already
11652         half a second for the self-hosting MCS compilation.
11653
11654         * typemanager.cs (IMemberFinder): New interface.  It is used by
11655         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11656         Enum, Delegate or Interface.
11657         (TypeManager.finder_to_member_finder): New PtrHashtable.
11658         (TypeManager.finder_to_container): Removed.
11659         (TypeManager.finder_to_delegate): Removed.
11660         (TypeManager.finder_to_interface): Removed.
11661         (TypeManager.finder_to_enum): Removed.
11662
11663         * interface.cs (Interface): Implement IMemberFinder.
11664
11665         * delegate.cs (Delegate): Implement IMemberFinder.
11666
11667         * enum.cs (Enum): Implement IMemberFinder.
11668
11669         * class.cs (TypeContainer): Implement IMemberFinder.
11670
11671 2002-08-12  Martin Baulig  <martin@gnome.org>
11672
11673         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11674
11675 2002-08-12  Martin Baulig  <martin@gnome.org>
11676
11677         * ecore.cs (ITypeExpression): New interface for expressions which
11678         resolve to a type.
11679         (TypeExpression): Renamed to TypeLookupExpression.
11680         (Expression.DoResolve): If we're doing a types-only lookup, the
11681         expression must implement the ITypeExpression interface and we
11682         call DoResolveType() on it.
11683         (SimpleName): Implement the new ITypeExpression interface.
11684         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11685         hack, the situation that we're only looking up types can't happen
11686         anymore when this method is called.  Moved the type lookup code to
11687         DoResolveType() and call it.
11688         (SimpleName.DoResolveType): This ITypeExpression interface method
11689         is now doing the types-only lookup.
11690         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11691         (ResolveFlags): Added MaskExprClass.
11692
11693         * expression.cs (MemberAccess): Implement the ITypeExpression
11694         interface.
11695         (MemberAccess.DoResolve): Added support for a types-only lookup
11696         when we're called via ITypeExpression.DoResolveType().
11697         (ComposedCast): Implement the ITypeExpression interface.
11698
11699         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11700         Expression.Resolve() with ResolveFlags.Type instead.
11701
11702 2002-08-12  Martin Baulig  <martin@gnome.org>
11703
11704         * interface.cs (Interface.Define): Apply attributes.
11705
11706         * attribute.cs (Attribute.ApplyAttributes): Added support for
11707         interface attributes.
11708
11709 2002-08-11  Martin Baulig  <martin@gnome.org>
11710
11711         * statement.cs (Block.Emit): Only check the "this" variable if we
11712         do not always throw an exception.
11713
11714         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11715         whether the property has a set accessor.
11716
11717 2002-08-11  Martin Baulig  <martin@gnome.org>
11718
11719         Added control flow analysis support for structs.
11720
11721         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11722         with control flow analysis turned off.
11723         (IVariable): New interface.
11724         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11725         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11726         (FieldExpr.DoResolve): Resolve the instance expression with flow
11727         analysis turned off and do the definite assignment check after the
11728         resolving when we know what the expression will resolve to.
11729
11730         * expression.cs (LocalVariableReference, ParameterReference):
11731         Implement the new IVariable interface, only call the flow analysis
11732         code if ec.DoFlowAnalysis is true.
11733         (This): Added constructor which takes a Block argument.  Implement
11734         the new IVariable interface.
11735         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11736         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11737         This does the definite assignment checks for struct members.
11738
11739         * class.cs (Constructor.Emit): If this is a non-static `struct'
11740         constructor which doesn't have any initializer, call
11741         Block.AddThisVariable() to tell the flow analysis code that all
11742         struct elements must be initialized before control returns from
11743         the constructor.
11744
11745         * statement.cs (MyStructInfo): New public class.
11746         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11747         argument to this indexer.  If non-zero, check an individual struct
11748         member, not the whole struct.
11749         (FlowBranching.CheckOutParameters): Check struct members.
11750         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11751         overloaded versions of these methods which take an additional
11752         `int field_idx' argument to check struct members.
11753         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11754         overloaded versions of these methods which take an additional
11755         `string field_name' argument to check struct member.s
11756         (VariableInfo): Implement the IVariable interface.
11757         (VariableInfo.StructInfo): New public property.  Returns the
11758         MyStructInfo instance of the variable if it's a struct or null.
11759         (Block.AddThisVariable): New public method.  This is called from
11760         Constructor.Emit() for non-static `struct' constructor which do
11761         not have any initializer.  It creates a special variable for the
11762         "this" instance variable which will be checked by the flow
11763         analysis code to ensure that all of the struct's fields are
11764         initialized before control returns from the constructor.
11765         (UsageVector): Added support for struct members.  If a
11766         variable/parameter is a struct with N members, we reserve a slot
11767         in the usage vector for each member.  A struct is considered fully
11768         initialized if either the struct itself (slot 0) or all its
11769         members are initialized.
11770
11771 2002-08-08  Martin Baulig  <martin@gnome.org>
11772
11773         * driver.cs (Driver.MainDriver): Only report an error CS5001
11774         if there were no compilation errors.
11775
11776         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11777         `UnsafeContext' property to determine whether the parent is in
11778         unsafe context rather than checking the parent's ModFlags:
11779         classes nested in an unsafe class are unsafe as well.
11780
11781 2002-08-08  Martin Baulig  <martin@gnome.org>
11782
11783         * statement.cs (UsageVector.MergeChildren): Distinguish between
11784         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11785         we return.  Added test17() and test18() to test-154.cs.
11786
11787 2002-08-08  Martin Baulig  <martin@gnome.org>
11788
11789         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11790         Family access, make sure the invoking type isn't a subclass of the
11791         queried type (that'd be a CS1540).
11792
11793         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11794         this method which takes an additional `Type invocation_type'.
11795
11796         * expression.cs (BaseAccess.DoResolve): Use the base type as
11797         invocation and query type.
11798         (MemberAccess.DoResolve): If the lookup failed and we're about to
11799         report a CS0122, try a lookup with the ec.ContainerType - if this
11800         succeeds, we must report a CS1540.
11801
11802 2002-08-08  Martin Baulig  <martin@gnome.org>
11803
11804         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11805         (MethodGroupExpr): Implement the IMemberExpr interface.
11806
11807         * expression (MemberAccess.ResolveMemberAccess): No need to have
11808         any special code for MethodGroupExprs anymore, they're now
11809         IMemberExprs.   
11810
11811 2002-08-08  Martin Baulig  <martin@gnome.org>
11812
11813         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11814         Family, FamANDAssem and FamORAssem permissions.
11815         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11816
11817 2002-08-08  Martin Baulig  <martin@gnome.org>
11818
11819         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11820         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11821         or loop block.
11822
11823 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11824
11825         * driver.cs: implemented /resource option to embed managed resources.
11826
11827 2002-08-07  Martin Baulig  <martin@gnome.org>
11828
11829         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11830         (FieldBase.HasFieldInitializer): New public property.
11831         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11832         returns the field initializer and makes sure it is only resolved once.
11833         (TypeContainer.EmitFieldInitializers): Call
11834         FieldBase.GetInitializerExpression to get the initializer, this ensures
11835         that it isn't resolved multiple times.
11836
11837         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11838         the resolving process (SimpleName/MemberLookup) that we're currently
11839         emitting a field initializer (which must not access any instance members,
11840         this is an error CS0236).
11841
11842         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11843         argument, if the `IsFieldInitializer' flag is set, we must report and
11844         error CS0236 and not an error CS0120.   
11845
11846 2002-08-07  Martin Baulig  <martin@gnome.org>
11847
11848         * ecore.cs (IMemberExpr): New public interface.
11849         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11850         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11851         if the expression is an IMemberExpr.
11852
11853         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11854         to be null, implicitly default to `this' if we're non-static in
11855         this case.  Simplified the code a lot by using the new IMemberExpr
11856         interface.  Also fixed bug #28176 here.
11857
11858 2002-08-06  Martin Baulig  <martin@gnome.org>
11859
11860         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11861         ParameterReferences during semantic analysis so that we can do a
11862         type-only search when resolving Cast, TypeOf and SizeOf.
11863         (block): Pass the `current_local_parameters' to the Block's
11864         constructor.
11865
11866         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11867         argument to the constructor.
11868         (ConstructorInitializer.Resolve): Create a temporary implicit
11869         block with the parameters.
11870
11871         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11872         references here if we aren't doing a type-only search.
11873
11874         * statement.cs (Block): Added constructor which takes a
11875         `Parameters parameters' argument.
11876         (Block.Parameters): New public property.
11877
11878         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11879         to `Parameters' and made it public readonly.
11880
11881 2002-08-06  Martin Baulig  <martin@gnome.org>
11882
11883         * ecore.cs (Expression.Warning): Made this public as well.
11884
11885         * report.cs (Report.Debug): Print the contents of collections.
11886
11887 2002-08-06  Martin Baulig  <martin@gnome.org>
11888
11889         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11890         used to tell Resolve() which kinds of expressions it may return.
11891         (Expression.Resolve): Added overloaded version of this method which
11892         takes a `ResolveFlags flags' argument.  This can be used to tell
11893         Resolve() which kinds of expressions it may return.  Reports a
11894         CS0118 on error.
11895         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11896         ResolveFlags.SimpleName.
11897         (Expression.Error118): Added overloaded version of this method which
11898         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11899         which kinds of expressions are allowed.
11900
11901         * expression.cs (Argument.ResolveMethodGroup): New public method.
11902         Resolves an argument, but allows a MethodGroup to be returned.
11903         This is used when invoking a delegate.
11904
11905         * TODO: Updated a bit.
11906
11907 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11908
11909         Fixed compilation with csc.
11910
11911         * ecore.cs: Expression.Error made public. Is this correct? Should
11912         Warning be made public too?
11913
11914         * expression.cs: use ea.Location instead of ea.loc.
11915         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11916
11917 2002-08-06  Martin Baulig  <martin@gnome.org>
11918
11919         * ecore.cs (Expression.loc): Moved the location here instead of
11920         duplicating it in all derived classes.
11921         (Expression.Location): New public property.
11922         (Expression.Error, Expression.Warning): Made them non-static and
11923         removed the location argument.
11924         (Expression.Warning): Added overloaded version which takes an
11925         `int level' argument.
11926         (Expression.Error118): Make this non-static and removed the
11927         expression and location arguments.
11928         (TypeExpr): Added location argument to the constructor.
11929
11930         * expression.cs (StaticCallExpr): Added location argument to
11931         the constructor.
11932         (Indirection, PointerArithmetic): Likewise.
11933         (CheckedExpr, UnCheckedExpr): Likewise.
11934         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11935         (StringPtr): Likewise.
11936
11937
11938 2002-08-05  Martin Baulig  <martin@gnome.org>
11939
11940         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11941
11942         * assign.cs (Assign.DoResolve): Check whether the source
11943         expression is a value or variable.
11944
11945         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11946         while resolving the corresponding blocks.
11947
11948         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11949         an error, don't silently return null.
11950
11951         * statement.cs (Block.AddVariable): Do the error reporting here
11952         and distinguish between CS0128 and CS0136.
11953         (Block.DoResolve): Report all unused labels (warning CS0164).
11954         (LabeledStatement): Pass the location to the constructor.
11955         (LabeledStatement.HasBeenReferenced): New property.
11956         (LabeledStatement.Resolve): Set it to true here.
11957
11958         * statement.cs (Return.Emit): Return success even after reporting
11959         a type mismatch error (CS0126 or CS0127), this is what csc does and
11960         it avoids confusing the users with any consecutive errors.
11961
11962 2002-08-05  Martin Baulig  <martin@gnome.org>
11963
11964         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11965
11966         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11967
11968         * expression.cs (MemberAccess.DoResolve): Silently return if an
11969         error has already been reported.
11970
11971         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11972         error has already been reported.
11973
11974 2002-08-05  Martin Baulig  <martin@gnome.org>
11975
11976         * statement.cs (UsageVector): Only initialize the `parameters'
11977         vector if we actually have any "out" parameters.
11978
11979 2002-08-05  Martin Baulig  <martin@gnome.org>
11980
11981         * expression.cs (Binary.ResolveOperator): When combining delegates,
11982         they must have the same type.
11983
11984 2002-08-05  Martin Baulig  <martin@gnome.org>
11985
11986         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11987         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11988         work with the ms runtime and we also don't need it: if we're a
11989         PropertyBuilder and not in the `indexer_arguments' hash, then we
11990         are a property and not an indexer.
11991
11992         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11993         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11994         since the latter one doesn't work with the ms runtime.
11995
11996 2002-08-03  Martin Baulig  <martin@gnome.org>
11997
11998         Fixed bugs #27998 and #22735.
11999
12000         * class.cs (Method.IsOperator): New public field.
12001         (Method.CheckBase): Report CS0111 if there's already a method
12002         with the same parameters in the current class.  Report CS0508 when
12003         attempting to change the return type of an inherited method.
12004         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12005         and it's not marked abstract or extern.
12006         (PropertyBase): New abstract base class for Property and Indexer.
12007         (PropertyBase.CheckBase): Moved here from Property and made it work
12008         for indexers.
12009         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12010         the same so we can reuse it there.
12011         (Property, Indexer): Derive from PropertyBase.
12012         (MethodSignature.inheritable_property_signature_filter): New delegate
12013         to find properties and indexers.
12014
12015         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12016         argument and improved error reporting.
12017
12018         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12019         EmptyReadOnlyParameters and made it a property.
12020
12021         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12022         version of this method which takes a `PropertyInfo indexer'.
12023         (TypeManager.RegisterIndexer): New method.
12024
12025         * class.cs: Added myself as author of this file :-)
12026
12027 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12028
12029         * class.cs: fixed compilation on windoze.
12030
12031 2002-08-03  Martin Baulig  <martin@gnome.org>
12032
12033         * interface.cs (Interface.GetInterfaceBases): Check whether all
12034         base interfaces are at least as accessible than the current one.
12035
12036         * class.cs (TypeContainer.GetClassBases): Check whether base types
12037         are at least as accessible than the current type.
12038         (TypeContainer.AsAccessible): Implemented and made non-static.
12039         (MemberBase.CheckParameters): Report errors if the accessibility
12040         checks fail.
12041
12042         * delegate.cs (Delegate.Delegate): The default visibility is
12043         internal for top-level types and private for nested types.
12044         (Delegate.Define): Report errors if the accessibility checks fail.
12045
12046         * enum.cs (Enum.Enum): The default visibility is internal for
12047         top-level types and private for nested types.
12048         (Enum.DefineType): Compute the correct visibility.
12049
12050         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12051         function which takes a `bool is_toplevel' instead of a TypeContainer.
12052
12053         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12054         builtin type.
12055
12056 2002-08-02  Martin Baulig  <martin@gnome.org>
12057
12058         * expression.cs (LocalVariableReferenc): Added constructor which
12059         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12060         (LocalVariableReference.IsReadOnly): New property.
12061         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12062         variable is readonly, use our own readonly flag to do this; you can
12063         use the new constructor to get a writable reference to a read-only
12064         variable.
12065
12066         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12067         reference to the local variable.
12068
12069 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12070
12071         * rootcontext.cs (ResolveCore): Also include System.Exception
12072
12073         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12074         we reach an EmptyStatement.
12075
12076         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12077         is also fine.
12078
12079         * expression.cs (Binary.ResolveOperator): Check error result in
12080         two places.
12081
12082         use brtrue/brfalse directly and avoid compares to null.
12083
12084 2002-08-02  Martin Baulig  <martin@gnome.org>
12085
12086         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12087         Fixes bug #28407, added test-155.cs.
12088
12089 2002-08-01  Martin Baulig  <martin@gnome.org>
12090
12091         * class.cs (Event.EmitDefaultMethod): Make this work with static
12092         events.  Fixes #28311, added verify-3.cs.
12093
12094 2002-08-01  Martin Baulig  <martin@gnome.org>
12095
12096         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12097         `is_disposable' fields.
12098         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12099         `hm.is_disposable' if we're using the collection pattern.
12100         (Foreach.EmitCollectionForeach): Use the correct type for the
12101         enumerator's local variable, only emit the try/finally block if
12102         necessary (fixes #27713).
12103
12104 2002-08-01  Martin Baulig  <martin@gnome.org>
12105
12106         * ecore.cs (Expression.report118): Renamed to Error118 and made
12107         it public static.
12108
12109         * statement.cs (Throw.Resolve): Check whether the expression is of
12110         the correct type (CS0118) and whether the type derives from
12111         System.Exception (CS0155).
12112         (Catch.Resolve): New method.  Do the type lookup here and check
12113         whether it derives from System.Exception (CS0155).
12114         (Catch.CatchType, Catch.IsGeneral): New public properties.
12115
12116         * typemanager.cs (TypeManager.exception_type): Added.
12117
12118 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * driver.cs: Updated About function.
12121
12122 2002-07-31  Martin Baulig  <martin@gnome.org>
12123
12124         Implemented Control Flow Analysis.
12125
12126         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12127         (EmitContext.CurrentBranching): Added.
12128         (EmitContext.StartFlowBranching): Added.
12129         (EmitContext.EndFlowBranching): Added.
12130         (EmitContext.KillFlowBranching): Added.
12131         (EmitContext.IsVariableAssigned): Added.
12132         (EmitContext.SetVariableAssigned): Added.
12133         (EmitContext.IsParameterAssigned): Added.
12134         (EmitContext.SetParameterAssigned): Added.
12135         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12136         Added control flow analysis stuff here.
12137
12138         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12139         resolve the expression as lvalue.
12140         (LocalVariableReference.DoResolve): Check whether the variable has
12141         already been assigned.
12142         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12143         the parameter as assigned here.
12144         (ParameterReference.DoResolve): Check whether the parameter has already
12145         been assigned.
12146         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12147         expression as lvalue.
12148
12149         * statement.cs (FlowBranching): New class for the flow analysis code.
12150         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12151         (LabeledStatement.IsDefined): New public property.
12152         (LabeledStatement.AddUsageVector): New public method to tell flow
12153         analyis that the label may be reached via a forward jump.
12154         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12155         flow analysis.
12156         (VariableInfo.Number): New public field.  This is used by flow analysis
12157         to number all locals of a block.
12158         (Block.CountVariables): New public property.  This is the number of
12159         local variables in this block (including the locals from all parent
12160         blocks).
12161         (Block.EmitMeta): Number all the variables.
12162
12163         * statement.cs: Added flow analysis support to all classes.
12164
12165 2002-07-31  Martin Baulig  <martin@gnome.org>
12166
12167         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12168         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12169         then use this argument.
12170
12171         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12172
12173         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12174         use this to specify /define options.
12175
12176 2002-07-29  Martin Baulig  <martin@gnome.org>
12177
12178         * statement.cs (Fixed): Moved all code that does variable lookups
12179         and resolvings from Emit to Resolve.
12180
12181         * statement.cs (For): Moved all code that does variable lookups
12182         and resolvings from Emit to Resolve.
12183
12184         * statement.cs (Using): Moved all code that does variable lookups
12185         and resolvings from Emit to Resolve.
12186
12187 2002-07-29  Martin Baulig  <martin@gnome.org>
12188
12189         * attribute.cs (Attribute.Resolve): Explicitly catch a
12190         System.NullReferenceException when creating the
12191         CustromAttributeBuilder and report a different warning message.
12192
12193 2002-07-29  Martin Baulig  <martin@gnome.org>
12194
12195         * support.cs (ParameterData.ParameterName): Added method to
12196         get the name of a parameter.
12197
12198         * typemanager.cs (TypeManager.IsValueType): New public method.
12199
12200 2002-07-29  Martin Baulig  <martin@gnome.org>
12201
12202         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12203         is a flag which specifies that it's either ref or out.
12204         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12205         the out parameter to `out Parameter.Modifier mod', also set the
12206         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12207
12208         * support.cs (InternalParameters.ParameterModifier): Distinguish
12209         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12210         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12211
12212         * expression.cs (Argument.GetParameterModifier): Distinguish
12213         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12214         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12215
12216 2002-07-29  Martin Baulig  <martin@gnome.org>
12217
12218         * expression.cs (ParameterReference.ParameterReference): Added
12219         `Location loc' argument to the constructor.
12220
12221         * cs-parser.jay: Pass location to ParameterReference.
12222
12223 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12224
12225         * statement.cs (Try): Initialize the location.
12226
12227         * cs-parser.jay: pass location to Try.
12228
12229         * expression.cs (Unary.Reduce): Change the prototype to return
12230         whether a constant fold could be performed or not.  The result is
12231         returned in an out parameters.  In the case of Indirection and
12232         AddressOf, we want to perform the full tests.
12233
12234 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * statement.cs (Statement.Emit): Flag dead code.
12237
12238 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12239
12240         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12241
12242 2002-07-27  Martin Baulig  <martin@gnome.org>
12243
12244         * class.cs (MethodData.Define): Put back call to
12245         TypeManager.AddMethod(), accidentally commented this out.
12246
12247         * report.cs (Debug): New public method to print debugging information,
12248         this is `[Conditional ("DEBUG")]'.
12249
12250 2002-07-26  Martin Baulig  <martin@gnome.org>
12251
12252         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12253         (switch_statement): Push the current_block to the switch_stack and
12254         pop it again when we're done with the switch.
12255         (switch_section): The new block is a child of the current_block.
12256         Fixes bug #24007, added test-152.cs.
12257
12258 2002-07-27  Martin Baulig  <martin@gnome.org>
12259
12260         * expression.cs (Invocation.EmitArguments): When calling a varargs
12261         function with only its fixed arguments, we need to pass an empty
12262         array.
12263
12264 2002-07-27  Martin Baulig  <martin@gnome.org>
12265
12266         Mono 0.13 has been released.
12267
12268 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12269
12270         * driver.cs: Rename --resource to --linkres, because that is what
12271         we do currently, we dont support --resource yet.
12272
12273         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12274
12275 2002-07-25  Martin Baulig  <martin@gnome.org>
12276
12277         * class.cs (MethodData): New public class.  This is a `method builder'
12278         class for a method or one accessor of a Property/Indexer/Event.
12279         (MethodData.GetMethodFlags): Moved here from MemberBase.
12280         (MethodData.ApplyAttributes): Likewise.
12281         (MethodData.ApplyObsoleteAttribute): Likewise.
12282         (MethodData.ApplyConditionalAttribute): Likewise.
12283         (MethodData.ApplyDllImportAttribute): Likewise.
12284         (MethodData.CheckAbstractAndExternal): Likewise.
12285         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12286         (MethodData.Emit): Formerly known as Method.Emit().
12287         (MemberBase): Moved everything which was specific to a single
12288         accessor/method to MethodData.
12289         (Method): Create a new MethodData and call Define() and Emit() on it.
12290         (Property, Indexer, Event): Create a new MethodData objects for each
12291         accessor and call Define() and Emit() on them.
12292
12293 2002-07-25  Martin Baulig  <martin@gnome.org>
12294
12295         Made MethodCore derive from MemberBase to reuse the code from there.
12296         MemberBase now also checks for attributes.
12297
12298         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12299         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12300         as virtual.
12301         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12302         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12303         (MemberBase.ApplyAttributes): New virtual method; applies the
12304         attributes to a method or accessor.
12305         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12306         (MemberBase.ApplyConditionalAttribute): Likewise.
12307         (MemberBase.ApplyDllImportAttribute): Likewise.
12308         (MemberBase.CheckAbstractAndExternal): Likewise.
12309         (MethodCore.ParameterTypes): This is now a property instead of a
12310         method, it's initialized from DoDefineParameters().
12311         (MethodCore.ParameterInfo): Removed the set accessor.
12312         (MethodCore.DoDefineParameters): New protected virtual method to
12313         initialize ParameterTypes and ParameterInfo.
12314         (Method.GetReturnType): We can now simply return the MemberType.
12315         (Method.GetMethodFlags): Override the MemberBase version and add
12316         the conditional flags.
12317         (Method.CheckBase): Moved some code from Define() here, call
12318         DoDefineParameters() here.
12319         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12320         here to avoid some larger code duplication.
12321         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12322         ensure that abstract and external accessors don't declare a body.
12323
12324         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12325         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12326         lookup in the attribute's parent classes, so we need to abort as soon
12327         as we found the first match.
12328         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12329         the attribute has no arguments.
12330
12331         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12332         of a Method.
12333
12334 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12335
12336         * cs-parser.jay: reverted previous patch.
12337
12338 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12339
12340         * cs-parser.jay: fixed bug #22119.
12341
12342 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12343
12344         * attribute.cs: fixed compilation. The error was:
12345         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12346         be assigned to before control leaves the current method."
12347         [FIXME:  Filed as bug #28186: MCS must report this error.]
12348
12349 2002-07-25  Martin Baulig  <martin@gnome.org>
12350
12351         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12352         method to pull the condition name ouf of a Conditional attribute.
12353         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12354         the obsolete message and error flag out of an Obsolete attribute.
12355
12356         * class.cs (Method.GetMethodFlags): New public method to get the
12357         TypeManager.MethodFlags for this method.
12358         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12359         private methods.
12360         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12361         if we're overriding a virtual function, set the new private variable
12362         `parent_method'; call the new TypeManager.AddMethod().
12363
12364         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12365         the MethodBuilder and the Method in a PtrHashtable.
12366         (TypeManager.builder_to_method): Added for this purpose.
12367         (TypeManager.MethodFlags): Added IsObsoleteError.
12368         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12369         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12370         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12371         the message from the attribute.
12372
12373 2002-07-24  Martin Baulig  <martin@gnome.org>
12374
12375         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12376         preprocessor directives, ensure that the argument to #define/#undef is
12377         exactly one identifier and that it's actually an identifier.
12378
12379         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12380         did not work ....
12381
12382 2002-07-24  Martin Baulig  <martin@gnome.org>
12383
12384         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12385         initialize it to TypeManager.object_type in the constructor.
12386         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12387         of the `hm.get_current' method if we're using the collection pattern.
12388         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12389         for the explicit conversion to make it work when we're using the collection
12390         pattern and the `Current' property has a different return type than `object'.
12391         Fixes #27713.
12392
12393 2002-07-24  Martin Baulig  <martin@gnome.org>
12394
12395         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12396         does not match, but don't report any errors.  This method is called in
12397         order for all methods in a MethodGroupExpr until a matching method is
12398         found, so we don't want to bail out if the first method doesn't match.
12399         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12400         matches, report the 123.  Fixes #28070.
12401
12402 2002-07-24  Martin Baulig  <martin@gnome.org>
12403
12404         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12405         TypeManager.TypeToCoreType() to the top of the method so the
12406         following equality checks will work.  Fixes #28107.
12407
12408 2002-07-24  Martin Baulig  <martin@gnome.org>
12409
12410         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12411         operand is of type uint, and the other operand is of type sbyte,
12412         short or int, the operands are converted to type long." -
12413         Actually do what this comment already told us.  Fixes bug #28106,
12414         added test-150.cs.
12415
12416 2002-07-24  Martin Baulig  <martin@gnome.org>
12417
12418         * class.cs (MethodBase): New abstract class.  This is now a base
12419         class for Property, Indexer and Event to avoid some code duplication
12420         in their Define() and DefineMethods() methods.
12421         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12422         generic methods for Define() and DefineMethods().
12423         (FieldBase): Derive from MemberBase, not MemberCore.
12424         (Property): Derive from MemberBase, not MemberCore.
12425         (Property.DefineMethod): Moved all the code from this method to the
12426         new MethodBase.DefineAccessor(), just call it with appropriate
12427         argumetnts.
12428         (Property.Define): Call the new Property.DoDefine(), this does some
12429         sanity checks and we don't need to duplicate the code everywhere.
12430         (Event): Derive from MemberBase, not MemberCore.
12431         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12432         accessors, this will also make them work with interface events.
12433         (Indexer): Derive from MemberBase, not MemberCore.
12434         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12435         (Indexer.Define): Use the new MethodBase functions.
12436
12437         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12438         argument to the constructor.
12439         (Interface.FindMembers): Added support for interface events.
12440         (Interface.PopluateEvent): Implemented.
12441
12442         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12443
12444 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12445
12446         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12447         but this is required to check for a method name being the same as
12448         the containing class.  
12449
12450         Handle this now.
12451
12452 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12453
12454         * interface.cs: initialize variable.
12455
12456 2002-07-23  Martin Baulig  <martin@gnome.org>
12457
12458         Implemented the IndexerName attribute in interfaces.
12459
12460         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12461         name if this is an explicit interface implementation.
12462         (Indexer.InterfaceIndexerName): New public variable.  If we're
12463         implementing an interface indexer, this is the IndexerName in that
12464         interface.  Otherwise, it's the IndexerName.
12465         (Indexer.DefineMethod): If we're implementing interface indexer,
12466         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12467         and Pending.ImplementIndexer methods.
12468         (Indexer.Define): Also define the PropertyBuilder if we're
12469         implementing an interface indexer and this is neither an explicit
12470         interface implementation nor do the IndexerName match the one in
12471         the interface.
12472
12473         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12474         If a method is defined here, then we always need to create a proxy
12475         for it.  This is used when implementing interface indexers.
12476         (Pending.IsInterfaceIndexer): New public method.
12477         (Pending.ImplementIndexer): New public method.
12478         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12479         This is used when implementing interface indexers to define a proxy
12480         if necessary.
12481         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12482         define a proxy if necessary.
12483
12484         * interface.cs (Interface.IndexerName): New public variable.
12485         (Interface.PopulateIndexer): Set the IndexerName.
12486         (Interface.DefineIndexers): New private method.  Populate all the
12487         indexers and make sure their IndexerNames match.
12488
12489         * typemanager.cs (IndexerPropertyName): Added support for interface
12490         indexers.
12491
12492 2002-07-22  Martin Baulig  <martin@gnome.org>
12493
12494         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12495         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12496         ret if HasReturnLabel.
12497         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12498         variables.
12499
12500         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12501         and set the ec.LoopBeginTryCatchLevel.
12502         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12503         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12504         the current ec.TryCatchLevel, the branch goes out of an exception
12505         block.  In this case, we need to use Leave and not Br.
12506
12507 2002-07-22  Martin Baulig  <martin@gnome.org>
12508
12509         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12510         block unless the block does not always return or it is contained in
12511         another try { ... } catch { ... } block.  Fixes bug #26506.
12512         Added verify-1.cs to the test suite.
12513
12514 2002-07-22  Martin Baulig  <martin@gnome.org>
12515
12516         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12517         then we do not always return.  Fixes bug #24985.
12518
12519 2002-07-22  Martin Baulig  <martin@gnome.org>
12520
12521         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12522         lookup on a per-class level; ie. walk up the class hierarchy until we
12523         found at least one applicable method, then choose the best among them.
12524         Fixes bug #24463 and test-29.cs.
12525
12526 2002-07-22  Martin Baulig  <martin@gnome.org>
12527
12528         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12529         return types of the methods.  The return type is not part of the
12530         signature and we must not check it to make the `new' modifier work.
12531         Fixes bug #27999, also added test-147.cs.
12532         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12533
12534         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12535         on the method's return type.
12536
12537 2002-07-21  Martin Baulig  <martin@gnome.org>
12538
12539         * assign.cs: Make this work if the rightmost source is a constant and
12540         we need to do an implicit type conversion.  Also adding a few more tests
12541         to test-38.cs which should have caught this.
12542
12543         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12544         target in the makefile for this.  The makefile.gnu is primarily intended
12545         for end-users who don't want to debug the compiler.
12546
12547 2002-07-21  Martin Baulig  <martin@gnome.org>
12548
12549         * assign.cs: Improved the Assign class so it can now handle embedded
12550         assignments (X = Y = Z = something).  As a side-effect this'll now also
12551         consume less local variables.  test-38.cs now passes with MCS, added
12552         a few new test cases to that test.
12553
12554 2002-07-20  Martin Baulig  <martin@gnome.org>
12555
12556         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12557         instructions.  Fixes bug #27977, also added test-146.cs.
12558
12559 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12560
12561         * cs-tokenizer.cs: fixed getHex ().
12562
12563 2002-07-19  Martin Baulig  <martin@gnome.org>
12564
12565         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12566         not Type.GetType() to lookup the array type.  This is needed when
12567         we're constructing an array of a user-defined type.
12568         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12569         single-dimensional arrays, but also for single-dimensial arrays of
12570         type decimal.
12571
12572 2002-07-19  Martin Baulig  <martin@gnome.org>
12573
12574         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12575         this function is called, it's not allowed to share LocalBuilders
12576         among ILGenerators.
12577
12578 2002-07-19  Martin Baulig  <martin@gnome.org>
12579
12580         * expression.cs (Argument.Resolve): Report an error 118 when trying
12581         to pass a type as argument.
12582
12583 2002-07-18  Martin Baulig  <martin@gnome.org>
12584
12585         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12586         Conv_R_Un for the signed `long' type.
12587
12588 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12589
12590         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12591         `expr' for the temporary result, as that will fail if we do
12592         multiple resolves on the same expression.
12593
12594 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12595
12596         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12597         ec.TypeContainer for looking up aliases. 
12598
12599         * class.cs (TypeContainer): Remove LookupAlias from here.
12600
12601         * decl.cs (DeclSpace); Move here.
12602
12603 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12604
12605         * class.cs (FindMembers): Only call filter if the constructor
12606         bulider is not null.
12607
12608         Also handle delegates in `NestedTypes' now.  Now we will perform
12609         type lookups using the standard resolution process.  This also
12610         fixes a bug.
12611
12612         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12613         This uses Expressions (the limited kind that can be parsed by the
12614         tree) instead of strings.
12615
12616         * expression.cs (ComposedCast.ToString): Implement, used to flag
12617         errors since now we have to render expressions.
12618
12619         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12620         FormArrayType. 
12621
12622         * ecore.cs (SimpleName.ToString): ditto.
12623
12624         * cs-parser.jay: Instead of using strings to assemble types, use
12625         Expressions to assemble the type (using SimpleName, ComposedCast,
12626         MemberAccess).  This should fix the type lookups in declarations,
12627         because we were using a different code path for this.
12628
12629         * statement.cs (Block.Resolve): Continue processing statements
12630         even when there is an error.
12631
12632 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12633
12634         * class.cs (Event.Define): Also remove the `remove' method from
12635         the list of pending items.
12636
12637         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12638         generate more compact code. 
12639
12640 2002-07-17  Martin Baulig  <martin@gnome.org>
12641
12642         * const.cs (Const.LookupConstantValue): Add support for constant
12643         `unchecked' and `checked' expressions.
12644         Also adding test case test-140.cs for this.
12645
12646 2002-07-17  Martin Baulig  <martin@gnome.org>
12647
12648         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12649         check whether mi.ReturnType implements the IEnumerator interface; the
12650         `==' and the IsAssignableFrom() will fail in this situation.
12651
12652 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12653
12654         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12655         here too.
12656
12657 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12658
12659         * expression.cs: fixed bug #27811.
12660
12661 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12662
12663         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12664         Molaro: when we are a ref, the value already contains a pointer
12665         value, do not take the address of it.
12666
12667 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12668         * removed mb-parser.jay and mb-tokenizer.cs
12669
12670 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12671
12672         * expression.cs: check against the building corlib void type.
12673
12674 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12675
12676         * ecore.cs: fix for valuetype static readonly fields: when 
12677         initializing them, we need their address, not the address of a copy.
12678
12679 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12680
12681         * typemanager.cs: register also enum_type in corlib.
12682
12683 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12684
12685         * class.cs: allow calling this (but not base) initializers in structs.
12686
12687 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12688
12689         * ecore.cs: make sure we compare against the building base types
12690         in GetTypeSize ().
12691
12692 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12693
12694         * typemanager.cs: fix TypeToCoreType() to handle void and object
12695         (corlib gets no more typerefs after this change).
12696
12697 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12698
12699         * expression.cs (ArrayCreation.EmitArrayArguments): use
12700         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12701
12702         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12703         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12704         array indexes, the runtime actually forbids them.
12705
12706         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12707         for array arguments here.
12708
12709         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12710         instead of the default for ValueTypes.
12711
12712         (New.DoEmit): Use IsValueType instead of
12713         IsSubclassOf (value_type)
12714         (New.DoResolve): ditto.
12715         (Invocation.EmitCall): ditto.
12716
12717         * assign.cs (Assign): ditto.
12718
12719         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12720         Statements *are* currently doing part of their resolution during
12721         Emit.  
12722
12723         Expressions do always resolve during resolve, but statements are
12724         only required to propagate resolution to their children.
12725
12726 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12729
12730         (LoadAssembly): Do not add the dll if it is already specified
12731
12732         (MainDriver): Add the System directory to the link path at the end,
12733         after all the other -L arguments. 
12734
12735         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12736         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12737         ldelem.u1) and using the opposite for sbytes.
12738
12739         This fixes Digger, and we can finally run it.
12740
12741         * driver.cs (UnixParseOption): Move the option parsing here.  
12742         (CSCParseOption): Implement CSC-like parsing of options.
12743
12744         We now support both modes of operation, the old Unix way, and the
12745         new CSC-like way.  This should help those who wanted to make cross
12746         platform makefiles.
12747
12748         The only thing broken is that /r:, /reference: and /lib: are not
12749         implemented, because I want to make those have the same semantics
12750         as the CSC compiler has, and kill once and for all the confussion
12751         around this.   Will be doing this tomorrow.
12752
12753         * statement.cs (Unsafe.Resolve): The state is checked during
12754         resolve, not emit, so we have to set the flags for IsUnsfe here.
12755
12756 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12757
12758         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12759         not catch the Error_ObjectRefRequired in SimpleName (as it is
12760         possible to have a class/instance variable name that later gets
12761         deambiguated), we have to check this here.      
12762
12763 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12764
12765         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12766         make static and put into Expression.
12767
12768         (Event.Define): Register the private field of the event with the 
12769         TypeManager so that GetFieldFromEvent can get at it.
12770
12771         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12772         keep track of the private field associated with an event which
12773         has no accessors.
12774
12775         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12776         private field.
12777
12778         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12779
12780 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12781
12782         * expression.cs (Binary.EmitBranchable): this routine emits the
12783         Binary expression in a branchable context.  This basically means:
12784         we need to branch somewhere, not just get the value on the stack.
12785
12786         This works together with Statement.EmitBoolExpression.
12787
12788         * statement.cs (Statement.EmitBoolExpression): Use
12789         EmitBranchable. 
12790
12791 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * statement.cs (For): Reduce the number of jumps in loops.
12794
12795         (For): Implement loop inversion for the For statement.
12796
12797         (Break): We can be breaking out of a Try/Catch controlled section
12798         (foreach might have an implicit try/catch clause), so we need to
12799         use Leave instead of Br.
12800
12801         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12802         now).  If the instace expression supports IMemoryLocation, we use
12803         the AddressOf method from the IMemoryLocation to extract the
12804         address instead of emitting the instance.
12805
12806         This showed up with `This', as we were emitting the instance
12807         always (Emit) instead of the Address of This.  Particularly
12808         interesting when This is a value type, as we dont want the Emit
12809         effect (which was to load the object).
12810
12811 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12812
12813         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12814
12815         * statement.cs (Checked): Set the CheckedState during the resolve
12816         process too, as the ConvCast operations track the checked state on
12817         the resolve process, and not emit.
12818
12819         * cs-parser.jay (namespace_member_declaration): Flag that we have
12820         found a declaration when we do.  This is used to flag error 1529
12821
12822         * driver.cs: Report ok when we display the help only.
12823
12824 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12825
12826         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12827
12828 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12829
12830         * cs-tokenizer.cs (define): We also have to track locally the
12831         defines.  AllDefines is just used for the Conditional Attribute,
12832         but we also need the local defines for the current source code. 
12833
12834 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12835
12836         * statement.cs (While, For, Do): These loops can exit through a
12837         Break statement, use this information to tell whether the
12838         statement is the last piece of code.
12839
12840         (Break): Flag that we break.
12841
12842         * codegen.cs (EmitContexts): New `Breaks' state variable.
12843
12844 2002-07-03  Martin Baulig  <martin@gnome.org>
12845
12846         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12847         modifiers in method declarations in structs.  Otherwise, you won't
12848         be able to override things like Object.Equals().
12849
12850 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12851
12852         * class.cs (Method, Property, Indexer): Do not allow the public
12853         modifier to be used in explicit interface implementations.
12854
12855         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12856         override modifiers in method declarations in structs
12857
12858 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12859
12860         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12861         integer or real overflow, report an error
12862
12863 2002-07-02  Martin Baulig  <martin@gnome.org>
12864
12865         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12866         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12867         to tell the runtime about our newly created System.Object and
12868         System.ValueType types.
12869
12870 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12871
12872         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12873         struct instead of Ldarg/Starg.
12874
12875 2002-07-02  Martin Baulig  <martin@gnome.org>
12876
12877         * expression.cs (Indirection.Indirection): Call
12878         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12879
12880 2002-07-02  Martin Baulig  <martin@gnome.org>
12881
12882         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12883         ValueType, call TypeManager.TypeToCoreType() on it.
12884         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12885         the OpCodes.Newarr argument.
12886
12887 2002-07-02  Martin Baulig  <martin@gnome.org>
12888
12889         * expression.cs (Invocation.EmitCall): When compiling corlib,
12890         replace all calls to the system's System.Array type to calls to
12891         the newly created one.
12892
12893         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12894         System.Array methods.
12895         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12896         from the system's System.Array type which must be replaced.
12897
12898 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12899
12900         * typemanager.cs: load unverifiable_code_ctor so we can build
12901         corlib using the correct type. Avoid using GetTypeCode() with
12902         TypeBuilders.
12903         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12904         TypeManager.object_type to allow building corlib.
12905
12906 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12907
12908         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12909
12910 2002-07-01  Martin Baulig  <martin@gnome.org>
12911
12912         * class.cs: Make the last change actually work, we need to check
12913         whether `ifaces != null' to avoid a crash.
12914
12915 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12916
12917         * class.cs: when we build structs without fields that implement
12918         interfaces, we need to add the interfaces separately, since there is
12919         no API to both set the size and add the interfaces at type creation
12920         time.
12921
12922 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12923
12924         * expression.cs: the dimension arguments to the array constructors
12925         need to be converted if they are a long.
12926
12927 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12928
12929         * class.cs: don't emit ldarg.0 if there is no parent constructor
12930         (fixes showstopper for corlib).
12931
12932 2002-06-29  Martin Baulig  <martin@gnome.org>
12933
12934         MCS now compiles corlib on GNU/Linux :-)
12935
12936         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12937         ie. check for MethodImplOptions.InternalCall.
12938
12939         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12940         and TypeManager.attribute_type are null, so we must explicitly check
12941         whether parent is not null to find out whether it's an attribute type.
12942         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12943         and SetBuilder, not only if the property is neither abstract nor external.
12944         This is necessary to set the MethodImplOptions on the accessor methods.
12945         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12946         SetBuilder, see Property.Emit().
12947
12948         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12949         populate "System.Object", "System.ValueType" and "System.Attribute" since
12950         they've already been populated from BootCorlib_PopulateCoreTypes().
12951
12952 2002-06-29  Martin Baulig  <martin@gnome.org>
12953
12954         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12955         is the NullLiteral, we also need to make sure that target_type is not
12956         an enum type.   
12957
12958 2002-06-29  Martin Baulig  <martin@gnome.org>
12959
12960         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12961         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12962         before calling BootstrapCorlib_ResolveDelegate ().
12963
12964 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12965
12966         * statement.cs: fixed build-breaker. All tests passed ok.
12967
12968 2002-06-27  Martin Baulig  <martin@gnome.org>
12969
12970         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12971         for System.Decimal when compiling corlib.
12972
12973 2002-06-27  Martin Baulig  <martin@gnome.org>
12974
12975         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12976         switch blocks which contain nothing but a default clause.
12977
12978 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12979
12980        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12981
12982 2002-06-27  Martin Baulig  <martin@gnome.org>
12983
12984         * ecore.cs (PropertyExpr.PropertyExpr): Call
12985         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12986
12987         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12988         is already a TypeBuilder.
12989
12990 2002-06-27  Martin Baulig  <martin@gnome.org>
12991
12992         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12993         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12994         the "from an array-type to System.Array" case.  This makes it work
12995         when compiling corlib.
12996
12997 2002-06-27  Martin Baulig  <martin@gnome.org>
12998
12999         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13000         non-static PropertyExpr, set its InstanceExpression.  This makes
13001         the `ICollection.Count' property work in System/Array.cs.
13002
13003 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13004
13005         * driver.cs: Made error handling more consistent.  Errors now
13006         tracked by Report class, so many methods which used to return int
13007         now return void.  Main() now prints success/failure and 
13008         errors/warnings message.
13009
13010         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13011         the magic number return values (123 and 124).  Now, if the
13012         expected error occurs, the compiler exits with success (exit value
13013         0).  If the compilation completes without seeing that particular
13014         error, the compiler exits with failure (exit value 1).  The
13015         makefile in mcs/errors has been changed to handle the new behaviour.
13016
13017         * report.cs: Made 'expected error' number a property and renamed
13018         it from 'Probe' to 'ExpectedError'.
13019
13020         * genericparser.cs: Removed error handling support, since it is
13021         now all done by Report class.
13022
13023         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13024         class, so parse() no longer returns an int.
13025
13026         * namespace.cs: Use Report.Error instead of GenericParser.error
13027
13028 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13029
13030         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13031         TypeContainer.AddOperator): At the front of the list put the
13032         explicit implementations, so they get resolved/defined first. 
13033
13034 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13035
13036         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13037         interface type is implemented by this TypeContainer.  Used during
13038         explicit interface implementation.
13039
13040         (Property.Define, Indexer.Define, Method.Define): Validate that
13041         the given interface in the explicit implementation is one of the
13042         base classes for the containing type.
13043
13044         Also if we are explicitly implementing an interface, but there is
13045         no match in the pending implementation table, report an error.
13046
13047         (Property.Define): Only define the property if we are
13048         not explicitly implementing a property from an interface.  Use the
13049         correct name also for those properties (the same CSC uses,
13050         although that is really not needed).
13051
13052         (Property.Emit): Do not emit attributes for explicitly implemented
13053         properties, as there is no TypeBuilder.
13054
13055         (Indexer.Emit): ditto.
13056
13057         Hiding then means that we do not really *implement* a pending
13058         implementation, which makes code fail.
13059
13060 2002-06-22  Martin Baulig  <martin@gnome.org>
13061
13062         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13063         the return value of Object.GetType().  [FIXME: we need to do this whenever
13064         we get a type back from the reflection library].
13065
13066 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13067
13068         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13069
13070 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13071
13072         * attribute.cs: Return null if we can not look up the type.
13073
13074         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13075         the interface types found.
13076
13077         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13078         interface types found.
13079
13080         * typemanager.cs (GetInterfaces): Make this routine returns alll
13081         the interfaces and work around the lame differences between
13082         System.Type and System.Reflection.Emit.TypeBuilder in the results
13083         result for GetInterfaces.
13084
13085         (ExpandInterfaces): Given an array of interface types, expand and
13086         eliminate repeated ocurrences of an interface.  This expands in
13087         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13088         be IA, IB, IC.
13089
13090 2002-06-21  Martin Baulig  <martin@gnome.org>
13091
13092         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13093         on System.Enum.
13094
13095 2002-06-21  Martin Baulig  <martin@gnome.org>
13096
13097         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13098         and called with one of the core types, return the corresponding typebuilder for
13099         that type.
13100
13101         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13102         element type.
13103
13104 2002-06-21  Martin Baulig  <martin@gnome.org>
13105
13106         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13107         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13108         (Expression.ConvertReferenceExplicit): Likewise.
13109
13110         * expression.cs (ElementAccess.DoResolve): Likewise.
13111         (ElementAccess.DoResolveLValue): Likewise.
13112
13113 2002-06-10  Martin Baulig  <martin@gnome.org>
13114
13115         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13116         add the "value" parameter to the parameter list.
13117
13118         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13119         to our caller.
13120
13121 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13122
13123         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13124         the argument to an int, uint, long or ulong, per the spec.  Also
13125         catch negative constants in array creation.
13126
13127 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13128
13129         * class.cs: do not allow the same interface to appear twice in
13130         the definition list.
13131
13132 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13133
13134         * ecore.cs: don't use ldlen with System.Array.
13135
13136 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13137
13138         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13139
13140 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13141
13142         * modifiers.cs: produce correct field attributes for protected
13143         internal. Easy fix so miguel can work on ther harder stuff:-)
13144
13145 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13146
13147         * pending.cs: New file.  Move the code from class.cs here.
13148         Support clearning the pending flag for all methods (when not doing
13149         explicit interface implementation).
13150
13151 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13152
13153         * rootcontext.cs: added a couple more types needed to bootstrap.
13154
13155 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13156
13157         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13158         constructor in the type, instead of any constructor in the type
13159         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13160         a bug in the Mono runtime when applying the params attribute). 
13161
13162 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13163         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13164
13165 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13166
13167         * expression.cs (Unary.ResolveOperator): Use TypeManager
13168         to resolve the type.
13169
13170 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13171
13172         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13173         attached.
13174
13175         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13176         with each member too.
13177
13178         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13179         field builders too - this takes care of the enum member case.
13180
13181 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13182
13183         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13184         address-of operator on both value types and pointers.
13185
13186 2002-06-10  Martin Baulig  <martin@gnome.org>
13187
13188         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13189         PropertyBuilder to the `property_builders' list.
13190
13191         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13192         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13193         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13194         find any indexers which are inherited from an interface.
13195
13196 2002-06-09  Martin Baulig  <martin@gnome.org>
13197
13198         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13199         the same type as the constant if necessary.  There's also a test-130.cs
13200         for this.
13201
13202         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13203
13204         * typemanager.cs (TypeManager.ChangeType): Previously known as
13205         Enum.ChangeEnumType().
13206
13207 2002-06-09  Martin Baulig  <martin@gnome.org>
13208
13209         * expression.cs (Cast.TryReduce): Added support for consts.
13210
13211 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13212
13213         * class.cs (Accessor): Hold attributes information so we can pass
13214         it along.
13215
13216         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13217         Modify to pass in attributes attached to the methods.
13218
13219         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13220
13221         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13222         to handle the Accessor kind :-)
13223
13224         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13225
13226 2002-06-08  Martin Baulig  <martin@gnome.org>
13227
13228         * expression.cs (Unary.TryReduceNegative): Added support for
13229         ULongConstants.
13230
13231 2002-06-08  Martin Baulig  <martin@gnome.org>
13232
13233         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13234         name can't be found in the `defined_names' - the caller will do a
13235         MemberLookup in this case and thus find methods in System.Enum
13236         such as Enum.IsDefined().
13237
13238 2002-06-08  Martin Baulig  <martin@gnome.org>
13239
13240         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13241         Convert.ChangeType() which works with TypeBuilder created types.
13242         (Enum.LookupEnumValue, Enum.Define): Use it here.
13243
13244         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13245         `TypeBuilder.BaseType != null' check.
13246         (TypeContainer.FindMembers): Only lookup parent members if we
13247         actually have a parent.
13248         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13249         (ConstructorInitializer.Resolve): Likewise.
13250
13251         * interface.cs (Interface.FindMembers): Added
13252         `TypeBuilder.BaseType != null' check.
13253
13254         * rootcontext.cs (RootContext.ResolveCore): Added
13255         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13256         classes_second_stage.
13257
13258         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13259         debug_type and trace_type when compiling with --nostdlib.       
13260
13261 2002-06-07  Martin Baulig  <martin@gnome.org>
13262
13263         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13264         (AddField): Set it to true when adding a non-static field.
13265         (DefineType): Use `have_nonstatic_fields' to find out whether we
13266         have non-static fields, not `Fields != null'.
13267
13268 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13269
13270         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13271         dereferencing a null on the static-field code path)
13272
13273 2002-05-30  Martin Baulig  <martin@gnome.org>
13274
13275         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13276         to take command line arguments.  Use reflection to call the new
13277         custom `Initialize' function on the symbol writer and pass it the
13278         command line arguments.
13279
13280         * driver.cs (--debug-args): New command line argument to pass command
13281         line arguments to the symbol writer.
13282
13283 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13284
13285         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13286         the target type for indexers and properties.  Thanks to Joe for
13287         catching this.
13288
13289 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13290
13291         * typemanager.cs (MethodFlags): returns the method flags
13292         (Obsolete/ShouldIgnore) that control warning emission and whether
13293         the invocation should be made, or ignored. 
13294
13295         * expression.cs (Invocation.Emit): Remove previous hack, we should
13296         not do this on matching a base type, we should do this based on an attribute
13297
13298         Only emit calls to System.Diagnostics.Debug and
13299         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13300         on the command line.
13301
13302         * rootcontext.cs: Global settings for tracing and debugging.
13303
13304         * cs-tokenizer.cs (define): New utility function to track
13305         defines.   Set the global settings for TRACE and DEBUG if found.
13306
13307 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13308
13309         * interface.cs (Populate*): Pass in the TypeContainer as well as
13310         the DeclSpace as parameters so that we can create EmitContexts and
13311         then use that to apply attributes etc.
13312
13313         (PopulateMethod, PopulateEvent, PopulateProperty)
13314         (PopulateIndexer): Apply attributes everywhere.
13315
13316         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13317         etc.
13318
13319         (ApplyAttributes): Update accordingly.
13320
13321         We now apply interface attributes for all members too.
13322
13323 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13324
13325         * class.cs (Indexer.Define); Correctly check if we are explicit
13326         implementation (instead of checking the Name for a ".", we
13327         directly look up if the InterfaceType was specified).
13328
13329         Delay the creation of the PropertyBuilder.
13330
13331         Only create the PropertyBuilder if we are not an explicit
13332         interface implementation.   This means that explicit interface
13333         implementation members do not participate in regular function
13334         lookups, and hence fixes another major ambiguity problem in
13335         overload resolution (that was the visible effect).
13336
13337         (DefineMethod): Return whether we are doing an interface
13338         implementation. 
13339
13340         * typemanager.cs: Temporary hack until we get attributes in
13341         interfaces (Ravi is working on that) and we get IndexerName
13342         support in interfaces.
13343
13344         * interface.cs: Register the indexers as properties.
13345
13346         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13347         warning, I have verified that this is a bug in the .NET runtime
13348         (JavaScript suffers of the same problem).
13349
13350         * typemanager.cs (MemberLookup): When looking up members for
13351         interfaces, the parent of an interface is the implicit
13352         System.Object (so we succeed in searches of Object methods in an
13353         interface method invocation.  Example:  IEnumerable x;  x.ToString
13354         ()) 
13355
13356 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13357
13358         * class.cs (Event): Events should also register if they do
13359         implement the methods that an interface requires.
13360
13361         * typemanager.cs (MemberLookup); use the new GetInterfaces
13362         method. 
13363
13364         (GetInterfaces): The code used to lookup interfaces for a type is
13365         used in more than one place, factor it here. 
13366
13367         * driver.cs: Track the errors at the bottom of the file, we kept
13368         on going.
13369
13370         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13371         instance if the method we are calling is static!
13372
13373 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13374
13375         * attribute.cs (ApplyAttributes): Make this function filter out
13376         the IndexerName attribute (as that attribute in reality is never
13377         applied) and return the string constant for the IndexerName
13378         attribute. 
13379
13380         * class.cs (TypeContainer.Emit): Validate that all the indexers
13381         have the same IndexerName attribute, and if so, set the
13382         DefaultName attribute on the class. 
13383
13384         * typemanager.cs: The return value might contain other stuff (not
13385         only methods).  For instance, consider a method with an "Item"
13386         property and an Item method.
13387
13388         * class.cs: If there is a problem with the parameter types,
13389         return. 
13390
13391 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13392
13393         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13394         looks at user defined conversion after making a call to 
13395         StandardConversionExists - we need this for overload resolution.
13396
13397         * expression.cs : Update accordingly the various method calls.
13398
13399         This fixes 2 bugs filed against implicit user defined conversions 
13400
13401 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13402
13403         * statement.cs: Track the result of the assignment.
13404
13405 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13406
13407         * expression.cs (MemberAccess): Improved error reporting for
13408         inaccessible members.
13409
13410 2002-05-22  Martin Baulig  <martin@gnome.org>
13411
13412         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13413         itself with debugging support.
13414
13415 2002-05-22  Martin Baulig  <martin@gnome.org>
13416
13417         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13418         Removed, this isn't needed anymore.
13419
13420 2002-05-20  Martin Baulig  <martin@gnome.org>
13421
13422         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13423         be underlying type for an enum.
13424
13425 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13426
13427         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13428         that splits out the loading of just the core types.
13429
13430         * rootcontext.cs (ResolveCore): Split the struct resolution in
13431         two, so we can load the enumeration underlying types before any
13432         enums are used.
13433
13434         * expression.cs (Is): Bandaid until we fix properly Switch (see
13435         bug #24985 for details).
13436
13437         * typemanager.cs (ImplementsInterface): The hashtable will contain
13438         a null if there are no interfaces implemented.
13439
13440 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13441
13442         * cs-parser.jay (indexer_declarator): It is fine to have array
13443         parameters
13444
13445 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13446
13447         * typemanager.cs: (RegisterBuilder): New function used to register
13448         TypeBuilders that implement interfaces.  Since
13449         TypeBuilder.GetInterfaces (as usual) does not work with lame
13450         Reflection.Emit. 
13451         (AddUserType): register interfaces.
13452
13453         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13454         dealing with TypeBuilder.  Also, arrays are showing up as
13455         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13456         methods can not be invoked on them!
13457
13458         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13459         (ImplicitReferenceConversionExists): Split out from
13460         StandardConversionExists. 
13461
13462         * expression.cs (As): We were only implementing one of the three
13463         cases for the as operator.  We now implement them all.
13464         (Is): Implement the various other cases for Is as well.
13465
13466         * typemanager.cs (CACHE): New define used to control if we want or
13467         not the FindMembers cache.  Seems to have a negative impact on
13468         performance currently
13469
13470         (MemberLookup): Nested types have full acess to
13471         enclosing type members
13472
13473         Remove code that coped with instance/static returns for events, we
13474         now catch this in RealFindMembers.
13475
13476         (RealFindMembers): only perform static lookup if the instance
13477         lookup did not return a type or an event.  
13478
13479 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13480
13481         * assign.cs (CompoundAssign): We pass more semantic information
13482         now to Compound Assignments than we did before: now we have all
13483         the information at hand, and now we resolve the target *before* we
13484         do the expression expansion, which allows the "CacheValue" method
13485         to have the effect we intended (before, a [x] += 1 would generate
13486         two differen ArrayAccess expressions from the ElementAccess,
13487         during the resolution process).
13488
13489         (CompoundAssign.DoResolve): Resolve target and original_source here.
13490
13491 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13492
13493         * expression.cs (ArrayAccess): dropped debugging information. 
13494
13495         * typemanager.cs: Small bug fix: I was always returning i_members,
13496         instead of one of i_members or s_members (depending on which had
13497         the content).
13498
13499         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13500         method is invoked before any code generation takes place, and it
13501         is a mechanism to inform that the expression will be invoked more
13502         than once, and that the method should use temporary values to
13503         avoid having side effects
13504
13505         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13506
13507         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13508         implementation.
13509
13510         * expression.cs (Indirection, ArrayAccess): Add support for
13511         CacheTemporaries in these two bad boys. 
13512
13513         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13514         ldobj or ldind_ref.  
13515         (StoreFromPtr): Handle stobj as well.
13516
13517         * expression.cs (UnaryMutator): Share more code.
13518
13519         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13520         down: I was not tracking the Filter function as well, which
13521         was affecting the results of the cache.
13522
13523 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13524
13525         * attribute.cs: Remove the hack to handle the CharSet property on
13526         StructLayouts. 
13527
13528 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * attribute.cs (DoResolve): More uglyness, we now only try to
13531         resolve the attribute partially, to extract the CharSet
13532         information (only if we are a StructLayout attribute).  Otherwise 
13533
13534         (GetExtraTypeInfo): Add some code to conditionally kill in the
13535         future this.   I am more and more convinced that the .NET
13536         framework has special code to handle the attribute setting on
13537         certain elements.
13538
13539         * expression.cs (IsParamsMethodApplicable): Revert my previous
13540         foreach change here, it was wrong.
13541
13542 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13543
13544         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13545         (pp_expr): do not abort on unknown input, just return.
13546         (eval): abort if there are pending chars.
13547
13548         * attribute.cs (Attribute.Resolve): Positional parameters are
13549         optional.  Deal with that case.
13550
13551         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13552         the Ansi/Unicode/Auto information for the type.
13553
13554         (TypeContainer.DefineType): instantiate the EmitContext here, as
13555         we will be using it during the type definition (to resolve
13556         attributes) and during the emit phase.
13557
13558         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13559         to pull type information out of the attributes
13560
13561         (Attribute.Resolve): track the constructor builder, and allow for
13562         multiple invocations (structs and classes will use this).
13563
13564         * ecore.cs (MemberLookupFinal): new version with all the
13565         parameters customizable.
13566
13567         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13568         constructors.  Return if the result value is null (as the error
13569         would have been flagged already by MemberLookupFinal)
13570
13571         Do not allow instances of abstract classes or interfaces to be
13572         created.
13573
13574         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13575         We have to compare the assembly property here when dealing with
13576         FamANDAssem and Assembly access modifiers, because we might be
13577         creating an assembly from *modules* (that means that we are not
13578         getting TypeBuilders for types defined in other modules that are
13579         part of this assembly).
13580
13581         (Method.Emit): If the method is marked abstract and has a body,
13582         emit an error. 
13583
13584         (TypeContainer.DefineMembers): If both the defined member and the
13585         parent name match are methods, then do not emit any warnings: let
13586         the Method.Define routine take care of flagging warnings.  But if
13587         there is a mismatch (method overrides something else, or method is
13588         overriwritten by something, then emit warning).
13589
13590         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13591         set to null, this means `do not check for the return type on the
13592         signature'. 
13593
13594         (Method.Define): set the return type for the method signature to
13595         null, so that we get methods with the same name and parameters and
13596         different return types.  This is used to flag warning 114 (you are
13597         hiding a method, and you probably want to use the new/override
13598         keywords instead).
13599
13600         * typemanager.cs (MemberLookup): Implemented proper access
13601         control, closing a long standing set of bug reports.  The problem
13602         was that the Framework only has two bits: Public and NonPublic,
13603         and NonPublic includes private and protected methods, but we need
13604         to enforce the FamANDAssem, FamOrAssem and Family. 
13605
13606 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13607
13608         * statement.cs (GotoCase): Return true: Ammounts to giving up
13609         knowledge on whether we return or not, and letting the other case
13610         be responsible for it.
13611
13612 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13613
13614         * driver.cs: Do not load directories for each file processed, only
13615         do it if there is a pattern.
13616
13617         * ecore.cs: Report readonly assigns here as well, as we might have
13618         been resolved only by MemberAccess.
13619
13620         (SimpleName.SimpleNameResolve): Also be useful for LValue
13621         resolution.   We need this to propagate assign to local readonly variables
13622
13623         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13624         do not want to reuse potential criteria memory.
13625
13626         * class.cs (MyEventBuilder): Set reflected_type;
13627
13628         * ecore.cs (Constantify): Added support for constifying bools.
13629
13630         (RootContext.LookupType): Added a cache for values looked up in
13631         the declaration space.
13632
13633         * typemanager.cs (FindMembers): Now is a front-end to
13634         RealFindMembers, and provides a two-level hashtable-based cache to
13635         the request.  
13636
13637         15% performance improvement: from 22.5 to 19.2 seconds.
13638
13639         * expression.cs (IsParamsMethodApplicable): use foreach.
13640         (Invocation.DoResolve): ditto.
13641         (New.DoResolve): ditto.
13642         (ArrayCreation.DoResolve): ditto.
13643
13644         * ecore.cs (FindMostEncompassingType): use foreach.
13645
13646         * delegate.cs (NewDelegate.DoResolve): Use foreach
13647
13648         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13649         (RemoveMethods): use foreach.
13650
13651         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13652         nested foreach statements instead of for, and also break out of
13653         the inner loop once a match is found.
13654
13655         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13656
13657 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13660         we actually unwrap the expression to allow for extra information
13661         to be extracted. 
13662
13663         * expression.cs: Use Shr_Un on unsigned operations. 
13664
13665 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13666
13667         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13668         applicable operators was not being considered correctly. This closes
13669         the bug Miguel reported.
13670
13671 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13672
13673         * attribute.cs: check that the type derives from System.Attribute
13674         and report the correct error in that case (moved the duplicate code to
13675         its own method, too).
13676
13677 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13678
13679         * attribute.cs: lookup attribute type name as the spec says: first the
13680         bare attribute name and then name + "Attribute" (nant compiles with
13681         mcs after this fix).
13682
13683 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13684
13685         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13686         Because of the way we parse things, we should try to see if a
13687         UIntConstant can fit in an integer.
13688
13689 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13690
13691         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13692         when we are in an explicit context.
13693
13694         (ConvertReferenceExplicit): When converting from Iface type S to Class
13695         T make sure the rules are implemented as an OR.
13696
13697         * parameter.cs (ParameterType): Make it a property for now although the
13698         purpose really isn't anything immediate.
13699
13700         * expression.cs (Is*Applicable): Do better checking on the parameter type
13701         of a ref/out parameter. The ones from the system assemblies are already 
13702         marked with the correct type so we don't need to do any correction.
13703
13704         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13705         the object type is standard too so include that.
13706
13707 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13708
13709         * ecore.cs (StandardConversionExists): Augment with missing code:
13710         deal with IntConstant, LongConstants and Enumerations.
13711
13712         * assign.cs: Report the error, instead of failing silently
13713
13714         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13715         typecontainer that they are declared, because the
13716         typecontainer/namespace will have the list of using clauses that
13717         need to be applied.
13718
13719         Assembly Attributes were escaping the normal registration
13720         mechanism. 
13721
13722         (EmitCode): Apply attributes within an EmitContext that represents
13723         the container they were declared on.
13724
13725         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13726
13727 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13728
13729         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13730         Revamp completely - make much cleaner as we now operate only
13731         on a set of Types.
13732
13733         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13734         to implement the logic detailed in the spec more correctly.
13735
13736         (UserDefinedConversion): Update accordingly.
13737
13738 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * statement.cs: Return flow analysis information up.
13741
13742         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13743         and the default.
13744
13745         (token): Do not consume an extra character before calling
13746         decimal_digits.
13747
13748 2002-05-06  Piers Haken <piersh@friskit.com>
13749
13750         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13751
13752 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13753
13754         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13755         EmitContext during the instance constructor initializer
13756         resolution, to stop access to instance variables.
13757
13758         This is mandated by the spec, last paragraph of the `constructor
13759         initializers' section. 
13760
13761 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13762
13763         * cs-parser.jay, class.cs (Accessor): new class used to represent
13764         an accessor (get or set).  In the past we used `null' to represent
13765         a missing accessor.  But this is ambiguous because there was no
13766         way to tell in abstract indexers/properties if one of them was
13767         specified.
13768
13769         Now there is a way of addressing that.
13770
13771         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13772         instead of FindMembers.
13773
13774         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13775         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13776
13777         * attribute.cs: Treat indexers and properties as the same in terms
13778         of applying attributes
13779
13780         * ecore.cs (FindMostEncompassedType): Use statically initialized
13781         EmptyExpressions()s like we do elsewhere to avoid creating useless
13782         objects (and we take this out of the tight loop).
13783
13784         (GetConversionOperators): Move the code to extract the actual
13785         operators to a separate routine to clean things up.
13786
13787 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13788
13789         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13790         events are always registered FieldBuilders.
13791
13792         * class.cs (FieldBase): New class shared by Fields 
13793
13794         * delegate.cs: If we are a toplevel delegate, use our full name.
13795         If we are a nested delegate, then only use our tail name.
13796
13797 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13798
13799         * expression.cs (IsApplicable): Ensure that we add the "&" to
13800         ref/out types before comparing it with the type of the argument.
13801
13802         (IsParamsMethodApplicable): Ditto.
13803
13804         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13805         silly me ;-)
13806
13807         * delegate.cs : Handle the case when we have more than one applicable
13808         method. Flag an error only when we finish checking all.
13809
13810 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13811
13812         * expression.cs: Add support for boolean static initializers.
13813
13814 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13815
13816         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13817
13818         * parameter.cs (ComputeParameterTypes,
13819         ComputeAndDefineParameterTypes): Better error handling: now we
13820         clear the `types' cache if we fail during any of the type lookups.
13821         We also return the status code correctly to our caller
13822
13823         * delegate.cs: If we fail to define a delegate, abort the extra
13824         steps. 
13825
13826         * expression.cs (Binary.ResolveOperator): for
13827         operator==(object,object) and operator !=(object, object) we also
13828         have to verify that there is an implicit conversion from one to
13829         the other.
13830
13831         (ArrayAccess.DoResolve): Array Access can operate on
13832         non-variables. 
13833
13834 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13835
13836         * assign.cs (CompoundAssign): A new class used as a "flag" that
13837         the assignment actually is happening as part of a compound
13838         assignment operator.
13839
13840         During compound assignment, a few new rules exist to enable things
13841         like:
13842
13843         byte b |= 1 + 2
13844
13845         From the spec:
13846
13847         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13848         to the type of x) if y is implicitly convertible to the type of x,
13849         and the operator is a builtin operator and the return type of the
13850         operator is explicitly convertible to the type of x. 
13851
13852         * rootcontext.cs: Reset warning level to 2.  4 catches various
13853         "interesting" features in mcs, we must clean this up at some
13854         point, but currently am trying to kill other bugs ;-)
13855
13856         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13857         in container classes as well.  
13858
13859         * expression.cs (Binary.ResolveOperator): Handle string case
13860         before anything else (as operator overloading does emit an error
13861         before doing anything else).
13862
13863         This code could go away when we move to a table driven model, but
13864         i could not come up with a good plan last night.
13865
13866 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13867
13868         * typemanager.cs (CSharpName): reimplementation using regex.
13869         * class.cs: added null check for fields in Emit
13870         * rootcontext.cs: set warninglevel to 4
13871
13872 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13873
13874         * typemanager.cs (CSharpName): reimplemented with Lupus
13875         suggestion.
13876
13877 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13878
13879         * statement.cs (If): correclty implement Resolve, because we were
13880         not catching sem errors in there.  The same process is needed
13881         everywhere else. 
13882         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13883
13884
13885         (Statement.Warning_DeadCodeFound): Factorize code.
13886         (While): Report dead code here too.
13887
13888         (Statement): Added Resolve virtual method to allow
13889         for resolution split from the emit code.
13890
13891 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13892
13893         * statement.cs (EmitBoolExpression): No longer try to resolve the
13894         expression here.    
13895         (MakeBoolean): New utility function that resolve, implicitly
13896         converts to boolean and tags the expression. 
13897
13898
13899         (If, Do): Implement dead code elimination.
13900         (While): Implement loop inversion
13901
13902         (Do, While, For, If): Resolve the expression prior to calling our
13903         code generation.
13904
13905 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13906
13907         * class.cs:
13908           - added method Report28 (warning: program has more than one entry point)
13909           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13910           - modified method Method.Define, the part at the end of the method
13911
13912         * rootcontext.cs: added static public Location EntryPointLocation;
13913           
13914         * ../errors/cs0028.cs : Add test case for the above warning.              
13915
13916         * typemanager.cs:
13917           - modified method CSharpName to allow arrays of primitive type to
13918             be printed nicely (e.g. instead of System.Int32[][] it now prints
13919             int[][])
13920           - added method CSharpSignature: returns the signature of a method
13921             in string format to be used in reporting errors, warnings, etc.
13922
13923         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13924         with String.Empty.
13925
13926 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13927
13928         * delegate.cs (Define): Fix extremely silly bug where I was
13929         setting the type of the 'object' parameter of the BeginInvoke
13930         method to System.IAsyncResult instead of System.Object ;-)
13931
13932 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13933
13934         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13935         here. 
13936
13937         (Constructor.Emit): return if we fail to initialize the
13938         constructor.  Another door closed!  
13939
13940         * expression.cs (New.DoResolve): Improve error message (from -6 to
13941         1501).  Use DeclaredOnly lookup to find the exact constructor.
13942
13943         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13944         loop.  This is useful.
13945
13946         * cs-parser.jay: Adjust the default parameters so that destructors
13947         have the proper signature.
13948
13949 2002-04-26  Martin Baulig  <martin@gnome.org>
13950
13951         * driver.cs (LoadAssembly): If `assembly' contains any characters
13952         which are only valid in path names and not in assembly names
13953         (currently slash, backslash and point), use Assembly.LoadFrom ()
13954         instead of Assembly.Load () on the `assembly' (before iteration
13955         over the link_paths).
13956
13957 2002-04-26  Martin Baulig  <martin@gnome.org>
13958
13959         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13960
13961 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * class.cs (Property): use the new typemanager.MemberLookup
13964
13965         (TypeContainer.MemberLookup): Implement using the
13966         TypeManager.MemberLookup now. 
13967
13968         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13969         and return MemberInfos, so that these can be used without an
13970         EmitContext (what we had before).
13971
13972 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13973
13974         * expression.cs: Fix the case where the argument to params if the
13975         type of the params.  I omitted handling this before.   Fixed
13976
13977 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13978
13979         * driver.cs: Call BootCorlib_PopulateCoreType
13980
13981         * class.cs (Property.CheckBase): Check for properties only, not
13982         for all members. 
13983
13984         * interface.cs: Temporary hack: try/catch around the
13985         CustomAttributeBuilder, because I am getting an exception that I
13986         do not understand.
13987
13988         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13989         types whose definitions are required to be there (attributes are
13990         defined before standard types).
13991
13992         Compute definitions as we boot the various types, as they are used
13993         immediately (value_type class will need object_type, but if we do
13994         not initialize object_type, we will pass a null, which will let
13995         the runtime pick the System.Object from the existing corlib, which
13996         is not what we want).
13997
13998 2002-04-22  Patrik Torstensson <totte@labs2.com>
13999
14000         * cs-tokenizer.cs: fixed a number of trim() issues.
14001
14002 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14003
14004         * expression.cs (Argument.Type): Ensure that we return the correct
14005         type when we have out or ref parameters [in which case we 
14006         append a "&"].
14007
14008 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14009
14010         * class.cs (Property, Indexer): Allow extern modifier in there. 
14011
14012         * typemanager.cs (InitBaseTypes): Initializes object_type and
14013         value_type, since those will be used early on during the bootstrap
14014         process to compile corlib.
14015
14016         (InitCoreTypes): Move code from here to InitBaseTypes.
14017
14018 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14019
14020         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14021         single-dimension arrays as using the ldlen opcode.  
14022
14023         Daniel Lewis discovered this optimization.  
14024
14025         * typemanager.cs: Add signature for System.Array::get_Length
14026
14027 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14028
14029         * statement.cs: report the error when the foreach does not apply to an
14030         array nor a collection.
14031
14032 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14033
14034         * expression.cs: Add implicit conversions to the operator ~.
14035
14036         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14037
14038         * typemanager.cs: Locate the decimal constructor.
14039
14040 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14041
14042         * attribute.cs: use the new property of TypeOf.
14043         * expression.cs: added 'get' property around typearg.
14044
14045         These changes fix a build breaker reported by NickD. Is this the
14046         correct way to fix?  If not, please, revert my changes and make it
14047         work :-).
14048
14049 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14050
14051         * attribute.cs: Add support for typeof in attribute invocations.
14052         I am not sure that this is right though.
14053
14054 2002-04-14  Duncan Mak  <duncan@ximian.com>
14055
14056         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14057         Binary.Operator.Division case.
14058
14059 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14060
14061         * class.cs (DefineType): Ensure that we do a proper check on
14062         attribute types and also register it with the TypeManager.
14063
14064         (TypeContainer.Targets): The default for attribute types is
14065         AttributeTargets.All.
14066
14067         * attribute.cs (ApplyAttributes): Registering the attribute type
14068         is done elsewhere, not when we discover we have a Usage attribute.
14069
14070 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14071
14072         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14073         and get rid of is_delegate parameter.
14074
14075         * everywhere : update.
14076
14077 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14078
14079         * cs-parser.jay (compilation_unit): Revamp completely to use
14080         some new ideas that I got from Rhys' grammar to solve the problems
14081         with assembly level attributes.
14082
14083         (outer_declaration): New grammar production.
14084
14085         (attribute_sections): Add.
14086
14087         (opt_attributes): Base on attribute_sections
14088
14089         (namespace_declaration): Allow opt_attributes to tackle the case
14090         when we have assembly level attributes - we are clever in this
14091         regard now ;-)
14092
14093         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14094         attributes in the non-global context.
14095
14096         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14097         instead of SetGlobalAttributes.
14098
14099         * class.cs, rootcontext.cs : Ensure we define and generate 
14100         attribute types before anything else.
14101
14102         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14103         and flag the new error -20 for the case when the attribute type
14104         does not have valid targets specified. csc does not catch this.
14105
14106         * ../errors/errors.txt : update for error # -20
14107
14108 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14109
14110         * support.cs (InternalParameters.ParameterModifier): Do some null
14111         checking and return sane values.
14112
14113         * class.cs (Method.Define): If we are a PInvoke method, ensure
14114         that we are static and extern. Report error # 601
14115
14116         * ../errors/cs0601.cs : Add test case for the above error.
14117
14118 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14119
14120         * rootcontext.cs (attribute_types): We need to keep type of
14121         all attribute types separately and emit code for them first.
14122
14123         (RegisterAttribute) : Implement.
14124
14125         * class.cs (DefineType): Check if the current Type is a custom
14126         attribute type and register it accordingly.
14127
14128         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14129         adding the first attribute twice and rename to
14130
14131         (SetGlobalAttributes): this.
14132
14133         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14134         lookups.
14135
14136         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14137         if we are processing global arguments. Hmm, I am unsure of this.
14138
14139 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14140
14141         * expression.cs: added static array of strings to avoid calling
14142         Enum.ToString () for Operator in Binary. Significant recover of
14143         performance.
14144
14145 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14146
14147         * class.cs (FindMembers): Allow the Builders of the various
14148         members to be null.  If they are skip them.  This only happens
14149         during the PInvoke declaration.
14150
14151 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14154         failure, so we do not keep going afterwards.
14155
14156         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14157         wanted to pass `false' as the `is_delegate' argument.  If this is
14158         the case, why not use delegate_type == null to mean `is_delegate =
14159         false' and anything else as is_delegate = true.
14160
14161 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14162
14163         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14164         code for the section, not the beginning of the tests.
14165
14166 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14167
14168         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14169
14170         * expression.cs (Binary): same.  Warn about errors where we have
14171         Enum/Enum in operator + as well.
14172
14173 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14174
14175         * statement.cs:
14176                 - added support for switch(bool)
14177                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14178                 - add TableSwitchEmit() to handle table-based switch statements
14179
14180 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14181
14182         * expression.cs (Invocation.OverloadResolve): Factor out code which
14183         does parameter compatibility checking with arguments so that we can 
14184         re-use the code even from Delegate.VerifyApplicability
14185
14186         (VerifyArgumentsCompat): Move above code here.
14187
14188         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14189         and instead make a call to the above method.
14190
14191 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14192
14193         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14194         We use it to keep track of classes which are attribute types.
14195
14196 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * delegate.cs (Delegate.Define): Correctly define the types in the
14199         presence of fixed and array parameters.
14200
14201         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14202         doing FindMembers.
14203
14204         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14205         include NonPublic after the first iteration.
14206
14207         * class.cs (Indexer.CheckBase): Only check if both parents are
14208         non-null. 
14209
14210         * cs-parser.jay (accessor_body): If empty, set to null.
14211
14212         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14213         same code path here to resolve constants names that we did have in
14214         MemberAccess.DoResolve.  There is too much code duplicated here.
14215
14216 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14219
14220         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14221         to MakeUnionSet.
14222
14223         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14224         tokens, numbers and strings.
14225
14226         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14227         parenthesis.
14228
14229         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14230         asyncronous parameters and the regular parameters.  
14231
14232         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14233         specify the target directory.
14234
14235         * expression.cs: (This.DoResolve): Simplify
14236         (As.Emit): Optimize, do not generate IsInst if the expression is
14237         always of the given type.
14238
14239         (Is.DoResolve): Bug fix, we were reporting both always/never for
14240         the is expression.
14241
14242         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14243         creating too many unnecessary arrays.
14244
14245 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14246
14247         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14248         fields instead of rolling our own initializer.   Takes care of all
14249         implicit conversions, and drops unnecessary static checks/argument.
14250
14251 2002-03-31  Dick Porter  <dick@ximian.com>
14252
14253         * driver.cs: use the GetDirectories() return values properly, and
14254         use "/" as path separator.
14255
14256 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14257
14258         * expression.cs (Unary): Optimize - - expr into expr.
14259         (Binary): Optimize a + (-b) into a -b.
14260
14261         * codegen.cs (CodeGen): Made all methods static.
14262
14263 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14264
14265         * rootcontext.cs: 
14266
14267         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14268         TypeBuilder property.
14269
14270         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14271         instead. 
14272
14273         * tree.cs: Removed the various RecordXXXX, and replaced with a
14274         single RecordDecl.  Removed all the accessor methods, and just
14275         left a single access point Type 
14276
14277         * enum.cs: Rename DefineEnum to DefineType.
14278
14279         * decl.cs: New abstract method `DefineType' used to unify the
14280         Defines for Enumerations, Interfaces, TypeContainers and
14281         Delegates.
14282
14283         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14284         LookupBaseClasses method that used to live in class.cs and
14285         interface.cs here, and renamed to FindType.
14286
14287         * delegate.cs: Implement DefineType.  Take advantage of the
14288         refactored pattern for locating the parent builder without taking
14289         the parent_builder argument (which we know does not work if we are
14290         nested, and triggering a toplevel definition).
14291
14292 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14293
14294         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14295         accessibility of a member has changed during override and report
14296         an error if so.
14297
14298         * class.cs (Method.Define, Property.Define): Only complain on
14299         overrides if the method is private, any other accessibility is
14300         fine (and since we just checked the permission is the same, we are
14301         good to go).
14302
14303         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14304         and elif are processed always.  The other pre-processing
14305         directives are only processed if we are "taking" the path
14306
14307 2002-03-29  Martin Baulig  <martin@gnome.org>
14308
14309         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14310         current location is not Null.
14311
14312         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14313         a separate method so we can profile it.
14314
14315         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14316         `span.Seconds' are just seconds, but no minutes or hours.
14317         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14318
14319 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14320
14321         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14322         Remove the gratuitous set of Final:
14323
14324                                 // If an interface implementation, then we can set Final.
14325                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14326                                     implementing.DeclaringType.IsInterface)
14327                                         flags |= MethodAttributes.Final;
14328
14329         I do not know what I was smoking when I used that.
14330
14331
14332         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14333         step into fixing the name resolution issues for delegates and
14334         unifying the toplevel name resolution.
14335
14336 2002-03-28  Martin Baulig  <martin@gnome.org>
14337
14338         * class.cs (Method.Emit): If we have a symbol writer, call its
14339         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14340         tell it about the current method.
14341
14342         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14343         writer that we're going to emit the first byte of IL code for a new
14344         statement (a new source line).
14345         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14346         EmitContext.Mark() before emitting any code.
14347
14348         * location.cs (SymbolDocument): Return null when we're Null.
14349
14350         * statement.cs (Statement): Moved the `Location loc' variable here.
14351         (Statement.EmitBoolExpression): If we have a symbol writer, call
14352         ec.Mark() before emitting any code to tell it that we're at the
14353         beginning of a new statement.
14354         (StatementExpression): Added `Location' argument to the constructor.
14355         (Block): Added public readonly variable `StartLocation' and public
14356         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14357         (Block): Added constructor which takes a start and end location.
14358         (Block.SetEndLocation): New method. This sets the end location.
14359         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14360         local variables we create.
14361         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14362         each statement and do also mark the begin and end of the block.
14363
14364         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14365         tell it the current lexer.Location, use Location.Null for the end of the
14366         block.
14367         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14368         current block, set its end location using SetEndLocation().
14369         (statement_expression): StatementExpression constructor now takes the
14370         lexer.Location as additional argument.
14371         (for_statement, declare_local_variables): Likewise.
14372         (declare_local_variables): When creating a new implicit block, use the
14373         new Block constructor and pass it the lexer.Location.
14374
14375 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14376
14377         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14378         members also on the parent interfaces recursively.
14379
14380 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14381
14382         * report.cs: Use new formats, since Gonzalo finished the missing
14383         bits. 
14384
14385         * expression.cs (Binary.ResolveOperator): added missing operator|
14386         operator& and operator^ for bool/bool.
14387
14388         * cs-parser.jay: CheckDef now takes a Location argument that is
14389         used to report errors more precisly (instead of reporting the end
14390         of a definition, we try to track something which is a lot closer
14391         to the source of the problem).
14392
14393         * cs-tokenizer.cs: Track global token use, so we can properly flag
14394         the use of #define/#undef after the first token has been seen.
14395
14396         Also, rename the reportXXXX to Error_DescriptiveName
14397
14398         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14399         TypeContainer, so that Enum and Interface can use this too.
14400
14401         * class.cs (TypeContainer.LookupInterfaceOrClass,
14402         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14403         `builder' argument.  Typically this was used to pass the parent
14404         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14405         the definition).  
14406
14407         The problem is that a nested class could trigger the definition of
14408         a toplevel class, and the builder would be obviously wrong in that
14409         case. 
14410
14411         So we drop this argument, and we compute dynamically the
14412         TypeBuilder/ModuleBuilder (the correct information was available
14413         to us anyways from DeclSpace.Parent)
14414
14415         * interface.cs (Interface.DefineInterface): Drop builder
14416         parameter cleanup like class.cs
14417
14418         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14419         like class.cs
14420
14421         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14422         values. 
14423
14424         (Try.Emit): Propagate the returns value from the statement.
14425
14426         (Return.Emit): Even if we are leavning 
14427
14428         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14429
14430         * modifiers.cs: Fix the computation of MethodAttributes flags.
14431
14432 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14433
14434         * driver.cs: allow compilation of files that start with '/'.
14435         Add a default case when checking the argument of --target.
14436
14437 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14438
14439         * interface.cs: Implement the same search algorithm for types in
14440         the interface code.
14441
14442         * delegate.cs: Do not allow multiple definition.
14443
14444         * Recovered ChangeLog that got accidentally amputated
14445
14446         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14447
14448         * rootcontext.cs: Load manually enum to allow core classes to
14449         contain enumerations.
14450
14451         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14452         Update to new static methods in TypeManager.
14453
14454         * typemanager.cs (GetMethod, GetConstructor): Use our
14455         implementation of FindMembers to find the members, since during
14456         corlib compilation, the types are TypeBuilders and GetMethod and
14457         GetConstructor do not work.
14458
14459         Make all methods in TypeManager static.
14460
14461         (InitCodeHelpers): Split the functionality from
14462         the InitCodeTypes function.
14463
14464         * driver.cs: Call InitCodeHelpers after we have populated the
14465         types. 
14466
14467         * cs-parser.jay (delegate_declaration): we did not used to compute
14468         the delegate name correctly for void delegates.
14469
14470 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14471
14472         * rootcontext.cs (RootContext): Init the interface_resolve_order
14473         and type_container_resolve_order always.
14474
14475         (ResolveCore, BootstrapCorlib_ResolveClass,
14476         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14477         compiler when compiling with --nostdlib
14478
14479         * class.cs (TypeContainer.DefineType): Check that our parent is
14480         not null.  This test is most important when we are bootstraping
14481         the core types.
14482
14483         * codegen.cs: Split out the symbol writing code.
14484
14485 2002-03-25  Martin Baulig  <martin@gnome.org>
14486
14487         * driver.cs (-g): Made -g an alias for --debug.
14488
14489 2002-03-24  Martin Baulig  <martin@gnome.org>
14490
14491         * codegen.cs (SymbolWriter): New public variable. Returns the
14492         current symbol writer.
14493         (CodeGen): Added `bool want_debugging_support' argument to the
14494          constructor. If true, tell the ModuleBuild that we want debugging
14495         support and ask it for the ISymbolWriter.
14496         (Save): If we have a symbol writer, call it's Close() method after
14497         saving the assembly.
14498
14499         * driver.c (--debug): New command line argument to create a
14500         debugger information file.
14501
14502         * location.cs (SymbolDocument): New public property. Returns an
14503         ISymbolDocumentWriter object for the current source file or null
14504         if we don't have a symbol writer.
14505
14506 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14507
14508         * driver.cs (LoadAssembly): Correctly return when all the paths
14509         have been tried and not before.
14510
14511         * statement.cs (Switch.Emit): return the actual coverage for this
14512         statement (returns/not-returns)
14513
14514         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14515         switch of the statement if we are the last switch section.  That
14516         kills two problems: try/catch problems (we used to emit an empty
14517         nop at the end) and switch statements where all branches would
14518         return. 
14519
14520 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14521
14522         * driver.cs: Add default assemblies (the equivalent to the
14523         Microsoft CSC.RSP file)
14524
14525         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14526         also update tokens_seen and set it to false.
14527
14528         * driver.cs: Implement --recurse for Mike.
14529
14530         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14531         correctly splitting out the paths.
14532
14533 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * interface.cs (Interface.PopulateProperty): Instead of using
14536         `parent' as the declaration space for the set parameters, use
14537         `this' 
14538
14539         * support.cs (InternalParameters): InternalParameters constructor
14540         takes a DeclSpace instead of a TypeContainer.
14541
14542         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14543         types are being initialized, load the address of it before calling
14544         the function.  
14545
14546         (New): Provide a mechanism to disable the generation of local
14547         value type temporaries when the caller will be providing us with
14548         an address to store it.
14549
14550         (ArrayCreation.EmitDynamicInitializers): Use it.
14551
14552 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14553
14554         * expression.cs (Invocation.EmitArguments): Only probe for array
14555         property if there is more than one argument.  Sorry about that.
14556
14557         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14558         empty param arrays.
14559
14560         * class.cs (Method.LabelParameters): Fix incorrect code path that
14561         prevented the `ParamArrayAttribute' from being applied to the
14562         params attribute.
14563
14564 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14565
14566         * support.cs (ReflectionParameters): Correctly compute whether the
14567         last argument is a params array.  Fixes the problem with
14568         string.Split ('a')
14569
14570         * typemanager.cs: Make the assemblies array always be non-null
14571         (empty, but non-null)
14572
14573         * tree.cs (RecordDecl): New function that abstracts the recording
14574         of names.  This reports error 101, and provides a pointer to the
14575         previous declaration.  Fixes a crash in the compiler.
14576
14577         * cs-parser.jay (constructor_declaration): Update to new grammar,
14578         and provide a constructor_body that can be empty.
14579
14580 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * driver.cs: Add support for --resources.
14583
14584         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14585         Make all types for the various array helper methods be integer.
14586
14587         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14588         CheckState to ConvCast.
14589
14590         (ConvCast): Now it takes a `checked' state argument, to avoid
14591         depending on the emit context for the conversion, and just using
14592         the resolve time setting.
14593
14594         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14595         instead of Invocation.EmitArguments.  We do not emit the original
14596         arguments, instead we emit those which have been converted to
14597         unsigned int expressions.
14598
14599         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14600
14601         * codegen.cs: ditto.
14602
14603         * expression.cs (LocalVariableReference): Drop the use of the
14604         Store function that depended on the variable index.
14605
14606         * statement.cs (VariableInfo): Drop the `Idx' property from this
14607         class, as this is not taking into account the indexes for
14608         temporaries tat we generate during the execution, getting the
14609         indexes wrong.
14610
14611         * class.cs: First emit class initializers, then call the parent
14612         constructor. 
14613
14614         * expression.cs (Binary): Fix opcode emision.
14615         (UnaryMutator.EmitCode): Support checked code generation
14616
14617         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14618         matches for events for both the Static and Instance scans,
14619         pointing to the same element.   Fix that.
14620
14621 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14622
14623         * rootcontext.cs (ResolveTree): Always set the
14624         interface_resolve_order, because nested interfaces will be calling
14625         into us.
14626
14627         * class.cs (GetInterfaceOrClass): Track the same resolution
14628         process used by TypeManager.LookupType.  This fixes the nested
14629         type lookups in class declarations (separate path from
14630         LookupType). 
14631
14632         (TypeContainer.DefineType): Also define nested interfaces.
14633         (TypeContainer.RegisterOrder): New public function used to
14634         register the order in which child interfaces need to be closed.
14635
14636         Nested interfaces need to be closed after their parents have been
14637         created. 
14638
14639         * interface.cs (InterfaceAttr): Put all the logic for computing
14640         the interface attribute here. 
14641
14642         (DefineInterface): Register our interface order with the
14643         RootContext or with the TypeContainer depending on the case.
14644
14645 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * cs-parser.jay: rework foreach statement to work with the new
14648         changes to the policy on SimpleNames.
14649
14650         * report.cs: support Stacktrace on warnings as well.
14651
14652         * makefile: drop --unsafe and /unsafe from the compile.
14653
14654 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14655
14656         * ecore.cs (StandardConversionExists): Modify to take an Expression
14657         as the first parameter. Ensure we do null -> reference type conversion
14658         checking.
14659
14660         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14661         temporary Expression objects.
14662
14663 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14664
14665         * interface.cs: workaround bug in method overloading resolution
14666         (there is already a bugzilla bug for it).
14667
14668 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14669
14670         We could also solve this problem by having a separate path for
14671         performing type lookups, instead of DoResolve, we could have a
14672         ResolveType entry point, and only participating pieces of the
14673         production (simplename, deref, array) would implement this. 
14674
14675         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14676         signal SimpleName to only resolve type names and not attempt to
14677         resolve anything else.
14678
14679         * expression.cs (Cast): Set the flag.
14680
14681         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14682
14683         * class.cs: Only report 108 if there is no `new' modifier.
14684
14685         * cs-parser.jay: rework foreach statement to work with the new
14686         changes to the policy on SimpleNames.
14687         
14688         * report.cs: support Stacktrace on warnings as well.
14689
14690         * makefile: drop --unsafe and /unsafe from the compile.
14691
14692 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14693
14694         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14695         lookups here, instead of doing that at parse time.  This means
14696         that our grammar will not introduce `LocalVariableReferences' as
14697         expressions at this point.  That solves the problem of code like
14698         this:
14699
14700         class X {
14701            static void Main ()
14702            { int X = 1;
14703             { X x = null }}}
14704
14705         This is only half the fix.  The full fix requires parameters to
14706         also be handled in this way.
14707
14708         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14709         makes the use more obvious of the DeclSpace.  The
14710         ec.TypeContainer.TypeBuilder is now only used to pull the
14711         TypeBuilder for it.
14712
14713         My theory is that I can get rid of the TypeBuilder completely from
14714         the EmitContext, and have typecasts where it is used (from
14715         DeclSpace to where it matters).  
14716
14717         The only pending problem is that the code that implements Aliases
14718         is on TypeContainer, and probably should go in DeclSpace.
14719
14720         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14721         lookups here, instead of doing that at parse time.  This means
14722         that our grammar will not introduce `LocalVariableReferences' as
14723         expressions at this point.  That solves the problem of code like
14724         this:
14725
14726         class X {
14727            static void Main ()
14728            { int X = 1;
14729             { X x = null }}}
14730
14731         This is only half the fix.  The full fix requires parameters to
14732         also be handled in this way.
14733
14734         * class.cs (Property.DefineMethod): When implementing an interface
14735         method, set newslot, when implementing an abstract method, do not
14736         set the flag (before we tried never setting it, or always setting
14737         it, which is the difference).
14738         (Indexer.DefineMethod): same.
14739         (Method.DefineMethod): same.
14740
14741         * ecore.cs: Only set the status used flag if we get back a Field.
14742
14743         * attribute.cs: Temporary hack, so Paolo can keep working.
14744
14745 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14746
14747         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14748         the unmanaged type in the case we have a MarshalAs attribute.
14749
14750         (Resolve): Handle the case when we are parsing the special MarshalAs
14751         attribute [we need to store the unmanaged type to use later]
14752
14753         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14754         MarshalAs Attribute.
14755
14756         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14757         on parameters and accordingly set the marshalling info.
14758
14759 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * class.cs: Optimizing slightly by removing redundant code after
14762         we switched to the `NoTypes' return value.
14763         (Property.DefineMethod): use NoTypes here too.
14764
14765         This fixes the bug I introduced in my last batch of changes.
14766
14767 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14768
14769         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14770
14771         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14772         Enums since those are types too. 
14773
14774         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14775
14776         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14777         thanks to a call during the lookup process.
14778
14779 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * statement.cs (Foreach): Lots of work to accomodate a particular
14782         kind of foreach statement that I had not kept in mind.  It is
14783         possible to have foreachs on classes that provide a GetEnumerator
14784         method that return objects that implement the "pattern" for using
14785         a foreach, there is no need to support GetEnumerator
14786         specifically. 
14787
14788         This is needed to compile nant.
14789
14790         * decl.cs: Only report 114 if the member is not `Finalize' and if
14791         the warning level is at least 2.
14792
14793         * class.cs: Moved the compare function from Method to
14794         MethodSignature. 
14795
14796         (MethodSignature.InheritableMemberSignatureCompare): Add new
14797         filter function that is used to extract inheritable methods from a
14798         class. 
14799
14800         (Method.Define): Use the new `inheritable_method_signature_filter'
14801         delegate
14802
14803         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14804         command. 
14805
14806 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14807
14808         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14809
14810         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14811
14812         * expression.cs: Pass location information to
14813         ConvertImplicitStandard. 
14814
14815         * class.cs: Added debugging code to track return values from
14816         interfaces. 
14817
14818 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14819
14820         * expression.cs (Is.DoResolve): If either side of the `is' is an
14821         interface, do not flag the warning.
14822
14823         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14824         for interfaces
14825
14826         * report.cs: Allow for --fatal to be used with --probe.
14827
14828         * typemanager.cs (NoTypes): Move the definition for the empty Type
14829         array here. 
14830
14831         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14832         properties. 
14833         (TypeContainer.DefineProxy): New function used to proxy to parent
14834         implementations when implementing interfaces.
14835         (TypeContainer.ParentImplements): used to lookup if our parent
14836         implements a public function that is required by an interface.
14837         (TypeContainer.VerifyPendingMethods): Hook this up.
14838
14839         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14840         `modules' and `assemblies' arraylists into arrays.  We only grow
14841         these are the very early start up of the program, so this improves
14842         the speedof LookupType (nicely measured).
14843
14844         * expression.cs (MakeByteBlob): Replaced unsafe code with
14845         BitConverter, as suggested by Paolo.
14846
14847         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14848         folding of string concatenation, but if either side is a string,
14849         and the other is not, then return null, and let the runtime use
14850         the concatenation on the string plus the object (using
14851         `Object.ToString'). 
14852
14853 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14854
14855         Constant Folding has been implemented now.
14856
14857         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14858         the error instead on types that are not supported in one's
14859         complement. 
14860
14861         * constant.cs (Constant and all children): New set of functions to
14862         perform implict and explicit conversions.
14863
14864         * ecore.cs (EnumConstant): Implement the new functions to perform
14865         conversion by proxying to the child expression.
14866
14867         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14868         own separate setting that can not be turned off from the command
14869         line using --unchecked or --checked and is only controlled using
14870         the checked/unchecked statements and expressions.  This setting is
14871         used by the constant folder to flag errors.
14872
14873         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14874         ConstantCheckState as well.   
14875
14876         During Resolve, they also have to flag the state, because the
14877         constant folder runs completely in the Resolve phase.
14878
14879         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14880         well.
14881
14882 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14883
14884         * cfold.cs: New file, this file contains the constant folder.
14885
14886         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14887         argument to track whether we are using the resulting address to
14888         load or store a value and provide better error messages. 
14889
14890         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14891         new AddressOf arguments.
14892
14893         * statement.cs (Foreach.EmitCollectionForeach): Update
14894
14895         * expression.cs (Argument.Emit): Call AddressOf with proper
14896         arguments to track usage.
14897
14898         (New.DoEmit): Call AddressOf with new arguments.
14899
14900         (Unary.Emit): Adjust AddressOf call.
14901
14902 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14903
14904         * cs-parser.jay (member_access): Change the case for pre-defined types
14905         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14906         this suggestion.
14907
14908         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14909         a method body.
14910
14911         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14912         essentially like methods and apply attributes like MethodImplOptions to them too.
14913
14914         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14915         not being null.
14916
14917         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14918         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14919         is the DeclSpace.
14920
14921         * Update code everywhere accordingly.
14922
14923         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14924
14925         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14926
14927 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14928
14929         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14930         try performing lookups against those instead of jumping straight into using
14931         the 'using' clauses.
14932
14933         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14934
14935         (LookupType): Perform lookups in implicit parents too.
14936
14937         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14938         sequence as RootContext.LookupType. 
14939
14940         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14941         the various cases of namespace lookups into this method.
14942
14943 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14944
14945         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14946         in positional arguments)
14947
14948         * class.cs (Operator): Update the AllowedModifiers to contain
14949         extern. 
14950
14951         * cs-parser.jay: Update operator declaration to allow for the
14952         operator body to be empty.
14953
14954         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14955         values. 
14956
14957 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14958
14959         * class.cs (Method.Emit): Label parameters.
14960
14961         * driver.cs: Return 1 or 0 as the program exit code.
14962
14963 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14964
14965         * expression.cs: Special case the `null' object when trying to
14966         auto-compute the type, as anything can be explicitly converted to
14967         that. 
14968
14969         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14970         spotting this Paolo.
14971
14972         (Expression.ImplicitNumericConversion): Perform comparissions of
14973         the type using the underlying type in the case of an enumeration
14974         rather than using the enumeration type for the compare.
14975
14976         Cope with the underlying == type case, which is not possible to
14977         catch before. 
14978
14979         (Expression.ConvertNumericExplicit): Perform comparissions of
14980         the type using the underlying type in the case of an enumeration
14981         rather than using the enumeration type for the compare.
14982
14983         * driver.cs: If the user does not supply an extension, assume .exe
14984
14985         * cs-parser.jay (if_statement): Rewrote so that we can track the
14986         location for the if statement.
14987
14988         * expression.cs (Binary.ConstantFold): Only concat strings when
14989         the operation is "+", not everything ;-)
14990
14991         * statement.cs (Statement.EmitBoolExpression): Take a location
14992         argument. 
14993         (If, While, Do): Track location.
14994
14995         * expression.cs (Binary.ResolveOperator): In the object + string
14996         case, I was missing a call to ConvertImplicit
14997
14998 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14999
15000         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15001         Location arguments. Ensure we use RootContext.LookupType to do our work
15002         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15003
15004         * interface.cs (PopulateMethod): Handle the type of the parameter being
15005         null gracefully.
15006
15007         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15008         have a params method with no fixed arguments and a call is made with no
15009         arguments.
15010
15011 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15012
15013         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15014         the verbatim-string-literal
15015
15016         * support.cs (InternalParameters.ParameterModifier): handle null
15017         fixed parameters.
15018         (InternalParameters.ParameterType): ditto.
15019
15020         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15021         duplicating the name of the variable parameter.
15022         (GetParameterByName): Fix bug where we were not looking up array
15023         paramters if they were the only present (thanks Paolo!).
15024         (GetParameterInfo): We only have an empty set of types if both
15025         fixed and array are set to null.
15026         (GetParameterInfo-idx): Handle FixedParameter == null
15027
15028         * cs-parser.jay: Handle the case where there is no catch
15029         statements (missing null test).
15030
15031 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * driver.cs (MainDriver): Be conservative on our command line
15034         handling.
15035
15036         Catch DirectoryNotFoundException when calling GetFiles.
15037
15038         (SplitPathAndPattern): Used to split the input specification into
15039         a path and a pattern that we can feed to Directory.GetFiles.
15040
15041 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * statement.cs (Fixed): Implement the last case of the Fixed
15044         statement (string handling).
15045
15046         * expression.cs (StringPtr): New class used to return a char * to
15047         a string;  Used by the Fixed statement.
15048
15049         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15050
15051         * expression.cs (Binary.ResolveOperator): Remove redundant
15052         MemberLookup pn parent type.
15053         Optimize union call, we do not need a union if the types are the same.
15054         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15055         type.
15056
15057         Specialize the use of MemberLookup everywhere, instead of using
15058         the default settings. 
15059
15060         (StackAlloc): Implement stackalloc keyword.
15061
15062         * cs-parser.jay: Add rule to parse stackalloc.
15063
15064         * driver.cs: Handle /h, /help, /?
15065
15066         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15067         before we supported unsafe code.
15068
15069         * makefile: add --unsafe to the self compilation of mcs.
15070
15071 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * expression.cs (PointerArithmetic): New class that is used to
15074         perform pointer arithmetic.
15075         (Binary.Resolve): Handle pointer arithmetic
15076         Handle pointer comparission.
15077         (ArrayPtr): Utility expression class that is used to take the
15078         address of an array.
15079
15080         (ElementAccess): Implement array access for pointers
15081
15082         * statement.cs (Fixed): Implement fixed statement for arrays, we
15083         are missing one more case before we are done.
15084
15085         * expression.cs (Indirection): Implement EmitAssign and set the
15086         ExprClass to Variable.  This allows pointer dereferences to be
15087         treated as variables, and to have values assigned to them.
15088
15089         * ecore.cs (Expression.StoreFromPtr): New utility function to
15090         store values dereferencing.
15091
15092 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15093
15094         * expression.cs (Binary.ResolveOperator): Ensure that we are
15095         not trying to operate on a void type - this fixes the reported
15096         bug.
15097
15098         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15099         the parent implementation is sealed.
15100
15101         * ../errors/cs0239.cs : Add.
15102
15103         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15104
15105         * typemanager.cs (unverifiable_code_type): Corresponds to 
15106         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15107         which have unsafe code in them.
15108
15109         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15110         unsafe context.
15111
15112 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * cs-tokenizer.cs: Add support for @"litreal strings"
15115
15116         Make tokenizer accept pre-processor directives
15117         on any column (remove the old C-like limitation). 
15118
15119         * rootcontext.cs (EmitCode): Emit any global attributes.
15120         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15121
15122         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15123
15124         * cs-parser.jay: Add support for global attributes.  
15125
15126 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15127
15128         * expression.cs (Indirection): New helper class.  Unary will
15129         create Indirection classes to be able to implement the
15130         IMemoryLocation interface on it.
15131
15132 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15133
15134         * cs-parser.jay (fixed_statement): reference the right statement.
15135
15136         * statement.cs (Fixed.Emit): Finish implementing the fixed
15137         statement for the &x case.
15138
15139 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * class.cs (Property.Define, Method.Define): Remove newslot when
15142         `implementing'.  
15143
15144         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15145         wrong.  NewSlot should only be used if the `new' keyword is present.
15146
15147         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15148         locating our system dir.  Sorry about this.
15149
15150 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15151
15152         * driver.cs (GetSystemDir): Compute correctly the location of our
15153         system assemblies.  I was using the compiler directory instead of
15154         the library directory.
15155
15156 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15157
15158         * expression.cs (BetterFunction): Put back in what Miguel commented out
15159         since it is the correct fix. The problem is elsewhere ;-)
15160
15161         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15162         parameters of the parms method are themselves compatible or not !
15163
15164         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15165         to check that a class implements an interface before saying that an implicit
15166         conversion was allowed. Use ImplementsInterface to do the checking.
15167
15168 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15169
15170         * class.cs (Method.Define): Track whether we are an explicit
15171         implementation or not.  And only call DefineMethodOverride if we
15172         are an explicit implementation.
15173
15174         (Property.DefineMethod): Ditto.
15175
15176 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15177
15178         * expression.cs (BetterFunction): Catch hideous bug which was
15179          preventing us from detecting ambiguous calls due to implicit casts i.e
15180         cs0121.
15181
15182 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15183
15184         * support.cs (Pair): Remove un-needed method.  I figured why I was
15185         getting the error in cs-parser.jay, the variable in a foreach loop
15186         is readonly, and the compiler does not really treat this as a variable.
15187
15188         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15189         instead of EQUALS in grammar.  
15190
15191         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15192
15193         * expression.cs (Unary.DoResolve): Check whether the argument is
15194         managed or not.
15195
15196 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15197
15198         * support.cs: Api for Pair to set a value.  Despite the fact that
15199         the variables are public the MS C# compiler refuses to compile
15200         code that accesses the field if the variable is part of a foreach
15201         statement. 
15202
15203         * statement.cs (Fixed): Begin implementation of the fixed
15204         statement.
15205
15206         (Block.AddVariable): Return the VariableInfo on success and null
15207         on failure instead of true/false. 
15208
15209         * cs-parser.jay (foreach): Catch errors on variables already
15210         defined (we were ignoring this value before) and properly unwind
15211         the block hierarchy
15212
15213         (fixed_statement): grammar for the fixed statement.
15214
15215 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15216
15217         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15218         pointer types to be incretemented.
15219
15220         (SizeOf): Implement.
15221
15222         * cs-parser.jay (pointer_member_access): Implement
15223         expr->IDENTIFIER production.
15224
15225         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15226         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15227         on safe contexts.
15228
15229         (Unary): Implement indirection.
15230
15231         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15232         use in non-unsafe context).
15233
15234         (SimpleName.DoResolve): Check for pointers in field access on safe
15235         contexts. 
15236
15237         (Expression.LoadFromPtr): Factor the load-indirect code in this
15238         function.  This was duplicated in UnboxCast and ParameterReference
15239
15240 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15241
15242         * expression.cs (ComposedCast): report an error if a pointer cast
15243         is used in a safe region.
15244
15245         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15246         pointer type casts in unsafe context.
15247
15248         * codegen.cs (EmitContext): Set up IsUnsafe.
15249
15250         * cs-parser.jay (non_expression_type): Add productions for pointer
15251         casts. 
15252
15253         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15254         code.  We should not use force into static mode if the method is
15255         not virtual.  Fixes bug in MIS
15256
15257         * statement.cs (Do.Emit, While.Emit, For.Emit,
15258         Statement.EmitBoolExpression): Add support to Do and While to
15259         propagate infinite loop as `I do return' semantics.
15260
15261         Improve the For case to also test for boolean constants.
15262
15263         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15264         to the list of attributes we can add.
15265
15266         Remove `EmitContext' argument.
15267
15268         * class.cs (Method.Define): Apply parameter attributes.
15269         (Constructor.Define): Apply parameter attributes.
15270         (MethodCore.LabelParameters): Move here the core of labeling
15271         parameters. 
15272
15273         * support.cs (ReflectionParameters.ParameterModifier,
15274         InternalParameters.ParameterModifier): Use IsByRef on the type and
15275         only return the OUT bit for these parameters instead of in/out/ref
15276         flags.
15277
15278         This is because I miss-understood things.  The ParameterInfo.IsIn
15279         and IsOut represent whether the parameter has the [In] and [Out]
15280         attributes set.  
15281
15282 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15283
15284         * ecore.cs (FieldExpr.Emit): Release temporaries.
15285
15286         * assign.cs (LocalTemporary.Release): new function.
15287
15288         * codegen.cs (EmitContext.GetTemporaryStorage,
15289         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15290         temporary storage.  Now we can "put back" localbuilders when we
15291         are done with them
15292
15293 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15294
15295         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15296         need to make a copy of the variable to generate verifiable code.
15297
15298 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * driver.cs: Compute dynamically the system directory.
15301
15302         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15303         Slower, but more generally useful.  Used by the abstract
15304         registering implementation. 
15305
15306         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15307         the rules for the special rule on Type/instances.  First check if
15308         we have the same name, and if so, try that special static path
15309         rather than the instance path.
15310
15311 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15312
15313         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15314         for, while and if.
15315
15316         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15317         Enum, ValueType, Delegate or Array for non-corlib compiles.
15318
15319         * cs-tokenizer.cs: Catch long identifiers (645)
15320
15321         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15322         piece of code.
15323
15324         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15325         fix, we were returning too early, so we were not registering
15326         pending methods from abstract classes.
15327
15328         Do not register pending methods if the class is abstract.
15329
15330         * expression.cs (Conditional.DoResolve): Report circular implicit
15331         conversions when we neecd to compute it for conditional
15332         expressions. 
15333
15334         (Is.DoResolve): If the expression is always of the provided type,
15335         flag warning 183.  If the expression can not ever be of the
15336         provided type flag warning 184.
15337
15338         * class.cs: Catch 169 as well.
15339
15340         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15341         read. 
15342
15343 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15344
15345         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15346
15347 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15348
15349         * interface.cs: (PopulateMethod): Check for pointers being defined
15350         only if the unsafe context is active.
15351         (PopulateProperty): ditto.
15352         (PopulateIndexer): ditto.
15353
15354         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15355         specified.  If pointers are present, make sure that they are
15356         present in an unsafe context.
15357         (Constructor, Constructor.Define): ditto.
15358         (Field, Field.Define): ditto.
15359         (Property, Property.Define): ditto.
15360         (Event, Event.Define): ditto.
15361
15362         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15363         hashtable if there are classes or structs defined.
15364
15365         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15366         code, as the constant resolution moved.
15367
15368         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15369         the metadata, so we can flag error 133. 
15370
15371         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15372         pointer is being declared in an unsafe context.
15373
15374 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * modifiers.cs (Modifiers.Check): Require a Location argument.
15377         Report error 227 for Unsafe use.
15378
15379         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15380
15381         * statement.cs (For.Emit): If the test is null, then report that
15382         we do `return', as we wont reach anything afterwards.
15383
15384         (Switch.SwitchGoverningType): Track the expression that matched
15385         the conversion.
15386
15387         * driver.cs: Allow negative numbers as an error code to flag.
15388
15389         * cs-parser.jay: Handle 1551.
15390
15391         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15392
15393 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15394
15395         * cs-parser.jay: Report 1518 (type declaration can only contain
15396         class, struct, interface, enum or delegate)
15397
15398         (switch_label): Report 1523 (keywords `case' or `default' must
15399         preced code)
15400
15401         (opt_switch_sections): Report 1522 (empty switch)
15402
15403         * driver.cs: Report 1515 (response file specified multiple times)
15404         Report 1516 (Source file specified multiple times).
15405
15406         * expression.cs (Argument.Resolve): Signal 1510
15407
15408         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15409         access not allowed in static code)
15410
15411 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15412
15413         * typemanager.cs (IsPointerType): Utility method which we are going
15414         to need a lot.
15415
15416         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15417         the object type, so we take care of that.
15418
15419         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15420
15421         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15422         added to non-params parameters :-)
15423
15424         * typemanager.cs (CSharpName): Include 'void' type too. 
15425
15426         (void_ptr_type): Include in the set of core types.
15427
15428         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15429         duplicating code.
15430
15431         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15432         an unsafe context.
15433
15434         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15435         completely forgotten about it.
15436
15437 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15438
15439         * cs-parser.jay (pointer_type): Add. This begins our implementation
15440         of parsing rules for unsafe code.
15441
15442         (unsafe_statement): Implement.
15443
15444         (embedded_statement): Modify to include the above.
15445
15446         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15447
15448         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15449         if the current context is an unsafe one.
15450
15451         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15452         are handled differently, we need separate rules for them.
15453
15454         (local_variable_declaration): Update to use local_variable_pointer_type
15455         to allow variable declarations of unmanaged pointer types.
15456
15457         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15458         in unsafe contexts.
15459
15460         * ../errors/cs0214.cs : Add.
15461
15462 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15463
15464         * makefile: remove 'response' file when cleaning.
15465
15466 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15467
15468         * cs-parser.jay: Report 1524.
15469
15470 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15471
15472         * typemanager.cs (RegisterMethod): drop checking if we have
15473         registered this from here
15474
15475 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * class.cs (Method.EmitDestructor): Implement calling our base
15478         destructor. 
15479
15480         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15481         value of InFinally.
15482
15483         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15484         this routine and will wrap the call in a try/catch block.  Deal
15485         with the case.
15486
15487 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15488
15489         * ecore.cs (Expression.MemberLookup): instead of taking a
15490         parameter `same_type' that was used to tell whether we could
15491         access private members we compute our containing type from the
15492         EmitContext.
15493
15494         (FieldExpr): Added partial support for volatile fields.  This does
15495         not work for volatile fields exposed from assemblies, as I can not
15496         figure out how to extract the modreq from it.
15497
15498         Updated all the source files to use this.
15499
15500         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15501         because it is referenced by MemberLookup very often. 
15502
15503 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15504
15505         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15506         TypeBuilder.GetCustomAttributes to retrieve what we need.
15507
15508         Get rid of redundant default_member_attr_type as this is the same as
15509         default_member_type which already exists.
15510
15511         * interface.cs, attribute.cs : Update accordingly.
15512
15513 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15514
15515         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15516         work for TYpeBuilders though.  Ravi, can you please fix this?
15517
15518         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15519
15520         * expression.cs (Argument.Emit): Handle the case of ref objects
15521         being passed to ref functions;  
15522
15523         (ParameterReference.EmitLoad): Loads the content of the pointer
15524         without dereferencing.
15525
15526 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15527
15528         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15529
15530 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15531
15532         * class.cs (Indexer.DefineMethod): Incorporate the interface
15533         type in the name of the method if we are doing explicit interface
15534         implementation.
15535
15536         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15537
15538         (BetterConversion): Fix extremely trivial bug where we were referring to
15539         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15540         again !
15541
15542         * ../errors/bug16.cs : Add although we have fixed it.
15543
15544 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * expression.cs (BaseIndexer): Begin implementation.
15547
15548         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15549
15550         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15551         production directly to remove a shift/reduce, and implement
15552         explicit interface implementation.
15553
15554         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15555         after a floating point suffix.
15556
15557         * expression.cs (DoNumericPromotions): Improved the conversion for
15558         uint/uint.  If we have a constant, we avoid doing a typecast to a
15559         larger type.
15560
15561         * class.cs (Indexer): Implement explicit interface implementation
15562         for indexers.
15563
15564 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15565
15566         * class.cs: make the default instance constructor public and hidebysig.
15567
15568 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15569
15570         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15571         so we can call it from elsewhere.
15572
15573         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15574         we emit it internally if the class has a defined indexer; otherwise the user
15575         emits it by decorating the class definition with the DefaultMemberAttribute.
15576
15577         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15578         attribute is not used on a type which defines an indexer.
15579
15580         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15581         character when we skip whitespace.
15582
15583         * ../errors/cs0646.cs : Add.
15584
15585 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15588         again. 
15589
15590         * makefile: Add practical target `mcs3.exe' which builds the third
15591         generation compiler. 
15592
15593         * expression.cs (New): Fix structures constructor calling.
15594
15595         * class.cs (Property, Method, Indexer): Emit Final flag on the
15596         method if we are an interface implementation and we are not
15597         abstract. 
15598
15599         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15600         whether this property is referencing a `base' method.
15601
15602         * expression.cs (Invocation.EmitCall): take an extra argument:
15603         is_base, this is used to determine whether the `call' or
15604         `callvirt' opcode should be used.
15605
15606
15607         * delegate.cs: update EmitCall.
15608
15609         * class.cs (Method.Define): Set NewSlot for the cases where we are
15610         not implementing an interface method.
15611
15612         (Property.Define): ditto.
15613
15614 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15617         'r'.  Allows mcs to parse itself fully.
15618
15619 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15620
15621         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15622         of the number of initializers that require the InitializeArray method.
15623
15624         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15625         update the above field where necessary.
15626
15627         (MakeByteBlob): Update accordingly.
15628
15629         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15630         greater than 2.
15631
15632         (EmitDynamicInitializers): Update in accordance with the new optimization.
15633
15634         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15635         same OpCode applies.
15636
15637         * cs-parser.jay : Fix some glaring errors I introduced.
15638
15639 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15640
15641         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15642         so that we can check for name clashes there too.
15643
15644         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15645         for interface indexers.
15646
15647         * interfaces.cs (Define): Emit the default member attribute.
15648
15649         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15650         variable was being referred to while setting the value ;-)
15651
15652 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15653
15654         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15655         byte-by-byte information when we know the data is zero.
15656
15657         Make the block always a multiple of 4, because
15658         DefineInitializedData has a bug.
15659
15660         * assign.cs: Fix, we should assign from the temporary, not from
15661         the source. 
15662
15663         * expression.cs (MakeByteBlob): Fix my incorrect code.
15664
15665 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15666
15667         * typemanager.cs (EnumToUnderlying): This function is used to get
15668         the underlying type from an enumeration, because it does not
15669         always work. 
15670
15671         * constant.cs: Use the I4_S form for values between -128 and 127.
15672
15673         * statement.cs (Block.LookupLabel): Looks up a label.
15674         (Block): Drop support for labeled blocks.
15675
15676         (LabeledStatement): New kind of statement that represents a label
15677         only.
15678
15679         (Goto): Finally implement this bad boy.
15680
15681         * cs-parser.jay: Update to reflect new mechanism to implement
15682         labels.
15683
15684 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15685
15686         * codegen.cs (EmitContext.This): a codegen property that keeps the
15687         a single instance of this instead of creating many different this
15688         instances. 
15689
15690         * delegate.cs (Delegate.DoResolve): Update to use the property;
15691
15692         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15693
15694         * expression.cs (BaseAccess.DoResolve): Ditto.
15695
15696 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15697
15698         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15699         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15700
15701         (InitCoreTypes): Update accordingly.
15702
15703         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15704         so we can quickly store the state.
15705
15706         (ApplyAttributes): Set the correct implementation flags
15707         for InternalCall methods.
15708
15709 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15710
15711         * expression.cs (EmitCall): if a method is not virtual, then do
15712         not use callvirt on it.
15713
15714         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15715         user defined stuff) requires the use of stobj, which takes an
15716         address on the stack instead of an array and an index.  So emit
15717         the Ldelema operation for it.
15718
15719         (EmitStoreOpcode): Use stobj for valuetypes.
15720
15721         (UnaryMutator.EmitCode): Use the right 1 value depending on
15722         whether we are dealing with int64/uint64, float or doubles.
15723
15724         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15725         constructors that I implemented last night.
15726
15727         (Constructor.IsDefault): Fix to work properly for static
15728         constructors.
15729
15730         * cs-parser.jay (CheckDef): report method signature errors.
15731         Update error number 103 to be 132.
15732
15733         * decl.cs: New AdditionResult enumeration value: MethodExists.
15734         Although we do this check for methods later on in the semantic
15735         analysis, catching repeated default constructors is so easy that
15736         we catch these here. 
15737
15738         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15739         promotions code.
15740
15741         (ParameterReference.EmitAssign, Emit): handle
15742         bools as bytes.
15743
15744         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15745         (ArrayAccess.EmitStoreOpcode): ditto.
15746
15747         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15748
15749         * expression.cs (MakeByteBlob): Complete all the missing types
15750         (uint, short, ushort, byte, sbyte)
15751
15752         * class.cs: Only init instance field initializers on instance
15753         constructors. 
15754
15755         Rename `constructors' to instance_constructors. 
15756
15757         (TypeContainer.AddConstructor): Only add constructors to the list
15758         if it is not static.
15759
15760         Make sure that we handle default_static_constructor independently
15761         everywhere where we handle instance_constructors
15762
15763 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * class.cs: Do not lookup or create a base initializer for a
15766         static constructor.
15767
15768         (ConstructorInitializer.Resolve): use the proper type to lookup
15769         for constructors.
15770
15771         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15772
15773         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15774         in DeclSpace. 
15775
15776         * decl.cs: CloseType is now an virtual method, the default
15777         implementation just closes this type.
15778
15779 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15780
15781         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15782         to PreserveSig by default. Also emit HideBySig on such methods.
15783
15784         Basically, set the defaults to standard values.
15785
15786         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15787         argument, if candidate is better, it can't be worse than the best !
15788
15789         (Invocation): Re-write bits to differentiate between methods being
15790         applicable in their expanded form and their normal form - for params
15791         methods of course.
15792
15793         Get rid of use_standard everywhere as only standard conversions are allowed
15794         in overload resolution. 
15795
15796         More spec conformance.
15797
15798 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15799
15800         * driver.cs: Add --timestamp, to see where the compiler spends
15801         most of its time.
15802
15803         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15804         `this' in static code.
15805
15806         (SimpleName.DoResolve): Implement in terms of a helper function
15807         that allows static-references to be passed upstream to
15808         MemberAccess.
15809
15810         (Expression.ResolveWithSimpleName): Resolve specially simple
15811         names when called by MemberAccess to implement the special
15812         semantics. 
15813
15814         (Expression.ImplicitReferenceConversion): Handle conversions from
15815         Null to reference types before others, as Null's type is
15816         System.Object. 
15817
15818         * expression.cs (Invocation.EmitCall): Handle the special case of
15819         calling methods declared on a reference type from a ValueType
15820         (Base classes System.Object and System.Enum)
15821
15822         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15823         the left hand side is a TypeExpr, not on every enumeration. 
15824
15825         (Binary.Resolve): If types are reference types, then do a cast to
15826         object on operators != and == of both arguments.
15827
15828         * typemanager.cs (FindMembers): Extract instance and static
15829         members if requested.
15830
15831         * interface.cs (PopulateProperty): Use void_type instead of null
15832         as the return type for the setter method.
15833
15834         (PopulateIndexer): ditto.
15835
15836 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15837
15838         * support.cs (ReflectionParameters): Fix minor bug where we
15839         were examining the wrong parameter for the ParamArray attribute.
15840
15841         Cope with requests for the type of the parameter at position
15842         greater than the params parameter's. We now return the element
15843         type of the params array as that makes more sense.
15844
15845         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15846         accordingly as we no longer have to extract the element type
15847         ourselves.
15848
15849         (Invocation.OverloadResolve): Update.
15850
15851 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15852
15853         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15854         against IEnumerator, test whether the return value is a descendant
15855         of the IEnumerator interface.
15856
15857         * class.cs (Indexer.Define): Use an auxiliary method to implement
15858         the other bits of the method definition.  Begin support for
15859         explicit interface implementation.
15860
15861         (Property.DefineMethod): Use TypeManager.void_type instead of null
15862         for an empty return value.
15863
15864 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15865
15866         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15867         dealing with a FieldExpr which is composed of a FieldBuilder, in
15868         the code path we did extract the constant, but we should have
15869         obtained the underlying value to be able to cast it (otherwise we
15870         end up in an infinite loop, this is what Ravi was running into).
15871
15872         (ArrayCreation.UpdateIndices): Arrays might be empty.
15873
15874         (MemberAccess.ResolveMemberAccess): Add support for section
15875         14.5.4.1 that deals with the special case of E.I when E is a type
15876         and something else, that I can be a reference to a static member.
15877
15878         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15879         handle a particular array type to create byte blobs, it is just
15880         something we dont generate byteblobs for.
15881
15882         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15883         arguments. 
15884
15885         * location.cs (Push): remove the key from the hashtable that we
15886         are about to add.   This happens for empty files.
15887
15888         * driver.cs: Dispose files after we have parsed them.
15889
15890         (tokenize): new function that only runs the tokenizer on its
15891         input, for speed testing.
15892
15893 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15894
15895         * class.cs (Event.Define): Define the private field only if there
15896         are no accessors defined.
15897
15898         * expression.cs (ResolveMemberAccess): If there is no associated
15899         field with the event, that means we have an event defined with its
15900         own accessors and we should flag error cs0070 since transforming
15901         ourselves into a field is not valid in that case.
15902
15903         * ecore.cs (SimpleName.DoResolve): Same as above.
15904
15905         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15906         and charset to sane values.
15907
15908 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15909
15910         * assign.cs (DoResolve): Perform check on events only if they 
15911         are being accessed outside the declaring type.
15912
15913         * cs-parser.jay (event_declarations): Update rules to correctly
15914         set the type of the implicit parameter etc.
15915
15916         (add_accessor, remove_accessor): Set current local parameters.
15917
15918         * expression.cs (Binary): For delegate addition and subtraction,
15919         cast the return value from the method into the appropriate delegate
15920         type.
15921
15922 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15923
15924         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15925         of these as the workaround is unnecessary.
15926
15927         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15928         delegate data - none of that is needed at all.
15929
15930         Re-write bits to extract the instance expression and the delegate method
15931         correctly.
15932
15933         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15934         on delegates too.
15935
15936         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15937         of attaching attributes instead of duplicating code everywhere.
15938
15939         * everywhere : Update code to do attribute emission using the above method.
15940
15941 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * expression.cs (IsParamsMethodApplicable): if there are not
15944         parameters, return immediately.
15945
15946         * ecore.cs: The 0 literal can be implicity converted to an enum
15947         type. 
15948
15949         (SimpleName.DoResolve): First lookup the type, then lookup the
15950         members. 
15951
15952         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15953         want to get its address.  If the InstanceExpression is not
15954         addressable, store the result in a temporary variable, then get
15955         the address of it.
15956
15957         * codegen.cs: Only display 219 errors on warning level or above. 
15958
15959         * expression.cs (ArrayAccess): Make it implement the
15960         IMemoryLocation interface.
15961
15962         (Binary.DoResolve): handle the operator == (object a, object b)
15963         and operator != (object a, object b) without incurring into a
15964         BoxedCast (because 5 != o should never be performed).
15965
15966         Handle binary enumerator operators.
15967
15968         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15969         value type, otherwise use Ldelem_ref.
15970
15971         Use precomputed names;
15972
15973         (AddressOf): Implement address of
15974
15975         * cs-parser.jay (labeled_statement): Fix recursive block
15976         addition by reworking the production.
15977
15978         * expression.cs (New.DoEmit): New has a special case:
15979                 
15980                  If we are dealing with a ValueType, we have a few
15981                  situations to deal with:
15982                 
15983                     * The target of New is a ValueType variable, that is
15984                       easy, we just pass this as the variable reference
15985                 
15986                     * The target of New is being passed as an argument,
15987                       to a boxing operation or a function that takes a
15988                       ValueType.
15989                 
15990                       In this case, we need to create a temporary variable
15991                       that is the argument of New.
15992
15993
15994 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15995
15996         * rootcontext.cs (LookupType): Check that current_type is not null before
15997         going about looking at nested types.
15998
15999         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16000         not implement the IAssignMethod interface any more.
16001
16002         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16003         where we tranform them into FieldExprs if they are being resolved from within
16004         the declaring type.
16005
16006         * ecore.cs (SimpleName.DoResolve): Do the same here.
16007
16008         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16009
16010         * ../errors/bug10.cs : Add.
16011
16012         * ../errors/cs0070.cs : Add.
16013
16014         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16015
16016         * assign.cs : Get rid of EventIsLocal everywhere.
16017
16018 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16019
16020         * ecore.cs (ConvertIntLiteral): finished the implementation.
16021
16022         * statement.cs (SwitchLabel): Convert the value we are using as a
16023         key before looking up the table.
16024
16025 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * codegen.cs (EmitTopBlock): Require a Location argument now.
16028
16029         * cs-parser.jay (constructor_declarator): We need to setup
16030         current_local_parameters before we parse the
16031         opt_constructor_initializer, to allow the variables to be bound
16032         to the constructor arguments.
16033
16034         * rootcontext.cs (LookupType): First lookup nested classes in our
16035         class and our parents before we go looking outside our class.
16036
16037         * expression.cs (ConstantFold): Extract/debox the values at the
16038         beginnning. 
16039
16040         * rootcontext.cs (EmitCode): Resolve the constants first before we
16041         resolve the types.  This is not really needed, but it helps debugging.
16042
16043         * statement.cs: report location.
16044
16045         * cs-parser.jay: pass location to throw statement.
16046
16047         * driver.cs: Small bug fix.
16048
16049         * report.cs: Updated format to be 4-zero filled digits.
16050
16051 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16052
16053         * expression.cs (CheckIndices): Fix minor bug where the wrong
16054         variable was being referred to ;-)
16055
16056         (DoEmit): Do not call EmitStaticInitializers when the 
16057         underlying type is System.Object.
16058
16059 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16060
16061         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16062         and do the usual workaround for SRE.
16063
16064         * class.cs (MyEventBuilder.EventType): New member to get at the type
16065         of the event, quickly.
16066
16067         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16068
16069         * assign.cs (Assign.DoResolve): Handle the case when the target
16070         is an EventExpr and perform the necessary checks.
16071
16072         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16073         interface.
16074
16075         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16076
16077         (EventExpr): Set the type in the constructor itself since we 
16078         are meant to be born fully resolved.
16079
16080         (EventExpr.Define): Revert code I wrote earlier.
16081                 
16082         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16083         instance expression is null. The instance expression is a This in that case
16084         or a null, depending on whether it is a static method or not.
16085
16086         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16087         refers to more than one method.
16088
16089         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16090         and accordingly flag errors.
16091
16092 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16093
16094         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16095
16096 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * location.cs (ToString): Provide useful rutine.
16099
16100 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16101
16102         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16103         objects, return the actual integral boxed.
16104
16105         * statement.cs (SwitchLabel): define an ILLabel for each
16106         SwitchLabel. 
16107
16108         (Switch.CheckSwitch): If the value is a Literal, extract
16109         the underlying literal.
16110
16111         Also in the unused hashtable we had, add the SwitchLabel so we can
16112         quickly look this value up.
16113
16114         * constant.cs: Implement a bunch of new constants.  Rewrite
16115         Literal based on this.  Made changes everywhere to adapt to this.
16116
16117         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16118         dereferencing array only once, and also copes with enumrations.
16119
16120         bytes are two bytes wide, not one.
16121
16122         (Cast): Perform constant conversions.
16123
16124         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16125         wrappers to the literals here.
16126
16127         * expression.cs (DoNumericPromotions): long literals can converted
16128         to ulong implicity (this is taken care of elsewhere, but I was
16129         missing this spot).
16130
16131         * ecore.cs (Expression.Literalize): Make the return type Literal,
16132         to improve type checking.
16133
16134         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16135
16136 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16137
16138         * literal.cs: Revert code from ravi that checked the bounds.  The
16139         bounds are sane by the definition of the type itself. 
16140
16141         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16142         need to actually look up in our parent hierarchy for interfaces
16143         implemented. 
16144
16145         * const.cs: Use the underlying type for enumerations
16146
16147         * delegate.cs: Compute the basename for the delegate creation,
16148         that should fix the delegate test case, and restore the correct
16149         Type Lookup semantics in rootcontext
16150
16151         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16152         referencing a nested type with the Reflection API is using the "+"
16153         sign. 
16154
16155         * cs-parser.jay: Do not require EOF token at the end.
16156
16157 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16158
16159         * rootcontext.cs (LookupType): Concatenate type names with
16160         a '.' instead of a '+' The test suite passes again.
16161
16162         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16163         field of the enumeration.
16164
16165         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16166         the case when the member is an EventExpr.
16167
16168         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16169         static has an associated instance expression.
16170
16171         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16172
16173         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16174
16175         * class.cs (Event.Define): Register event and perform appropriate checks
16176         for error #111.
16177
16178         We define the Add and Remove methods even if the use provides none because
16179         in that case, we provide default implementations ourselves.
16180
16181         Define a private field of the type of the event. This is done by the CSC compiler
16182         and we should be doing it too ;-)
16183
16184         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16185         More methods we use in code we generate.
16186
16187         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16188         is important.
16189
16190         (InitCoreTypes): Update accordingly for the above.
16191
16192         * class.cs (Event.Emit): Generate code for default accessors that we provide
16193
16194         (EmitDefaultMethod): Do the job in the above.
16195
16196         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16197         appropriate place.
16198
16199 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16200
16201         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16202         builders even if we were missing one.
16203
16204         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16205         pass the Basename as our class name instead of the Name.  The
16206         basename will be correctly composed for us.
16207
16208         * parameter.cs (Paramters): Now takes a Location argument.
16209
16210         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16211         make all the code call directly LookupType in RootContext and take
16212         this chance to pass the Location information everywhere.
16213
16214         * Everywhere: pass Location information.
16215
16216 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16217
16218         * class.cs (Constructor.Define): Updated way of detecting the
16219         length of the parameters.
16220
16221         (TypeContainer.DefineType): Use basename as the type name for
16222         nested types.
16223
16224         (TypeContainer.Define): Do not recursively define types here, as
16225         definition is taken care in order by the RootContext.
16226
16227         * tree.cs: Keep track of namespaces in a per-file basis.
16228
16229         * parameter.cs (Parameter.ComputeSignature): Update to use
16230         DeclSpace. 
16231
16232         (Parameters.GetSignature): ditto.
16233
16234         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16235         instead of a TypeContainer.
16236
16237         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16238         resolve names.  Because we need to be resolve in our context, not
16239         our parents.
16240
16241         * driver.cs: Implement response files.
16242
16243         * class.cs (TypeContainer.DefineType): If we are defined, do not
16244         redefine ourselves.
16245
16246         (Event.Emit): Emit the code for add/remove handlers.
16247         (Event.Define): Save the MethodBuilders for add/remove.
16248
16249         * typemanager.cs: Use pair here too.
16250
16251         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16252         DictionaryEntry requires the first argument to be non-null.  
16253
16254         (enum_declaration): Compute full name for registering the
16255         enumeration.
16256
16257         (delegate_declaration): Instead of using
16258         formal_parameter_list, use opt_formal_parameter_list as the list
16259         can be empty.
16260
16261         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16262         (EventParsing): New property that controls whether `add' and
16263         `remove' are returned as tokens or identifiers (for events);
16264
16265 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16266
16267         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16268         use MyEventBuilder only and let it wrap the real builder for us.
16269
16270         (MyEventBuilder): Revamp constructor etc.
16271
16272         Implement all operations that we perform on EventBuilder in precisely the same
16273         way here too.
16274
16275         (FindMembers): Update to use the EventBuilder member.
16276
16277         (Event.Emit): Update accordingly.
16278
16279 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16280
16281         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16282         by calling the appropriate methods.
16283
16284         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16285         useful.
16286
16287         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16288
16289 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16290
16291         * delegate.cs (Delegate.Populate): Check that the return type
16292         and various parameters types are indeed accessible.
16293
16294         * class.cs (Constructor.Define): Same here.
16295
16296         (Field.Define): Ditto.
16297
16298         (Event.Define): Ditto.
16299
16300         (Operator.Define): Check that the underlying Method defined itself
16301         correctly - so it's MethodBuilder should not be null.
16302
16303         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16304         expression happens to be null.
16305
16306         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16307         members but as of now we don't seem to be able to do anything really useful with it.
16308
16309         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16310         not the EventBuilder.
16311
16312 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16313
16314         * cs-tokenizer.cs: Add support for defines.
16315         Add support for #if, #elif, #else, #endif
16316
16317         (eval_var): evaluates a variable.
16318         (eval): stubbed for evaluating functions.
16319
16320         * cs-parser.jay: Pass the defines information
16321
16322         * driver.cs: Add --define command line option.
16323
16324         * decl.cs: Move MemberCore here.
16325
16326         Make it the base class for DeclSpace.  This allows us to catch and
16327         report 108 and 109 for everything now.
16328
16329         * class.cs (TypeContainer.Define): Extract all the members
16330         before populating and emit the warning 108 (new keyword required
16331         to override) instead of having each member implement this.
16332
16333         (MemberCore.Define): New abstract method, we will be using this in
16334         the warning reporting engine in Populate.
16335
16336         (Operator.Define): Adjust to new MemberCore protocol. 
16337
16338         * const.cs (Const): This does not derive from Expression, it is a
16339         temporary object we use to create fields, it is a MemberCore. 
16340
16341         * class.cs (Method.Define): Allow the entry point to be in a
16342         specific class.
16343
16344         * driver.cs: Rewrite the argument handler to clean it up a bit.
16345
16346         * rootcontext.cs: Made it just an auxiliary namespace feature by
16347         making everything static.
16348
16349         * driver.cs: Adapt code to use RootContext type name instead of
16350         instance variable.
16351
16352         * delegate.cs: Remove RootContext argument.
16353
16354         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16355         argument. 
16356
16357         * class.cs (Event.Define): The lookup can fail.
16358
16359         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16360
16361         * expression.cs: Resolve the this instance before invoking the code.
16362
16363 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16364
16365         * cs-parser.jay: Add a production in element_access that allows
16366         the thing to become a "type" reference.  This way we can parse
16367         things like "(string [])" as a type.
16368
16369         Note that this still does not handle the more complex rules of
16370         casts. 
16371
16372
16373         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16374
16375         * ecore.cs: (CopyNewMethods): new utility function used to
16376         assemble the list of methods from running FindMembers.
16377
16378         (MemberLookup): Rework FindMembers so that 
16379
16380 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * class.cs (TypeContainer): Remove Delegates who fail to be
16383         defined.
16384
16385         * delegate.cs (Populate): Verify that we dont get null return
16386         values.   TODO: Check for AsAccessible.
16387
16388         * cs-parser.jay: Use basename to emit error 574 (destructor should
16389         have the same name as container class), not the full name.
16390
16391         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16392         possible representation.  
16393
16394         Also implements integer type suffixes U and L.
16395
16396 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16397
16398         * expression.cs (ArrayCreation.DoResolve): We need to do the
16399         argument resolution *always*.
16400
16401         * decl.cs: Make this hold the namespace.  Hold the root context as
16402         well.
16403         (LookupType): Move here.
16404
16405         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16406
16407         * location.cs (Row, Name): Fixed the code, it was always returning
16408         references to the first file.
16409
16410         * interface.cs: Register properties defined through interfaces.
16411
16412         * driver.cs: Add support for globbing on the command line
16413
16414         * class.cs (Field): Make it derive from MemberCore as well.
16415         (Event): ditto.
16416
16417 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16418
16419         * class.cs (Event::Define): Check that the type of the event is a delegate
16420         type else flag error #66.
16421
16422         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16423         same.
16424
16425         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16426         values of EntryPoint, CharSet etc etc.
16427
16428         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16429
16430         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16431         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16432         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16433         which needs this to do its work.
16434
16435         * ../errors/cs0066.cs : Add.
16436
16437 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16440         helper functions.
16441
16442         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16443         clears out the parameters field.
16444         (MemberSignatureCompare): Cleanup
16445
16446         (MemberCore): New base class used to share code between MethodCore
16447         and Property.
16448
16449         (RegisterRequiredImplementations) BindingFlags.Public requires
16450         either BindingFlags.Instace or Static.  Use instance here.
16451
16452         (Property): Refactored code to cope better with the full spec.
16453
16454         * parameter.cs (GetParameterInfo): Return an empty array instead
16455         of null on error.
16456
16457         * class.cs (Property): Abstract or extern properties have no bodies.
16458
16459         * parameter.cs (GetParameterInfo): return a zero-sized array.
16460
16461         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16462         method modifier validation to the typecontainer so we can reuse
16463         this on properties.
16464
16465         (MethodCore.ParameterTypes): return an empty sized array of types.
16466
16467         (Property.Define): Test property modifier validity.
16468
16469         Add tests for sealed/override too.
16470
16471         (Method.Emit): abstract or extern methods have no bodies.
16472
16473 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16474
16475         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16476         thing.
16477
16478         (Method::Define, ::Emit): Modify accordingly.
16479
16480         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16481
16482         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16483
16484         * makefile: Pass in /unsafe.
16485
16486 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16487
16488         * class.cs (MakeKey): Kill routine.
16489
16490         * class.cs (TypeContainer.Define): Correctly define explicit
16491         method implementations (they require the full interface name plus
16492         the method name).
16493
16494         * typemanager.cs: Deply the PtrHashtable here and stop using the
16495         lame keys.  Things work so much better.
16496
16497         This of course broke everyone who depended on `RegisterMethod' to
16498         do the `test for existance' test.  This has to be done elsewhere.
16499
16500         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16501         the object stupid Equals method (because, that like fails all over
16502         the place).  We still do not use it.
16503
16504         * class.cs (TypeContainer.SetRequiredInterface,
16505         TypeContainer.RequireMethods): Killed these two routines and moved
16506         all the functionality to RegisterRequiredImplementations.
16507
16508         (TypeContainer.RegisterRequiredImplementations): This routine now
16509         registers all the implementations required in an array for the
16510         interfaces and abstract methods.  We use an array of structures
16511         which can be computed ahead of time to reduce memory usage and we
16512         also assume that lookups are cheap as most classes will not
16513         implement too many interfaces.
16514
16515         We also avoid creating too many MethodSignatures.
16516
16517         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16518         clear the "pending" bit if we find that there are problems with
16519         the declaration.
16520
16521         (TypeContainer.VerifyPendingMethods): Update to report errors of
16522         methods that look like implementations but are not.
16523
16524         (TypeContainer.Define): Add support for explicit interface method
16525         implementation. 
16526
16527 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16528
16529         * typemanager.cs: Keep track of the parameters here instead of
16530         being a feature of the TypeContainer.
16531
16532         * class.cs: Drop the registration of parameters here, as
16533         InterfaceMethods are also interface declarations.
16534
16535         * delegate.cs: Register methods with the TypeManager not only with
16536         the TypeContainer.  This code was buggy.
16537
16538         * interface.cs: Full registation here.
16539
16540 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * expression.cs: Remove reducer for binary expressions, it can not
16543         be done this way.
16544
16545         * const.cs: Put here the code that used to go into constant.cs
16546
16547         * constant.cs: Put here the code for constants, this is a new base
16548         class for Literals.
16549
16550         * literal.cs: Make Literal derive from Constant.
16551
16552 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16553
16554         * statement.cs (Return.Emit): Report error 157 if the user
16555         attempts to return from a finally block.
16556
16557         (Return.Emit): Instead of emitting a return, jump to the end of
16558         the function.
16559
16560         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16561         LocalBuilder to store the result of the function.  ReturnLabel is
16562         the target where we jump.
16563
16564
16565 2001-12-09  Radek Doulik  <rodo@ximian.com>
16566
16567         * cs-parser.jay: remember alias in current namespace
16568
16569         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16570         namespaces
16571
16572         * class.cs (LookupAlias): lookup alias in my_namespace
16573
16574         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16575         aliases hashtable
16576         (LookupAlias): lookup alias in this and if needed in parent
16577         namespaces
16578
16579 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16580
16581         * support.cs: 
16582
16583         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16584         making things static.  I need this to avoid passing the
16585         TypeContainer when calling ParameterType.
16586
16587         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16588         that did string manipulation to compute the type and then call
16589         GetType.  Use Parameter.ParameterType instead.
16590
16591         * cs-tokenizer.cs: Consume the suffix for floating values.
16592
16593         * expression.cs (ParameterReference): figure out whether this is a
16594         reference parameter or not.  Kill an extra variable by computing
16595         the arg_idx during emission.
16596
16597         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16598         function that returns whether a parameter is an out/ref value or not.
16599
16600         (Parameter.ParameterType): The type of the parameter (base,
16601         without ref/out applied).
16602
16603         (Parameter.Resolve): Perform resolution here.
16604         (Parameter.ExternalType): The full type (with ref/out applied).
16605
16606         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16607         support for expressions on the using statement.
16608
16609 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * statement.cs (Using.EmitLocalVariableDecls): Split the
16612         localvariable handling of the using statement.
16613
16614         (Block.EmitMeta): Keep track of variable count across blocks.  We
16615         were reusing slots on separate branches of blocks.
16616
16617         (Try.Emit): Emit the general code block, we were not emitting it. 
16618
16619         Check the type of the declaration to be an IDisposable or
16620         something that can be implicity converted to it. 
16621
16622         Emit conversions if required.
16623
16624         * ecore.cs (EmptyExpression): New utility class.
16625         (Expression.ImplicitConversionExists): New utility function.
16626
16627 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16628
16629         * statement.cs (Using): Implement.
16630
16631         * expression.cs (LocalVariableReference): Support read only variables.
16632
16633         * statement.cs: Remove the explicit emit for the Leave opcode.
16634         (VariableInfo): Add a readonly field.
16635
16636 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * ecore.cs (ConvCast): new class used to encapsulate the various
16639         explicit integer conversions that works in both checked and
16640         unchecked contexts.
16641
16642         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16643         properly generate the overflow opcodes.
16644
16645 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16646
16647         * statement.cs: The correct type for the EmptyExpression is the
16648         element_type, not the variable type.  Ravi pointed this out.
16649
16650 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16651
16652         * class.cs (Method::Define): Handle PInvoke methods specially
16653         by using DefinePInvokeMethod instead of the usual one.
16654
16655         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16656         above to do the task of extracting information and defining the method.
16657
16658 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16659
16660         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16661         of the condition for string type.
16662
16663         (Emit): Move that here. 
16664
16665         (ArrayCreation::CheckIndices): Keep string literals in their expression
16666         form.
16667
16668         (EmitDynamicInitializers): Handle strings appropriately.
16669
16670 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16671
16672         * codegen.cs (EmitContext): Replace multiple variables with a
16673         single pointer to the current Switch statement.
16674
16675         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16676         EmitContext.
16677
16678 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * statement.cs 
16681
16682         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16683         default'.
16684
16685         (Foreach.Emit): Foreach on arrays was not setting
16686         up the loop variables (for break/continue).
16687
16688         (GotoCase): Semi-implented.
16689
16690 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16691
16692         * attribute.cs (CheckAttribute): Handle system attributes by using
16693         Attribute.GetAttributes to examine information we need.
16694
16695         (GetValidPlaces): Same here.
16696
16697         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16698
16699         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16700
16701         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16702
16703         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16704
16705         (Method::Emit): Handle the case when we are a PInvoke method.
16706
16707 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * expression.cs: Use ResolveWithSimpleName on compound names.
16710
16711 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16712
16713         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16714         before trying to reduce it.
16715
16716         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16717
16718         * constant.cs (LookupConstantValue): Implement.
16719
16720         (EmitConstant): Use the above in emitting the constant.
16721
16722         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16723         that are user-defined by doing a LookupConstantValue on them.
16724
16725         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16726         too, like above.
16727
16728 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16729
16730         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16731
16732         (BaseAccess.DoResolve): Implement.
16733
16734         (MemberAccess.DoResolve): Split this routine into a
16735         ResolveMemberAccess routine that can be used independently
16736
16737 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16738
16739         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16740         As that share bits of the implementation.  Is returns a boolean,
16741         while As returns the Type that is being probed.
16742
16743 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16744
16745         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16746         instead of a Literal - much easier.
16747
16748         (EnumInTransit): Remove - utterly useless :-)
16749
16750         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16751
16752         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16753
16754         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16755         chain when we have no associated expression.
16756
16757 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16758
16759         * constant.cs (Define): Use Location while reporting the errror.
16760
16761         Also emit a warning when 'new' is used and there is no inherited
16762         member to hide.
16763
16764         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16765         populated.
16766
16767         (LookupEnumValue): Implement to lookup an enum member's value and define it
16768         if necessary.
16769
16770         (Populate): Re-write accordingly to use the above routine.
16771
16772 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * expression.cs (This): Fix prototype for DoResolveLValue to
16775         override the base class DoResolveLValue.
16776
16777         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16778         declarations) 
16779
16780         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16781         (we need to load the address of the field here).  This fixes
16782         test-22. 
16783
16784         (FieldExpr.DoResolveLValue): Call the DoResolve
16785         function to initialize the Instance expression.
16786
16787         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16788         correctly the GetEnumerator operation on a value type.
16789
16790         * cs-parser.jay: Add more simple parsing error catches.
16791
16792         * statement.cs (Switch): Add support for string switches.
16793         Handle null specially.
16794
16795         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16796
16797 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16798
16799         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16800
16801         (declare_local_constant): New helper function.
16802
16803         * statement.cs (AddConstant): Keep a separate record of constants
16804
16805         (IsConstant): Implement to determine if a variable is a constant.
16806
16807         (GetConstantExpression): Implement.
16808
16809         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16810
16811         * statement.cs (IsVariableDefined): Re-write.
16812
16813 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16814
16815         * class.cs (TypeContainer::FindMembers): Look for constants
16816         in the case when we are looking for MemberTypes.Field
16817
16818         * expression.cs (MemberAccess::DoResolve): Check that in the
16819         case we are a FieldExpr and a Literal, we are not being accessed
16820         by an instance reference.
16821
16822         * cs-parser.jay (local_constant_declaration): Implement.
16823
16824         (declaration_statement): Implement for constant declarations.
16825
16826 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * statement.cs (Switch): Catch double defaults.
16829
16830         (Switch): More work on the switch() statement
16831         implementation.  It works for integral values now, need to finish
16832         string support.
16833
16834
16835 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16836
16837         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16838         integer literals into other integer literals.  To be used by
16839         switch. 
16840
16841 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16842
16843         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16844         some memory.
16845
16846         (EmitDynamicInitializers): Cope with the above since we extract data
16847         directly from ArrayData now.
16848
16849         (ExpectInitializers): Keep track of whether initializers are mandatory
16850         or not.
16851
16852         (Bounds): Make it a hashtable to prevent the same dimension being 
16853         recorded for every element in that dimension.
16854
16855         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16856         from being found.
16857
16858         Also fix bug which was causing the indices to be emitted in the reverse
16859         order.
16860
16861 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16862
16863         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16864         unfinished.  They do not work, because the underlying code is
16865         sloppy.
16866
16867 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16868
16869         * cs-parser.jay: Remove bogus fixme.
16870
16871         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16872         on Switch statement.
16873
16874 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16875
16876         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16877         the same. 
16878
16879         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16880         parameter. Apparently, any expression is allowed. 
16881
16882         (ValidateInitializers): Update accordingly.
16883
16884         (CheckIndices): Fix some tricky bugs thanks to recursion.
16885
16886         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16887         I was being completely brain-dead.
16888
16889         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16890         and re-write acordingly.
16891
16892         (DelegateInvocation): Re-write accordingly.
16893
16894         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16895
16896         (MakeByteBlob): Handle types more correctly.
16897
16898         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16899         initialization from expressions but it is incomplete because I am a complete
16900         Dodo :-|
16901
16902 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16903
16904         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16905         on If.  Basically, we have to return `true' (ie, we do return to
16906         our caller) only if both branches of the if return.
16907
16908         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16909         short-circuit operators, handle them as short circuit operators. 
16910
16911         (Cast.DoResolve): Resolve type.
16912         (Cast.Cast): Take an expression as the target type.
16913
16914         * cs-parser.jay (cast_expression): Remove old hack that only
16915         allowed a limited set of types to be handled.  Now we take a
16916         unary_expression and we resolve to a type during semantic
16917         analysis.
16918
16919         Use the grammar productions from Rhys to handle casts (this is
16920         not complete like Rhys syntax yet, we fail to handle that corner
16921         case that C# has regarding (-x), but we will get there.
16922
16923 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16924
16925         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16926         field which is an array type.
16927
16928         * cs-parser.jay (declare_local_variables): Support array initialization too.
16929
16930         * typemanager.cs (MakeKey): Implement.
16931
16932         (everywhere): Use the above appropriately.
16933
16934         * cs-parser.jay (for_statement): Update for array initialization while
16935         declaring variables.
16936
16937         * ecore.cs : The error message was correct, it's the variable's names that
16938         were misleading ;-) Make the code more readable.
16939
16940         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16941         the correct type etc.
16942
16943         (ConvertExplicit): Handle Enum types by examining the underlying type.
16944
16945 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16946
16947         * parameter.cs (GetCallingConvention): Always return
16948         CallingConventions.Standard for now.
16949
16950 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16953         and `r' after calling DoNumericPromotions.
16954
16955         * ecore.cs: Fix error message (the types were in the wrong order).
16956
16957         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16958         BindingFlags.Instance as well 
16959
16960         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16961         implicit int literal conversion in an empty cast so that we
16962         propagate the right type upstream.
16963
16964         (UnboxCast): new class used to unbox value types.
16965         (Expression.ConvertExplicit): Add explicit type conversions done
16966         by unboxing.
16967
16968         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16969         the target type before applying the implicit LongLiterals to ULong
16970         literal cast.
16971
16972 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16973
16974         * cs-parser.jay (for_statement): Reworked the way For works: now
16975         we declare manually any variables that are introduced in
16976         for_initializer to solve the problem of having out-of-band code
16977         emition (that is what got for broken).
16978
16979         (declaration_statement): Perform the actual variable declaration
16980         that used to be done in local_variable_declaration here.
16981
16982         (local_variable_declaration): Do not declare anything, just pass
16983         the information on a DictionaryEntry
16984
16985 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16986
16987         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16988         re-write of the logic to now make it recursive.
16989
16990         (UpdateIndices): Re-write accordingly.
16991
16992         Store element data in a separate ArrayData list in the above methods.
16993
16994         (MakeByteBlob): Implement to dump the array data into a byte array.
16995
16996 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16997
16998         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16999         into CheckIndices.
17000
17001         * constant.cs (Define): Implement.
17002
17003         (EmitConstant): Re-write fully.
17004
17005         Pass in location info.
17006
17007         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17008         respectively.
17009
17010         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17011         DictionaryEntry since we need location info too.
17012
17013         (constant_declaration): Update accordingly.
17014
17015         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17016         code into another method : UpdateIndices.
17017
17018 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17019
17020         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17021         some type checking etc.
17022
17023 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17024
17025         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17026         bits to provide dimension info if the user skips doing that.
17027
17028         Update second constructor to store the rank correctly.
17029
17030 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17031
17032         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17033         and try to implement.
17034
17035         * ../errors/cs0150.cs : Add.
17036
17037         * ../errors/cs0178.cs : Add.
17038
17039 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17040
17041         * statement.cs: Implement foreach on multi-dimensional arrays. 
17042
17043         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17044         name of the params argument.
17045
17046         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17047         initializing the array.
17048
17049         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17050         we can use this elsewhere.
17051
17052         * statement.cs: Finish implementation of foreach for single
17053         dimension arrays.
17054
17055         * cs-parser.jay: Use an out-of-band stack to pass information
17056         around, I wonder why I need this.
17057
17058         foreach_block: Make the new foreach_block the current_block.
17059
17060         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17061         function used to return a static Parameters structure.  Used for
17062         empty parameters, as those are created very frequently.
17063
17064         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17065
17066 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17067
17068         * interface.cs : Default modifier is private, not public. The
17069         make verify test passes again.
17070
17071 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17072
17073         * support.cs (ReflectionParameters): Fix logic to determine
17074         whether the last parameter is a params one. Test 9 passes again.
17075
17076         * delegate.cs (Populate): Register the builders we define with
17077         RegisterParameterForBuilder. Test 19 passes again.
17078
17079         * cs-parser.jay (property_declaration): Reference $6 instead
17080         of $$ to get at the location.
17081
17082         (indexer_declaration): Similar stuff.
17083
17084         (attribute): Ditto.
17085
17086         * class.cs (Property): Register parameters for the Get and Set methods
17087         if they exist. Test 23 passes again.
17088
17089         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17090         call to EmitArguments as we are sure there aren't any params arguments. 
17091         Test 32 passes again.
17092
17093         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17094         IndexOutOfRangeException. 
17095
17096         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17097         Test 33 now passes again.
17098
17099 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17100
17101         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17102         broke a bunch of things.  Will have to come up with a better way
17103         of tracking locations.
17104
17105         * statement.cs: Implemented foreach for single dimension arrays.
17106
17107 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17110         an error.  This removes the lookup from the critical path.
17111
17112         * cs-parser.jay: Removed use of temporary_loc, which is completely
17113         broken. 
17114
17115 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17116
17117         * support.cs (ReflectionParameters.ParameterModifier): Report
17118         whether the argument is a PARAMS argument or not.
17119
17120         * class.cs: Set the attribute `ParamArrayAttribute' on the
17121         parameter argument.
17122
17123         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17124         and cons_param_array_attribute (ConstructorInfo for
17125         ParamArrayAttribute)., 
17126
17127         * codegen.cs: Emit the return using the `Return' statement, that
17128         way we can report the error correctly for missing return values. 
17129
17130         * class.cs (Method.Emit): Clean up.
17131
17132         * expression.cs (Argument.Resolve): Take another argument: the
17133         location where this argument is used.  Notice that this is not
17134         part of the "Argument" class as to reduce the size of the
17135         structure (we know the approximate location anyways).
17136
17137         Test if the argument is a variable-reference, if not, then
17138         complain with a 206.
17139
17140         (Argument.Emit): Emit addresses of variables.
17141
17142         (Argument.FullDesc): Simplify.
17143
17144         (Invocation.DoResolve): Update for Argument.Resolve.
17145
17146         (ElementAccess.DoResolve): ditto.
17147
17148         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17149         method should be virtual, as this method is always virtual.
17150
17151         (NewDelegate.DoResolve): Update for Argument.Resolve.
17152
17153         * class.cs (ConstructorInitializer.DoResolve): ditto.
17154
17155         * attribute.cs (Attribute.Resolve): ditto.
17156
17157 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17158
17159         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17160
17161         * expression.cs (ParameterReference): Drop IStackStorage and implement
17162         IAssignMethod instead. 
17163
17164         (LocalVariableReference): ditto.
17165
17166         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17167         IAssignMethod instead. 
17168
17169 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17170
17171         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17172         enumerations that are used in heavily used structures derive from
17173         byte in a laughable and pathetic attempt to reduce memory usage.
17174         This is the kind of pre-optimzations that you should not do at
17175         home without adult supervision.
17176
17177         * expression.cs (UnaryMutator): New class, used to handle ++ and
17178         -- separatedly from the other unary operators.  Cleans up the
17179         code, and kills the ExpressionStatement dependency in Unary.
17180
17181         (Unary): Removed `method' and `Arguments' from this class, making
17182         it smaller, and moving it all to SimpleCall, so I can reuse this
17183         code in other locations and avoid creating a lot of transient data
17184         strucutres when not required.
17185
17186         * cs-parser.jay: Adjust for new changes.
17187
17188 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17189
17190         * enum.cs (Enum.Populate): If there is a failure during
17191         definition, return
17192
17193         * cs-parser.jay (opt_enum_base): we used to catch type errors
17194         here, but this is really incorrect.  The type error should be
17195         catched during semantic analysis.
17196
17197 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17198
17199         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17200         current_local_parameters as expected since I, in my stupidity, had forgotten
17201         to do this :-)
17202
17203         * attribute.cs (GetValidPlaces): Fix stupid bug.
17204
17205         * class.cs (Method::Emit): Perform check on applicability of attributes.
17206
17207         (Constructor::Emit): Ditto.
17208
17209         (Field::Emit): Ditto.
17210
17211         (Field.Location): Store location information.
17212
17213         (Property, Event, Indexer, Operator): Ditto.
17214
17215         * cs-parser.jay (field_declaration): Pass in location for each field.
17216
17217         * ../errors/cs0592.cs : Add.
17218
17219 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17220
17221         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17222
17223         (InitCoreTypes): Update accordingly.
17224
17225         (RegisterAttrType, LookupAttr): Implement.
17226
17227         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17228         info about the same.
17229
17230         (Resolve): Update to populate the above as necessary.
17231
17232         (Error592): Helper.
17233
17234         (GetValidPlaces): Helper to the above.
17235
17236         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17237
17238         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17239
17240 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17241
17242         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17243
17244         * ../errors/cs0617.cs : Add.
17245
17246 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17247
17248         * enum.cs (Emit): Rename to Populate to be more consistent with what
17249         we expect it to do and when exactly it is called.
17250
17251         * class.cs, rootcontext.cs : Update accordingly.
17252
17253         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17254         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17255
17256         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17257
17258         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17259         of a fieldinfo using the above, when dealing with a FieldBuilder.
17260
17261 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17262
17263         * ../errors/cs0031.cs : Add.
17264
17265         * ../errors/cs1008.cs : Add.
17266
17267         * ../errrors/cs0543.cs : Add.
17268
17269         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17270         enum type.
17271
17272         (FindMembers): Implement.
17273
17274         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17275         enums and delegates too.
17276
17277         (enum_types): Rename to builder_to_enum.
17278
17279         (delegate_types): Rename to builder_to_delegate.
17280
17281         * delegate.cs (FindMembers): Implement.
17282
17283 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17284
17285         * typemanager.cs (IsEnumType): Implement.
17286
17287         * enum.cs (Emit): Re-write parts to account for the underlying type
17288         better and perform checking etc.
17289
17290         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17291         of the underlying type.
17292
17293         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17294         value
17295
17296         * enum.cs (error31): Helper to report error #31.
17297
17298         * cs-parser.jay (enum_declaration): Store location of each member too.
17299
17300         * enum.cs (member_to_location): New hashtable. 
17301
17302         (AddEnumMember): Update location hashtable.
17303
17304         (Emit): Use the location of each member while reporting errors.
17305
17306 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * cs-parser.jay: A for_initializer if is a
17309         local_variable_declaration really ammount to have an implicit
17310         block with the variable declaration and no initializer for for.
17311
17312         * statement.cs (For.Emit): Cope with null initializers.
17313
17314         This fixes the infinite loop on for initializers.
17315
17316 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17317
17318         * enum.cs: More cleanup.
17319
17320         * ecore.cs: Remove dead code.
17321
17322         * class.cs (Property.Emit): More simplification.
17323         (Event.Emit): ditto.
17324
17325         Reworked to have less levels of indentation.
17326
17327 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17328
17329         * class.cs (Property): Emit attributes.
17330
17331         (Field): Ditto.
17332
17333         (Event): Ditto.
17334
17335         (Indexer): Ditto.
17336
17337         (Operator): Ditto.
17338
17339         * enum.cs (Emit): Ditto.
17340
17341         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17342         Enums too.
17343
17344         * class.cs (Field, Event, etc.): Move attribute generation into the
17345         Emit method everywhere.
17346
17347         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17348         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17349         as we had no way of defining nested enums !
17350
17351         * rootcontext.cs : Adjust code accordingly.
17352
17353         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17354
17355 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17356
17357         * expression.cs (EvalConstantExpression): Move into ecore.cs
17358
17359         * enum.cs (Enum): Rename some members and make them public and readonly
17360         according to our convention.
17361
17362         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17363         nothing else.
17364
17365         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17366
17367         (Enum::Emit): Write a simple version for now which doesn't try to compute
17368         expressions. I shall modify this to be more robust in just a while.
17369
17370         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17371
17372         (TypeContainer::CloseType): Create the Enum types too.
17373
17374         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17375
17376         * expression.cs (EvalConstantExpression): Get rid of completely.
17377
17378         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17379         user-defined values and other cases.
17380
17381         (IsValidEnumLiteral): Helper function.
17382
17383         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17384         out there in the case we had a literal FieldExpr.
17385
17386         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17387
17388         (Literalize): Revamp a bit to take two arguments.
17389
17390         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17391
17392 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17393
17394         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17395
17396         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17397
17398         (Resolve): Use the above to ensure we have proper initializers.
17399
17400 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17401
17402         * expression.cs (Expression::EvalConstantExpression): New method to 
17403         evaluate constant expressions.
17404
17405         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17406
17407 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17408
17409         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17410         in an array.
17411
17412         (Binary.ResolveOperator): Handle operator != (object a, object b)
17413         and operator == (object a, object b);
17414
17415         (Binary.DoNumericPromotions): Indicate whether the numeric
17416         promotion was possible.
17417
17418         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17419         Implement.  
17420
17421         Made the ArrayAccess implement interface IAssignMethod instead of
17422         IStackStore as the order in which arguments are passed reflects
17423         this.
17424
17425         * assign.cs: Instead of using expr.ExprClass to select the way of
17426         assinging, probe for the IStackStore/IAssignMethod interfaces.
17427
17428         * typemanager.cs: Load InitializeArray definition.
17429
17430         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17431         static data that can be used to initialize arrays. 
17432
17433 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17434
17435         * expression.cs: Handle operator== and operator!= for booleans.
17436
17437         (Conditioal.Reduce): Implement reducer for the ?: operator.
17438
17439         (Conditional.Resolve): Implement dead code elimination.
17440
17441         (Binary.Resolve): Catch string literals and return a new
17442         concatenated string.
17443
17444         (Unary.Reduce): Implement reduction of unary expressions.
17445
17446         * ecore.cs: Split out the expression core handling here.
17447
17448         (Expression.Reduce): New method used to perform constant folding
17449         and CSE.  This is needed to support constant-expressions. 
17450
17451         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17452         targets, and optimize for !x.
17453
17454 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17455
17456         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17457         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17458         set custom atttributes.
17459
17460         * literal.cs (Literal::GetValue): New abstract method to return the actual
17461         value of the literal, cast as an object.
17462
17463         (*Literal): Implement GetValue method.
17464
17465         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17466         expressions to the arraylist but objects of type Argument.
17467
17468         * class.cs (TypeContainer::Emit): Emit our attributes too.
17469
17470         (Method::Emit, Constructor::Emit): Ditto.
17471
17472         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17473         to be ignoring earlier.
17474
17475 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17476
17477         * attribute.cs (AttributeSection::Define): Implement to do the business
17478         of constructing a CustomAttributeBuilder.
17479
17480         (Attribute): New trivial class. Increases readability of code.  
17481
17482         * cs-parser.jay : Update accordingly.
17483
17484         (positional_argument_list, named_argument_list, named_argument): New rules
17485
17486         (attribute_arguments): Use the above so that we are more correct.
17487
17488 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17489
17490         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17491         to perform all checks for a method with a params parameter.
17492
17493         (Invocation::OverloadResolve): Update to use the above method and therefore
17494         cope correctly with params method invocations.
17495
17496         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17497         params too.
17498
17499         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17500         constructors in our parent too because we can't afford to miss out on 
17501         protected ones ;-)
17502
17503         * attribute.cs (AttributeSection): New name for the class Attribute
17504
17505         Other trivial changes to improve readability.
17506
17507         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17508         use the new class names.
17509
17510 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17511
17512         * class.cs (Method::Define): Complete definition for params types too
17513
17514         (Indexer::Define): Ditto.
17515
17516         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17517         Cope everywhere with a request for info about the array parameter.
17518
17519 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17520
17521         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17522
17523         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17524         local_variable_type to extract the string corresponding to the type.
17525
17526         (local_variable_type): Fixup the action to use the new helper method.
17527
17528         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17529         go.
17530
17531         * expression.cs : Clean out code which uses the above.
17532
17533 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17534
17535         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17536         and bale out if necessary by returning a false.
17537
17538         (RegisterProperty): Ditto.
17539
17540         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17541         and print out appropriate error messages.
17542
17543         * interface.cs (everywhere): Ditto.
17544
17545         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17546         location to constructor.
17547
17548         * class.cs (Property, Event, Indexer): Update accordingly.
17549
17550         * ../errors/cs111.cs : Added.
17551
17552         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17553         of a method, as laid down by the spec.
17554
17555         (Invocation::OverloadResolve): Use the above method.
17556
17557 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17558
17559         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17560         now take a TypeContainer and a Parameters object.
17561
17562         (ParameterData): Modify return type of ParameterModifier method to be 
17563         Parameter.Modifier and not a string.
17564
17565         (ReflectionParameters, InternalParameters): Update accordingly.
17566
17567         * expression.cs (Argument::GetParameterModifier): Same here.
17568
17569         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17570         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17571         symbol in it at all so maybe this is only for now.
17572
17573 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17574
17575         * support.cs (InternalParameters): Constructor now takes an extra argument 
17576         which is the actual Parameters class.
17577
17578         (ParameterDesc): Update to provide info on ref/out modifiers.
17579
17580         * class.cs (everywhere): Update call to InternalParameters to pass in
17581         the second argument too.
17582
17583         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17584         to return the modifier info [ref/out etc]
17585
17586         (InternalParameters, ReflectionParameters): Implement the above.
17587
17588         * expression.cs (Argument::ParameterModifier): Similar function to return
17589         info about the argument's modifiers.
17590
17591         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17592         too.
17593
17594         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17595         a new SetFormalParameters object which we pass to InternalParameters.
17596
17597 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17598
17599         * expression.cs (NewArray): Merge into the ArrayCreation class.
17600
17601 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17602
17603         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17604         NewUserdefinedArray into one as there wasn't much of a use in having
17605         two separate ones.
17606
17607         * expression.cs (Argument): Change field's name to ArgType from Type.
17608
17609         (Type): New readonly property which returns the proper type, taking into 
17610         account ref/out modifiers.
17611
17612         (everywhere): Adjust code accordingly for the above.
17613
17614         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17615         whether we are emitting for a ref or out parameter.
17616
17617         * expression.cs (Argument::Emit): Use the above field to set the state.
17618
17619         (LocalVariableReference::Emit): Update to honour the flag and emit the
17620         right stuff.
17621
17622         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17623
17624         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17625
17626         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17627
17628         (ReflectionParameters, InternalParameters): Implement the above method.
17629
17630         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17631         reporting errors.
17632
17633         (Invocation::FullMethodDesc): Ditto. 
17634
17635 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17636
17637         * cs-parser.jay: Add extra production for the second form of array
17638         creation. 
17639
17640         * expression.cs (ArrayCreation): Update to reflect the above
17641         change. 
17642
17643         * Small changes to prepare for Array initialization.
17644
17645 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17646
17647         * typemanager.cs (ImplementsInterface): interface might be null;
17648         Deal with this problem;
17649
17650         Also, we do store negative hits on the cache (null values), so use
17651         this instead of calling t.GetInterfaces on the type everytime.
17652
17653 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17654
17655         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17656
17657         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17658         split functionality out into different classes.
17659
17660         (New::FormArrayType): Move into NewBuiltinArray.
17661
17662         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17663         quite useless.
17664
17665         (NewBuiltinArray): New class to handle creation of built-in arrays.
17666
17667         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17668         account creation of one-dimensional arrays.
17669
17670         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17671
17672         (NewUserdefinedArray::DoResolve): Implement.
17673
17674         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17675
17676         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17677         we maintain inside the TypeManager. This is necessary to perform lookups on the
17678         module builder.
17679
17680         (LookupType): Update to perform GetType on the module builders too.     
17681
17682         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17683
17684         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17685
17686 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17687
17688         * expression.cs (New::DoResolve): Implement guts of array creation.
17689
17690         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17691
17692 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17693
17694         * expression.cs: Fix bug I introduced lsat night that broke
17695         Delegates. 
17696
17697         (Expression.Resolve): Report a 246 error (can not resolve name)
17698         if we find a SimpleName in the stream.
17699
17700         (Expression.ResolveLValue): Ditto.
17701
17702         (Expression.ResolveWithSimpleName): This function is a variant of
17703         ResolveName, this one allows SimpleNames to be returned without a
17704         warning.  The only consumer of SimpleNames is MemberAccess
17705
17706 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17707
17708         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17709         might arrive here.  I have my doubts that this is correct.
17710
17711         * statement.cs (Lock): Implement lock statement.
17712
17713         * cs-parser.jay: Small fixes to support `lock' and `using'
17714
17715         * cs-tokenizer.cs: Remove extra space
17716
17717         * driver.cs: New flag --checked, allows to turn on integer math
17718         checking. 
17719
17720         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17721         Threading.Monitor.Exit 
17722
17723 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17724
17725         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17726         Expression Class to be IndexerAccess.
17727
17728         Notice that Indexer::DoResolve sets the eclass to Value.
17729
17730 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17731
17732         * class.cs (TypeContainer::Emit): Emit code for indexers.
17733
17734         * assign.cs (IAssignMethod): New interface implemented by Indexers
17735         and Properties for handling assignment.
17736
17737         (Assign::Emit): Simplify and reuse code. 
17738
17739         * expression.cs (IndexerAccess, PropertyExpr): Implement
17740         IAssignMethod, clean up old code. 
17741
17742 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17743
17744         * typemanager.cs (ImplementsInterface): New method to determine if a type
17745         implements a given interface. Provides a nice cache too.
17746
17747         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17748         method.
17749
17750         (ConvertReferenceExplicit): Ditto.
17751
17752         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17753         various methods, with correct names etc.
17754
17755         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17756         Operator.UnaryNegation.
17757
17758         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17759         we have a unary plus or minus operator.
17760
17761         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17762         UnaryMinus.
17763
17764         * everywhere : update accordingly.
17765
17766         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17767         respectively.
17768
17769         * class.cs (Method::Define): For the case where we are implementing a method
17770         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17771         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17772
17773 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17774
17775         * interface.cs (FindMembers): Implement to work around S.R.E
17776         lameness.
17777
17778         * typemanager.cs (IsInterfaceType): Implement.
17779
17780         (FindMembers): Update to handle interface types too.
17781
17782         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17783         use IsAssignableFrom as that is not correct - it doesn't work.
17784
17785         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17786         and accordingly override EmitStatement.
17787
17788         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17789         using the correct logic :-)
17790
17791 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17792
17793         * ../errors/cs-11.cs : Add to demonstrate error -11 
17794
17795 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17796
17797         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17798         then pass this as a hint to ResolveLValue.
17799
17800         * expression.cs (FieldExpr): Add Location information
17801
17802         (FieldExpr::LValueResolve): Report assignment to readonly
17803         variable. 
17804
17805         (Expression::ExprClassFromMemberInfo): Pass location information.
17806
17807         (Expression::ResolveLValue): Add new method that resolves an
17808         LValue. 
17809
17810         (Expression::DoResolveLValue): Default invocation calls
17811         DoResolve. 
17812
17813         (Indexers): New class used to keep track of indexers in a given
17814         Type. 
17815
17816         (IStackStore): Renamed from LValue, as it did not really describe
17817         what this did.  Also ResolveLValue is gone from this interface and
17818         now is part of Expression.
17819
17820         (ElementAccess): Depending on the element access type
17821
17822         * typemanager.cs: Add `indexer_name_type' as a Core type
17823         (System.Runtime.CompilerServices.IndexerNameAttribute)
17824
17825         * statement.cs (Goto): Take a location.
17826
17827 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17828
17829         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17830         if two delegates are compatible.
17831
17832         (NewDelegate::DoResolve): Update to take care of the case when
17833         we instantiate a delegate from another delegate.
17834
17835         * typemanager.cs (FindMembers): Don't even try to look up members
17836         of Delegate types for now.
17837
17838 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17839
17840         * delegate.cs (NewDelegate): New class to take care of delegate
17841         instantiation.
17842
17843         * expression.cs (New): Split the delegate related code out into 
17844         the NewDelegate class.
17845
17846         * delegate.cs (DelegateInvocation): New class to handle delegate 
17847         invocation.
17848
17849         * expression.cs (Invocation): Split out delegate related code into
17850         the DelegateInvocation class.
17851
17852 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17853
17854         * expression.cs (New::DoResolve): Implement delegate creation fully
17855         and according to the spec.
17856
17857         (New::DoEmit): Update to handle delegates differently.
17858
17859         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17860         because of which we were printing out arguments in reverse order !
17861
17862         * delegate.cs (VerifyMethod): Implement to check if the given method
17863         matches the delegate.
17864
17865         (FullDelegateDesc): Implement.
17866
17867         (VerifyApplicability): Implement.
17868
17869         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17870         delegate invocations too.
17871
17872         (Invocation::Emit): Ditto.
17873
17874         * ../errors/cs1593.cs : Added.
17875
17876         * ../errors/cs1594.cs : Added.
17877
17878         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17879
17880 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17881
17882         * typemanager.cs (intptr_type): Core type for System.IntPtr
17883
17884         (InitCoreTypes): Update for the same.
17885
17886         (iasyncresult_type, asynccallback_type): Ditto.
17887
17888         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17889         correct.
17890
17891         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17892         too.
17893
17894         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17895         the builders for the 4 members of a delegate type :-)
17896
17897         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17898         type.
17899
17900         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17901
17902         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17903
17904 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17905
17906         * statement.cs (Break::Emit): Implement.   
17907         (Continue::Emit): Implement.
17908
17909         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17910         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17911         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17912         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17913         end loop
17914
17915         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17916         properties that track the label for the current loop (begin of the
17917         loop and end of the loop).
17918
17919 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17920
17921         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17922         use of emitting anything at all.
17923
17924         * class.cs, rootcontext.cs : Get rid of calls to the same.
17925
17926         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17927
17928         (Populate): Define the constructor correctly and set the implementation
17929         attributes.
17930
17931         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17932         have been defined.
17933
17934         (AddDelegateType): Implement.
17935
17936         (IsDelegateType): Implement helper method.
17937
17938         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17939
17940         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17941         and accordingly handle it.
17942
17943         * delegate.cs (Populate): Take TypeContainer argument.
17944         Implement bits to define the Invoke method. However, I still haven't figured out
17945         how to take care of the native int bit :-(
17946
17947         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17948         Qualify the name of the delegate, not its return type !
17949
17950         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17951         conversion.
17952
17953         (StandardConversionExists): Checking for array types turns out to be recursive.
17954
17955         (ConvertReferenceExplicit): Implement array conversion.
17956
17957         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17958
17959 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17960
17961         * cs-parser.jay (delegate_declaration): Store the fully qualified
17962         name as it is a type declaration.
17963
17964         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17965         readonly.
17966
17967         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17968         as TypeContainer::DefineType.
17969
17970         (Populate): Method in which all the definition of the various methods (Invoke)
17971         etc is done.
17972
17973         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17974         see.
17975
17976         (CloseDelegate): Finally creates the delegate.
17977
17978         * class.cs (TypeContainer::DefineType): Update to define delegates.
17979         (Populate, Emit and CloseType): Do the same thing here too.
17980
17981         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17982         delegates in all these operations.
17983
17984 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17985
17986         * expression.cs: LocalTemporary: a new expression used to
17987         reference a temporary that has been created.
17988
17989         * assign.cs: Handle PropertyAccess back here, so that we can
17990         provide the proper semantic access to properties.
17991
17992         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17993         a few more explicit conversions. 
17994
17995         * modifiers.cs: `NEW' modifier maps to HideBySig.
17996
17997         * expression.cs (PropertyExpr): Make this into an
17998         ExpressionStatement, and support the EmitStatement code path. 
17999
18000         Perform get/set error checking, clean up the interface.
18001
18002         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18003         them into toplevel access objects.
18004
18005 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18008         SRE.
18009
18010         * typemanager.cs: Keep track here of our PropertyBuilders again to
18011         work around lameness in SRE.
18012
18013 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * expression.cs (LValue::LValueResolve): New method in the
18016         interface, used to perform a second resolution pass for LValues. 
18017
18018         (This::DoResolve): Catch the use of this in static methods.
18019
18020         (This::LValueResolve): Implement.
18021
18022         (This::Store): Remove warning, assigning to `this' in structures
18023         is 
18024
18025         (Invocation::Emit): Deal with invocation of
18026         methods on value types.  We need to pass the address to structure
18027         methods rather than the object itself.  (The equivalent code to
18028         emit "this" for structures leaves the entire structure on the
18029         stack instead of a pointer to it). 
18030
18031         (ParameterReference::DoResolve): Compute the real index for the
18032         argument based on whether the method takes or not a `this' pointer
18033         (ie, the method is static).
18034
18035         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18036         value types returned from functions when we need to invoke a
18037         method on the sturcture.
18038
18039
18040 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18041
18042         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18043         defining the type in the Modulebuilder or Typebuilder. This is to take
18044         care of nested types which need to be defined on the TypeBuilder using
18045         DefineNestedMethod.
18046
18047         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18048         methods in RootContext, only ported to be part of TypeContainer.
18049
18050         (TypeContainer::GetInterfaceOrClass): Ditto.
18051
18052         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18053
18054         * interface.cs (Interface::DefineInterface): New method. Does exactly
18055         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18056         too.
18057
18058         (Interface::GetInterfaces): Move from RootContext here and port.
18059
18060         (Interface::GetInterfaceByName): Same here.
18061
18062         * rootcontext.cs (ResolveTree): Re-write.
18063
18064         (PopulateTypes): Re-write.
18065
18066         * class.cs (TypeContainer::Populate): Populate nested types too.
18067         (TypeContainer::Emit): Emit nested members too.
18068
18069         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18070         instead just use the name argument passed in as it is already fully
18071         qualified.
18072
18073         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18074         to TypeContainer mapping to see if a type is user-defined.
18075
18076         * class.cs (TypeContainer::CloseType): Implement. 
18077
18078         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18079         the default constructor.
18080
18081         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18082         twice.
18083
18084         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18085
18086         * interface.cs (CloseType): Create the type here.
18087
18088         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18089         the hierarchy.
18090
18091         Remove all the methods which are now in TypeContainer.
18092
18093 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18094
18095         * delegate.cs (Define): Re-write bits to define the delegate
18096         correctly.
18097
18098 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18099
18100         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18101
18102         * expression.cs (ImplicitReferenceConversion): handle null as well
18103         as a source to convert to any reference type.
18104
18105         * statement.cs (Return): Perform any implicit conversions to
18106         expected return type.  
18107
18108         Validate use of return statement.  
18109
18110         * codegen.cs (EmitContext): Pass the expected return type here.
18111
18112         * class.cs (Method, Constructor, Property): Pass expected return
18113         type to EmitContext.
18114
18115 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * expression.cs: Make DoResolve take an EmitContext instead of a
18118         TypeContainer.
18119
18120         Replaced `l' and `location' for `loc', for consistency.
18121
18122         (Error, Warning): Remove unneeded Tc argument.
18123
18124         * assign.cs, literal.cs, constant.cs: Update to new calling
18125         convention. 
18126
18127         * codegen.cs: EmitContext now contains a flag indicating whether
18128         code is being generated in a static method or not.
18129
18130         * cs-parser.jay: DecomposeQI, new function that replaces the old
18131         QualifiedIdentifier.  Now we always decompose the assembled
18132         strings from qualified_identifier productions into a group of
18133         memberaccesses.
18134
18135 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * rootcontext.cs: Deal with field-less struct types correctly now
18138         by passing the size option to Define Type.
18139
18140         * class.cs: Removed hack that created one static field. 
18141
18142 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18143
18144         * statement.cs: Moved most of the code generation here. 
18145
18146 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18147
18148         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18149         seem very right.
18150
18151         (ElementAccess): Remove useless bits for now - keep checks as the spec
18152         says.
18153
18154 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18155
18156         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18157         and start performing checks according to the spec.
18158
18159 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18160
18161         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18162         rank_specifiers instead.
18163
18164         (rank_specifiers): Change the order in which the rank specifiers are stored
18165
18166         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18167
18168         * expression.cs (ElementAccess): Implement the LValue interface too.
18169
18170 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18171
18172         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18173         except that user defined conversions are not included.
18174
18175         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18176         perform the conversion of the return type, if necessary.
18177
18178         (New::DoResolve): Check whether we are creating an array or an object
18179         and accordingly do the needful.
18180
18181         (New::Emit): Same here.
18182
18183         (New::DoResolve): Implement guts of array creation.
18184
18185         (New::FormLookupType): Helper function.
18186
18187 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18188
18189         * codegen.cs: Removed most of the code generation here, and move the
18190         corresponding code generation bits to the statement classes. 
18191
18192         Added support for try/catch/finalize and throw.
18193
18194         * cs-parser.jay: Added support for try/catch/finalize.
18195
18196         * class.cs: Catch static methods having the flags override,
18197         virtual or abstract.
18198
18199         * expression.cs (UserCast): This user cast was not really doing
18200         what it was supposed to do.  Which is to be born in fully resolved
18201         state.  Parts of the resolution were being performed at Emit time! 
18202
18203         Fixed this code.
18204
18205 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18206
18207         * expression.cs: Implicity convert the result from UserCast.
18208
18209 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18210
18211         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18212         prevented it from working correctly. 
18213
18214         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18215         merely ConvertImplicit.
18216
18217 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * typemanager.cs: Make the LookupTypeContainer function static,
18220         and not per-instance.  
18221
18222         * class.cs: Make static FindMembers (the one that takes a Type
18223         argument). 
18224
18225         * codegen.cs: Add EmitForeach here.
18226
18227         * cs-parser.jay: Make foreach a toplevel object instead of the
18228         inline expansion, as we need to perform semantic analysis on it. 
18229
18230 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18231
18232         * expression.cs (Expression::ImplicitUserConversion): Rename to
18233         UserDefinedConversion.
18234
18235         (Expression::UserDefinedConversion): Take an extra argument specifying 
18236         whether we look for explicit user conversions too.
18237
18238         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18239
18240         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18241
18242         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18243         with the appropriate arguments.
18244
18245         * cs-parser.jay (cast_expression): Record location too.
18246
18247         * expression.cs (Cast): Record location info.
18248
18249         (Expression::ConvertExplicit): Take location argument.
18250
18251         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18252         to determine if we are doing explicit conversions.
18253
18254         (UserCast::Emit): Update accordingly.
18255
18256         (Expression::ConvertExplicit): Report an error if everything fails.
18257
18258         * ../errors/cs0030.cs : Add.
18259
18260 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18261
18262         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18263         virtual and newslot bits. 
18264
18265         * class.cs (TypeContainer::RegisterRequiredImplementations):
18266         Record methods we need.
18267
18268         (TypeContainer::MakeKey): Helper function to make keys for
18269         MethodBases, since the Methodbase key is useless.
18270
18271         (TypeContainer::Populate): Call RegisterRequiredImplementations
18272         before defining the methods.   
18273
18274         Create a mapping for method_builders_to_methods ahead of time
18275         instead of inside a tight loop.
18276
18277         (::RequireMethods):  Accept an object as the data to set into the
18278         hashtable so we can report interface vs abstract method mismatch.
18279
18280 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18281
18282         * report.cs: Make all of it static.
18283
18284         * rootcontext.cs: Drop object_type and value_type computations, as
18285         we have those in the TypeManager anyways.
18286
18287         Drop report instance variable too, now it is a global.
18288
18289         * driver.cs: Use try/catch on command line handling.
18290
18291         Add --probe option to debug the error reporting system with a test
18292         suite. 
18293
18294         * report.cs: Add support for exiting program when a probe
18295         condition is reached.
18296
18297 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18298
18299         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18300         we do a forcible conversion regardless of type, to check if 
18301         ForceConversion returns a null.
18302
18303         (Binary::error19): Use location to report error.
18304
18305         (Unary::error23): Use location here too.
18306
18307         * ../errors/cs0019.cs : Check in.
18308
18309         * ../errors/cs0023.cs : Check in.
18310
18311         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18312         case of a non-null MethodInfo object with a length of 0 !
18313
18314         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18315         an applicable member - according to the spec :-)
18316         Also fix logic to find members in base types.
18317
18318         (Unary::ResolveOperator): Same here.
18319
18320         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18321         as I was getting thoroughly confused between this and error19 :-)
18322
18323         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18324         (::FindMostEncompassedType): Implement.
18325         (::FindMostEncompassingType): Implement.
18326         (::StandardConversionExists): Implement.
18327
18328         (UserImplicitCast): Re-vamp. We now need info about most specific
18329         source and target types so that we can do the necessary conversions.
18330
18331         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18332         mathematical union with no duplicates.
18333
18334 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18337         in order from base classes to child classes, so that we can in
18338         child classes look up in our parent for method names and
18339         attributes (required for handling abstract, virtual, new, override
18340         constructs: we need to instrospect our base class, and if we dont
18341         populate the classes in order, the introspection might be
18342         incorrect.  For example, a method could query its parent before
18343         the parent has any methods and would determine that the parent has
18344         no abstract methods (while it could have had them)).
18345
18346         (RootContext::CreateType): Record the order in which we define the
18347         classes.
18348
18349 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18350
18351         * class.cs (TypeContainer::Populate): Also method definitions can
18352         fail now, keep track of this.
18353
18354         (TypeContainer::FindMembers): Implement support for
18355         DeclaredOnly/noDeclaredOnly flag.
18356
18357         (Constructor::Emit) Return the ConstructorBuilder.
18358
18359         (Method::Emit) Return the MethodBuilder. 
18360         Check for abstract or virtual methods to be public.
18361
18362         * rootcontext.cs (RootContext::CreateType): Register all the
18363         abstract methods required for the class to be complete and the
18364         interface methods that must be implemented. 
18365
18366         * cs-parser.jay: Report error 501 (method requires body if it is
18367         not marked abstract or extern).
18368
18369         * expression.cs (TypeOf::Emit): Implement.
18370
18371         * typemanager.cs: runtime_handle_type, new global type.
18372
18373         * class.cs (Property::Emit): Generate code for properties.
18374
18375 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18376
18377         * expression.cs (Unary::ResolveOperator): Find operators on base type
18378         too - we now conform exactly to the spec.
18379
18380         (Binary::ResolveOperator): Same here.
18381
18382         * class.cs (Operator::Define): Fix minor quirk in the tests.
18383
18384         * ../errors/cs0215.cs : Added.
18385
18386         * ../errors/cs0556.cs : Added.
18387
18388         * ../errors/cs0555.cs : Added.
18389
18390 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18391
18392         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18393         single integer which is really efficient
18394
18395 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18396
18397         *  expression.cs (Expression::ImplicitUserConversion): Use location
18398         even in the case when we are examining True operators.
18399  
18400         * class.cs (Operator::Define): Perform extensive checks to conform
18401         with the rules for operator overloading in the spec.
18402
18403         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18404         some of the other conversions mentioned in the spec.
18405
18406         * typemanager.cs (array_type): New static member for the System.Array built-in
18407         type.
18408
18409         (cloneable_interface): For System.ICloneable interface.
18410
18411         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18412         we start resolving the tree and populating types.
18413
18414         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18415  
18416 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18417
18418         * expression.cs (Expression::ExprClassFromMemberInfo,
18419         Expression::Literalize): Create literal expressions from
18420         FieldInfos which are literals.
18421
18422         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18423         type casts, because they were wrong.  The test suite in tests
18424         caught these ones.
18425
18426         (ImplicitNumericConversion): ushort to ulong requires a widening
18427         cast. 
18428
18429         Int32 constant to long requires widening cast as well.
18430
18431         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18432         for integers because the type on the stack is not i4.
18433
18434 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * expression.cs (report118): require location argument. 
18437
18438         * parameter.cs: Do not dereference potential null value.
18439
18440         * class.cs: Catch methods that lack the `new' keyword when
18441         overriding a name.  Report warnings when `new' is used without
18442         anything being there to override.
18443
18444         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18445
18446         * class.cs: Only add constructor to hashtable if it is non-null
18447         (as now constructors can fail on define).
18448
18449         (TypeManager, Class, Struct): Take location arguments.
18450
18451         Catch field instance initialization in structs as errors.
18452
18453         accepting_filter: a new filter for FindMembers that is static so
18454         that we dont create an instance per invocation.
18455
18456         (Constructor::Define): Catch errors where a struct constructor is
18457         parameterless 
18458
18459         * cs-parser.jay: Pass location information for various new
18460         constructs. 
18461
18462         * delegate.cs (Delegate): take a location argument.
18463
18464         * driver.cs: Do not call EmitCode if there were problesm in the
18465         Definition of the types, as many Builders wont be there. 
18466
18467         * decl.cs (Decl::Decl): Require a location argument.
18468
18469         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18470         into integers, and find the most appropiate integer for it.
18471
18472         * literal.cs: Implement ULongLiteral.
18473
18474         * rootcontext.cs: Provide better information about the location of
18475         failure when CreateType fails.
18476
18477 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18478
18479         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18480         as well.
18481
18482         * expression.cs (Binary::CheckShiftArguments): Add missing type
18483         computation.
18484         (Binary::ResolveOperator): Add type to the logical and and logical
18485         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18486         before.
18487
18488         (Binary::DoNumericPromotions): In the case where either argument
18489         is ulong (and most signed types combined with ulong cause an
18490         error) perform implicit integer constant conversions as well.
18491
18492 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18493
18494         * expression.cs (UserImplicitCast): Method should always be
18495         non-null. 
18496         (Invocation::BetterConversion): Simplified test for IntLiteral.
18497
18498         (Expression::ImplicitNumericConversion): Split this routine out.
18499         Put the code that performs implicit constant integer conversions
18500         here. 
18501
18502         (Expression::Resolve): Become a wrapper around DoResolve so we can
18503         check eclass and type being set after resolve.
18504
18505         (Invocation::Badness): Remove this dead function
18506
18507         (Binary::ResolveOperator): Do not compute the expensive argumnets
18508         unless we have a union for it.
18509
18510         (Probe::Emit): Is needs to do an isinst and then
18511         compare against null.
18512
18513         (::CanConvert): Added Location argument.  If the Location argument
18514         is null (Location.Null), then we do not report errors.  This is
18515         used by the `probe' mechanism of the Explicit conversion.  We do
18516         not want to generate an error for something that the user
18517         explicitly requested to be casted.  But the pipeline for an
18518         explicit cast first tests for potential implicit casts.
18519
18520         So for now, if the Location is null, it means `Probe only' to
18521         avoid adding another argument.   Might have to revise this
18522         strategy later.
18523
18524         (ClassCast): New class used to type cast objects into arbitrary
18525         classes (used in Explicit Reference Conversions).
18526
18527         Implement `as' as well.
18528
18529         Reverted all the patches from Ravi below: they were broken:
18530
18531                 * The use of `level' as a mechanism to stop recursive
18532                   invocations is wrong.  That was there just to catch the
18533                   bug with a strack trace but not as a way of addressing
18534                   the problem.
18535
18536                   To fix the problem we have to *understand* what is going
18537                   on and the interactions and come up with a plan, not
18538                   just get things going.
18539
18540                 * The use of the type conversion cache that I proposed
18541                   last night had an open topic: How does this work across
18542                   protection domains.  A user defined conversion might not
18543                   be public in the location where we are applying the
18544                   conversion, a different conversion might be selected
18545                   (ie, private A->B (better) but public B->A (worse),
18546                   inside A, A->B applies, but outside it, B->A will
18547                   apply).
18548
18549                 * On top of that (ie, even if the above is solved),
18550                   conversions in a cache need to be abstract.  Ie, `To
18551                   convert from an Int to a Short use an OpcodeCast', not
18552                   `To convert from an Int to a Short use the OpcodeCast on
18553                   the variable 5' (which is what this patch was doing).
18554
18555 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18556
18557         * expression.cs (Invocation::ConversionExists): Re-write to use
18558         the conversion cache
18559
18560         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18561         cache all conversions done, not just user-defined ones.
18562
18563         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18564         to determine if a conversion exists instead of acutually trying to 
18565         perform the conversion. It's faster too.
18566
18567         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18568         and only then attempt the implicit conversion.
18569
18570 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18571
18572         * expression.cs (ConvertImplicit): Use a cache for conversions
18573         already found. Check level of recursion and bail out if necessary.
18574
18575 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18576
18577         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18578         Export standard methods that we expect for string operations.
18579
18580         * statement.cs (Block::UsageWarning): Track usage of variables and
18581         report the errors for not used variables.
18582
18583         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18584         operator. 
18585
18586 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18587
18588         * codegen.cs: remove unnneded code 
18589
18590         * expression.cs: Removed BuiltinTypeAccess class
18591
18592         Fix the order in which implicit conversions are
18593         done.  
18594
18595         The previous fixed dropped support for boxed conversions (adding a
18596         test to the test suite now)
18597
18598         (UserImplicitCast::CanConvert): Remove test for source being null,
18599         that code is broken.  We should not feed a null to begin with, if
18600         we do, then we should track the bug where the problem originates
18601         and not try to cover it up here.
18602
18603         Return a resolved expression of type UserImplicitCast on success
18604         rather than true/false.  Ravi: this is what I was talking about,
18605         the pattern is to use a static method as a "constructor" for
18606         objects. 
18607
18608         Also, do not create arguments until the very last minute,
18609         otherwise we always create the arguments even for lookups that
18610         will never be performed. 
18611
18612         (UserImplicitCast::Resolve): Eliminate, objects of type
18613         UserImplicitCast are born in a fully resolved state. 
18614
18615         * typemanager.cs (InitCoreTypes): Init also value_type
18616         (System.ValueType). 
18617
18618         * expression.cs (Cast::Resolve): First resolve the child expression.
18619
18620         (LValue): Add new method AddressOf to be used by
18621         the `&' operator.  
18622
18623         Change the argument of Store to take an EmitContext instead of an
18624         ILGenerator, because things like FieldExpr need to be able to call
18625         their children expression to generate the instance code. 
18626
18627         (Expression::Error, Expression::Warning): Sugar functions for
18628         reporting errors.
18629
18630         (Expression::MemberLookup): Accept a TypeContainer instead of a
18631         Report as the first argument.
18632
18633         (Expression::ResolvePrimary): Killed.  I still want to improve
18634         this as currently the code is just not right.
18635
18636         (Expression::ResolveMemberAccess): Simplify, but it is still
18637         wrong. 
18638
18639         (Unary::Resolve): Catch errors in AddressOf operators.
18640
18641         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18642         index to a byte for the short-version, or the compiler will choose
18643         the wrong Emit call, which generates the wrong data.
18644
18645         (ParameterReference::Emit, ::Store): same.
18646
18647         (FieldExpr::AddressOf): Implement.
18648
18649         * typemanager.cs: TypeManager: made public variable instead of
18650         property.
18651
18652         * driver.cs: document --fatal.
18653
18654         * report.cs (ErrorMessage, WarningMessage): new names for the old
18655         Error and Warning classes.
18656
18657         * cs-parser.jay (member_access): Turn built-in access to types
18658         into a normal simplename
18659
18660 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18661
18662         * expression.cs (Invocation::BetterConversion): Fix to cope
18663         with q being null, since this was introducing a bug.
18664
18665         * expression.cs (ConvertImplicit): Do built-in conversions first.
18666
18667 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18668
18669         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18670
18671 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18672
18673         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18674         I had introduced long ago (what's new ?).
18675
18676         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18677         the work of all the checking. 
18678         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18679         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18680
18681         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18682         that is the right way. 
18683
18684         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18685         overloading resolution. Use everywhere instead of cutting and pasting code.
18686
18687         (Binary::ResolveOperator): Use MakeUnionSet.
18688
18689         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18690         we have to convert to bool types. Not complete yet.
18691
18692 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18693
18694         * typemanager.cs (TypeManager::CSharpName): support ushort.
18695
18696         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18697         to provide an expression that performsn an implicit constant int
18698         conversion (section 6.1.6).
18699         (Expression::ConvertImplicitRequired): Reworked to include
18700         implicit constant expression conversions.
18701
18702         (Expression::ConvertNumericExplicit): Finished.
18703
18704         (Invocation::Emit): If InstanceExpression is null, then it means
18705         that we perform a call on this.
18706
18707 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * expression.cs (Unary::Emit): Remove some dead code.
18710         (Probe): Implement Resolve and Emit for `is'.
18711         (Expression::ConvertImplicitRequired): Attempt to do constant
18712         expression conversions here.  Maybe should be moved to
18713         ConvertImplicit, but I am not sure.
18714         (Expression::ImplicitLongConstantConversionPossible,
18715         Expression::ImplicitIntConstantConversionPossible): New functions
18716         that tell whether is it possible to apply an implicit constant
18717         expression conversion.
18718
18719         (ConvertNumericExplicit): Started work on explicit numeric
18720         conversions.
18721
18722         * cs-parser.jay: Update operator constants.
18723
18724         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18725         (Parameters::GetSignature): Hook up VerifyArgs here.
18726         (Parameters::VerifyArgs): Verifies that no two arguments have the
18727         same name. 
18728
18729         * class.cs (Operator): Update the operator names to reflect the
18730         ones that the spec expects (as we are just stringizing the
18731         operator names).
18732
18733         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18734         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18735         previous usage did only work for our methods.
18736         (Expression::ConvertImplicit): Handle decimal implicit numeric
18737         conversions as well.
18738         (Expression::InternalTypeConstructor): Used to invoke constructors
18739         on internal types for default promotions.
18740
18741         (Unary::Emit): Implement special handling for the pre/post
18742         increment/decrement for overloaded operators, as they need to have
18743         the same semantics as the other operators.
18744
18745         (Binary::ResolveOperator): ditto.
18746         (Invocation::ConversionExists): ditto.
18747         (UserImplicitCast::Resolve): ditto.
18748
18749 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18750
18751         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18752         operator, return after emitting body. Regression tests pass again !
18753
18754         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18755         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18756         (Invocation::OverloadResolve): Ditto.
18757         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18758
18759         * everywhere : update calls to the above methods accordingly.
18760
18761 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18762
18763         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18764
18765         * expression.cs (ExpressionStatement): New base class used for
18766         expressions that can appear in statements, so that we can provide
18767         an alternate path to generate expression that do not leave a value
18768         on the stack.
18769
18770         (Expression::Emit, and all the derivatives): We no longer return
18771         whether a value is left on the stack or not.  Every expression
18772         after being emitted leaves a single value on the stack.
18773
18774         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18775         facilties of ExpressionStatement if possible.
18776
18777         * cs-parser.jay: Update statement_expression.
18778
18779 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18780
18781         * driver.cs: Change the wording of message
18782
18783 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18784
18785         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18786         the type of the expression to the return type of the method if
18787         we have an overloaded operator match ! The regression tests pass again !
18788         (Unary::ResolveOperator): Ditto.
18789
18790         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18791         to find "op_Implicit", not "implicit" ;-)
18792         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18793         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18794
18795         * everywhere : Correct calls to the above accordingly.
18796
18797         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18798         (ConvertImplicit): Do user-defined conversion if it exists.
18799
18800 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18801
18802         * assign.cs: track location.
18803         (Resolve): Use implicit conversions on assignment.
18804
18805         * literal.cs: Oops.  Not good, Emit of short access values should
18806         pass (Bytes) or the wrong argument will be selected.
18807
18808         * expression.cs (Unary::Emit): Emit code for -expr.
18809
18810         (Unary::ResolveOperator): Handle `Substract' for non-constants
18811         (substract from zero from the non-constants).
18812         Deal with Doubles as well. 
18813
18814         (Expression::ConvertImplicitRequired): New routine that reports an
18815         error if no implicit conversion exists. 
18816
18817         (Invocation::OverloadResolve): Store the converted implicit
18818         expressions if we make them
18819
18820 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18821
18822         * class.cs (ConstructorInitializer): Take a Location argument.
18823         (ConstructorBaseInitializer): Same here.
18824         (ConstructorThisInitializer): Same here.
18825
18826         * cs-parser.jay : Update all calls accordingly.
18827
18828         * expression.cs (Unary, Binary, New): Take location argument.
18829         Update accordingly everywhere.
18830
18831         * cs-parser.jay : Update all calls to the above to take a location
18832         argument.
18833
18834         * class.cs : Ditto.
18835
18836 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18837
18838         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18839         (Invocation::BetterConversion): Same here
18840         (Invocation::ConversionExists): Ditto.
18841
18842         (Invocation::ConversionExists): Implement.
18843
18844 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18845
18846         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18847         Also take an additional TypeContainer argument.
18848
18849         * All over : Pass in TypeContainer as argument to OverloadResolve.
18850
18851         * typemanager.cs (CSharpName): Update to check for the string type and return
18852         that too.
18853
18854         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18855         a given method.
18856
18857 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18858
18859         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18860         (Invocation::BetterFunction): Implement.
18861         (Invocation::BetterConversion): Implement.
18862         (Invocation::ConversionExists): Skeleton, no implementation yet.
18863
18864         Okay, things work fine !
18865
18866 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * typemanager.cs: declare and load enum_type, delegate_type and
18869         void_type. 
18870
18871         * expression.cs (Expression::Emit): Now emit returns a value that
18872         tells whether a value is left on the stack or not.  This strategy
18873         might be reveted tomorrow with a mechanism that would address
18874         multiple assignments.
18875         (Expression::report118): Utility routine to report mismatches on
18876         the ExprClass.
18877
18878         (Unary::Report23): Report impossible type/operator combination
18879         utility function.
18880
18881         (Unary::IsIncrementableNumber): Whether the type can be
18882         incremented or decremented with add.
18883         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18884         complemented. 
18885         (Unary::ResolveOperator): Implement ++, !, ~,
18886
18887         (Invocation::Emit): Deal with new Emit convetion.
18888
18889         * All Expression derivatives: Updated their Emit method to return
18890         whether they leave values on the stack or not.
18891
18892         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18893         stack for expressions that are statements. 
18894
18895 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18896
18897         * expression.cs (LValue): New interface.  Must be implemented by
18898         LValue objects.
18899         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18900         LValue interface.
18901
18902         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18903         interface for generating code, simplifies the code.
18904
18905 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18906
18907         * expression.cs (everywhere): Comment out return statements in ::Resolve
18908         methods to avoid the warnings.
18909
18910 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18911
18912         * driver.cs (parse): Report error 2001 if we can not open the
18913         source file.
18914
18915         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18916         not resolve it.
18917
18918         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18919         object. 
18920
18921         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18922         otherwise nested blocks end up with the same index.
18923
18924         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18925
18926         * expression.cs:  Instead of having FIXMEs in the Resolve
18927         functions, throw exceptions so it is obvious that we are facing a
18928         bug. 
18929
18930         * cs-parser.jay (invocation_expression): Pass Location information.
18931
18932         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18933         Use a basename for those routines because .NET does not like paths
18934         on them. 
18935
18936         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18937         already defined.
18938
18939 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18940
18941         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18942         are loading the correct data types (throws an exception if not).
18943         (TypeManager::InitCoreTypes): Use CoreLookupType
18944
18945         * expression.cs (Unary::ResolveOperator): return the child
18946         expression for expressions which are just +expr.
18947         (Unary::ResolveOperator): Return negative literals for -LITERAL
18948         expressions (otherwise they are Unary {Literal}).
18949         (Invocation::Badness): Take into account `Implicit constant
18950         expression conversions'.
18951
18952         * literal.cs (LongLiteral): Implement long literal class.
18953         (IntLiteral): export the `Value' of the intliteral. 
18954
18955 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18956
18957         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18958
18959         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18960         instead of 'Operator'
18961
18962         * expression.cs (Binary::ResolveOperator): Update accordingly.
18963         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18964         and 'Minus'
18965
18966         * cs-parser.jay (unary_expression): Update to use the new names.
18967
18968         * gen-treedump.cs (GetUnary): Same here.
18969
18970         * expression.cs (Unary::Resolve): Implement.
18971         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18972         operators are found instead of making noise ;-)
18973         (Unary::ResolveOperator): New method to do precisely the same thing which
18974         Binary::ResolveOperator does for Binary expressions.
18975         (Unary.method, .Arguments): Add.
18976         (Unary::OperName): Implement.   
18977         (Unary::ForceConversion): Copy and Paste !
18978
18979         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18980         a unary operator.
18981
18982         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18983         for the inbuilt operators. Only overloading works for now ;-)
18984
18985 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18986
18987         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18988         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18989
18990         * expression.cs (This::Emit): Implement. 
18991         (This::Resolve): Implement.
18992         (TypeOf:Resolve): Implement.
18993         (Expression::ResolveSimpleName): Add an implicit this to instance
18994         field references. 
18995         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18996         Bind instance variable to Field expressions.
18997         (FieldExpr::Instance): New field used to track the expression that
18998         represents the object instance.
18999         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19000         binding 
19001         (FieldExpr::Emit): Implement.
19002
19003         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19004         the last instruction contains a return opcode to avoid generating
19005         the last `ret' instruction (this generates correct code, and it is
19006         nice to pass the peverify output).
19007
19008         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19009         initializer for static and instance variables.
19010         (Constructor::Emit): Allow initializer to be null in the case of
19011         static constructors.  Only emit initializer for instance
19012         constructors. 
19013
19014         (TypeContainer::FindMembers): Return a null array if there are no
19015         matches.
19016
19017         Also fix the code for the MemberTypes.Method branch, as it was not
19018         scanning that for operators (or tried to access null variables before).
19019
19020         * assign.cs (Assign::Emit): Handle instance and static fields. 
19021
19022         * TODO: Updated.
19023
19024         * driver.cs: Stop compilation if there are parse errors.
19025
19026         * cs-parser.jay (constructor_declaration): Provide default base
19027         initializer for non-static constructors.
19028         (constructor_declarator): Do not provide a default base
19029         initializers if none was specified.
19030         Catch the fact that constructors should not have parameters.
19031
19032         * class.cs: Do not emit parent class initializers for static
19033         constructors, that should be flagged as an error.
19034
19035 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19036
19037         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19038         Move back code into TypeContainer::Populate.
19039
19040 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19041
19042         * class.cs (TypeContainer::AddConstructor): Fix the check to
19043         compare against Name, not Basename. 
19044         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19045
19046         * cs-parser.jay : Update accordingly.
19047
19048         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19049         for methods, don't forget to look into the operators too.
19050         (RegisterMethodBuilder): Helper method to take care of this for
19051         methods, constructors and operators.
19052         (Operator::Define): Completely revamp.
19053         (Operator.OperatorMethod, MethodName): New fields.
19054         (TypeContainer::Populate): Move the registering of builders into
19055         RegisterMethodBuilder.
19056         (Operator::Emit): Re-write.
19057
19058         * expression.cs (Binary::Emit): Comment out code path to emit method
19059         invocation stuff for the case when we have a user defined operator. I am
19060         just not able to get it right !
19061
19062 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19063
19064         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19065         argument. 
19066
19067         (Expression::MemberLookup): Provide a version that allows to
19068         specify the MemberTypes and BindingFlags. 
19069
19070         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19071         so it was not fetching variable information from outer blocks.
19072
19073         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19074         Beforefieldinit as it was buggy.
19075
19076         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19077         that Ravi put here.  
19078
19079         * class.cs (Constructor::Emit): Only emit if block is not null.
19080         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19081         deal with this by semantically definining it as if the user had
19082         done it.
19083
19084         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19085         constructors as we now "emit" them at a higher level.
19086
19087         (TypeContainer::DefineDefaultConstructor): Used to define the
19088         default constructors if none was provided.
19089
19090         (ConstructorInitializer): Add methods Resolve and Emit. 
19091
19092         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19093
19094 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19095
19096         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19097         the default constructor builder with our hashtable for methodbuilders
19098         to methodcores.
19099
19100         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19101         and argument_count is 0 in which case we have a match.
19102         (Binary::ResolveOperator): More null checking and miscellaneous coding
19103         style cleanup.
19104
19105 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19106
19107         * rootcontext.cs (IsNameSpace): Compare against null.
19108
19109         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19110
19111         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19112         and Unary::Operator.
19113
19114         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19115         accordingly.
19116
19117         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19118         we have overloaded operators.
19119         (Binary::ResolveOperator): Implement the part which does the operator overload
19120         resolution.
19121
19122         * class.cs (Operator::Emit): Implement.
19123         (TypeContainer::Emit): Emit the operators we have too.
19124
19125         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19126         the case when we have a user-defined operator.
19127
19128 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19129
19130         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19131
19132 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19133
19134         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19135         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19136         (Constructor::Emit): Implement.
19137         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19138         if we have no work to do. 
19139         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19140         Emit method.
19141
19142         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19143         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19144
19145         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19146         of parent.parent.
19147
19148 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19149
19150         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19151         in the source.
19152         (Tree::RecordNamespace): Method to do what the name says ;-)
19153         (Tree::Namespaces): Property to get at the namespaces hashtable.
19154
19155         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19156         keep track.
19157
19158         * rootcontext.cs (IsNamespace): Fixed it :-)
19159
19160 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * class.cs (TypeContainer::FindMembers): Add support for
19163         constructors. 
19164         (MethodCore): New class that encapsulates both the shared aspects
19165         of a Constructor and a Method.  
19166         (Method, Constructor): Factored pieces into MethodCore.
19167
19168         * driver.cs: Added --fatal which makes errors throw exceptions.
19169         Load System assembly as well as part of the standard library.
19170
19171         * report.cs: Allow throwing exceptions on errors for debugging.
19172
19173         * modifiers.cs: Do not use `parent', instead use the real type
19174         container to evaluate permission settings.
19175
19176         * class.cs: Put Ravi's patch back in.  He is right, and we will
19177         have to cope with the
19178
19179 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19180
19181         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19182         FamORAssem, not FamANDAssem.
19183
19184 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * driver.cs: Added --parse option that only parses its input files
19187         and terminates.
19188
19189         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19190         incorrect.  IsTopLevel is not used to tell whether an object is
19191         root_types or not (that can be achieved by testing this ==
19192         root_types).  But to see if this is a top-level *class* (not
19193         necessarly our "toplevel" container). 
19194
19195 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19196
19197         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19198         parent instead of a direct call to GetType.
19199
19200 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19201
19202         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19203         Modifiers.TypeAttr. This should just be a call to that method.
19204
19205         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19206         object so that we can determine if we are top-level or not.
19207
19208         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19209         TypeContainer too.
19210
19211         * enum.cs (Enum::Define): Ditto.
19212
19213         * modifiers.cs (FieldAttr): Re-write.
19214
19215         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19216         (TypeContainer::HaveStaticConstructor): New property to provide access
19217         to precisely that info.
19218
19219         * modifiers.cs (MethodAttr): Re-write.
19220         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19221
19222         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19223         of top-level types as claimed.
19224
19225 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19226
19227         * expression.cs (MemberLookup): Fruitless attempt to lookup
19228         constructors.  Maybe I need to emit default constructors?  That
19229         might be it (currently .NET emits this for me automatically).
19230         (Invocation::OverloadResolve): Cope with Arguments == null.
19231         (Invocation::EmitArguments): new function, shared by the new
19232         constructor and us.
19233         (Invocation::Emit): Handle static and instance methods.  Emit
19234         proper call instruction for virtual or non-virtual invocations.
19235         (New::Emit): Implement.
19236         (New::Resolve): Implement.
19237         (MemberAccess:Resolve): Implement.
19238         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19239         to track instances.
19240         (FieldExpr::Resolve): Set type.
19241
19242         * support.cs: Handle empty arguments.
19243                 
19244         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19245         SimpleLookup): Auxiliary routines to help parse a qualifier
19246         identifier.  
19247
19248         Update qualifier_identifier rule.
19249
19250         * codegen.cs: Removed debugging messages.
19251
19252         * class.cs: Make this a global thing, this acts just as a "key" to
19253         objects that we might have around.
19254
19255         (Populate): Only initialize method_builders_to_methods once.
19256
19257         * expression.cs (PropertyExpr): Initialize type from the
19258         PropertyType. 
19259
19260         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19261         Resolve pattern.  Attempt to implicitly convert value to boolean.
19262         Emit code.
19263
19264         * expression.cs: Set the type for the int32/int32 argument case.
19265         (Binary::ResolveOperator): Set the return type to boolean for
19266         comparission operators
19267
19268         * typemanager.cs: Remove debugging print code.
19269
19270         (Invocation::Resolve): resolve type.
19271
19272         * class.cs: Allocate a MemberInfo of the correct size, as the code
19273         elsewhere depends on the test to reflect the correct contents.
19274
19275         (Method::) Keep track of parameters, due to System.Reflection holes
19276
19277         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19278         mapping here.
19279
19280         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19281         of the exact size and return that.
19282
19283         (Class::LookupMethodByBuilder): New function that maps
19284         MethodBuilders to its methods.  Required to locate the information
19285         on methods because System.Reflection bit us again.
19286
19287         * support.cs: New file, contains an interface ParameterData and
19288         two implementations: ReflectionParameters and InternalParameters
19289         used to access Parameter information.  We will need to grow this
19290         as required.
19291
19292         * expression.cs (Invocation::GetParameterData): implement a cache
19293         and a wrapper around the ParameterData creation for methods. 
19294         (Invocation::OverloadResolve): Use new code.
19295
19296 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19297
19298         * class.cs (TypeContainer::EmitField): Remove and move into 
19299         (Field::Define): here and modify accordingly.
19300         (Field.FieldBuilder): New member.
19301         (TypeContainer::Populate): Update accordingly.
19302         (TypeContainer::FindMembers): Implement.
19303
19304 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19305
19306         * statement.cs: (VariableInfo::VariableType): New field to be
19307         initialized with the full type once it is resolved. 
19308
19309 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19310
19311         * parameter.cs (GetParameterInfo): Use a type cache to compute
19312         things only once, and to reuse this information
19313
19314         * expression.cs (LocalVariableReference::Emit): Implement.
19315         (OpcodeCast::Emit): fix.
19316
19317         (ParameterReference::Resolve): Implement.
19318         (ParameterReference::Emit): Implement.
19319
19320         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19321         that are expressions need to stay as Expressions.
19322
19323         * typemanager.cs (CSharpName): Returns the C# name of a type if
19324         possible. 
19325
19326         * expression.cs (Expression::ConvertImplicit): New function that
19327         implements implicit type conversions.
19328
19329         (Expression::ImplicitReferenceConversion): Implements implicit
19330         reference conversions.
19331
19332         (EmptyCast): New type for transparent casts.
19333
19334         (OpcodeCast): New type for casts of types that are performed with
19335         a sequence of bytecodes.
19336
19337         (BoxedCast): New type used for casting value types into reference
19338         types.  Emits a box opcode.
19339
19340         (Binary::DoNumericPromotions): Implements numeric promotions of
19341         and computation of the Binary::Type.
19342
19343         (Binary::EmitBranchable): Optimization.
19344
19345         (Binary::Emit): Implement code emission for expressions.
19346
19347         * typemanager.cs (TypeManager): Added two new core types: sbyte
19348         and byte.
19349
19350 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19351
19352         * class.cs (TypeContainer::FindMembers): Method which does exactly
19353         what Type.FindMembers does, only we don't have to use reflection. No
19354         implementation yet.
19355
19356         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19357         typecontainer objects as we need to get at them.
19358         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19359
19360         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19361         typecontainer object.
19362
19363         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19364         of just a Report object.
19365
19366 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19367
19368         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19369         "remove_"
19370         (TypeContainer::Populate): Now define the delegates of the type too.
19371         (TypeContainer.Delegates): Property to access the list of delegates defined
19372         in the type.
19373
19374         * delegates.cs (Delegate::Define): Implement partially.
19375
19376         * modifiers.cs (TypeAttr): Handle more flags.
19377
19378 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19379
19380         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19381         and not <=
19382         (Operator::Define): Re-write logic to get types by using the LookupType method
19383         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19384         (Indexer::Define): Ditto.
19385         (Event::Define): Ditto.
19386         (Property::Define): Ditto.
19387
19388 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19389
19390         * class.cs (TypeContainer::Populate): Now define operators too. 
19391         (TypeContainer.Operators): New property to access the list of operators
19392         in a type.
19393         (Operator.OperatorMethodBuilder): New member to hold the method builder
19394         for the operator we are defining.
19395         (Operator::Define): Implement.
19396
19397 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19398
19399         * class.cs (Event::Define): Make the prefixes of the accessor methods
19400         addOn_ and removeOn_ 
19401
19402         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19403         of the location being passed in too. Ideally, this should go later since all
19404         error reporting should be done through the Report object.
19405
19406         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19407         (Populate): Iterate thru the indexers we have and define them too.
19408         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19409         for the get and set accessors.
19410         (Indexer::Define): Implement.
19411
19412 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19413
19414         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19415         my previous implementation, did not work.
19416
19417         * typemanager.cs: Add a couple of missing types (the longs).
19418
19419         * literal.cs: Use TypeManager.bool_type instead of getting it.
19420
19421         * expression.cs (EventExpr): New kind of expressions.
19422         (Expressio::ExprClassFromMemberInfo): finish
19423
19424 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19425
19426         * assign.cs: Emit stores to static fields differently.
19427
19428 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19429
19430         * Merge in changes and adjust code to tackle conflicts. Backed out my
19431         code in Assign::Resolve ;-) 
19432
19433 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19434
19435         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19436         instead Report.Error and also pass in the location.
19437         (CSharpParser::Lexer): New readonly property to return the reference
19438         to the Tokenizer object.
19439         (declare_local_variables): Use Report.Error with location instead of plain 
19440         old error.
19441         (CheckDef): Ditto.
19442
19443         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19444         (Operator.CheckBinaryOperator): Ditto.
19445
19446         * cs-parser.jay (operator_declarator): Update accordingly.
19447
19448         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19449         (CheckBinaryOperator): Same here.
19450
19451         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19452         on the name without any prefixes of namespace names etc. This is because we
19453         already might have something already fully qualified like 
19454         'System.Console.WriteLine'
19455
19456         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19457
19458 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19459
19460         * cs-tokenizer.cs (location): Return a string which also contains
19461         the file name.
19462
19463         * expression.cs (ElementAccess): New class for expressions of the
19464         type 'element access.'
19465         (BaseAccess): New class for expressions of the type 'base access.'
19466         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19467         respectively.
19468
19469         * cs-parser.jay (element_access): Implement action.
19470         (base_access): Implement actions.
19471         (checked_expression, unchecked_expression): Implement.
19472
19473         * cs-parser.jay (local_variable_type): Correct and implement.
19474         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19475
19476         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19477
19478         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19479         name and the specifiers.
19480
19481         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19482
19483         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19484         making them all public ;-)
19485
19486         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19487         class anyways.
19488
19489 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19492         PropertyExprs.
19493         (FieldExpr, PropertyExprs): New resolved expressions.
19494         (SimpleName::MemberStaticCheck): Perform static checks for access
19495         to non-static fields on static methods. Maybe this should be
19496         generalized for MemberAccesses. 
19497         (SimpleName::ResolveSimpleName): More work on simple name
19498         resolution. 
19499
19500         * cs-parser.jay (primary_expression/qualified_identifier): track
19501         the parameter index.
19502
19503         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19504         (EmitContext::EmitBoolExpression): Chain to expression generation
19505         instead of temporary hack.
19506         (::EmitStatementExpression): Put generic expression code generation.
19507
19508         * assign.cs (Assign::Emit): Implement variable assignments to
19509         local variables, parameters and fields.
19510
19511 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19512
19513         * statement.cs (Block::GetVariableInfo): New method, returns the
19514         VariableInfo for a variable name in a block.
19515         (Block::GetVariableType): Implement in terms of GetVariableInfo
19516
19517         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19518         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19519
19520 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19521
19522         * cs-parser.jay (operator_declaration): Continue on my quest : update
19523         to take attributes argument.
19524         (event_declaration): Ditto.
19525         (enum_declaration): Ditto.
19526         (indexer_declaration): Ditto.
19527
19528         * class.cs (Operator::Operator): Update constructor accordingly.
19529         (Event::Event): Ditto.
19530
19531         * delegate.cs (Delegate::Delegate): Same here.
19532
19533         * enum.cs (Enum::Enum): Same here.
19534
19535 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19536
19537         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19538
19539         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19540
19541         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19542         being passed around as an arraylist.
19543         (Attributes::AddAttribute): Method to add attribute sections.
19544
19545         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19546         (struct_declaration): Update accordingly.
19547         (constant_declaration): Update.
19548         (field_declaration): Update.
19549         (method_header): Update.
19550         (fixed_parameter): Update.
19551         (parameter_array): Ditto.
19552         (property_declaration): Ditto.
19553         (destructor_declaration): Ditto.
19554
19555         * class.cs (Struct::Struct): Update constructors accordingly.
19556         (Class::Class): Ditto.
19557         (Field::Field): Ditto.
19558         (Method::Method): Ditto.
19559         (Property::Property): Ditto.
19560         (TypeContainer::OptAttribute): update property's return type.
19561
19562         * interface.cs (Interface.opt_attributes): New member.
19563         (Interface::Interface): Update to take the extra Attributes argument.
19564
19565         * parameter.cs (Parameter::Parameter): Ditto.
19566
19567         * constant.cs (Constant::Constant): Ditto.
19568
19569         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19570         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19571         the attributes as a parameter.
19572         (InterfaceProperty): Update constructor call.
19573         (InterfaceEvent): Ditto.
19574         (InterfaceMethod): Ditto.
19575         (InterfaceIndexer): Ditto.
19576
19577         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19578         pass the attributes too.
19579         (interface_event_declaration): Ditto.
19580         (interface_property_declaration): Ditto.
19581         (interface_method_declaration): Ditto.
19582         (interface_declaration): Ditto.
19583
19584 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19585
19586         * class.cs (Method::Define): Track the "static Main" definition to
19587         create an entry point. 
19588
19589         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19590         EntryPoint if we find it. 
19591
19592         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19593         (EmitContext::ig): Make this variable public.
19594
19595         * driver.cs: Make the default output file be the first file name
19596         with the .exe extension.  
19597
19598         Detect empty compilations
19599
19600         Handle various kinds of output targets.  Handle --target and
19601         rename -t to --dumper.
19602
19603         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19604         methods inherited from Expression return now an Expression.  This
19605         will is used during the tree rewriting as we resolve them during
19606         semantic analysis.
19607
19608         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19609         the spec.  Missing entirely is the information about
19610         accessability of elements of it.
19611
19612         (Expression::ExprClassFromMemberInfo): New constructor for
19613         Expressions that creates a fully initialized Expression based on
19614         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19615         a Type.
19616
19617         (Invocation::Resolve): Begin implementing resolution of invocations.
19618
19619         * literal.cs (StringLiteral):  Implement Emit.
19620
19621 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19622
19623         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19624         member.
19625
19626 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19627
19628         * cs-parser.jay (attribute_arguments): Implement actions.
19629         (attribute): Fix bug in production. Implement action.
19630         (attribute_list): Implement.
19631         (attribute_target): Implement.
19632         (attribute_target_specifier, opt_target_specifier): Implement
19633         (CheckAttributeTarget): New method to check if the attribute target
19634         is valid.
19635         (attribute_section): Implement.
19636         (opt_attributes): Implement.
19637
19638         * attribute.cs : New file to handle attributes.
19639         (Attribute): Class to hold attribute info.
19640
19641         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19642         (attribute_section): Modify production to use 2 different rules to 
19643         achieve the same thing. 1 s/r conflict down !
19644         Clean out commented, useless, non-reducing dimension_separator rules.
19645
19646         * class.cs (TypeContainer.attributes): New member to hold list
19647         of attributes for a type.
19648         (Struct::Struct): Modify to take one more argument, the attribute list.
19649         (Class::Class): Ditto.
19650         (Field::Field): Ditto.
19651         (Method::Method): Ditto.
19652         (Property::Property): Ditto.
19653
19654         * cs-parser.jay (struct_declaration): Update constructor call to
19655         pass in the attributes too.
19656         (class_declaration): Ditto.
19657         (constant_declaration): Ditto.
19658         (field_declaration): Ditto.
19659         (method_header): Ditto.
19660         (fixed_parameter): Ditto.
19661         (parameter_array): Ditto.
19662         (property_declaration): Ditto.
19663
19664         * constant.cs (Constant::Constant): Update constructor similarly.
19665         Use System.Collections.
19666
19667         * parameter.cs (Parameter::Parameter): Update as above.
19668
19669 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19670
19671         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19672         (TypeContainer.delegates): New member to hold list of delegates.
19673
19674         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19675         this time as I seem to be on crack ;-)
19676
19677 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19680         tell whether an identifier represents a namespace.
19681
19682         * expression.cs (NamespaceExpr): A namespace expression, used only
19683         temporarly during expression resolution.
19684         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19685         utility functions to resolve names on expressions.
19686
19687 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * codegen.cs: Add hook for StatementExpressions. 
19690
19691         * class.cs: Fix inverted test for static flag in methods.
19692
19693 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19694
19695         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19696         to make it coincide with MS' number.
19697         (Operator::CheckBinaryOperator): Ditto.
19698
19699         * ../errors/errors.txt : Remove error numbers added earlier.
19700
19701         * ../errors/cs1019.cs : Test case for error # 1019
19702
19703         * ../errros/cs1020.cs : Test case for error # 1020
19704
19705         * cs-parser.jay : Clean out commented cruft.
19706         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19707         used anywhere - non-reducing rule.
19708         (namespace_declarations): Non-reducing rule - comment out.
19709
19710         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19711         with TypeContainer::AddEnum.
19712
19713         * delegate.cs : New file for delegate handling classes.
19714         (Delegate): Class for declaring delegates.
19715
19716         * makefile : Update.
19717
19718         * cs-parser.jay (delegate_declaration): Implement.
19719
19720 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19721
19722         * class.cs (Event::Define): Implement.
19723         (Event.EventBuilder): New member.
19724
19725         * class.cs (TypeContainer::Populate): Update to define all enums and events
19726         we have.
19727         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19728         readonly fields for all these cases ?
19729
19730 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19731
19732         * class.cs (Property): Revamp to use the convention of making fields readonly.
19733         Accordingly modify code elsewhere.
19734
19735         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19736         the Define method of the Property class.
19737
19738         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19739         trivial bug.
19740         (TypeContainer::Populate): Update to define all the properties we have. Also
19741         define all enumerations.
19742
19743         * enum.cs (Define): Implement.
19744
19745 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19746
19747         * cs-parser.jay (overloadable_operator): The semantic value is an
19748         enum of the Operator class.
19749         (operator_declarator): Implement actions.
19750         (operator_declaration): Implement.
19751
19752         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19753         validity of definitions.
19754         (Operator::CheckBinaryOperator): Static method to check for binary operators
19755         (TypeContainer::AddOperator): New method to add an operator to a type.
19756
19757         * cs-parser.jay (indexer_declaration): Added line to actually call the
19758         AddIndexer method so it gets added ;-)
19759
19760         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19761         already taken care of by the MS compiler ?  
19762
19763 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19764
19765         * class.cs (Operator): New class for operator declarations.
19766         (Operator::OpType): Enum for the various operators.
19767
19768 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19769
19770         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19771         ostensibly handle this in semantic analysis.
19772
19773         * cs-parser.jay (general_catch_clause): Comment out
19774         (specific_catch_clauses, specific_catch_clause): Ditto.
19775         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19776         (catch_args, opt_catch_args): New productions.
19777         (catch_clause): Rewrite to use the new productions above
19778         (catch_clauses): Modify accordingly.
19779         (opt_catch_clauses): New production to use in try_statement
19780         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19781         and re-write the code in the actions to extract the specific and
19782         general catch clauses by being a little smart ;-)
19783
19784         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19785         Hooray, try and catch statements parse fine !
19786
19787 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19788
19789         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19790         string from the hashtable of variables.
19791
19792         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19793         I end up making that mistake ;-)
19794         (catch_clauses): Fixed gross error which made Key and Value of the 
19795         DictionaryEntry the same : $1 !!
19796
19797 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19798
19799         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19800
19801         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19802         when the add and remove accessors are specified. 
19803
19804 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19805
19806         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19807         information about indexer_declarator.
19808         (indexer_declarator): Implement actions.
19809         (parsing_indexer): New local boolean used to keep track of whether
19810         we are parsing indexers or properties. This is necessary because 
19811         implicit_parameters come into picture even for the get accessor in the 
19812         case of an indexer.
19813         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19814
19815         * class.cs (Indexer): New class for indexer declarations.
19816         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19817         (TypeContainer::indexers): New member to hold list of indexers for the
19818         type.
19819
19820 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19821
19822         * cs-parser.jay (add_accessor_declaration): Implement action.
19823         (remove_accessor_declaration): Implement action.
19824         (event_accessors_declaration): Implement
19825         (variable_declarators): swap statements for first rule - trivial.
19826
19827         * class.cs (Event): New class to hold information about event
19828         declarations.
19829         (TypeContainer::AddEvent): New method to add an event to a type
19830         (TypeContainer::events): New member to hold list of events.
19831
19832         * cs-parser.jay (event_declaration): Implement actions.
19833
19834 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19835
19836         * cs-parser.jay (dim_separators): Implement. Make it a string
19837         concatenating all the commas together, just as they appear.
19838         (opt_dim_separators): Modify accordingly
19839         (rank_specifiers): Update accordingly. Basically do the same
19840         thing - instead, collect the brackets here.
19841         (opt_rank_sepcifiers): Modify accordingly.
19842         (array_type): Modify to actually return the complete type string
19843         instead of ignoring the rank_specifiers.
19844         (expression_list): Implement to collect the expressions
19845         (variable_initializer): Implement. We make it a list of expressions
19846         essentially so that we can handle the array_initializer case neatly too.
19847         (variable_initializer_list): Implement.
19848         (array_initializer): Make it a list of variable_initializers
19849         (opt_array_initializer): Modify accordingly.
19850
19851         * expression.cs (New::NType): Add enumeration to help us
19852         keep track of whether we have an object/delegate creation
19853         or an array creation.
19854         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19855         members to hold data about array creation.
19856         (New:New): Modify to update NewType
19857         (New:New): New Overloaded contructor for the array creation
19858         case.
19859
19860         * cs-parser.jay (array_creation_expression): Implement to call
19861         the overloaded New constructor.
19862
19863 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19864
19865         * class.cs (TypeContainer::Constructors): Return member
19866         constructors instead of returning null.
19867
19868 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19869
19870         * typemanager.cs (InitCoreTypes): Initialize the various core
19871         types after we have populated the type manager with the user
19872         defined types (this distinction will be important later while
19873         compiling corlib.dll)
19874
19875         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19876         on Expression Classification.  Now all expressions have a method
19877         `Resolve' and a method `Emit'.
19878
19879         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19880         generation from working.     Also add some temporary debugging
19881         code. 
19882
19883 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19884
19885         * codegen.cs: Lots of code generation pieces.  This is only the
19886         beginning, will continue tomorrow with more touches of polish.  We
19887         handle the fundamentals of if, while, do, for, return.  Others are
19888         trickier and I need to start working on invocations soon.
19889
19890         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19891         s.InitStatement. 
19892
19893         * codegen.cs (EmitContext): New struct, used during code
19894         emission to keep a context.   Most of the code generation will be
19895         here. 
19896
19897         * cs-parser.jay: Add embedded blocks to the list of statements of
19898         this block.  So code generation proceeds in a top down fashion.
19899
19900 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * statement.cs: Add support for multiple child blocks.
19903
19904 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19905
19906         * codegen.cs (EmitCode): New function, will emit the code for a
19907         Block of code given a TypeContainer and its ILGenerator. 
19908
19909         * statement.cs (Block): Standard public readonly optimization.
19910         (Block::Block constructors): Link children. 
19911         (Block::Child): Child Linker.
19912         (Block::EmitVariables): Emits IL variable declarations.
19913
19914         * class.cs: Drop support for MethodGroups here, delay until
19915         Semantic Analysis.
19916         (Method::): Applied the same simplification that I did before, and
19917         move from Properties to public readonly fields.
19918         (Method::ParameterTypes): Returns the parameter types for the
19919         function, and implements a cache that will be useful later when I
19920         do error checking and the semantic analysis on the methods is
19921         performed.
19922         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19923         and made a method, optional argument tells whether this is a class
19924         or a structure to apply the `has-this' bit.
19925         (Method::GetCallingConvention): Implement, returns the calling
19926         convention. 
19927         (Method::Define): Defines the type, a second pass is performed
19928         later to populate the methods.
19929
19930         (Constructor::ParameterTypes): implement a cache similar to the
19931         one on Method::ParameterTypes, useful later when we do semantic
19932         analysis. 
19933
19934         (TypeContainer::EmitMethod):  New method.  Emits methods.
19935
19936         * expression.cs: Removed MethodGroup class from here.
19937
19938         * parameter.cs (Parameters::GetCallingConvention): new method.
19939
19940 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * class.cs (TypeContainer::Populate): Drop RootContext from the
19943         argument. 
19944
19945         (Constructor::CallingConvention): Returns the calling convention.
19946         (Constructor::ParameterTypes): Returns the constructor parameter
19947         types. 
19948
19949         (TypeContainer::AddConstructor): Keep track of default constructor
19950         and the default static constructor.
19951
19952         (Constructor::) Another class that starts using `public readonly'
19953         instead of properties. 
19954
19955         (Constructor::IsDefault): Whether this is a default constructor. 
19956
19957         (Field::) use readonly public fields instead of properties also.
19958
19959         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19960         track of static constructors;  If none is used, turn on
19961         BeforeFieldInit in the TypeAttributes. 
19962
19963         * cs-parser.jay (opt_argument_list): now the return can be null
19964         for the cases where there are no arguments. 
19965
19966         (constructor_declarator): If there is no implicit `base' or
19967         `this', then invoke the default parent constructor. 
19968
19969         * modifiers.cs (MethodAttr): New static function maps a set of
19970         modifiers flags into a MethodAttributes enum
19971         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19972         MethodAttr, TypeAttr to represent the various mappings where the
19973         modifiers are used.
19974         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19975
19976 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19977
19978         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19979         method arguments.
19980
19981         * interface.cs (PopulateIndexer): Implemented the code generator
19982         for interface indexers.
19983
19984 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19985
19986         * interface.cs (InterfaceMemberBase): Now we track the new status
19987         here.  
19988
19989         (PopulateProperty): Implement property population.  Woohoo!  Got
19990         Methods and Properties going today. 
19991
19992         Removed all the properties for interfaces, and replaced them with
19993         `public readonly' fields. 
19994
19995 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19996
19997         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19998         initialize their hashtables/arraylists only when they are needed
19999         instead of doing this always.
20000
20001         * parameter.cs: Handle refs and out parameters.
20002
20003         * cs-parser.jay: Use an ArrayList to construct the arguments
20004         instead of the ParameterCollection, and then cast that to a
20005         Parameter[] array.
20006
20007         * parameter.cs: Drop the use of ParameterCollection and use
20008         instead arrays of Parameters.
20009
20010         (GetParameterInfo): Use the Type, not the Name when resolving
20011         types. 
20012
20013 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20016         and instead use public readonly fields.
20017
20018         * class.cs: Put back walking code for type containers.
20019
20020 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20021
20022         * class.cs (MakeConstant): Code to define constants.
20023
20024         * rootcontext.cs (LookupType): New function.  Used to locate types 
20025
20026
20027 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20028
20029         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20030         this System.Reflection code is.  Kudos to Microsoft
20031
20032         * typemanager.cs: Implement a type cache and avoid loading all
20033         types at boot time.  Wrap in LookupType the internals.  This made
20034         the compiler so much faster.  Wow.  I rule!
20035
20036         * driver.cs: Make sure we always load mscorlib first (for
20037         debugging purposes, nothing really important).
20038
20039         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20040         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20041
20042         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20043         on namespaces that have been imported using the `using' keyword.
20044
20045         * class.cs (TypeContainer::TypeAttr): Virtualize.
20046         (Class::TypeAttr): Return attributes suitable for this bad boy.
20047         (Struct::TypeAttr): ditto.
20048         Handle nested classes.
20049         (TypeContainer::) Remove all the type visiting code, it is now
20050         replaced with the rootcontext.cs code
20051
20052         * rootcontext.cs (GetClassBases): Added support for structs. 
20053
20054 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20055
20056         * interface.cs, statement.cs, class.cs, parameter.cs,
20057         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20058         Drop use of TypeRefs, and use strings instead.
20059
20060 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20061
20062         * rootcontext.cs: 
20063
20064         * class.cs (Struct::Struct): set the SEALED flags after
20065         checking the modifiers.
20066         (TypeContainer::TypeAttr): new property, returns the
20067         TypeAttributes for a class.  
20068
20069         * cs-parser.jay (type_list): Oops, list production was creating a
20070         new list of base types.
20071
20072         * rootcontext.cs (StdLib): New property.
20073         (GetInterfaceTypeByName): returns an interface by type name, and
20074         encapsulates error handling here.
20075         (GetInterfaces): simplified.
20076         (ResolveTree): Encapsulated all the tree resolution here.
20077         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20078         types. 
20079
20080         * driver.cs: Add support for --nostdlib, to avoid loading the
20081         default assemblies.
20082         (Main): Do not put tree resolution here. 
20083
20084         * rootcontext.cs: Beginning of the class resolution.
20085
20086 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20087
20088         * rootcontext.cs: Provide better error reporting. 
20089
20090         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20091
20092         * rootcontext.cs (CreateInterface): Handle the case where there
20093         are no parent interfaces.
20094
20095         (CloseTypes): Routine to flush types at the end.
20096         (CreateInterface): Track types.
20097         (GetInterfaces): Returns an array of Types from the list of
20098         defined interfaces.
20099
20100         * typemanager.c (AddUserType): Mechanism to track user types (puts
20101         the type on the global type hash, and allows us to close it at the
20102         end). 
20103
20104 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20107         RecordInterface instead.
20108
20109         * cs-parser.jay: Updated to reflect changes above.
20110
20111         * decl.cs (Definition): Keep track of the TypeBuilder type that
20112         represents this type here.  Not sure we will use it in the long
20113         run, but wont hurt for now.
20114
20115         * driver.cs: Smaller changes to accomodate the new code.
20116
20117         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20118         when done. 
20119
20120         * rootcontext.cs (CreateInterface):  New method, used to create
20121         the System.TypeBuilder type for interfaces.
20122         (ResolveInterfaces): new entry point to resolve the interface
20123         hierarchy. 
20124         (CodeGen): Property, used to keep track of the code generator.
20125
20126 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * cs-parser.jay: Add a second production for delegate_declaration
20129         with `VOID'.
20130
20131         (enum_body): Put an opt_comma here instead of putting it on
20132         enum_body or enum_member_declarations so we can handle trailing
20133         commas on enumeration members.  Gets rid of a shift/reduce.
20134
20135         (type_list): Need a COMMA in the middle.
20136
20137         (indexer_declaration): Tell tokenizer to recognize get/set
20138
20139         * Remove old targets.
20140
20141         * Re-add the parser target.
20142
20143 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20144
20145         * cs-parser.jay: Add precendence rules for a number of operators
20146         ot reduce the number of shift/reduce conflicts in the grammar.
20147
20148 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20149
20150         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20151         and put it here.
20152
20153         Get rid of old crufty code.
20154
20155         * rootcontext.cs: Use this to keep track of the parsed
20156         representation and the defined types available to the program. 
20157
20158         * gen-treedump.cs: adjust for new convention.
20159
20160         * type.cs: Split out the type manager, and the assembly builder
20161         from here. 
20162
20163         * typemanager.cs: the type manager will live here now.
20164
20165         * cil-codegen.cs: And the code generator here. 
20166
20167 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20168
20169         * makefile: Fixed up for easy making.
20170
20171 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20172
20173         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20174         the 
20175
20176         (unary_expression): Expand pre_increment_expression and
20177         post_decrement_expression to reduce a shift/reduce.
20178
20179 2001-07-11  Simon Cozens
20180
20181         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20182
20183         Improve allow_keyword_as_indent name.
20184
20185 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20186
20187         * Adjustments for Beta2. 
20188
20189 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * decl.cs: Added `Define' abstract method.
20192         (InTransit): new property, used to catch recursive definitions. 
20193
20194         * interface.cs: Implement `Define'. 
20195
20196         * modifiers.cs: Map Modifiers.constants to
20197         System.Reflection.TypeAttribute flags.
20198
20199         * class.cs: Keep track of types and user-defined types.
20200         (BuilderInit): New method for creating an assembly
20201         (ResolveType): New function to launch the resolution process, only
20202         used by interfaces for now.
20203
20204         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20205         that are inserted into the name space. 
20206
20207 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20208
20209         * ARGH.  I have screwed up my tree so many times due to the use of
20210         rsync rather than using CVS.  Going to fix this at once. 
20211
20212         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20213         load types.
20214
20215 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20216
20217         * Experiment successful: Use System.Type rather that our own
20218         version of Type.  
20219
20220 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20221
20222         * cs-parser.jay: Removed nsAliases from here.
20223
20224         Use new namespaces, handle `using XXX;' 
20225
20226         * namespace.cs: Reimplemented namespace handling, use a recursive
20227         definition of the class.  Now we can keep track of using clauses
20228         and catch invalid using clauses.
20229
20230 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20231
20232         * gen-treedump.cs: Adapted for all the renaming.
20233
20234         * expression.cs (Expression): this class now has a Type property
20235         which returns an expression Type.
20236
20237         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20238         `Type', as this has a different meaning now in the base
20239
20240 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20241
20242         * interface.cs, class.cs: Removed from all the sources the
20243         references to signature computation, as we can not do method
20244         signature computation during the parsing time, as we are not
20245         trying to solve at that point distinguishing:
20246
20247         class X {
20248                 void a (Blah x) {}
20249                 void a (NS.Blah x) {}
20250         }
20251
20252         Which depending on the context might be valid or not, as we do not
20253         know if Blah is the same thing as NS.Blah at that point.
20254
20255         * Redid everything so the code uses TypeRefs now instead of
20256         Types.  TypeRefs are just temporary type placeholders, that need
20257         to be resolved.  They initially have a pointer to a string and the
20258         current scope in which they are used.  This is used later by the
20259         compiler to resolve the reference to an actual Type. 
20260
20261         * DeclSpace is no longer a CIR.Type, and neither are
20262         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20263         are all DeclSpaces, but no Types. 
20264
20265         * type.cs (TypeRefManager): This implements the TypeRef manager,
20266         which keeps track of all the types that need to be resolved after
20267         the parsing has finished. 
20268
20269 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * ARGH.  We are going to have to store `foreach' as a class rather
20272         than resolving it, as we need to verify error 1579 after name
20273         resolution.   *OR* we could keep a flag that says `This request to
20274         IEnumerator comes from a foreach statement' which we can then use
20275         to generate the error.
20276
20277 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20278
20279         * class.cs (TypeContainer.AddMethod): we now add methods to the
20280         MethodGroup instead of the method hashtable.  
20281
20282         * expression.cs: Add MethodGroup abstraction, which gets us one
20283         step closer to the specification in the way we handle method
20284         declarations.  
20285
20286         * cs-parser.jay (primary_expression): qualified_identifier now
20287         tried to match up an identifier to a local variable reference or
20288         to a parameter reference.
20289
20290         current_local_parameters is now a parser global variable that
20291         points to the current parameters for the block, used during name
20292         lookup.
20293
20294         (property_declaration): Now creates an implicit `value' argument to
20295         the set accessor.
20296
20297 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20298
20299         * parameter.cs: Do not use `param' arguments as part of the
20300         signature, per the spec.
20301
20302 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20303
20304         * decl.cs: Base class for classes, structs and interfaces.  This
20305         is the "Declaration Space" 
20306
20307         * cs-parser.jay: Use CheckDef for checking declaration errors
20308         instead of having one on each function.
20309
20310         * class.cs: Factor out some code for handling error handling in
20311         accordance to the "Declarations" section in the "Basic Concepts"
20312         chapter in the ECMA C# spec.
20313
20314         * interface.cs: Make all interface member classes derive from
20315         InterfaceMemberBase.
20316
20317 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20318
20319         * Many things: all interfaces are parsed and generated in
20320         gen-treedump.  Support for member variables, constructors,
20321         destructors, properties, constants is there.
20322
20323         Beginning of the IL backend, but very little done, just there for
20324         testing purposes. 
20325
20326 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * cs-parser.jay: Fix labeled statement.
20329
20330         * cs-tokenizer.cs (escape): Escape " and ' always.
20331         ref_line, ref_name: keep track of the line/filename as instructed
20332         by #line by the compiler.
20333         Parse #line.
20334
20335 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20336
20337         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20338         to match the values in System.CodeDOM.
20339
20340         Divid renamed to Divide.
20341
20342         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20343         statements. 
20344         (Statements.set): remove.
20345
20346         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20347         statements. 
20348
20349         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20350         falseStatements always have valid values. 
20351
20352         * cs-parser.jay: Use System.CodeDOM now.
20353