2005-04-12 Dick Porter <dick@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #71992.
4         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5         'ignore_cs0104' parameter.  Pass it to ...
6         (NamespaceEntry.Lookup): ... this.
7         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9         (TypeLookupExpression.DoResolveAsTypeStep): Update.
10         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11         Update.  Request that cs0104 errors be ignored.
12         (ComposedCast.ResolveAsTypeStep): Update.
13
14 2005-02-14  Raja R Harinath  <rharinath@novell.com>
15
16         Fix #59209.
17         * expression.cs (Invocation.BetterFunction): Remove support for
18         comparing virtual functions and their overrides.
19         (Invocation.IsOverride): New.
20         (Invocation.OverloadResolve): Don't consider 'override' functions
21         during candidate selection.  Store them in a lookaside list.
22         If the selected method is a 'virtual' function, use the list to
23         find any overrides that are closer to the LHS type.
24
25 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
26
27         * expression.cs (New.DoResolve): Add complex core type reduction.
28         (New.Constantify): Converts complex core type syntax like 'new int ()'
29         to simple constant.
30         
31 2005-02-14  Raja R Harinath  <rharinath@novell.com>
32
33         * decl.cs (EntryType.EntryType): New constructor to create an
34         updated copy of a cache entry.
35         (MemberCache.AddMethods): Use it.
36         (MemberCache.ClearDeclaredOnly): Remove.
37         (MemberCache.MemberCache): Update.
38
39 2005-02-11  Miguel de Icaza  <miguel@novell.com>
40
41         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
42         variable.  This one is represents the actual low-level declaration
43         of the method, as opposed to the semantic level `IsStatic'.   
44
45         An anonymous method which is hosted into a static method might be
46         actually an instance method.  IsStatic would reflect the
47         container, while MethodIsStatic represents the actual code
48         generated.
49
50         * expression.cs (ParameterReference): Use the new MethodIsStatic
51         instead of IsStatic.
52
53         * anonymous.cs (AnonymousMethod.Compatible): Pass the
54         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
55         set on the current EmitContext. 
56
57         * expression.cs (Cast): Overload DoResolveLValue so we can pass
58         resolve our casted expression as an LValue.  This triggers the
59         proper LValue processing that is later required by Assign.
60
61         This fixes 72347.
62
63         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
64
65 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
66
67         C# 2.0 Fixed buffer implementation
68
69         * anonymous.cs: Update after RegisterHelperClass renaming.
70
71         * attribute.cs (AttributeTester.fixed_buffer_cache):
72         Cache of external fixed buffers.
73         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
74         implementation if field is fixed buffer else null.
75
76         * class.cs
77         (TypeContainer.AddField): Accept FieldMember instead of Field.
78         (FieldBase.IsFieldClsCompliant): Extracted code from
79         VerifyClsCompliance descendant customization.
80         (FixedField): New class handles fixed buffer fields.
81         (FixedFieldExternal): Keeps information about imported fixed
82         buffer.
83         (IFixedField): Make access to internal or external fixed buffer
84         same.
85
86         * cs-parser.jay: Add fixed buffer parsing.
87
88         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
89         buffer.
90
91         * expression.cs (Indirection): Extended implementation to accept
92         fixed buffer field.
93         (PointerArithmetic.Emit): Get element from fixed buffer as well.
94         (ElementAccess.MakePointerAccess): Get type as parameter.
95         (DoResolve): Add fixed buffer field expression conversion.
96         (DoResolveLValue): Ditto.
97         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
98         (ArrayPtr): Derives from FixedBufferPtr.
99         (ArrayPtr.Emit): Add extra emit for array elements.
100
101         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
102
103         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
104         for compiler generated types.
105         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
106
107         * statement.cs (Fixed): Refactored to be easier add fixed buffer
108         and consume less memory.
109         (Fixed.Resolve): Add fixed buffer case.
110
111         * typemanager.cs (compiler_generated_attr_ctor,
112         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
113         (HasElementType): Add our own implementation to work on every
114         runtime.
115
116 2005-02-11  Miguel de Icaza  <miguel@novell.com>
117
118         * anonymous.cs (CaptureContext): Track whether `this' has been
119         referenced.   
120
121         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
122         only captured `this' if it was implicitly done (instance
123         methods/variables were used). 
124
125         * codegen.cs (EmitContext.CaptureThis): New method to flag that
126         `this' must be captured.
127
128 2005-01-30  Miguel de Icaza  <miguel@novell.com>
129  
130         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
131         is null it means that there has been no need to capture anything,
132         so we just create a sibling.
133
134         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
135
136         Just a partial fix.  The other half is fairly elusive.
137         
138 2005-02-10  Raja R Harinath  <rharinath@novell.com>
139
140         Fix #52586, cs0121-4.cs.
141         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
142         and return a hashtable.
143         (MemberCache.ClearDeclaredOnly): New.
144         (MemberCache.MemberCache): Update to change.  Make a deep copy of
145         the method_hash of a base type too.
146         (MemberCache.AddMethods): Adapt to having a deep copy of the base
147         type methods.  Overwrite entries with the same MethodHandle so
148         that the ReflectedType is correct.  The process leaves in base
149         virtual functions and their overrides as distinct entries.
150         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
151         matters since it was boxed in a ArrayList before.
152         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
153         modifier.
154         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
155         case of a virtual function and its override (choose the overload
156         as better).
157         (Invocation.OverloadResolve): Avoid 'override' members during
158         'applicable_type' calculation.
159
160 2005-03-28  Raja R Harinath  <rharinath@novell.com>
161
162         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
163         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
164         GetTypeHandle.  It is possible for a reflected type to derive from
165         a TypeBuilder (e.g., int[] derives from the TypeBuilder
166         System.Array during mscorlib compilation).
167         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
168         contain a method_hash, don't create one either.  Don't create a
169         deep copy of the base cache's method_hash.
170         (MemberCache.SetupCache): Rename back from DeepCopy.
171         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
172         already initialized.  If we see an override function, add its
173         underlying base virtual function to the member_hash too.
174
175 2005-02-09  Raja R Harinath  <rharinath@novell.com>
176
177         Combine two near-redundant caches.
178         * typemanager.cs (method_params): Rename from method_internal_params.
179         (TypeManager.GetParameterData): New.  Replace
180         Invocation.GetParameterData.
181         (TypeManager.LookupParametersByBuilder): Remove.
182         * expression.cs (Invocation.method_parameter_cache): Remove.
183         (Invocation.GetParameterData): Remove.
184         Update to changes.
185         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
186         Update to changes.
187
188 2005-02-08  Raja R Harinath  <rharinath@novell.com>
189
190         Fix #72015.
191         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
192         TypeManager.multicast_delegate_type is null, resolve it by looking
193         up "System.MulticastDelegate".
194         * rootcontext.cs (RootContext.ResolveCore): Simplify.
195
196 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
197             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
198             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
199
200         Fix cs0164.cs.
201         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
202         (LabeledStatement.AddReference): New.  Set 'referenced'.
203         (Goto.Resolve): Use it.
204
205 2005-02-05  John Luke  <john.luke@gmail.com>
206
207         * driver.cs: remove duplicate -doc line in Usage ()
208
209 2005-02-04  Raja R Harinath  <rharinath@novell.com>
210
211         * location.cs (Location.AddFile): Fix CS2002 error report.
212
213 2005-02-02  Martin Baulig  <martin@ximian.com>
214
215         * delegate.cs (Delegate.DefineType): Report an internal error if
216         TypeManager.multicast_delegate_type is null.  See bug #72015 for
217         details.        
218
219 2005-02-02  Raja R Harinath  <rharinath@novell.com>
220
221         Fix a crasher in a variant of #31984.
222         * const.cs (Constant.CheckBase): New override that defers the
223         new-or-override check in case the base type hasn't been populated
224         yet.
225         (Constant.Define): Ensure the new-or-override check is performed.
226
227 2005-02-01  Duncan Mak  <duncan@ximian.com>
228
229         * const.cs (LookupConstantValue): Check that `ce' is not null
230         before calling GetValue ().
231
232 2005-02-01  Raja R Harinath  <rharinath@novell.com>
233
234         Fix test-334.cs (#69519).
235         * cs-parser.jay (using_alias_directive): Pass in an expression to
236         NamespaceEntry.UsingAlias.
237         (using_namespace_directive): Pass in an expression to
238         NamespaceEntry.Using.
239         (namespace_name): Don't flatten to a string.
240         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
241         (NamespaceEntry.AliasEntry.Resolve): Lookup using
242         ResolveAsTypeStep.
243         (NamespaceEntry.UsingEntry): Likewise.
244         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
245         changes.
246         (NamespaceEntry.LookupForUsing): Remove.
247         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
248         names.
249         (NamespaceEntry.Lookup): Remove support for dotted names.
250
251 2005-02-01  Raja R Harinath  <rharinath@novell.com>
252
253         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
254         split into two.
255         (NamespaceEntry.ImplicitParent): Compute on demand.
256         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
257         parallels the current.
258         (NamespaceEntry.LookupForUsing): Use it.
259         (NamespaceEntry.Lookup): If the current namespace-entry is
260         implicit, don't search aliases and using tables.
261
262 2005-02-01  Raja R Harinath  <rharinath@novell.com>
263
264         Fix #31984.
265         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
266         BaseCache here.
267         (TypeContainer.BaseCache): Compute on demand.
268         (TypeContainer.FindMembers): Define constants and types if they're
269         not already created.
270         (FieldMember.Define): Move resetting of ec.InUnsafe before error
271         check.
272         * const.cs (Constant.Define): Make idempotent.
273
274 2005-01-29  Miguel de Icaza  <miguel@novell.com>
275
276         * pending.cs: Produce better code (no nops produced by using Ldarg
277         + value).
278         
279         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
280         i - 1' it should be arg + 1.
281
282         Fixes bug #71819.
283
284 2005-01-28  Raja R Harinath  <rharinath@novell.com>
285
286         * attribute.cs (Attribute.CheckAttributeType): Make private
287         non-virtual.
288         (Attribute.ResolveType): Make virtual.
289         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
290         handling of RootContext.Tree.Types.
291
292 2005-01-27  Raja R Harinath  <rharinath@novell.com>
293
294         Update attribute-handling to use the SimpleName/MemberAccess
295         mechanisms.
296         * cs-parser.jay (attribute): Pass in an expression to the
297         constructors of Attribute and GlobalAttribute.
298         * attribute.cs (Attribute): Take an expression for the name.
299         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
300         passed in attribute name expression.
301         (Attribute.CheckAttributeType): Use it.
302         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
303         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
304         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
305         argument to prevent error messages if the lookup fails.
306
307 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
308
309         * expression.cs (Indirection): Implemented IVariable interface
310         to support indirection in AddressOf operator.
311         (PointerArithmetic.Emit): Add optimalization for case where
312         result can be precomputed.
313
314 2005-01-26  Martin Baulig  <martin@ximian.com>
315
316         * class.cs (TypeContainer.AttributeTargets): Return the correct
317         AttributeTargets depending on our `Kind' instead of throwing an
318         exception; fixes #71632.
319
320 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
321
322         Fix #71257
323         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
324         constant members.
325
326 2005-03-17  Martin Baulig  <martin@ximian.com>
327
328         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
329         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
330
331 2005-03-17  Martin Baulig  <martin@ximian.com>
332
333         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
334         to bool so we can return an error condition.
335         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
336         returned an error.
337
338 2005-03-17  Martin Baulig  <martin@ximian.com>
339
340         * generic.cs (TypeMananager.IsIEnumerable): New public method.
341
342         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
343         converting from an array-type of T to `IEnumerable<T>'.
344
345 2005-03-16  Martin Baulig  <martin@ximian.com>
346
347         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
348         (Nullable.LiftedUnaryMutator): New public class.
349
350         * expression.cs (UnaryMutator.DoResolve): Added support for
351         Nullable Types.
352
353 2005-03-14  Martin Baulig  <martin@ximian.com>
354
355         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
356
357 2005-03-14  Martin Baulig  <martin@ximian.com>
358
359         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
360         the comparision operators `<', `>', `<=' and `>='.
361
362 2005-03-13  Martin Baulig  <martin@ximian.com>
363
364         * generic.cs
365         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
366         avoid confusion with the `NullLiteral'.
367         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
368
369 2005-03-13  Martin Baulig  <martin@ximian.com>
370
371         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
372         comparing arbitrary types with the null literal.
373
374 2005-03-13  Martin Baulig  <martin@ximian.com>
375
376         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
377         boolean operators '&&', '||', '&' and '|'.
378         (Nullable.OperatorTrueOrFalse): New public class.
379
380         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
381         instead of a `StaticCallExpr'; added support for nullables.
382
383 2005-03-10  Martin Baulig  <martin@ximian.com>
384
385         * expression.cs
386         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
387         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
388
389 2005-03-07  Martin Baulig  <martin@ximian.com>
390
391         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
392         it work if `expr' is not an IMemoryLocation.
393         (Nullable.Lifted): Implement IMemoryLocation.
394         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
395         target type.
396
397 2005-03-05  Martin Baulig  <martin@ximian.com>
398
399         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
400         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
401         (Nullable): Added support for lifted unary and binary operators.
402
403         * expression.cs (Unary.DoResolve): Added support for nullable types.
404         (Binary.DoResolve): Likewise.
405         (Conditional.DoResolve): Likewise.
406
407 2005-03-02  Martin Baulig  <martin@ximian.com>
408
409         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
410
411         * class.cs (ClassPart.SetParameterInfo): Override this.
412         (PartialContainer.SetParameterInfo): Override this.
413         (TypeContainer.CheckConstraints): New protected method.
414         (PartialContainer.CheckConstraints): Override this and check
415         whether the same contraints were specified in all parts of a
416         partial generic type definition.
417         (PartialContainer.UpdateConstraints): New public method.
418
419         * generic.cs (TypeParameter.UpdateConstraints): New public method.
420
421 2005-03-02  Martin Baulig  <martin@ximian.com>
422
423         Committing a patch from Carlos Alberto Cortez to fix #72887.
424
425         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
426         casts from `T []' to `int []'.
427
428 2005-03-02  Martin Baulig  <martin@ximian.com>
429
430         * generic.cs (TypeManager.IsEqual): Make this symmetric.
431
432         * expression.cs (Binary.ResolveOperator): When resolving a
433         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
434         `=='.  Fixes #71866.  See gen-127.cs.
435
436 2005-03-02  Martin Baulig  <martin@ximian.com>
437
438         * class.cs (TypeContainer.DoDefineMembers): We also need a default
439         static constructor in static classes.
440
441 2005-03-02  Martin Baulig  <martin@ximian.com>
442
443         * generic.cs
444         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
445         (Nullable.LiftedConversion): Added support for user-defined
446         conversions.
447
448         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
449
450         * cs-parser.jay: Use ComposedCast everywhere instead of
451         NullableType, so we don't need to check for NullableType
452         everywhere.
453         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
454         case where we'll be resolved into a `parenthesized_expression_0'
455         afterwards.
456
457         * convert.cs
458         (Convert.UserDefinedConversion): Added nullable conversions.
459
460 2005-02-28  Martin Baulig  <martin@ximian.com>
461
462         * generic.cs (TypeManager.IsNullableType): New static method.
463         (Nullable): New abstract class.
464         (Nullable.NullLiteral): New public class.
465         (Nullable.LiftedConversion): New public class.
466
467         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
468         `builtin_types opt_nullable'.
469
470         * convert.cs
471         (Convert.ImplicitConversionStandard): Added nullable conversions.
472         (Convert.ExplicitConversionStandard): Likewise.
473         (Convert.ExplicitConversion): Likewise.
474
475 2005-02-26  Martin Baulig  <martin@ximian.com>
476
477         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
478         begin with a "?", for instance "?[]".  Don't do a type lookup if
479         `dim' is empty.
480
481 2005-02-25  Martin Baulig  <martin@ximian.com>
482
483         The first part of Nullable Types :-)
484
485         * generic.cs (NullableType): New public class.
486         (NullCoalescingOperator): New public class.
487         (TypeArguments.Resolve): Add a CS0306 check.
488
489         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
490         (opt_nullable): New rule.
491         (type): Added `opt_nullable' to `namespace_or_type_name',
492         `builtin_types' and `pointer_type'.
493         (array_type): Added `opt_nullable'.
494         (opt_rank_specifier_or_nullable): New rule; this is the
495         combination of `opt_rank_specifier' and `opt_nullable'.
496         (opt_error): New rule; catch errors here.
497         (nullable_type_or_conditional): New rule; we use this to check for
498         nullable and still detect the conditional operator.
499         (local_variable_type): Use `opt_rank_specifier_or_nullable'
500         instead `opt_rank_specifier'.
501
502         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
503         for nullables.
504
505 2005-02-24  Martin Baulig  <martin@ximian.com>
506
507         * README, README.Changes: Removed; they're old and obsolete.
508
509 2005-02-22  Martin Baulig  <martin@ximian.com>
510
511         * generic.cs (TypeParameter.Resolve): If resolving the constraints
512         returned an error, set `constraints' to null to avoid a crash
513         later on.
514         (TypeParameter.ResolveType): Likewise.
515
516 2005-02-22  Martin Baulig  <martin@ximian.com>
517
518         * generic.cs
519         (Constraints.ResolveTypes): Protect against being called twice.
520         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
521         (TypeParameter.ResolveType): New public method; calls
522         constraints.ResolveTypes().
523         (TypeParameter.DefineType): Moved constraints.ResolveType() out
524         into the new ResolveType().
525         (GenericMethod.Define): Call ResolveType() on all our
526         TypeParameter's.        
527
528 2005-02-21  Martin Baulig  <martin@ximian.com>
529
530         * generic.cs
531         (TypeManager.generic_nullable_type): New static public field.
532         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
533
534         * rootcontext.cs
535         (RootContext.ResolveCore): Resolve "System.Nullable`1".
536
537 2005-02-15  Martin Baulig  <martin@ximian.com>
538
539         * generic.cs (ConstructedType.Constraints): Correctly check
540         constraints if the argument type is a type parameter; fixes
541         #72326. 
542
543 2005-02-02  Martin Baulig  <martin@ximian.com>
544
545         * delegate.cs (Delegate.DefineType): Report an internal error if
546         TypeManager.multicast_delegate_type is null.  See bug #72015 for
547         details.        
548
549 2005-01-29  Miguel de Icaza  <miguel@novell.com>
550
551         * pending.cs: Produce better code (no nops produced by using Ldarg
552         + value).
553         
554         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
555         i - 1' it should be arg + 1.
556
557         Fixes bug #71819.
558         
559 2005-01-26  Martin Baulig  <martin@ximian.com>
560
561         * cs-parser.jay (indexer_declarator): Don't report an error if we
562         have type parameters since we can be an explicit interface
563         implementation; fixes #71449.
564
565 2005-01-26  Martin Baulig  <martin@ximian.com>
566
567         * class.cs (TypeContainer.AttributeTargets): Return the correct
568         AttributeTargets depending on our `Kind' instead of throwing an
569         exception; fixes #71632.
570
571 2005-01-26  Martin Baulig  <martin@ximian.com>
572
573         * delegate.cs (Delegate.DefineType): Correctly define our type
574         parameters.  Fixes #71483.
575
576 2005-01-25  Raja R Harinath  <rharinath@novell.com>
577
578         Fix #71602.
579         * expression.cs (MemberAccess.DoResolve): Don't complain with
580         cs0572 when the LHS of a member access has identical name and type
581         name.
582
583 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
584
585         Fix #71651, #71675
586         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
587         CreatePermission.
588         Create custom PermissionSet only for PermissionSetAttribute.
589
590 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
591
592         Fix #71649
593         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
594         delegates in static class.
595
596 2005-01-24  Martin Baulig  <martin@ximian.com>
597
598         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
599         merging an implicit block, just use its reachability.
600
601         * statement.cs (Block.Resolve): Make the unreachable code check
602         work wrt. implicit blocks; see test-337 from #63842.
603
604 2005-01-21  Alp Toker  <alp@atoker.com>
605  
606         * cs-parser.jay: destructor_declaration's container is PartialContainer
607         not Class when partial types are used, so use Kind prop instead of
608         'is'.
609         
610 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
611
612         * cs-parser.jay: Improve error reporting when an interface
613         declares new types.
614
615 2005-01-20  Dick Porter  <dick@ximian.com>
616
617         * support.cs: SeekableStreamReader fix from Sandor Dobos
618         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
619         chars are read.  Fixes bug 70369.
620
621 2005-01-20  Raja R Harinath  <rharinath@novell.com>
622
623         * cs-parser.jay (catch_clause): Simplify current_block handling
624         somewhat.
625
626 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
627
628         * convert.cs (ImplicitStandardConversionExists): Synchronize the
629         code with ImplicitStandardConversion to handle the implicit
630         conversion of method groups into valid delegate invocations. 
631
632         The problem is that in parameter handling we were using this code
633         path.  Fixes bug #64698
634
635 2005-01-19  Raja R Harinath  <rharinath@novell.com>
636
637         * cs-parser.jay: Fix several infelicities.
638         - Avoid assigning to the parser value stack.  Code like 
639           '$3 = null' is unclean.  Synthesize a value for the code block
640           instead. 
641         - Avoid using oob_stack for storing location information.  Use ...
642         (_mark_): ... this.  New (empty) rule.  Saves the current location
643         in $$.
644         (foreach_statement): Avoid using oob_stack for current_block
645         handling.  Use technique used in for_statement and
646         using_statement.  Synthesize a value for the code block to store
647         additional intermediate information.
648
649 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
650
651         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
652         of a different type is only allowed to private fields of a
653         containing type, not on fields of a base class.
654
655         See test-174.cs and error cs0122-9.cs
656
657 2005-01-13  Raja R Harinath  <rharinath@novell.com>
658
659         Fix test-335.cs (bug #58126).
660         * cs-parser.jay (argument): Split out non-expression parts of the
661         rule into 'non_simple_argument'.
662         (invocation_expression): Support parenthesized invocations with
663         multiple arguments, and with single non-simple arguments.
664
665 2005-01-13  Raja R Harinath  <rharinath@novell.com>
666
667         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
668         places.
669
670 2005-01-12  Raja R Harinath  <rharinath@novell.com>
671
672         Fix cs0038-1.cs, cs1640-6.cs.
673         * ecore.cs (Expression.Resolve): Remove special-case for
674         SimpleName in error-handling.
675         (Expression.almostMatchedMembers): Relax access permission to
676         protected.
677         (Expression.MemberLookupFailed): Handle duplicates in
678         almostMatchedMembers list.
679         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
680         * expression.cs (New.DoResolve): Report CS1540 for more cases.
681         * typemanager.cs (GetFullNameSignature): Use the MethodBase
682         overload if the passed in MemberInfo is a MethodBase.
683
684 2005-01-25  Martin Baulig  <martin@ximian.com>
685
686         * doc.cs
687         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
688
689 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
690
691         Fix #70749
692         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
693         for non-CAS & merge permission sets properly.
694
695 2005-01-11  Raja R Harinath  <rharinath@novell.com>
696
697         Improve standard-compliance of simple name and member access 
698         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
699         * ecore.cs (FullNamedExpression): New abstract base class 
700         for Namespaces and TypeExpressions.
701         (ResolveFlags.SimpleName): Remove.
702         (SimpleName): Remove support for dotted names.
703         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
704         DeclSpace.FindType and DeclSpace.LookupType.
705         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
706         (Expression.ExprClassName): Make member function.
707         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
708         a namespace.  Remove creation of dotted "SimpleName"s.
709         (MemberAccess.DoResolve): Likewise.
710         * decl.cs (DeclSpace.Cache): Make private.
711         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
712         (DeclSpace.FindType): Update.
713         (DeclSpace.LookupType): Move here from RootContext.  Return a 
714         FullNamedExpression.
715         * namespace.cs (Namespace): Derive from FullNamedExpression
716         so that it can be part of expression resolution.
717         (Namespace.Lookup): Return an FullNamedExpression.
718         (NamespaceEntry.LookupAlias): Lookup aliases only in current
719         namespace.
720         * rootcontext.cs (NamespaceLookup): Remove.
721         (LookupType): Move to DeclSpace.
722         * attribute.cs (CheckAttributeType): Update.
723         * doc.cs (FindDocumentedType): Remove allowAlias argument.
724         (FindDocumentedTypeNonArray): Likewise.
725
726 2005-01-11  Raja R Harinath  <rharinath@novell.com>
727
728         Fix cs0509.cs, cs1632.cs.
729         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
730         is the same as IsInterface.
731         (TypeContainer.GetClassBases): Likewise.
732         * statement.cs (LabeledStatement.ig): New field.
733         (LabeledStatement.LabelTarget): Save ILGenerator which created the
734         label.
735         (LabeledStatement.DoEmit): Check that the label was created with
736         the same ILGenerator.
737
738 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
739
740         Fix #71058
741         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
742         accessors to its properties.
743
744         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
745         from accessors to property.
746         
747 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
748
749         Fix #70722
750         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
751         only for overrides.
752         
753 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
754
755         * attribute.cs: Check for null and empty strings.  
756
757         I have lost another battle to Paolo.
758
759 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
760
761         Fix #70942
762         * class.cs (PropertyMethod): Set Parent field in ctors.
763         (SetMethod.InternalParameters): Add unsafe switch hack.
764         Override MarkForDuplicationCheck where it is appropriate.
765
766         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
767         It says whether container allows members with the same name.
768         Base default is no.
769         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
770         Removed is_method parameter.
771
772 2005-01-06  Duncan Mak  <duncan@ximian.com>
773
774         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
775         because the previous change led to incorrect reporting of CS1032
776         ("Cannot define/undefine preprocessor symbols after first token in
777         file"). Instead of using `tokens_seen' as the only flag that
778         triggers CS1040, introduce `comments_seen'. This new flag is used
779         to signify having seen comments on the current line, so it is
780         unset after a newline.
781
782 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
783
784         * doc.cs : When searching for a type, find nested type too.
785           This fixes bug #71040.
786
787 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
788
789         * doc.cs :
790           - Warn missing member comment on those classes which also does not
791             have doc comments. Fixed bug #71041.
792           - Don't warn missing doc comment on default constructor.
793             Fixed bug #71042.
794
795 2005-01-06  Duncan Mak  <duncan@ximian.com>
796
797         * cs-tokenizer.cs (xtoken): After handling traditional C-style
798         comments, set `tokens_seen' to true. This allows us to detect
799         misplaced preprocessor directives (i.e. not at the beginning of
800         the a line, nor after whitespaces). In that case, report error
801         CS1040. This fixes bug #56460.
802
803         * cs-parser.jay (interface_member_declaration): Add checks for
804         IsExplicitImpl, and report CS0541 error if an interface member is
805         defined as an explicit interface declaration.
806
807 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
808
809         Fix #70817
810         * class.cs (PropertyMethod): Set Parent field in ctors.
811         (SetMethod.InternalParameters): Add unsafe switch hack.
812         
813         * decl.cs (MemberCore.Parent): Cannot be readonly.
814
815 2005-01-06  Raja R Harinath  <rharinath@novell.com>
816
817         * decl.cs (DeclSpace.ResolveType): Remove.
818         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
819         Merge in code from ...
820         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
821         * class.cs, enum.cs: Update to changes.
822
823 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
824
825         * anonymous.cs: Ensure that we init the scope of our parent if it
826         has not been initialized yet.
827
828 2004-12-30  Duncan Mak  <duncan@ximian.com>
829
830         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
831         if field.FieldBuilder is null. Fixes #70758.
832
833         * convert.cs: Fixed some typos and updated some of the comments.
834         (ImplicitStandardConversionExists):
835         (TryImplicitIntConversion): If `target_type' is an interface and
836         the type of `ic' implements this interface, return true or a new
837         BoxedCast instead of null. This fixes #70468.
838
839 2004-12-29  Duncan Mak  <duncan@ximian.com>
840
841         * expression.cs (Argument.Emit): Check that Expr is
842         IMemoryLocation before casting to it, and report CS1510 otherwise.
843
844         This fixes #70402.
845
846 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
847
848         * statement.cs (Block.ThisVariable): remove the recursion here, to
849         make the --profile more sane.
850
851 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
852
853         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
854         assembly, by JB Evain.
855
856 2004-12-17  Raja R Harinath  <rharinath@novell.com>
857
858         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
859           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
860         "parent" refers to enclosing type/class.  "base" refers to superclass.
861
862 2004-12-17  Raja R Harinath  <rharinath@novell.com>
863
864         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
865         Ensure that we only have GlobalAttributes.
866         * attribute.cs (Attribute.Emit): Make non-virtual.
867         (GlobalAttribute.Emit): Remove.
868         (Attribute.Resolve): Make virtual.
869         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
870         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
871         the argument. Don't create one.
872         (Attribute.GetObsoleteAttribute): Likewise.
873         (Attribute.GetClsCompliantAttributeValue): Likewise.
874         * class.cs, decl.cs: Update to changes.
875
876 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
877
878         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
879         
880         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
881         
882         * statement.cs (Foreach.Resolve): Add error 186 report.
883
884 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
885
886         * expression.cs (Conditional.DoResolve): Add warning 429.
887         
888         * statement.cs (If.Resolve): Add warning 665.
889
890 2004-12-16  Raja R Harinath  <rharinath@novell.com>
891
892         New invariant: RootContext.Tree.Types.NamespaceEntry == null
893         except when in the parser, and in GlobalAttribute.
894         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
895         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
896         RootContext.Tree.Types.NamespaceEntry once work is done.
897         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
898         and resets RootContext.Tree.Types.NamespaceEntry.
899
900 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
901
902         * cs-parser.jay: Don't create a block for every variable.
903
904 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
905
906         * location.cs: Provide extra information.
907
908         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
909         variables from the captured environment, it is the ldarg_0.
910
911 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
912
913         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
914         find a conclusion.
915         
916         * class.cs: Changed warning level for 169 to avoid developer
917         displeasure from warning flooding. It will be changed back when they
918         fix most of current BCL warnings.
919         
920         * RootContext.cs: Pushed default WarningLevel to 3.
921         
922         * statement.cs: Removed unused variable.
923
924 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
925
926         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
927         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
928         Add error 502 report.
929         (StaticClass.DefineType): Add error 441 report.
930         (Class.AllowedModifiersProp): New virtual property as temporary
931         extension to AllowedModifiers.
932         (Class.DefineType): Add error 418 report. Moved ModFlags check here
933         to share implementation with StaticClass and don't call virtual
934         methods from ctor.
935         
936         * driver.cs (MainDriver): Add error 1558 test.
937
938         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
939         report. Moved error 36 test here.
940
941         * statement.cs (Throw.Resolve): Add error 724 report.
942
943         * typemanager.cs: Add out_attribute_type core type.
944         
945 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
946
947         * class.cs (TypeContainer.VerifyClsCompliance): Add error
948         3018 report.
949         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
950
951         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
952         3017 report.
953         
954         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
955
956         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
957         Add error 3023 report.
958         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
959
960         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
961         implementation.
962
963 2004-12-12  John Luke  <john.luke@gmail.com>
964
965         * driver.cs (AddArgs): take -- into account when
966         adding arguments, fixes bug 65710 
967
968 2004-12-12  Martin Baulig  <martin@ximian.com>
969
970         * expression.cs (Unary.TryReduceNegative): Added support for
971         SByteConstant and ByteConstant.
972         (Unary.Reduce): Check error values from TryReduceNegative().
973
974 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
975
976         * attributes.cs (Attribute.Resolve): Avoid multiple error report
977         and report exception as error 182.
978
979 2004-12-10  Raja R Harinath  <rharinath@novell.com>
980
981         * driver.cs (Main): Fix message when there are warnings.
982
983 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
984
985         * delegate.cs: Fixed my fix from yesterday, sorry about that.
986
987 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
988
989         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
990         Reduced number of warnings.
991         
992         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
993
994 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
995
996         * driver.cs: Removed message.
997
998         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
999
1000 2004-12-08    <vargaz@freemail.hu>
1001
1002         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1003
1004 2004-12-08  Martin Baulig  <martin@ximian.com>
1005
1006         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1007         instead of a CS3002 for properties and indexer.
1008
1009 2004-12-08  Martin Baulig  <martin@ximian.com>
1010
1011         * decl.cs (MemberName.ToString): Make this work again.
1012
1013 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1014
1015         * attribute.cs (Resolve): Add error 591 detection.
1016
1017         * class.cs (FieldMember.Define): Add error 1547 detection.
1018         (Indexer.Define): Add error 620 detection.
1019         (Operator.Define): Add error 590 detection.
1020
1021         * ecore.cs: Missing argument for error 79.
1022
1023         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1024         detection.
1025
1026 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1027
1028         Fix #70106
1029         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1030         only.
1031
1032 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1033
1034         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1035           Some operator comments were suppressed.
1036         * doc.cs : Implicit/explicit operator name in doc comments are like
1037           "op_Explicit(type)~returnType", so added suffix handling.
1038
1039 2005-01-21  Alp Toker  <alp@atoker.com>
1040
1041         * cs-parser.jay: destructor_declaration's container is PartialContainer
1042         not Class when partial types are used, so use Kind prop instead of 'is'.
1043
1044 2004-12-12  Martin Baulig  <martin@ximian.com>
1045
1046         * expression.cs (Unary.TryReduceNegative): Added support for
1047         SByteConstant and ByteConstant.
1048         (Unary.Reduce): Check error values from TryReduceNegative().
1049
1050 2004-12-11  Martin Baulig  <martin@ximian.com>
1051
1052         * support.cs (ReflectionParameters.ParameterName): If we have a
1053         `gpd', call `ParameterName' on it.
1054
1055         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1056
1057         * pending.cs (PendingImplementation.DefineProxy): Call
1058         DefineParameter() for all of the MethodBuilder's arguments.
1059
1060 2004-12-09  Martin Baulig  <martin@ximian.com>
1061
1062         * doc.cs (DocUtil): Make this a static class.
1063
1064 2004-12-09  Martin Baulig  <martin@ximian.com>
1065
1066         * expression.cs (Invocation.InferType): Moved the type inference
1067         implementation into TypeManager.
1068
1069         * generics.cs (TypeManager): Moved the type inference
1070         implementation here.
1071
1072 2004-12-09  Martin Baulig  <martin@ximian.com>
1073
1074         * typemanager.cs (TypeManager): Make this a partial class.
1075
1076         * generics.cs
1077         (TypeManager): Move the generics part of `TypeManager' here.
1078
1079 2004-12-08  Martin Baulig  <martin@ximian.com>
1080
1081         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1082         instead of a CS3002 for properties and indexer.  Added CS3024
1083         check for generic interfaces.
1084
1085         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1086         instances are not CLS-compliant.
1087
1088 2004-12-08  Martin Baulig  <martin@ximian.com>
1089
1090         * cs-parser.jay
1091         (void_pointer_expression): New rule for `void*', `void**' etc.
1092         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1093
1094 2004-12-08  Martin Baulig  <martin@ximian.com>
1095
1096         * expression.cs (Invocation.InferType): Removed the hack for
1097         MethodCore.MayUnify().  
1098
1099         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1100         this actually work.
1101
1102         * class.cs (MethodCore.MayUnify): Use
1103         TypeManager.MayBecomeEqualGenericTypes().       
1104
1105 2004-12-08  Martin Baulig  <martin@ximian.com>
1106
1107         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1108         parameter, box it.  Fixes #69233.
1109
1110 2004-12-08  Martin Baulig  <martin@ximian.com>
1111
1112         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1113         have the ctor constraint.  Fixes #68326.
1114
1115 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1116
1117         * cs-parser.jay : interface comment was not consumed because of
1118           extra opt_semicolon before doc handling.
1119
1120 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1121
1122         Fix test-327.cs, test-328.cs, and put in early infrastructure
1123         for eventually fixing #52697.
1124         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1125         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1126         from other methods.
1127         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1128         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1129         (VerifyUsing, error246): Update.
1130         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1131         'NamespaceEntry.LookupNamespaceOrType'.
1132
1133 2004-12-07  Martin Baulig  <martin@ximian.com>
1134
1135         * driver.cs: Call it "BETA SOFTWARE" :-)
1136
1137 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1138
1139         Fix crash on cs0657-17.cs.
1140         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1141         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1142         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1143         the case where the NamespaceEntry gets overwritten.
1144
1145 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1146
1147         Fixed #69195, #56821
1148         * ecore.cs (ResolveBoolean): Tiny refactoring.
1149
1150         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1151         of right expression resolving when left is false constant and
1152         operator is LogicalAnd OR true constant and operator is LogicalOr.
1153
1154         * statement.cs (ResolveUnreachable): Always reports warning.
1155
1156 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1157
1158         * class.cs: Distinguish between 1721 and 1722 (just a little help
1159         for the programmer).
1160
1161 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1162
1163         * delegate.cs: Only allow this on new versions of the language. 
1164
1165 2004-12-02  Duncan Mak  <duncan@ximian.com>
1166
1167         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1168         Expression class.
1169         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1170         here as a static method. Take an additional bool out parameter
1171         `must_do_cs1540_check' for signaling to InstanceResolve.
1172         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1173         member field from PropertyExpr class and made it an argument of
1174         the method instead.
1175         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1176         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1177         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1178         and `remove_accessor' as well as InstanceResolve: report CS0122
1179         where applicable.
1180
1181         Fixes #70129.
1182
1183 2004-12-07  Martin Baulig  <martin@ximian.com>
1184
1185         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1186         and CS0692 where appropriate.
1187
1188 2004-12-06  Martin Baulig  <martin@ximian.com>
1189
1190         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1191         IsDuplicateImplementation() and improved it.
1192
1193         * expression.cs (Invocation.InferTypeArguments): Added
1194         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1195         and removed the "ref" modifier from `infered_types'.
1196
1197         * decl.cs (MemberName.ToString): Removed the exception.
1198
1199 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1200
1201         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1202           comments are allowed.
1203
1204 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1205
1206         * delegate.cs: Add checks for subtypes in paramaters and return values
1207         in VerifyMethod () to add support for Covariance/Contravariance
1208         in delegates.
1209         
1210 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1211
1212         * report.cs: Remove extra closing parenthesis.
1213
1214         * convert.cs (Error_CannotImplicitConversion): If the name of the
1215         types are the same, provide some extra information.
1216
1217 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1218
1219         Fix bug #70102
1220         * attribute.cs (Resolve): Improved implementation of params
1221         attribute arguments.
1222
1223         * support.cs (ParameterData): Add HasParams to be faster.
1224
1225 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1226
1227         all things are for /doc support:
1228
1229         * doc.cs: new file that supports XML documentation generation.
1230         * mcs.exe.sources: added doc.cs.
1231         * driver.cs:
1232           Handle /doc command line option.
1233           Report error 2006 instead of 5 for missing file name for /doc.
1234           Generate XML documentation when required, after type resolution.
1235         * cs-tokenizer.cs:
1236           Added support for picking up documentation (/// and /** ... */),
1237           including a new XmlCommentState enumeration.
1238         * cs-parser.jay:
1239           Added lines to fill Documentation element for field, constant,
1240           property, indexer, method, constructor, destructor, operator, event
1241           and class, struct, interface, delegate, enum.
1242           Added lines to warn incorrect comment.
1243         * rootcontext.cs :
1244           Added Documentation field (passed only when /doc was specified).
1245         * decl.cs:
1246           Added DocComment, DocCommentHeader, GenerateDocComment() and
1247           OnGenerateDocComment() and some supporting private members for
1248           /doc feature to MemberCore.
1249         * class.cs:
1250           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1251         * delegate.cs:
1252           Added overriden DocCommentHeader.
1253         * enum.cs:
1254           Added overriden DocCommentHeader and GenerateDocComment().
1255
1256 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1257
1258         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1259         unwrapping the enumeration values, chain to
1260         DoConstantNumericPromotions again, so we can promote things to the
1261         fundamental types (takes care of enums that are bytes, sbytes).
1262
1263         Fixes bug #62054.
1264
1265 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1266
1267         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1268         Fix long-standing bug in type-lookup.  Use FindType instead of
1269         LookupType when ec.ResolvingTypeTree.
1270         (Attribute.ResolveType, Attribute.Resolve)
1271         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1272         Update to changes.
1273         (Attributes.Search): Remove internal version.  Update.
1274         (Attributes.SearchMulti): Update.
1275         (Attributes.GetClsCompliantAttribute): Remove.
1276         (Attributes.GetIndexerNameAttribute): Remove.
1277         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1278         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1279         * class.cs (Indexer.Define): Likewise.
1280
1281 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1282
1283         Fix bug #68790
1284         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1285         MarshallByReference members access.
1286
1287         * expression.cs: Use CheckMarshallByRefAccess;
1288         Better error CS0197 message.
1289
1290         * report.cs: Print whole related error message.
1291
1292 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1293
1294         * class (GetClassBases): Better error 60 report.
1295         (EventProperty): Disabled warning 67 detection.
1296
1297 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1298
1299         Fix bug #60324
1300         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1301
1302         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1303         precise values.
1304
1305 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1306
1307         Fix bug #49488
1308         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1309
1310         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1311
1312 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1313
1314         * attribute.cs (Attribute.Resolve): Refine error reporting and
1315         report a cs0117 if the identifier does not exist, to distinguish
1316         from 0617 which is a miss-use of the actual identifier.
1317
1318         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1319         between cs0070 and cs0079.
1320
1321         * class.cs (MemberBase.DoDefine): When reporting a wrong
1322         accessibility level, we use MethodCore to compare instead of
1323         Method (this was a regression in some refactoring effort).
1324
1325         So now we correctly report cs0056 again.
1326
1327         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1328         testing the target_type (which was known to be object_type) and
1329         not the source type (which is anonymous_method).
1330
1331         Fixed reporting of error cs1660.
1332
1333         * expression.cs (UserCast.Source): Expose the underlying cast.
1334
1335         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1336         allowed types to find a match to int32 first (most common).
1337
1338         In addition, it ignores any ImplicitUserConversions that did an
1339         internal implicit conversion (as the switch statement allows only
1340         one integral conversion to exist).
1341
1342         * class.cs (PartialContainer.Create): rename `name' to
1343         `member_name' for clarity.  Then replace the string calls with a
1344         call to MemberName.GetPartialName, as now using
1345         MemberName.ToString is an error (this is due to the side effects
1346         it had, that were fixed in the past).
1347
1348         This will restore the error reporting on a number of partial class
1349         errors that were missusing this (and getting an exception as a
1350         results, which is now just a plain textual warning, because
1351         yyparse debug output would crash otherwise).
1352
1353 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1354
1355         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1356
1357 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1358
1359         * rootcontext.cs (LookupType): Make sure to cache lookups that
1360         don't give us a negative result. This saves about 5% of corlib
1361         compilation time.
1362
1363 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1364
1365         * report.cs (AbstractMessage.Print): messages are sent to stderr
1366
1367         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1368         non-interface in the list of interfaces (at this point, either
1369         parent was properly set, or a base class is being listed in the
1370         interfaces section).
1371
1372         This flags error 1722, and resolves the crash from bug 69259.
1373
1374 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1375
1376         * statement.cs (Using.EmitExpressionFinally): make this work right
1377         for valuetypes. Fixes 69926.
1378
1379 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1380
1381         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1382         converted to an enum" here, before we try to change the underlying
1383         type.  This code exists, but it is a different code path than the
1384         one used while encoding constants.
1385
1386         (ImplicitReferenceConversionExists): In addition, resynchronized
1387         the code here, so it matches the same code in
1388         ImplicitReferenceConversionExists for the `from any class-type S
1389         to any interface-type T'.       
1390
1391 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1392
1393         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1394
1395 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1396
1397         * cs-parser.jay: Use verbosity accordingly. 
1398
1399 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1400
1401         * expression.cs (Unary.ResolveOperator): Do not report warning;
1402         AddressOf reads from variable.
1403         
1404         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1405
1406 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1407
1408         Fix bug #69462
1409
1410         * attribute.cs (Attributable): Removed CheckTargets.
1411         (Attributes.Emit): Explicit attribute targets are tested here.
1412
1413         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1414         not enabled for interfaces.
1415
1416         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1417         (GetAssemblyName): Ouch next bug there.
1418
1419 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1420
1421         * expression.cs: Error 275 added.
1422         
1423 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1424
1425         Fix bug #69177 (Implemented decimal constant support)
1426
1427         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1428         (BinaryFold): Add DecimalConstant.
1429
1430         * const.cs (Define): Decimal constant 
1431         (is not constant.
1432         (ChangeType): Add decimal type handling.
1433         (LookupConstantValue): Don't set value for decimal type but
1434         emit DecimalConstantAttribute. Needed for constant optimization.
1435
1436         * constant.cs (ToDecimal): New method.
1437         (ConvertToDecimal): New method.
1438         (IntConstant): Implemented ConvertToDecimal.
1439         (DecimalConstant.Emit): Emit optimized version for decimals in
1440         int range.
1441
1442         * expression.cs (ResolveOperator): Changed order of constant
1443         reduction to work correctly with native types which have
1444         overloaded operators.
1445         (ResolveMemberAccess): Extract constant value from attribute
1446         for decimal type.
1447
1448         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1449
1450         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1451         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1452         (ChangeType): Decimal is special.
1453         (TypeToCoreType): Add decimal type.
1454
1455 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1456
1457         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1458         decimal types.
1459
1460 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1461
1462         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1463         test cs1667-5.cs.
1464
1465 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1466
1467         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1468
1469         * pending.cs (PendingImplementation): Grab only interfaces.
1470
1471 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1472
1473         * statement.cs (ForeachHelperMethods): Add location member and
1474         error 202 detection.
1475
1476 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1477
1478         * expression.cs (DoResolveBase): Fixed wrong warning for out
1479         variables.
1480
1481 2004-12-04  Martin Baulig  <martin@ximian.com>
1482
1483         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1484         to check whether the conversion is ok.
1485
1486         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1487         `Type.EmptyTypes' if we're not a generic TypeContainer.
1488
1489 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1490
1491         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1492         old bug: when converting from the null literal to a pointer,
1493         return an EmptyCast, not the NullLiteral.
1494
1495         This fixes #69921, the recent null_type changes probably made this
1496         bug more prominent.
1497
1498 2004-12-03  Martin Baulig  <martin@ximian.com>
1499
1500         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1501         method as our child, call AnonymousMethod.Compatible() on it.
1502
1503 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1504
1505         * class.cs (FieldBase): Use an unused bit field from the field to
1506         encode the `has_offset' property from the FieldMember.  This saves
1507         a couple of Ks on bootstrap compilation.
1508
1509         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1510         method as our child, return the AnonymousMethod resolved
1511         expression.
1512
1513         * expression.cs (New.DoResolve): Allow return values from
1514         NewDelegate to also include AnonymousMethods.
1515
1516         Fixes #70150.
1517
1518 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1519
1520         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1521         cs1648 report.
1522         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1523         System.Runtime.InteropServices._Exception, since it's a base
1524         interface of the core type System.Exception in the net_2_0 profile.
1525
1526 2004-11-27  Martin Baulig  <martin@ximian.com>
1527
1528         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1529
1530 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1531
1532         * Makefile: Convert to use executable.make.
1533         * gmcs.exe.sources: New.
1534
1535 2004-11-25  Martin Baulig  <martin@ximian.com>
1536
1537         * expression.cs (Invocation.InferType): Added support for byref types.
1538
1539 2004-11-25  Martin Baulig  <martin@ximian.com>
1540
1541         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1542         in TypeManager.TypeToCoreType().
1543
1544 2004-11-25  Martin Baulig  <martin@ximian.com>
1545
1546         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1547         "Dispose" method from the `current_type'.
1548         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1549         DoDefineMembers() instead of using the MethodBuilder; this is
1550         required for generic iterators.
1551
1552         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1553
1554 2004-11-24  Martin Baulig  <martin@ximian.com>
1555
1556         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1557
1558 2004-11-20  Martin Baulig  <martin@ximian.com>
1559
1560         * expression.cs (Invocation.InferType): Correctly infer generic
1561         instances; see gen-103.cs.
1562         (Invocation.InferTypeArguments): If a generic method doesn't have
1563         any unbound type parameters, we don't need to infer anything.
1564
1565 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1566
1567         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1568
1569 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1570
1571         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1572         (TypeHandle.GetMemberCache): New.
1573         (TypeHandle.TypeHandle): Update.
1574         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1575         (TypeManager.LookupParentInterfacesCache):
1576         Rename from LookupInterfaceCache.  Optimize slightly.
1577         (TypeManager.MemberLookup_FindMembers): Update.
1578         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1579         multi-type variant.
1580         (AddCacheContents): Rename from AddHashtable.
1581         * class.cs (TypeContainer.parent_container): Remove.
1582         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1583         (TypeContainer.DoDefineMembers): Don't initialize it.
1584         Update to name changes.
1585         
1586 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1587
1588         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1589         that factors the code to check access modifiers on override.  
1590
1591         (PropertyBase): Use the code here.
1592
1593         Patch from Lluis S'anchez, fixes bug #69361.
1594
1595 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1596
1597         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1598         routine that is used to report the use of a captured variable
1599         whose address has been taken.
1600
1601         There are two checks: one when variables are being captured and
1602         the other check is when the address of a variable is taken. 
1603         
1604         (because an anonymous methods might be resolved before *or* after
1605         the address has been taken) and 
1606
1607         * expression.cs (Conditional.DoResolve): Remove the special
1608         casing that Martin added to trueExpr and falseExpr being both
1609         NullLiteral.  We get the right behavior now just by introducing
1610         the null_type into the compiler. 
1611
1612         * convert.cs (ExplicitConversion): Change the code to use
1613         null_type instead of testing `expr is NullLiteral'.
1614         (ImplicitConversionStandard): use null_type too.
1615         (ImplicitReferenceConversionExists): use null_type too.
1616         (ImplicitReferenceConversion): use null_type too.
1617
1618         * literal.cs: The type of `NullLiteral' is now null_type instead
1619         of object_type. 
1620         (Resolve): Set the type here.
1621
1622         * typemanager.cs: Introduce null_type.
1623
1624 2004-11-18  Martin Baulig  <martin@ximian.com>
1625
1626         * rootcontext.cs
1627         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1628
1629 2004-11-18  Martin Baulig  <martin@ximian.com>
1630
1631         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1632
1633 2004-11-18  Martin Baulig  <martin@ximian.com>
1634
1635         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1636         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1637         call ResolveConstructedType() on it to resolve it without checking
1638         constraints.
1639         (Constraints.ResolveTypes): Check them here.
1640         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1641         but don't check constraints.
1642         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1643         check constraints here.
1644         (ConstructedType.ResolveConstructedType): New public method.  This
1645         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1646         resolve ourselves without checking constraints.
1647
1648         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1649
1650 2004-11-18  Martin Baulig  <martin@ximian.com>
1651
1652         * decl.cs
1653         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1654
1655         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1656
1657 2004-11-18  Martin Baulig  <martin@ximian.com>
1658
1659         * ecore.cs (TypeExpr.ResolveType): Removed.
1660         (Expression.ResolveAsTypeTerminal): We always return a fully
1661         resolved `TypeExpr', so we can just access its `Type'.
1662
1663         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1664
1665 2004-11-17  Martin Baulig  <martin@ximian.com>
1666
1667         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1668         sure we don't return any unresolved TypeExpr's.
1669         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1670         a `TypeExpr'.
1671         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1672
1673         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1674         unresolved `ConstructedType's.
1675
1676 2004-11-17  Martin Baulig  <martin@ximian.com>
1677
1678         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1679
1680 2004-11-17  Martin Baulig  <martin@ximian.com>
1681
1682         * ecore.cs
1683         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1684
1685         * decl.cs (DeclSpace.ResolveType): Removed.
1686         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1687
1688 2004-11-17  Martin Baulig  <martin@ximian.com>
1689
1690         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1691         direction, like FindMembers() does.  Fixes #69546, testcase is in
1692         test-315.cs.    
1693
1694 2004-11-16  Martin Baulig  <martin@ximian.com>
1695
1696         This is based on a patch from Marek Safar, see bug #69082.
1697         Fixes bugs #63705 and #67130.
1698
1699         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1700         method; create a MemberCache for an interface type and cache the
1701         result.
1702
1703         * decl.cs (IMemberContainer.ParentContainer): Removed.
1704         (IMemberContainer.ParentCache): New property.
1705         (MemberCache.SetupCacheForInterface): Removed.
1706         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1707         to create a cache for an interface's "parent".
1708
1709         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1710         interfaces too.
1711
1712 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1713
1714         * statement.cs: Avoid adding bools to a hashtable.
1715
1716 2004-11-15  Martin Baulig  <martin@ximian.com>
1717
1718         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1719
1720 2004-11-11  Martin Baulig  <martin@ximian.com>
1721
1722         * typemanager.cs (TypeManager.GetMethodName): New method.
1723
1724         * class.cs (MethodData.Define): Include the generic arity in the
1725         name of an explicit interface; also add it to the method name.
1726
1727         * pending.cs (PendingImplementation.InterfaceMethod): The method
1728         name now includes the generic arity.
1729
1730 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1731
1732         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1733         calling an unsafe method from a safe location.
1734
1735 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1736
1737         Fix #69167
1738         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1739
1740 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1741
1742         * namespace.cs (VerifyUsing): use GetPartialName instead of
1743         ToString. 
1744
1745 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1746
1747         * statement.cs (Return.Resolve): Fix regression in typo: if
1748         `in_exc', we have to request a NeedReturnLabel, this was a typo
1749         introduced in the anonymous method check-in.  Fixes #69131.
1750
1751         * Indexers were using the ShortName when defining themselves,
1752         causing a regression in the compiler bootstrap when applying the
1753         patch from 2004-11-02 (first part), now they use their full name
1754         and the bug is gone.
1755
1756 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1757
1758         * driver.cs: Strip the path from the names of embedded resources. Fixes
1759         #68519.
1760
1761 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1762
1763         Fix error message regression: cs0104-2.cs.
1764         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1765         (AliasEntry.Resolve): Update.
1766         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1767         'silent' flag.
1768         (RootContext.LookupType): Update.
1769
1770 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1771
1772         * cs-parser.jay: Add support for handling accessor modifiers
1773         * class: Add support port accessor modifiers and error checking,
1774         define PropertyMethod.Define as virtual (not abstract anymore)
1775         * ecore.cs: Add checking for proeprties access with access modifiers
1776         * iterators.cs: Modify Accessor constructor call based in the modified
1777         constructor
1778 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1779
1780         * expression.cs (StringConcat): Handle being called twice,
1781         as when we have a concat in a field init with more than two
1782         ctors in the class
1783
1784 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1785
1786         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1787         special case explicit implementations, we should always produce
1788         the .property or .event declaration.
1789         
1790         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1791         since it will not return correct data if people use this
1792         unresolved in the presence of using statements (see test-313).
1793
1794         * class.cs (MethodData.Define): If we are an explicit interface
1795         implementation, set the method name to the full name of the
1796         interface plus the name of the method.  
1797
1798         Notice that using the method.MethodName.GetFullName() does not
1799         work, as it will only contain the name as declared on the source
1800         file (it can be a shorthand in the presence of using statements)
1801         and not the fully qualifed type name, for example:
1802
1803         using System;
1804
1805         class D : ICloneable {
1806                 object ICloneable.Clone ()  {
1807                 }
1808         }
1809
1810         Would produce a method called `ICloneable.Clone' instead of
1811         `System.ICloneable.Clone'.
1812
1813         * namespace.cs (Alias.Resolve): Use GetPartialName.
1814         
1815 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1816
1817         * cs-parser.jay: Add error 1055 report.
1818
1819 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1820
1821         * assign.cs (Assign.DoResolve): Only do the transform of
1822         assignment into a New if the types are compatible, if not, fall
1823         through and let the implicit code deal with the errors and with
1824         the necessary conversions. 
1825
1826 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1827
1828         * cs-parser.jay: Add error 1031 report.
1829
1830         * cs-tokenizer.cs: Add location for error 1038.
1831
1832 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1833
1834         * cs-parser.jay: Add error 1016 report.
1835
1836 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1837
1838         * cs-parser.jay: Add errors 1575,1611 report.
1839
1840 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1841
1842         * cs-parser.jay: Add error 1001 report.
1843
1844 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1845
1846         Fix #68850
1847         * attribute.cs (GetMarshal): Add method argument for
1848         caller identification.
1849
1850         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1851         agument for GetMarshal and RuntimeMissingSupport.
1852
1853 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1854
1855         * attribute.cs (ExtractSecurityPermissionSet): Removed
1856         TypeManager.code_access_permission_type.
1857
1858         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1859
1860 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1861
1862         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1863         for obsolete use of a variable here.   Fixes regression on errors
1864         cs0619-25 and cs0619-26.
1865
1866 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1867
1868         Fix #62358, implemented security attribute encoding.
1869
1870         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1871         Tests permitted SecurityAction for assembly or other types.
1872         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1873         data from SecurityPermissionAttribute to PermisionSet class.
1874
1875         * class.cs (ApplyAttributeBuilder): Added special handling
1876         for System.Security.Permissions.SecurityAttribute based types.
1877
1878         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1879         special handling for System.Security.Permissions.SecurityAttribute
1880         based types.
1881
1882         * enum.cs (ApplyAttributeBuilder): Added special handling
1883         for System.Security.Permissions.SecurityAttribute based types.
1884
1885         * parameter.cs (ApplyAttributeBuilder): Added special handling
1886         for System.Security.Permissions.SecurityAttribute based types.
1887
1888         * rootcontext.cs: Next 2 core types.
1889
1890         * typemanager.cs (TypeManager.security_permission_attr_type):
1891         Built in type for the SecurityPermission Attribute.
1892         (code_access_permission_type): Build in type.
1893
1894 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1895
1896         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1897         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1898         all of this information into
1899         EmitContext.EmitCapturedVariableInstance.
1900         
1901         * codegen.cs (EmitCapturedVariableInstance): move here the
1902         funcionality of emitting an ldarg.0 in the presence of a
1903         remapping.   This centralizes the instance emit code.
1904
1905         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1906         then emit a load of this: it means that we have reached the
1907         topmost ScopeInfo: the one that contains the pointer to the
1908         instance of the class hosting the anonymous method.
1909
1910         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1911         captures to the topmost CaptureContext.
1912
1913 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1914
1915         * expression.cs (LocalVariableReference): Move the knowledge about
1916         the iterators into codegen's EmitCapturedVariableInstance.
1917
1918 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1919
1920         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1921         all code paths return a value from an anonymous method (it is the
1922         same as the 161 error, but for anonymous methods).
1923
1924 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1925
1926         The introduction of anonymous methods in the compiler changed
1927         various ways of doing things in the compiler.  The most
1928         significant one is the hard split between the resolution phase
1929         and the emission phases of the compiler.
1930
1931         For instance, routines that referenced local variables no
1932         longer can safely create temporary variables during the
1933         resolution phase: they must do so from the emission phase,
1934         since the variable might have been "captured", hence access to
1935         it can not be done with the local-variable operations from the runtime.
1936         
1937         * statement.cs 
1938
1939         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1940         is a toplevel block.
1941
1942         (ToplevelBlock): A new kind of Block, these are the blocks that
1943         are created by the parser for all toplevel method bodies.  These
1944         include methods, accessors and anonymous methods.
1945
1946         These contain some extra information not found in regular blocks:
1947         A pointer to an optional CaptureContext (for tracking captured
1948         local variables and parameters).  A pointer to the parent
1949         ToplevelBlock.
1950         
1951         (Return.Resolve): Catch missmatches when returning a value from an
1952         anonymous method (error 1662).
1953         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1954         phase.
1955
1956         (Break.Resolve): ditto.
1957
1958         (SwitchLabel): instead of defining the labels during the
1959         resolution phase, we now turned the public ILLabel and ILLabelCode
1960         labels into methods called GetILLabelCode() and GetILLabel() that
1961         only define the label during the Emit phase.
1962
1963         (GotoCase): Track the SwitchLabel instead of the computed label
1964         (its contained therein).  Emit the code by using
1965         SwitchLabel.GetILLabelCode ().
1966
1967         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1968         whether the Local has been captured or not.
1969
1970         (LocalInfo.IsCaptured): New property, used to tell whether the
1971         local has been captured.
1972         
1973         * anonymous.cs: Vastly updated to contain the anonymous method
1974         support.
1975
1976         The main classes here are: CaptureContext which tracks any
1977         captured information for a toplevel block and ScopeInfo used to
1978         track the activation frames for various local variables.   
1979
1980         Each toplevel block has an optional capture context associated
1981         with it.  When a method contains an anonymous method both the
1982         toplevel method and the anonymous method will create a capture
1983         context.   When variables or parameters are captured, they are
1984         recorded on the CaptureContext that owns them, for example:
1985
1986         void Demo () {
1987              int a;
1988              MyDelegate d = delegate {
1989                  a = 1;
1990              }
1991         }
1992
1993         Here `a' will be recorded as captured on the toplevel
1994         CapturedContext, the inner captured context will not have anything
1995         (it will only have data if local variables or parameters from it
1996         are captured in a nested anonymous method.
1997
1998         The ScopeInfo is used to track the activation frames for local
1999         variables, for example:
2000
2001         for (int i = 0; i < 10; i++)
2002                 for (int j = 0; j < 10; j++){
2003                    MyDelegate d = delegate {
2004                         call (i, j);
2005                    }
2006                 }
2007
2008         At runtime this captures a single captured variable `i', but it
2009         captures 10 different versions of the variable `j'.  The variable
2010         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2011         recorded on a child.  
2012
2013         The toplevel ScopeInfo will also track information like the `this'
2014         pointer if instance variables were referenced (this is necessary
2015         as the anonymous method lives inside a nested class in the host
2016         type of the method). 
2017
2018         (AnonymousMethod): Expanded to track the Toplevel, implement
2019         `AnonymousMethod.Compatible' to tell whether an anonymous method
2020         can be converted to a target delegate type. 
2021
2022         The routine now also produces the anonymous method content
2023
2024         (AnonymousDelegate): A helper class that derives from
2025         DelegateCreation, this is used to generate the code necessary to
2026         produce the delegate for the anonymous method that was created. 
2027
2028         * assign.cs: API adjustments for new changes in
2029         Convert.ImplicitStandardConversionExists.
2030
2031         * class.cs: Adjustments to cope with the fact that now toplevel
2032         blocks are of type `ToplevelBlock'. 
2033
2034         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2035         insteda of standard blocks.
2036
2037         Flag errors if params arguments are passed to anonymous methods.
2038
2039         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2040         `CurrentAnonymousMethod' which points to the current Anonymous
2041         Method.  The variable points to the AnonymousMethod class that
2042         holds the code being compiled.  It is set in the new EmitContext
2043         created for the anonymous method.
2044
2045         (EmitContext.Phase): Introduce a variable and an enumeration to
2046         assist in enforcing some rules about when and where we are allowed
2047         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2048         only one that enfonces this right now).
2049
2050         (EmitContext.HaveCaptureInfo): new helper method that returns
2051         whether we have a CapturedContext initialized.
2052
2053         (EmitContext.CaptureVariable): New method used to register that a
2054         LocalInfo must be flagged for capturing. 
2055
2056         (EmitContext.CapturedParameter): New method used to register that a
2057         parameters must be flagged for capturing. 
2058         
2059         (EmitContext.CapturedField): New method used to register that a
2060         field must be flagged for capturing. 
2061
2062         (EmitContext.HaveCapturedVariables,
2063         EmitContext.HaveCapturedFields): Return whether there are captured
2064         variables or fields. 
2065
2066         (EmitContext.EmitMethodHostInstance): This is used to emit the
2067         instance for the anonymous method.  The instance might be null
2068         (static methods), this (for anonymous methods that capture nothing
2069         and happen to live side-by-side with the current method body) or a
2070         more complicated expression if the method has a CaptureContext.
2071
2072         (EmitContext.EmitTopBlock): Routine that drives the emission of
2073         code: it will first resolve the top block, then emit any metadata
2074         and then emit the code.  The split is done so that we can extract
2075         any anonymous methods and flag any captured variables/parameters.
2076         
2077         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2078         during this phase, the ILGenerator should not be used as labels
2079         and local variables declared here might not be accessible to any
2080         code that is part of an anonymous method.  
2081
2082         Exceptions to this include the temporary variables that are
2083         created by some statements internally for holding temporary
2084         variables. 
2085         
2086         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2087         metadata for a cb
2088
2089         (EmitContext.TemporaryReturn): This method is typically called
2090         from the Emit phase, and its the only place where we allow the
2091         ReturnLabel to be defined other than the EmitMeta.  The reason is
2092         that otherwise we would have to duplicate a lot of logic in the
2093         Resolve phases of various methods that today is on the Emit
2094         phase. 
2095
2096         (EmitContext.NeedReturnLabel): This no longer creates the label,
2097         as the ILGenerator is not valid during the resolve phase.
2098
2099         (EmitContext.EmitThis): Extended the knowledge in this class to
2100         work in anonymous methods in addition to iterators. 
2101
2102         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2103         code is necessary on the stack to access the instance to a local
2104         variable (the variable will be accessed as a field).
2105
2106         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2107         EmitContext.EmitAddressOfParameter): Routines to support
2108         parameters (not completed at this point). 
2109         
2110         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2111         will also remove the parameters.
2112
2113         * convert.cs (Convert): Define a `ConstantEC' which points to a
2114         null.  This is just to prefity some code that uses
2115         ImplicitStandardConversion code and do not have an EmitContext
2116         handy.
2117
2118         The idea is to flag explicitly that at that point in time, it is
2119         known that the conversion will not trigger the delegate checking
2120         code in implicit conversions (which requires a valid
2121         EmitContext). 
2122
2123         Everywhere: pass new EmitContext parameter since
2124         ImplicitStandardConversionExists now requires it to check for
2125         anonymous method conversions. 
2126
2127         (Convert.ImplicitStandardConversionExists): If the type of an
2128         expression is the anonymous_method_type, and the type is a
2129         delegate, we invoke the AnonymousMethod.Compatible method to check
2130         whether an implicit conversion is possible. 
2131
2132         (Convert.ImplicitConversionStandard): Only do implicit method
2133         group conversions if the language level is not ISO_1.
2134
2135         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2136         MethodInfo for the Invoke method.  used by Delegate and
2137         AnonymousDelegate.
2138
2139         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2140         method conversions if the target type is a delegate.
2141
2142         Removed extra debugging nops.
2143
2144         (LocalVariableReference): Turn the `local_info' into a public
2145         field. 
2146
2147         Add `prepared' field, the same hack used for FieldExprs to cope
2148         with composed assignments, as Local variables do not necessarily
2149         operate purely on the stack as they used to: they can be captured
2150         fields. 
2151
2152         Add `temp' for a temporary result, like fields.
2153
2154         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2155
2156         It now copes with Local variables that are captured and emits the
2157         proper instance variable to load it from a field in the captured
2158         case. 
2159
2160         (ParameterReference.DoResolveBase): During the resolve phase,
2161         capture parameters if we are in an anonymous method.
2162
2163         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2164         anonymous method, use the EmitContext helper routines to emit the
2165         parameter reference.
2166
2167         * iterators.cs: Set RemapToProxy to true/false during the
2168         EmitDispose class.
2169
2170         * parameters.cs (GetParameterByName): New helper method. 
2171
2172         * typemanager.cs (anonymous_method_type) a new type that
2173         represents an anonyous method.  This is always an internal type,
2174         used as a fencepost to test against the anonymous-methodness of an
2175         expression. 
2176         
2177 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2178
2179         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2180         561 report.
2181         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2182
2183 2004-11-10  Martin Baulig  <martin@ximian.com>
2184
2185         * expression.cs (Invocation.BetterFunction): If two methods have
2186         equal parameter types, but only one of them is generic, the
2187         non-generic one wins.
2188         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2189         instance; just use `Type.IsValueType' to determine whether
2190         something is a struct or not.
2191         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2192         so we can be called multiple times.
2193
2194 2004-11-10  Martin Baulig  <martin@ximian.com>
2195
2196         * generic.cs (TypeParameter.DefineConstraints): New public method.
2197         (TypeParameter.CheckAccessLevel): Override this and return true.
2198         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2199         override ResolveType() anymore.
2200         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2201
2202 2004-11-10  Martin Baulig  <martin@ximian.com>
2203
2204         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2205         call DeclSpace.ResolveNestedType() on it.
2206
2207 2004-11-10  Martin Baulig  <martin@ximian.com>
2208
2209         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2210         non-null, call ParameterModifier() on it.
2211
2212 2004-11-10  Martin Baulig  <martin@ximian.com>
2213
2214         * iterators.cs
2215         (Iterators): Added `current_type' and `this_type' fields.
2216         (Iterators.DefineIterator): Create a new EmitContext and store it
2217         in `ec'; compute `this_type'.
2218
2219 2004-11-10  Martin Baulig  <martin@ximian.com>
2220
2221         * typemanager.cs
2222         (TypeManager.IsPrivateAccessible): New public method.
2223         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2224
2225 2004-11-10  Martin Baulig  <martin@ximian.com>
2226
2227         * class.cs (TypeContainer.DefineType): Call
2228         TypeBuilder.DefineGenericParameters() before resolving the type
2229         parameters.
2230         (MethodData.parent_method): New protected field.
2231         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2232         (MethodData.Define): Compute `parent_method'.
2233
2234         * decl.cs
2235         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2236         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2237         (DeclSpace.ec): New protected field; store the EmitContext here.
2238         (DeclSpace.EmitContext): New public property.
2239         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2240         (DeclSpace.ResolveNestedType): New public method.
2241         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2242         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2243         (DeclSpace.FamilyAccessible): Likewise.
2244         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2245         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2246         EmitContext.
2247
2248         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2249         field.
2250
2251         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2252         (Enum.Emit): Don't create a new EmitContext.
2253
2254 2004-10-18  Martin Baulig  <martin@ximian.com>
2255
2256         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2257         `Type' directly, but call ResolveType() on it.
2258         (Catch.Resolve): Likewise.
2259         (Foreach.Resolve): Likewise.
2260
2261 2004-10-18  Martin Baulig  <martin@ximian.com>
2262
2263         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2264         `Type' directly, but call ResolveType() on it.
2265         (Probe.DoResolve): Likewise.
2266         (ArrayCreation.LookupType): Likewise.
2267         (TypeOf.DoResolve): Likewise.
2268         (SizeOf.DoResolve): Likewise.
2269
2270 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2271
2272         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2273         the ResolveType.
2274
2275 2004-10-17  John Luke  <john.luke@gmail.com>
2276
2277         * class.cs (Operator.GetSignatureForError): use CSharpName
2278
2279         * parameter.cs (Parameter.GetSignatureForError): Returns
2280         correct name even if was not defined.
2281
2282 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2283
2284         Fix #65816.
2285         * class.cs (TypeContainer.EmitContext): New property.
2286         (DefineNestedTypes): Create an emitcontext for each part.
2287         (MethodCore.DoDefineParameters): Use container's emitcontext.
2288         Pass type array to InternalParameters.
2289         (MemberBase.DoDefine): Use container's emitcontext.
2290         (FieldMember.Define): Likewise.
2291         (Event.Define): Likewise.
2292         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2293         Pass type array to InternalParameters.
2294         (SetIndexerMethod.GetParameterInfo): Likewise.
2295         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2296         * delegate.cs (Define): Pass emitcontext to
2297         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2298         array to InternalParameters.
2299         * expression.cs (ParameterReference.DoResolveBase): Pass
2300         emitcontext to GetParameterInfo.
2301         (ComposedCast.DoResolveAsTypeStep): Remove check on
2302         ec.ResolvingTypeTree.
2303         * parameter.cs (Parameter.Resolve): Change argument to
2304         EmitContext.  Use ResolveAsTypeTerminal.
2305         (Parameter.GetSignature): Change argument to EmitContext.
2306         (Parameters.ComputeSignature): Likewise.
2307         (Parameters.ComputeParameterTypes): Likewise.
2308         (Parameters.GetParameterInfo): Likewise.
2309         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2310         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2311         * support.cs (InternalParameters..ctor): Remove variant that takes
2312         a DeclSpace.
2313         * typemanager.cs (system_intptr_expr): New.
2314         (InitExpressionTypes): Initialize it.
2315
2316 2004-10-12  Chris Toshok  <toshok@ximian.com>
2317
2318         * cs-parser.jay: fix location for try_statement and catch_clause.
2319
2320 2004-10-18  Martin Baulig  <martin@ximian.com>
2321
2322         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2323         `Type' directly, but call ResolveType() on it.
2324         (MemberBase.DoDefine): Likewise.
2325
2326         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2327         `Type' directly, but call ResolveType() on it.
2328         (ComposedCast.DoResolveAsTypeStep): Likewise.
2329
2330         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2331         `Type' directly, but call ResolveType() on it.
2332
2333 2004-10-17  John Luke  <john.luke@gmail.com>
2334
2335         * class.cs (Operator.GetSignatureForError): use CSharpName
2336
2337         * parameter.cs (Parameter.GetSignatureForError): Returns
2338         correct name even if was not defined.
2339
2340 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2341
2342         Fix #65816.
2343         * class.cs (TypeContainer.EmitContext): New property.
2344         (DefineNestedTypes): Create an emitcontext for each part.
2345         (MethodCore.DoDefineParameters): Use container's emitcontext.
2346         Pass type array to InternalParameters.
2347         (MemberBase.DoDefine): Use container's emitcontext.
2348         (FieldMember.Define): Likewise.
2349         (Event.Define): Likewise.
2350         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2351         Pass type array to InternalParameters.
2352         (SetIndexerMethod.GetParameterInfo): Likewise.
2353         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2354         * delegate.cs (Define): Pass emitcontext to
2355         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2356         array to InternalParameters.
2357         * expression.cs (ParameterReference.DoResolveBase): Pass
2358         emitcontext to GetParameterInfo.
2359         (ComposedCast.DoResolveAsTypeStep): Remove check on
2360         ec.ResolvingTypeTree.
2361         * parameter.cs (Parameter.Resolve): Change argument to
2362         EmitContext.  Use ResolveAsTypeTerminal.
2363         (Parameter.GetSignature): Change argument to EmitContext.
2364         (Parameters.ComputeSignature): Likewise.
2365         (Parameters.ComputeParameterTypes): Likewise.
2366         (Parameters.GetParameterInfo): Likewise.
2367         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2368         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2369         * support.cs (InternalParameters..ctor): Remove variant that takes
2370         a DeclSpace.
2371         * typemanager.cs (system_intptr_expr): New.
2372         (InitExpressionTypes): Initialize it.
2373
2374 2004-10-12  Chris Toshok  <toshok@ximian.com>
2375
2376         * cs-parser.jay: fix location for try_statement and catch_clause.
2377
2378 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2379
2380         More DeclSpace.ResolveType avoidance.
2381         * decl.cs (MemberCore.InUnsafe): New property.
2382         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2383         with newly created EmitContext.
2384         (FieldMember.Define): Likewise.
2385         * delegate.cs (Delegate.Define): Likewise.
2386         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2387         only if normal name-lookup fails.
2388         (TypeExpr.DoResolve): Enable error-checking.
2389         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2390         (SizeOf.DoResolve): Likewise.
2391         (ComposedCast.DoResolveAsTypeStep): Likewise.
2392         (StackAlloc.DoResolve): Likewise.
2393         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2394         (Block.Unsafe): New property.
2395         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2396         (Unsafe): Set 'unsafe' flag of contained block.
2397         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2398         (Fixed.Resolve): Likewise.
2399         (Catch.Resolve): Likewise.
2400         (Using.ResolveLocalVariableDecls): Likewise.
2401         (Foreach.Resolve): Likewise.
2402
2403 2004-10-05  John Luke <john.luke@gmail.com>
2404
2405         * cs-parser.jay: add location to error CS0175
2406
2407 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2408
2409         * ecore.cs (Expression.Constantity): Add support for turning null
2410         into a constant.
2411
2412         * const.cs (Const.Define): Allow constants to be reference types
2413         as long as the value is Null.
2414
2415 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2416
2417         * namespace.cs (NamespaceEntry.Using): No matter which warning
2418         level is set, check if this namespace name has already been added.
2419
2420 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2421
2422         * expression.cs: reftype [!=]= null should always use br[true,false].
2423         # 67410
2424
2425 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2426
2427         Fix #67108
2428         * attribute.cs: Enum conversion moved to 
2429         GetAttributeArgumentExpression to be applied to the all
2430         expressions.
2431
2432 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2433
2434         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2435         * class.c (TypeContainer.DefineType): Flag error if
2436         base types aren't accessible due to access permissions.
2437         * decl.cs (DeclSpace.ResolveType): Move logic to
2438         Expression.ResolveAsTypeTerminal.
2439         (DeclSpace.ResolveTypeExpr): Thin layer over
2440         Expression.ResolveAsTypeTerminal.
2441         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2442         Refactor code into NestedAccess.  Use it.
2443         (DeclSpace.NestedAccess): New.
2444         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2445         argument to silence errors.  Check access permissions.
2446         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2447         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2448         (Cast.DoResolve): Likewise.
2449         (New.DoResolve): Likewise.
2450         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2451         (TypeOf.DoResolve): Likewise.
2452
2453         * expression.cs (Invocation.BetterConversion): Return the Type of
2454         the better conversion.  Implement section 14.4.2.3 more faithfully.
2455         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2456         section 14.4.2.2 explicit.
2457         (Invocation.OverloadResolve): Update.
2458         (Invocation): Remove is_base field.
2459         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2460         (Invocation.Emit): Likewise.
2461
2462 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2463
2464         * cs-parser.jay: Reverted 642 warning fix.
2465
2466 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2467
2468         Fix bug #66615
2469         * decl.cs (FindMemberWithSameName): Indexer can have more than
2470         1 argument.
2471
2472 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2473
2474         * expression.cs (LocalVariableReference.DoResolveLValue):
2475         Do not report warning 219 for out values.
2476         (EmptyExpression.Null): New member to avoid extra allocations.
2477
2478 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2479
2480         * cs-parser.jay: Fix wrong warning 642 report.
2481
2482         * cs-tokenizer.cs (CheckNextToken): New helper;
2483         Inspect next character if is same as expected.
2484
2485 2004-09-23  Martin Baulig  <martin@ximian.com>
2486
2487         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2488         (Convert.ImplicitReferenceConversionExists): Likewise.
2489
2490 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2491
2492         * Makefile (DISTFILES): Comment out a few missing files.
2493
2494 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2495
2496         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2497         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2498         (gmcs.exe): Invoke bootstrap-libs.
2499         (clean-local): Clean the net_2_0_bootstrap profile too.
2500         (PROGRAM_INSTALL_DIR): New.
2501         (install-local): Use it.
2502
2503 2004-10-13  Martin Baulig  <martin@ximian.com>
2504
2505         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2506         (TypeParameter.DefineType): If we're a method type parameter and
2507         that method is overriding something, "inflate" its constraints.
2508
2509 2004-10-12  Martin Baulig  <martin@ximian.com>
2510
2511         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2512         and have type arguments, create and resolve a ConstructedType.
2513
2514 2004-10-12  Martin Baulig  <martin@ximian.com>
2515
2516         * decl.cs (MemberCache.FindMemberToOverride): Use
2517         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2518         to compare the invocationType.
2519
2520         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2521         When comparing two type parameters, only do the signature-only
2522         comparision for method type parameters.
2523
2524 2004-10-11  Martin Baulig  <martin@ximian.com>
2525
2526         * report.cs: Don't make --fatal abort on warnings, we have
2527         -warnaserror for that.
2528
2529 2004-10-11  Martin Baulig  <martin@ximian.com>
2530
2531         * typemanager.cs
2532         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2533         (TypeManager.IsEqual): Call ourself recursively instead of using
2534         Type.IsEqual(). 
2535
2536 2004-10-11  Martin Baulig  <martin@ximian.com>
2537
2538         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2539         on our own type parameters, not on the ones we inherit from a containing
2540         class.
2541
2542         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2543         the comparision.
2544
2545         * generic.cs (TypeParameter.Define): We may only be called once.
2546
2547         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2548         instead of TypeManager.IsEqual().
2549
2550 2004-09-28  Martin Baulig  <martin@ximian.com>
2551
2552         * generic.cs
2553         (GenericConstraints.EffectiveBaseClass): New public property.
2554         (TypeParameter.GenericConstraints): New public property.
2555         (ConstructedType.CheckConstraints): Improved.
2556
2557         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2558         (Convert.TypeParameterConversion): New private method; use this in
2559         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2560         for all conversions related to type parameters.
2561
2562 2004-09-24  Martin Baulig  <martin@ximian.com>
2563
2564         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2565         type parameter conversions for type parameters which are known to
2566         be reference types.
2567
2568 2004-09-24  Martin Baulig  <martin@ximian.com>
2569
2570         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2571         `IsValueType' properties.
2572
2573         * support.cs (ReflectionConstraints): Use
2574         Type.GetGenericParameterConstraints() instead of the old hack.
2575
2576 2004-09-24  Martin Baulig  <martin@ximian.com>
2577
2578         * generic.cs (GenericConstraints): Moved here and made it an
2579         abstract class.
2580
2581         * support.cs (GenericConstraints): Moved to generic.cs.
2582
2583 2004-09-24  Martin Baulig  <martin@ximian.com>
2584
2585         * support.cs
2586         (ReflectionConstraints): Un-nested this class and made it public.
2587
2588         * typemanager.cs
2589         (TypeManager.GetTypeParameterConstraints): New public method.
2590         (TypeManager.HasConstructorConstraint): Use the attributes.
2591
2592 2004-09-24  Martin Baulig  <martin@ximian.com>
2593
2594         * support.cs (GenericConstraints): Replaced `HasConstructor',
2595         `IsReferenceType' and `IsValueType' with `Attributes'.
2596         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2597         method and made the .ctor public.
2598
2599         * generic.cs (Constraints.Attributes): New public property.
2600         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2601         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2602         `IsValueType' -> `HasValueTypeConstraint'.
2603
2604 2004-09-23  Martin Baulig  <martin@ximian.com>
2605
2606         * generic.cs (Constraints): Reflect latest runtime changes.
2607
2608 2004-09-23  Martin Baulig  <martin@ximian.com>
2609
2610         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2611         (Convert.ImplicitReferenceConversionExists): Likewise.
2612
2613 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2614
2615         * class.cs (Operator.Define): Add error 448 and 559 report.
2616         
2617 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2618
2619         * class.cs (MemberBase.IsTypePermitted): New protected
2620         method for checking error CS0610.
2621
2622 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2623
2624         * class.cs (TypeContainer.HasExplicitLayout): New property
2625         Returns whether container has StructLayout attribute set Explicit.
2626         (FieldMember): New abstract class for consts and fields.
2627         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2628         (Field): Reuse FieldMember.
2629
2630         * const.cs (Const): Reuse FieldMember.
2631
2632         * rootcontext.cs: EmitConstants call moved to class.
2633
2634 2004-09-22  Martin Baulig  <martin@ximian.com>
2635
2636         Marek and me just fixed one of our oldest bugs: #28562 :-)
2637
2638         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2639
2640         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2641         we're an EnumConstant, just return that.
2642         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2643         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2644         to get the value which'll actually be written into the attribute.
2645         However, we have to use GetValue() to access the attribute's value
2646         in the compiler.        
2647
2648 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2649
2650         * constant.cs (Constant.IsNegative): New abstract property
2651         IsNegative.
2652
2653         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2654         (StackAlloc.DoResolve): Reused IsNegative.
2655
2656 2004-09-22  Martin Baulig  <martin@ximian.com>
2657
2658         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2659         public method; like LookupTypeContainer, but also works for
2660         generic instances.
2661
2662         * report.cs (Report.SymbolRelatedToPreviousError): Use
2663         TypeManager.LookupGenericTypeContainer().       
2664
2665 2004-09-22  Martin Baulig  <martin@ximian.com>
2666
2667         Thanks to Peter Sestoft for this bug report.
2668
2669         * expression.cs (Conditional): If both the `trueExpr' and the
2670         `falseExpr' is a NullLiteral, return a NullLiteral.
2671
2672 2004-09-22  Martin Baulig  <martin@ximian.com>
2673
2674         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2675         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2676         for the "get_Current" call.
2677
2678 2004-09-21  Martin Baulig  <martin@ximian.com>
2679
2680         * convert.cs (Convert.ImplicitReferenceConversion): When
2681         converting to an interface type, first check whether we're
2682         converting from a reference type.
2683
2684 2004-09-14  Martin Baulig  <martin@ximian.com>
2685
2686         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2687
2688 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2689
2690         Fixed bug #61902
2691         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2692         called and is obsolete then this member suppress message
2693         when call is inside next [Obsolete] method or type.
2694
2695         * expression.cs: Use TestObsoleteMethodUsage member.
2696
2697 2004-09-14  Martin Baulig  <martin@ximian.com>
2698
2699         * genericparser.cs: Removed.
2700
2701 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2702
2703         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2704
2705 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2706
2707         * attribute.cs (Attribute.Resolve): Add error 653 report.
2708
2709         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2710         report.
2711         (Method.ApplyAttributeBuilder): Add error 685 report.
2712         (Operator.Define): Add error 564 report.
2713
2714         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2715
2716         * expression.cs (Invocation.DoResolve): Add error
2717         245 and 250 report.
2718
2719         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2720         error 674 report.
2721
2722 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2723
2724         * class.cs (ConstructorInitializer.Resolve):
2725         Wrong error number (515->516).
2726
2727 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2728
2729         * class.cs (Indexer.Define): Add error 631 report.
2730
2731 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2732
2733         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2734
2735 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2736
2737         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2738
2739 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2740
2741         * cs-parser.jay: Added error CS0241 report.
2742
2743 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2744
2745         * cs-parser.jay (fixed_statement): Introduce a scope for the
2746         declaration in the 'fixed' statement.
2747
2748 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2749
2750         * cs-parser.jay: Added CS0230 error report.
2751
2752 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2753
2754         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2755
2756 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2757
2758         * expression.cs (Argument.Resolve): Added error CS0192 and
2759         CS0199 report.
2760
2761 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2762
2763         C# 2.0 #pragma warning feature
2764
2765         * cs-tokenizer.cs (PreProcessPragma): New method; 
2766         Handles #pragma directive.
2767
2768         * report.cs (WarningRegions): New class; Support
2769         class for #pragma warning directive. It tests whether
2770         warning is enabled for a given line.
2771
2772 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2773
2774         * const.cs: Add more descriptive error report, tahnks to
2775         Sebastien. 
2776
2777 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2778
2779         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2780
2781 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2782
2783         * expression.cs: Apply patch from Ben: Remove dead code from
2784         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2785         as that code just threw an exception anwyays.
2786
2787         * const.cs: Remove the call to the turnintoconstant, for details
2788         see bug: #63144
2789         
2790         * literal.cs: The type of the null-literal is the null type;  So
2791         we use a placeholder type (literal.cs:System.Null, defined here)
2792         for it.
2793
2794         * expression.cs (Conditional.DoResolve): Remove some old code that
2795         is no longer needed, conversions have been fixed.
2796
2797         (ArrayCreationExpression.DoResolve): Return false if we fail to
2798         resolve the inner expression.
2799
2800 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2801
2802         Fix test-290.cs.
2803         * cs-parser.jay (delegate_declaration): Record a delegate
2804         declaration as a type declaration.
2805         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2806
2807 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2808
2809         * parameter.cs: Do not crash if the type can not be resolved. 
2810
2811         * expression.cs: Report errors with unsafe pointers, fixes #64896
2812
2813 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2814
2815         * expression.cs: Pointer arith always needs to do a conv.i
2816         if the operand is a long. fix 65320
2817
2818 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2819
2820         Fixed cs0619-37.cs, cs0619-38.cs
2821
2822         * enum.cs (GetObsoleteAttribute): Removed.
2823
2824         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2825         on Enum member is double staged. The first is tested member
2826         and then enum.
2827
2828 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2829
2830         Fixed #56986, #63631, #65231
2831
2832         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2833         adds member to name container.
2834         (TypeContainer.AddToTypeContainer): New method, adds type to
2835         name container.
2836         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2837         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2838         AddOperator): Simplified by reusing AddToMemberContainer.
2839         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2840         instead of field.
2841         (Method.CheckForDuplications): Fixed implementation to test all
2842         possibilities.
2843         (MemberBase): Detection whether member is explicit interface
2844         implementation is now in constructor.
2845         (MemberBase.UpdateMemberName): Handles IndexerName.
2846         (Accessor): Changed to keep also location information.
2847         (AbstractPropertyEventMethod): Is derived from MemberCore.
2848         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2849         will be emited or not.
2850         (PropertyBase.AreAccessorsDuplicateImplementation):
2851         Tests whether accessors are not in collision with some method.
2852         (Operator): Is derived from MethodCore to simplify common
2853         operations.
2854
2855         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2856         must be performed.
2857         (DeclSpace.AddToContainer): Adds the member to defined_names
2858         table. It tests for duplications and enclosing name conflicts.
2859
2860         * enum.cs (EnumMember): Clean up to reuse the base structures
2861
2862 2004-09-03  Martin Baulig  <martin@ximian.com>
2863
2864         Merged latest changes into gmcs.  Please keep this comment in
2865         here, it makes it easier for me to see what changed in MCS since
2866         the last time I merged.
2867
2868 2004-09-03  Martin Baulig  <martin@ximian.com>
2869
2870         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2871         into TypeContainer, to make partial classes work again.
2872
2873 2004-09-03  Martin Baulig  <martin@ximian.com>
2874
2875         * rootcontext.cs (RootContext.V2): Removed.
2876
2877 2004-03-23  Martin Baulig  <martin@ximian.com>
2878
2879         * expression.cs (Invocation.OverloadResolve): Added `bool
2880         may_fail' argument and use it instead of the Location.IsNull() hack.
2881
2882 2004-09-09  Martin Baulig  <martin@ximian.com>
2883
2884         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2885
2886 2004-09-09  Martin Baulig  <martin@ximian.com>
2887
2888         * generic.cs (TypeParameter.DefineType): Added support for
2889         explicit interface methods.
2890
2891 2004-09-09  Martin Baulig  <martin@ximian.com>
2892
2893         * README.Changes: New document.  Started to list important changes
2894         between MCS and GMCS here.
2895
2896 2004-09-08  Martin Baulig  <martin@ximian.com>
2897
2898         * class.cs
2899         (TypeContainer.CheckRecursiveDefinition): New protected method.
2900         (TypeContainer.DefineType): Move the CS0146 check into
2901         CheckRecursiveDefinition().     
2902
2903 2004-09-06  Martin Baulig  <martin@ximian.com>
2904
2905         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2906         types for the constructor constraint.
2907
2908 2004-09-03  Martin Baulig  <martin@ximian.com>
2909
2910         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2911         into TypeContainer, to make partial classes work again.
2912
2913 2004-09-03  Martin Baulig  <martin@ximian.com>
2914
2915         * rootcontext.cs (RootContext.V2): Removed.
2916
2917 2004-03-23  Martin Baulig  <martin@ximian.com>
2918
2919         * expression.cs (Invocation.OverloadResolve): Added `bool
2920         may_fail' argument and use it instead of the Location.IsNull() hack.
2921
2922 2004-09-03  Martin Baulig  <martin@ximian.com>
2923
2924         Merged latest changes into gmcs.  Please keep this comment in
2925         here, it makes it easier for me to see what changed in MCS since
2926         the last time I merged.
2927
2928 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2929
2930         Fix #61128.
2931         * expression.cs (BetterConversion): Don't allow either conversion 
2932         to be null.  Remove redundant implicit conversion test when 'q ==
2933         null' -- when this function is invoked, we already know that the
2934         implicit conversion exists.
2935         (BetterFunction): Assume that 'best' is non-null.  Remove
2936         redundant reimplementation of IsApplicable when 'best' is null.
2937         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2938         number of arguments.
2939         (IsAncestralType): Extract from OverloadResolve.
2940         (OverloadResolve): Make robust to the MethodGroupExpr being
2941         unsorted.  Implement all the logic of Section 14.5.5.1, and
2942         support overloading of methods from multiple applicable types.
2943         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2944
2945         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2946         (RealError, Warning): Append type of report to related symbol.
2947
2948 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2949
2950         * enum.cs: Fixed CLS-Compliance checks for enum members.
2951         Error tests cs3008-8.cs, cs3014-8.cs
2952
2953 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2954
2955         Fixed bug #62342, #63102
2956         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2957         like ImplementMethod.
2958
2959 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2960
2961         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2962         Fixed bug #65170.
2963
2964 2004-09-02  Martin Baulig  <martin@ximian.com>
2965
2966         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2967         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2968         on the MethodBase.
2969
2970 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2971
2972         C# 2.0 Static classes implemented
2973
2974         * class.cs (TypeContainer): instance_constructors,
2975         initialized_fields, initialized_static_fields,
2976         default_constructor, base_inteface_types are protected to be
2977         accessible from StaticClass.
2978         (TypeContainer.DefineDefaultConstructor): New virtual method
2979         for custom default constructor generating
2980         (StaticClass): New class to handle "Static classes" feature.
2981
2982         * cs-parser.jay: Handle static keyword on class like instance
2983         of StaticClass.
2984
2985         * driver.cs: Added "/langversion" command line switch with two
2986         options (iso-1, default).
2987
2988 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2989
2990         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2991
2992 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2993
2994         * delegate.cs: Style.
2995
2996 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2997
2998         * delegate.cs: Add seperate instance expr field for miguel.
2999
3000 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3001
3002         * PointerArithmetic (Resolve): make sure we are not doing
3003         pointer arith on void*. Also, make sure we are resolved
3004         by not setting eclass until resolve.
3005
3006         All callers: Make sure that PointerArithmetic gets resolved.
3007
3008 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3009
3010         * ArrayCreation (LookupType): If the type does not resolve 
3011         to an array, give an error.
3012
3013 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3014
3015         * statement.cs (Try.Resolve): Fixed bug #64222
3016
3017 2004-08-27  Martin Baulig  <martin@ximian.com>
3018
3019         * class.cs
3020         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3021         crash here.     
3022
3023 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3024
3025         * ecore.cs (Constantify): Get underlying type via
3026         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3027         Windows in special cases.
3028
3029 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3030
3031         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3032         for obtaining also private methods.
3033         (GetRemoveMethod): Used GetRemoveMethod (true)
3034         for obtaining also private methods.
3035
3036 2004-09-02  Martin Baulig  <martin@ximian.com>
3037
3038         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3039         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3040         on the MethodBase.
3041
3042 2004-08-27  Martin Baulig  <martin@ximian.com>
3043
3044         * class.cs
3045         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3046         crash here.     
3047
3048 2004-08-25  Martin Baulig  <martin@ximian.com>
3049
3050         * support.cs (ReflectionParameters..ctor): If this is a generic
3051         method, retrieve and store its type parameters.
3052         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3053         (ReflectionParameters.GenericConstraints): The argument specifies
3054         the type parameter, not the method parameter.
3055         (InternalParameters.GenericConstraints): Likewise.
3056
3057         * generic.cs (TypeParameter.DefineType): Correctly handle
3058         constraints wrt. generic methods in interfaces and their
3059         implementations.        
3060
3061 2004-08-24  Martin Baulig  <martin@ximian.com>
3062
3063         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3064         (Constraints.IsSubclassOf): New internal method.
3065
3066         * typemanager.cs (TypeManager.FindMembers): Added special support
3067         for GenericTypeParameterBuilder's.      
3068         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3069         type parameters.
3070
3071 2004-08-24  Martin Baulig  <martin@ximian.com>
3072
3073         * typemanager.cs
3074         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3075         this for accessibility checks.
3076         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3077         IsNestedFamilyAccessible.
3078         (TypeManager.IsSubclassOf): New method, do what the name actually
3079         says.   
3080
3081 2004-08-24  Martin Baulig  <martin@ximian.com>
3082
3083         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3084         as a SimpleName, include the generic arity.
3085
3086 2004-08-24  Martin Baulig  <martin@ximian.com>
3087
3088         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3089         MethodAttributes.HideBySig for operators.
3090
3091 2004-08-23  Martin Baulig  <martin@ximian.com>
3092
3093         Back to the old error reporting system :-)
3094
3095         * report.cs (Message): Removed.
3096         (Report.MessageData, ErrorData, WarningData): Removed.
3097         (Report.Error, Warning): Back to the old system.
3098
3099 2004-08-23  Martin Baulig  <martin@ximian.com>
3100
3101         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3102
3103         * class.cs (TypeContainer.ParentContainer): New public virtual
3104         method; replaces the explicit interface implementation.
3105         (ClassPart.ParentContainer): Override.
3106
3107 2004-08-23  Martin Baulig  <martin@ximian.com>
3108
3109         * statement.cs (Switch): Added support for constant switches; see
3110         #59428 or test-285.cs.
3111
3112 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3113
3114         Fixed bug #62740.
3115         * statement.cs (GetEnumeratorFilter): Removed useless
3116         logic because C# specs is strict. GetEnumerator must be
3117         public.
3118
3119 2004-08-22  Martin Baulig  <martin@ximian.com>
3120
3121         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3122         a switch and may break, reset the barrier.  Fixes #59867.
3123
3124 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3125
3126         CLS-Compliance speed up (~5% for corlib)
3127
3128         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3129         New method. Tests container for CLS-Compliant names
3130
3131         * class.cs (TypeContainer.VerifyClsName): New method.
3132         Checks whether container name is CLS Compliant.
3133         (Constructor): Implements IMethodData.
3134
3135         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3136         low-case table for CLS Compliance test.
3137         (MemberCache.VerifyClsParameterConflict): New method.
3138         Checks method parameters for CS3006 error.
3139
3140         * enum.cs (EnumMember): Is derived from MemberCore.
3141         (Enum.VerifyClsName): Optimized for better performance.
3142
3143 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3144
3145         * report.cs: Renamed Error_T to Error and changed all
3146         references.
3147
3148 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3149
3150         * class.cs (TypeContainer.IndexerArrayList): New inner class
3151         container for indexers.
3152         (TypeContainer.DefaultIndexerName): New constant for default
3153         indexer name. Replaced all "Item" with this constant.
3154         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3155
3156         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3157         DefaultMemberAttribute constructor.
3158
3159 2004-08-05  Martin Baulig  <martin@ximian.com>
3160
3161         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3162         Fix bug #59429.
3163
3164 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3165
3166         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3167         multi platforms problem.
3168
3169         * compiler.csproj: Included shared files.
3170
3171 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3172
3173         Fix bug 60333, 55971 in the more general way
3174         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3175         Added arg_type argument for constant conversion.
3176         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3177
3178 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3179
3180         Fix bug #59760
3181         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3182         OperatorArrayList, MethodCoreArrayList for typecontainer
3183         containers. Changed class member types to these new types.
3184         (MethodArrayList.DefineMembers): Added test for CS0659.
3185
3186 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3187
3188         * cfold.cs: Synchronize the folding with the code in expression.cs
3189         Binary.DoNumericPromotions for uint operands.
3190
3191         * attribute.cs: Revert patch from Raja, it introduced a regression
3192         while building Blam-1.2.1 (hard to isolate a test case).
3193
3194 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3195
3196         Fix for #55382
3197         * class.cs:
3198         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3199         name collision.
3200         (MethodCore.parent_method): New member. The method we're overriding
3201         if this is an override method.
3202         (MethodCore.CheckBase): Moved from Method class and made common.
3203         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3204         private.
3205         (MethodCore.CheckForDuplications): New abstract method. For custom
3206         member duplication search in a container
3207         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3208         method and its return type.
3209         (Event.conflict_symbol): New member. Symbol with same name in the
3210         parent class.
3211
3212         * decl.cs:
3213         (MemberCache.FindMemberWithSameName): New method. The method
3214         is looking for conflict with inherited symbols.
3215
3216 2004-08-04  Martin Baulig  <martin@ximian.com>
3217
3218         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3219
3220         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3221
3222 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3223
3224         * report.cs (Message): New enum for better error, warning reference in
3225         the code.
3226         (MessageData): New inner abstract class. It generally handles printing of
3227         error and warning messages.
3228         Removed unused Error, Warning, Message methods.
3229
3230 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3231
3232         Fix for cs0592-8.cs test
3233         * attribute.cs
3234         (Attributable.ValidAttributeTargets): Made public.
3235         (Attribute.ExplicitTarget): New member for explicit target value.
3236         (Attribute.CheckTargets): Now we translate explicit attribute
3237         target to Target here.
3238
3239 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3240
3241         * ecore.cs (MethodGroupExpr): new IsBase property.
3242
3243         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3244
3245         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3246         rather than an instance expr.
3247
3248         (DelegateCreation.Emit): Use the method group rather than
3249         the instance expression. Also, if you have base.Foo as the
3250         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3251
3252         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3253
3254         (NewDelegate.DoResolve): Only check for the existance of Invoke
3255         if the method is going to be needed. Use MethodGroupExpr.
3256
3257         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3258
3259         * expression.cs: For pointer arith., make sure to use
3260         the size of the type, not the size of the pointer to
3261         the type.
3262
3263 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3264
3265         Fix for #60722
3266         * class.cs (Class): Added error CS0502 test.
3267
3268 2004-08-03  John Luke  <jluke@cfl.rr.com>
3269             Raja R Harinath  <rharinath@novell.com>
3270
3271         Fix for #60997.
3272         * attribute.cs (Attribute.complained_before): New flag.
3273         (Attribute.ResolveType, Attribute.Resolve),
3274         (Attribute.DefinePInvokeMethod): Set it.
3275         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3276         
3277 2004-08-03  Martin Baulig  <martin@ximian.com>
3278
3279         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3280         use a user-defined operator; we still need to do numeric
3281         promotions in case one argument is a builtin type and the other
3282         one has an implicit conversion to that type.  Fixes #62322.
3283
3284 2004-08-18  Martin Baulig  <martin@ximian.com>
3285
3286         * class.cs (Method.Define): Use the correct method name when
3287         creating the MethodBuilder for a generic method.
3288
3289 2004-08-17  Martin Baulig  <martin@ximian.com>
3290
3291         * generic.cs (Constraints): Support type parameter constraints.
3292
3293 2004-08-16  Martin Baulig  <martin@ximian.com>
3294
3295         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3296         (Token.GENERIC_DIMENSION): New token; this is returned if we
3297         encounter an unbound generic type in a typeof() expression.
3298
3299         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3300         this token is only generated while parsing a typeof() expression.
3301         (typeof_expression): Removed the old unbound_type hack.
3302
3303         * generic.cs (TypeArguments.IsUnbound): New public property.
3304
3305         * decl.cs (MemberName): Added support for unbound types.
3306
3307 2004-08-14  Martin Baulig  <martin@ximian.com>
3308
3309         * typemanager.cs
3310         (TypeManager.IsEqualGenericInstance): New static method.
3311         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3312         just used to check accessibility, so follow the rules of 26.1.6.        
3313
3314         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3315         ConstructedType instead of a TypeExpression if we have type arguments.
3316
3317         * cs-parser.jay (typeof_expression): Support unbound generic types.
3318
3319         * ecore.cs (UnboundTypeExpression): New public class.
3320
3321 2004-08-12  Martin Baulig  <martin@ximian.com>
3322
3323         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3324         TypeManager.IsEqual() rather than `=='.
3325
3326         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3327         generic instances as well.
3328
3329 2004-08-12  Martin Baulig  <martin@ximian.com>
3330
3331         * expression.cs (Invocation.InferType): We can only infer method
3332         type parameters.  Fixes #62647.
3333
3334 2004-08-11  Martin Baulig  <martin@ximian.com>
3335
3336         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3337         before resolving the base classes.
3338
3339 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3340
3341         * Makefile: install .mdb file too.
3342
3343 2004-08-05  Martin Baulig  <martin@ximian.com>
3344
3345         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3346         initializer, the current type is just the TypeBuilder, not the
3347         instantiated generic type.
3348         (FieldExpr.IsFieldInitializer): New public property.
3349
3350 2004-08-04  Martin Baulig  <martin@ximian.com>
3351
3352         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3353
3354         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3355
3356 2004-08-03  Martin Baulig  <martin@ximian.com>
3357
3358         * class.cs (MethodData.Define): If we're an explicit
3359         implementation, remove the generic arity from the type name.
3360
3361 2004-08-03  Martin Baulig  <martin@ximian.com>
3362
3363         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3364         use a user-defined operator; we still need to do numeric
3365         promotions in case one argument is a builtin type and the other
3366         one has an implicit conversion to that type.  Fixes #62322.
3367
3368 2004-08-02  Martin Baulig  <martin@ximian.com>
3369
3370         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3371         `TypeExpr[]' array.
3372         (TypeContainer.GetClassBases): Return the unexpanded list of
3373         interfaces; we expand them later.
3374         (TypeContainer.DefineType): After creating the TypeBuilder, call
3375         TypeManager.ExpandInterfaces() to get an expanded and resolved
3376         list of interfaces.
3377
3378         * ecore.cs (TypeExpr.GetInterfaces): Removed
3379
3380         * generics.cs (Constraints.InterfaceConstraints): Remove.
3381         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3382         register the interface constraints.
3383
3384         * typemanager.cs
3385         (TypeManager.AddUserType): Removed the `ifaces' argument.
3386         (TypeManager.AddTypeParameter): Likewise.
3387         (TypeManager.AddUserInterface): Removed, was unused.
3388         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3389         `TypeExpr[]' array for the interfaces.
3390         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3391         has been defined, returns a list of the resolved interfaces types.
3392         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3393         (TypeManager.GetExplicitInterfaces): Likewise.  
3394
3395 2004-08-02  Martin Baulig  <martin@ximian.com>
3396
3397         * expression.cs (Invocation.EmitCall): If we're invoking a method
3398         on a type parameter, use the new `Constrained' prefix opcode.
3399
3400 2004-08-02  Martin Baulig  <martin@ximian.com>
3401
3402         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3403         (LocalInfo.IsThis): New public property.
3404         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3405
3406 2004-08-01  Martin Baulig  <martin@ximian.com>
3407
3408         * class.cs (TypeContainer.GetClassBases): Don't set the default
3409         here since we may get called from GetPartialBases().
3410         (TypeContainer.DefineType): If GetClassBases() didn't return a
3411         parent, use the default one.
3412
3413 2004-07-30  Martin Baulig  <martin@ximian.com>
3414
3415         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3416
3417         * class.cs (SourceMethod): New public class, derive from the
3418         symbol writer's ISourceMethod.
3419         (Method): Use the new symbol writer API.
3420
3421         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3422         as argument and use the new symbol writer.
3423
3424         * location.cs
3425         (SourceFile): Implement the symbol writer's ISourceFile.
3426         (Location.SymbolDocument): Removed.
3427         (Location.SourceFile): New public property.
3428
3429         * symbolwriter.cs: Use the new symbol writer API.
3430
3431 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3432
3433         * Makefile (install-local): Remove.  Functionality moved to
3434         executable.make.
3435
3436 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3437
3438         * Makefile: Install mcs.exe.config file together with mcs.exe.
3439         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3440         correct runtime version.
3441         
3442 2004-07-25  Martin Baulig  <martin@ximian.com>
3443
3444         * class.cs
3445         (TypeContainer.RegisterOrder): Removed, this was unused.
3446         (TypeContainer, interface_order): Removed.
3447         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3448         TypeContainer as argument since we can also be called with a
3449         `PartialContainer' for a partial class/struct/interface.
3450         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3451         of checking whether we're an `Interface' - we could be a
3452         `PartialContainer'.
3453         (PartialContainer.Register): Override; call
3454         AddClass()/AddStruct()/AddInterface() on our parent.
3455
3456         * cs-parser.jay (interface_member_declaration): Add things to the
3457         `current_container', not the `current_class'.
3458
3459         * rootcontext.cs (RegisterOrder): The overloaded version which
3460         takes an `Interface' was unused, removed.
3461
3462         * typemanager.cs (TypeManager.LookupInterface): Return a
3463         `TypeContainer', not an `Interface'.
3464         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3465         contain a `PartialContainer' for an interface, so check it's
3466         `Kind' to figure out what it is.
3467
3468 2004-07-25  Martin Baulig  <martin@ximian.com>
3469
3470         * class.cs (Class.DefaultTypeAttributes): New public constant.
3471         (Struct.DefaultTypeAttributes): Likewise.
3472         (Interface.DefaultTypeAttributes): Likewise.
3473         (PartialContainer.TypeAttr): Override this and add the
3474         DefaultTypeAttributes.
3475
3476 2004-07-25  Martin Baulig  <martin@ximian.com>
3477
3478         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3479         we can just use the `Parent' field instead.
3480
3481 2004-07-25  Martin Baulig  <martin@ximian.com>
3482
3483         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3484
3485 2004-07-25  Martin Baulig  <martin@ximian.com>
3486
3487         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3488         our parts before defining any methods.
3489         (TypeContainer.VerifyImplements): Make this virtual.
3490         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3491         on our PartialContainer.
3492
3493 2004-07-25  Martin Baulig  <martin@ximian.com>
3494
3495         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3496
3497         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3498         argument, we can just use the `Parent' field instead.
3499
3500         * class.cs
3501         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3502         (MemberBase.DoDefine): Likewise.
3503
3504 2004-07-24  Martin Baulig  <martin@ximian.com>
3505
3506         * decl.cs (MemberCore.Parent): New public field.
3507         (DeclSpace.Parent): Moved to MemberCore.
3508
3509         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3510         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3511         parent's .ctor.
3512         (FieldBase, Field, Operator): Likewise.
3513         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3514         (EventField, Event): Likewise.
3515
3516 2004-07-23  Martin Baulig  <martin@ximian.com>
3517
3518         * class.cs (PartialContainer): New public class.
3519         (ClassPart): New public class.
3520         (TypeContainer): Added support for partial classes.
3521         (TypeContainer.GetClassBases): Splitted some of the functionality
3522         out into GetNormalBases() and GetPartialBases().
3523
3524         * cs-tokenizer.cs (Token.PARTIAL): New token.
3525         (Tokenizer.consume_identifier): Added some hacks to recognize
3526         `partial', but only if it's immediately followed by `class',
3527         `struct' or `interface'.
3528
3529         * cs-parser.jay: Added support for partial clases.
3530
3531 2004-07-23  Martin Baulig  <martin@ximian.com>
3532
3533         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3534         a `DeclSpace' and also made it readonly.
3535         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3536         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3537         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3538
3539         * cs-parser.jay: Pass the `current_class', not the
3540         `current_container' (at the moment, this is still the same thing)
3541         to a new Method, Property, Event, Indexer or Constructor.
3542
3543 2004-07-23  Martin Baulig  <martin@ximian.com>
3544
3545         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3546         and removed the `current_interface' one.
3547         (struct_declaration, class_declaration, interface_declaration):
3548         Set `current_class' to the newly created class/struct/interface;
3549         set their `Bases' and call Register() before parsing their body.
3550
3551 2004-07-23  Martin Baulig  <martin@ximian.com>
3552
3553         * class.cs (Kind): New public enum.
3554         (TypeContainer): Made this class abstract.
3555         (TypeContainer.Kind): New public readonly field.
3556         (TypeContainer.CheckDef): New public method; moved here from
3557         cs-parser.jay.
3558         (TypeContainer.Register): New public abstract method.
3559         (TypeContainer.GetPendingImplementations): New public abstract
3560         method.
3561         (TypeContainer.GetClassBases): Removed the `is_class' and
3562         `is_iface' parameters.
3563         (TypeContainer.DefineNestedTypes): Formerly known as
3564         DoDefineType().
3565         (ClassOrStruct): Made this class abstract.
3566
3567         * tree.cs (RootTypes): New public type. 
3568
3569 2004-07-20  Martin Baulig  <martin@ximian.com>
3570
3571         * tree.cs (Tree.RecordNamespace): Removed.
3572         (Tree.Namespaces): Removed.
3573
3574         * rootcontext.cs (RootContext.IsNamespace): Removed.
3575
3576         * cs-parser.jay (namespace_declaration): Just create a new
3577         NamespaceEntry here.
3578
3579 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3580
3581         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3582         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3583         entry to make sure it runs in the correct runtime version.
3584         
3585 2004-07-18  Martin Baulig  <martin@ximian.com>
3586
3587         * generic.cs (ConstructedType.CheckConstraints): Improved
3588         constraints checking.
3589
3590 2004-07-18  Martin Baulig  <martin@ximian.com>
3591
3592         * expression.cs (Invocation.BetterMethod): Call
3593         TypeManager.TypeToCoreType() on all types and removed my previous
3594         hack; we're already doig the right thing here.
3595
3596 2004-07-17  Martin Baulig  <martin@ximian.com>
3597
3598         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3599
3600 2004-07-16  Martin Baulig  <martin@ximian.com>
3601
3602         * iterators.cs: Added generics support.
3603
3604 2004-07-16  Martin Baulig  <martin@ximian.com>
3605
3606         * iterators.cs: Rewrote this.  We're now using one single Proxy
3607         class for both the IEnumerable and the IEnumerator interface and
3608         `Iterator' derives from Class so we can use the high-level API.
3609
3610         * class.cs (TypeContainer.AddIterator): New method.
3611         (TypeContainer.DoDefineType): New protected virtual method, which
3612         is called from DefineType().
3613         (TypeContainer.DoDefineMembers): Call DefineType() and
3614         DefineMembers() on all our iterators.
3615         (TypeContainer.Emit): Call Emit() on all our iterators.
3616         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3617
3618         * codegen.cs (EmitContext.CurrentIterator): New public field.
3619
3620 2004-07-15  Martin Baulig  <martin@ximian.com>
3621
3622         * typemanager.cs
3623         (TypeManager.not_supported_exception_type): New type.   
3624
3625 2004-07-14  Martin Baulig  <martin@ximian.com>
3626
3627         * typemanager.cs
3628         (TypeManager.generic_ienumerable_type): New type.
3629         (TypeManager.generic_ienumerator_type): New type.
3630
3631         * rootcontext.cs
3632         (RootContext.interfaces_first_stage): Added
3633         "System.Collections.Generic.IEnumerator`1" and
3634         "System.Collections.Generic.IEnumerable`1".     
3635
3636 2004-07-14  Martin Baulig  <martin@ximian.com>
3637
3638         * iterators.cs: Use real error numbers.
3639
3640 2004-07-14  Martin Baulig  <martin@ximian.com>
3641
3642         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3643         requires this to be a System.Collection.IEnumerable and not a
3644         class implementing that interface.
3645         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3646
3647 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3648
3649         * class.cs: Fixed previous fix, it broke some error tests.
3650
3651 2004-07-12  Martin Baulig  <martin@ximian.com>
3652
3653         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3654         Fixes #61293.
3655
3656 2004-07-14  Martin Baulig  <martin@ximian.com>
3657
3658         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3659         an exclamation mark (!) for the generic arity to reflect the
3660         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3661
3662 2004-07-13  Martin Baulig  <martin@ximian.com>
3663
3664         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3665         specifiers being part of a type argument.
3666
3667 2004-07-13  Martin Baulig  <martin@ximian.com>
3668
3669         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3670         name for generic types.
3671
3672 2004-07-13  Martin Baulig  <martin@ximian.com>
3673
3674         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3675         bit to fix #60119.
3676
3677 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3678
3679         * assign.cs (LocalTemporary): Add new argument: is_address,If
3680         `is_address' is true, then the value that we store is the address
3681         to the real value, and not the value itself.
3682         
3683         * ecore.cs (PropertyExpr): use the new local temporary
3684         stuff to allow us to handle X.Y += z (where X is a struct)
3685
3686 2004-07-08  Martin Baulig  <martin@ximian.com>
3687
3688         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3689         not always return, just like we're doing in Using.Resolve().
3690
3691 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3692
3693         * cs-parser.jay (fixed_statement): flag this as Pinned.
3694
3695 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3696
3697         * typemanager.cs (TypeManager): Removed MakePinned method, this
3698         mechanism is replaced with the .NET 2.x compatible mechanism of
3699         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3700
3701         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3702         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3703         `IsFixed' property which has a different meaning.
3704
3705 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3706
3707         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3708         visible from inside a nested class, not just the names of the
3709         immediately enclosing class.
3710         Fix for bug #60730.
3711
3712 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3713
3714         * expression.cs (BetterConversion): Remove buggy special-case
3715         handling of "implicit constant expression conversions".  At this
3716         point, we already know that the conversion is possible -- we're
3717         only checking to see which is better.
3718
3719 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3720
3721         * cs-parser.jay: Added error CS0210 test.
3722
3723 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3724
3725         * cs-parser.jay: Added error CS0134 test.
3726
3727 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3728
3729         Fix bug #52507
3730         * cs-parser.jay: Added error CS0145 test.
3731
3732 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3733
3734         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3735
3736 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3737         
3738         * expression.cs (StackAlloc.Resolve): The argument may not
3739         be a constant; deal with this case.
3740         
3741 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3742
3743         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3744         GetIndexerAttributeValue.
3745         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3746
3747         * class.cs (Indexer.Define): Added error tests for CS0415,
3748         CS0609.
3749
3750 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3751
3752         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3753         property code.
3754
3755 2004-06-23  Martin Baulig  <martin@ximian.com>
3756
3757         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3758         neither return nor throw, reset the barrier as well.  Fixes #60457.
3759
3760 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3761
3762         * class.cs : EventAttributes is now set to None by default.
3763           This fixes bug #60459.
3764
3765 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3766
3767         Fix bug #60219
3768         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3769         Don't throw exception but return null (it's sufficient now).
3770
3771 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3772
3773         * typemanager.cs (GetArgumentTypes): Faster implementation.
3774
3775 2004-06-18  Martin Baulig  <martin@ximian.com>
3776
3777         * attribute.cs (Attribute.Resolve): Check whether we're an
3778         EmptyCast which a Constant child.  Fixes #60333.
3779
3780 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3781
3782         * statement.cs (EmitCollectionForeach): Account for the fact that
3783         not all valuetypes are in areas which we can take the address of.
3784         For these variables, we store to a temporary variable. Also, make
3785         sure that we dont emit a `callvirt' on a valuetype method.
3786
3787 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3788
3789         * expression.cs (StackAlloc.DoReSolve): Added test for
3790         negative parameter (CS0247).
3791
3792 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3793
3794         Fix bug #59792
3795         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3796
3797 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3798
3799         Fix bug #59781
3800         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3801         ulong.
3802
3803 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3804
3805         Fix bug #58254 & cs1555.cs, cs1556.cs
3806         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3807
3808 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3809
3810         * cs-parser.jay: Added error CS1669 test for indexers.
3811
3812 2004-06-18  Martin Baulig  <martin@ximian.com>
3813
3814         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3815         argument.  Fixes #60441.
3816
3817 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3818         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3819         The name needs to have the actual name of the method in order
3820         for other tests (such as the one in OverloadResolve for Invoke
3821         on a delegate) to work. As well, it does not really help
3822         error reporting because the method group had multiple methods.
3823         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3824         Make profiling work.
3825         
3826 2004-06-13  Martin Baulig  <martin@ximian.com>
3827
3828         * cs-parser.jay: Don't allow generic attributes.
3829
3830 2004-06-13  Martin Baulig  <martin@ximian.com>
3831
3832         * class.cs (MemberBase.DoDefineBase): New protected method.
3833         (MemberBase.DoDefine): Compute the `flags' in the new
3834         DoDefineBase() which must be called first.
3835         (Method.Define): Call DoDefineBase() first so we have the flags
3836         when defining the generic method.
3837
3838         * cs-parser.jay (interface_method_declaration): Support generic methods.
3839
3840 2004-06-13  Martin Baulig  <martin@ximian.com>
3841
3842         * decl.cs (TypeName): Removed.
3843         (MemberName): Removed TypeName and MemberNow; now we just have
3844         MemberName.
3845
3846         * cs-parser.jay: Don't distinguish between type arguments and type
3847         parameters in the grammar and simplified the rules a bit.  The
3848         reduce/reduce conflicts are now gone (except the one we inherited
3849         from mcs).
3850
3851 2004-06-11  Martin Baulig  <martin@ximian.com>
3852
3853         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3854         call this twice: for params and varargs methods.
3855
3856 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3857
3858         * class.cs:
3859         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3860
3861 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3862
3863         * attribute.cs (Attribute.GetValidTargets): Made public.
3864
3865         * class.cs: 
3866         (AbstractPropertyEventMethod): New class for better code sharing.
3867         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3868         CS1667 report.
3869         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3870
3871 2004-06-09  Martin Baulig  <martin@ximian.com>
3872
3873         * cs-parser.jay: Removed a reduce/reduce conflict.
3874
3875 2004-06-03  Martin Baulig  <martin@ximian.com>
3876
3877         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3878         GetSimpleName() and return a SimpleName.
3879
3880         * ecore.cs (SimpleName.Arguments): New public field.
3881         (SimpleName): Added overloaded ctor which takes an additional
3882         TypeArguments argument.
3883         (SimpleName.SimpleNameResolve): Added support for generic methods.
3884         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3885         formerly in MemberAccess.DoResolve(), but we also need it in
3886         SimpleNameResolve().
3887
3888         * expression.cs (MemberAccess.DoResolve): Use the new
3889         MethodGroupExpr.ResolveGeneric().       
3890
3891 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3892
3893         * decl.cs: If possible, use lookuptypedirect here. We can only do
3894         this if there is no `.' after the namespace. Avoids using
3895         LookupType, which does lots of slow processing.
3896         (FindNestedType) New method, does what it says :-).
3897         * namespace.cs: use LookupTypeDirect.
3898         * rootcontext.cs: use membercache, if possible.
3899         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3900
3901 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3902
3903         * expression.cs:
3904         According to the spec, 
3905
3906         In a member access of the form E.I, if E is a single identifier,
3907         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3908         field, property, localvariable, or parameter with the same type as
3909         the meaning of E as a type-name (§3.8), then both possible
3910         meanings of E are permitted.
3911
3912         We did not check that E as a simple-name had the same type as E as
3913         a type name.
3914
3915         This trivial check gives us 5-7% on bootstrap time.
3916
3917 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3918
3919         * expression.cs (Invocation.OverloadResolve): Avoid the
3920         use of hashtables and boxing here by allocating on demand.
3921
3922 2004-05-30  Martin Baulig  <martin@ximian.com>
3923
3924         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3925         we're doing a silent lookup.  Don't try to lookup nested types in
3926         TypeManager.object_type (thanks to Ben Maurer).
3927
3928 2004-05-30  Martin Baulig  <martin@ximian.com>
3929
3930         Committing a patch from Ben Maurer.
3931
3932         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3933
3934 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3935
3936         * convert.cs: add a trivial cache for overload operator resolution.
3937
3938 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3939
3940         * attribute.cs
3941         (AttributeTester.GetObsoleteAttribute): Returns instance of
3942         ObsoleteAttribute when type is obsolete.
3943
3944         * class.cs
3945         (TypeContainer.VerifyObsoleteAttribute): Override.
3946         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3947         (MethodCode.VerifyObsoleteAttribute): Override.
3948         (MemberBase.VerifyObsoleteAttribute): Override.
3949
3950         * decl.cs
3951         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3952         and report proper error.
3953
3954         *delegate.cs
3955         (Delegate.VerifyObsoleteAttribute): Override.
3956
3957         * ecore.cs
3958         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3959         and report proper error.
3960         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3961
3962         * enum.cs
3963         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3964         and enum member.
3965
3966         * expression.cs
3967         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3968         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3969         Added test for ObsoleteAttribute.
3970
3971         * statement.cs
3972         (Catch): Derived from Statement.
3973
3974 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3975
3976         * decl.cs: If possible, use lookuptypedirect here. We can only do
3977         this if there is no `.' after the namespace. Avoids using
3978         LookupType, which does lots of slow processing.
3979         (FindNestedType) New method, does what it says :-).
3980         * namespace.cs: use LookupTypeDirect.
3981         * rootcontext.cs: use membercache, if possible.
3982         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3983
3984 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3985
3986         * expression.cs:
3987         According to the spec, 
3988
3989         In a member access of the form E.I, if E is a single identifier,
3990         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3991         field, property, localvariable, or parameter with the same type as
3992         the meaning of E as a type-name (§3.8), then both possible
3993         meanings of E are permitted.
3994
3995         We did not check that E as a simple-name had the same type as E as
3996         a type name.
3997
3998         This trivial check gives us 5-7% on bootstrap time.
3999
4000 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4001
4002         Fixed bug #59071 & cs0160.cs
4003         * statement.cs (Try.Resolve): Check here whether order of catch
4004         clauses matches their dependencies.
4005
4006 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4007
4008         Fixed bug #58624
4009         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
4010         unsafe type.
4011
4012 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4013
4014         * expression.cs (Invocation.OverloadResolve): Avoid the
4015         use of hashtables and boxing here by allocating on demand.
4016
4017 2004-05-30  Martin Baulig  <martin@ximian.com>
4018
4019         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4020         we're doing a silent lookup.  Don't try to lookup nested types in
4021         TypeManager.object_type (thanks to Ben Maurer).
4022
4023 2004-05-30  Martin Baulig  <martin@ximian.com>
4024
4025         Committing a patch from Ben Maurer.
4026
4027         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4028
4029 2004-05-29  Martin Baulig  <martin@ximian.com>
4030
4031         * class.cs (IMethodData.ShouldIgnore): New method.
4032
4033         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4034         `Location' argument, we don't need it anywhere.  Use
4035         `IMethodData.ShouldIgnore ()' instead of
4036         `MethodData.GetMethodFlags ()'.
4037         (TypeManager.AddMethod): Removed.
4038         (TypeManager.AddMethod2): Renamed to AddMethod.
4039
4040 2004-05-29  Martin Baulig  <martin@ximian.com>
4041
4042         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4043
4044         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4045         converting from a class type S to an interface type and we already
4046         have an object on the stack, don't box it again.  Fixes #52578.
4047
4048 2004-05-29  Martin Baulig  <martin@ximian.com>
4049
4050         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4051         Added support for `params' parameters.  Fixes #59267.
4052
4053 2004-05-29  Martin Baulig  <martin@ximian.com>
4054
4055         * literal.cs (NullPointer): Provide a private .ctor which sets
4056         `type' to TypeManager.object_type.  Fixes #59048.
4057
4058 2004-05-29  Martin Baulig  <martin@ximian.com>
4059
4060         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4061         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4062
4063         * ecore.cs (EventExpr.instance_expr): Make the field private.
4064
4065 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4066
4067         Fixed bug #50080 & cs0214-2.cs
4068         * expression.cs (Cast.DoResolve): Check unsafe context here.
4069         
4070         * statement.cs (Resolve.DoResolve): Likewise.
4071
4072 2004-05-26  Martin Baulig  <martin@ximian.com>
4073
4074         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4075
4076         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4077         (RootContext.LookupType): Pass down the `silent' flag.
4078
4079 2004-05-25  Martin Baulig  <martin@ximian.com>
4080
4081         * expression.cs
4082         (MethodGroupExpr.IdenticalTypeName): New public property.
4083         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4084         expression actually refers to a type.
4085
4086 2004-05-25  Martin Baulig  <martin@ximian.com>
4087
4088         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4089         for #56176 and made it actually work.
4090
4091 2004-05-25  Martin Baulig  <martin@ximian.com>
4092
4093         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4094         (FieldExpr, PropertyExpr): Override and implement
4095         CacheTemporaries.  Fixes #52279.
4096
4097 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4098
4099         * location.cs: In the new compiler listing a file twice is a
4100         warning, not an error.
4101
4102 2004-05-24  Martin Baulig  <martin@ximian.com>
4103
4104         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4105         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4106
4107 2004-05-24  Martin Baulig  <martin@ximian.com>
4108
4109         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4110         walking the `using' list.  Fixes #53921.
4111
4112 2004-05-24  Martin Baulig  <martin@ximian.com>
4113
4114         * const.cs (Const.LookupConstantValue): Added support for
4115         EmptyCast's; fixes #55251.
4116
4117 2004-05-24  Martin Baulig  <martin@ximian.com>
4118
4119         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4120         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4121         which does the CS0135 check.  The reason is that we first need to
4122         check whether the variable actually exists.
4123
4124 2004-05-24  Martin Baulig  <martin@ximian.com>
4125
4126         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4127         than RootContext.LookupType() to find the explicit interface
4128         type.  Fixes #58584.
4129
4130 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4131
4132         * Makefile: Simplify.  Use executable.make.
4133         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4134
4135 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4136
4137         * decl.cs:
4138         * enum.cs:
4139         Use the invariant culture when doing String.Compare for CLS case
4140         sensitivity.
4141         
4142 2004-05-23  Martin Baulig  <martin@ximian.com>
4143
4144         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4145         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4146
4147         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4148
4149 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4150
4151         * class.cs (MemberBase.Define): Reuse MemberType member for 
4152         resolved type. Other methods can use it too.
4153
4154 2004-05-23  Martin Baulig  <martin@ximian.com>
4155
4156         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4157         the variable also exists in the current block (otherwise, we need
4158         to report a CS0103).  Fixes #58670.
4159
4160 2004-05-23  Martin Baulig  <martin@ximian.com>
4161
4162         * flowanalysis.cs (Reachability.Reachable): Compute this
4163         on-the-fly rather than storing it as a field.
4164
4165 2004-05-23  Martin Baulig  <martin@ximian.com>
4166
4167         * flowanalysis.cs (Reachability.And): Manually compute the
4168         resulting `barrier' from the reachability.      
4169        
4170 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4171
4172         Fix bug #57835
4173         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4174         instance of ObsoleteAttribute when symbol is obsolete.
4175
4176         * class.cs
4177         (IMethodData): Extended interface for ObsoleteAttribute support.
4178
4179 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4180
4181         * attribute.cs: Fix bug #55970
4182
4183 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4184
4185         Fix bug #52705
4186         * attribute.cs
4187         (GetObsoleteAttribute): New method. Creates the instance of
4188         ObsoleteAttribute.
4189         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4190         ObsoleteAttribute when member is obsolete.
4191         (AttributeTester.Report_ObsoleteMessage): Common method for
4192         Obsolete error/warning reporting.
4193
4194         * class.cs
4195         (TypeContainer.base_classs_type): New member for storing parent type.
4196
4197         * decl.cs
4198         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4199         for this MemberCore.
4200
4201 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4202
4203         * attribute.cs, const.cs: Fix bug #58590
4204
4205 2004-05-21  Martin Baulig  <martin@ximian.com>
4206
4207         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4208         out parameters if the end of the method is unreachable.  Fixes
4209         #58098. 
4210
4211 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4212
4213         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4214         Hari was right, why extra method.
4215
4216 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4217
4218         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4219
4220 2004-05-20  Martin Baulig  <martin@ximian.com>
4221
4222         * delegate.cs: Convert this file to Unix mode - like the original
4223         version in mcs is.
4224
4225 2004-05-20  Martin Baulig  <martin@ximian.com>
4226
4227         * attribute.cs: Convert this file to Unix mode - like the original
4228         version in mcs is.
4229
4230 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4231
4232        Fix bug #58688 (MCS does not report error when the same attribute
4233        is assigned twice)
4234
4235        * attribute.cs (Attribute.Emit): Distinction between null and default.
4236
4237 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4238
4239        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4240        of a top-level attribute without an attribute target.
4241        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4242        Make non-static.
4243        (Attribute.Conditional_GetConditionName), 
4244        (Attribute.Obsolete_GetObsoleteMessage): Update.
4245        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4246        part of ScanForIndexerName.
4247        (Attribute.CanIgnoreInvalidAttribute): New function.
4248        (Attribute.ScanForIndexerName): Move to ...
4249        (Attributes.ScanForIndexerName): ... here.
4250        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4251        (Attributes.Search): New internal variant that can choose not to
4252        complain if types aren't resolved.  The original signature now
4253        complains.
4254        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4255        complaints suppressed.
4256        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4257        only if it not useful.
4258        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4259        top-level for attributes that are shared between the assembly
4260        and a top-level class.
4261        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4262        * class.cs: Update to reflect changes.
4263        (DefineIndexers): Fuse loops.
4264        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4265        a couple more variants of attribute names.
4266
4267 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4268
4269         Fix bug #52585 (Implemented explicit attribute declaration)
4270
4271         * attribute.cs:
4272         (Attributable.ValidAttributeTargets): New abstract method. It gets
4273         list of valid attribute targets for explicit target declaration.
4274         (Attribute.Target): It holds target itself.
4275         (AttributeSection): Removed.
4276         (Attribute.CheckTargets): New method. It checks whether attribute
4277         target is valid for the current element.
4278
4279         * class.cs:
4280         (EventProperty): New class. For events that are declared like
4281         property (with add and remove accessors).
4282         (EventField): New class. For events that are declared like field.
4283         class.cs
4284
4285         * cs-parser.jay: Implemented explicit attribute target declaration.
4286
4287         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4288         Override ValidAttributeTargets.
4289
4290         * parameter.cs:
4291         (ReturnParameter): Class for applying custom attributes on 
4292         the return type.
4293         (ParameterAtribute): New class. Class for applying custom
4294         attributes on the parameter type.
4295
4296 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4297
4298         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4299         definitions. 
4300
4301         (Method): Allow UNSAFE here.
4302
4303         * modifiers.cs: Support unsafe reporting.
4304
4305 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4306
4307         * decl.cs: Fix bug #58478.
4308
4309 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4310
4311         * statement.cs: When checking for unreachable code on an EmptyStatement,
4312         set the location. Fixes bug #58488.
4313
4314 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4315
4316         * driver.cs: Add -pkg handling.
4317
4318         From Gonzalo: UseShelLExecute=false
4319
4320 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4321
4322         * attribute.cs:
4323         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4324         for attribute.
4325         (Attribute.IsClsCompliaceRequired): Moved to base for better
4326         accesibility.
4327         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4328         when attribute is AttributeUsageAttribute.
4329         (Attribute.GetValidTargets): Simplified.
4330         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4331         attribute for this type.
4332         (Attribute.ApplyAttributes): Method renamed to Emit and make
4333         non-static.
4334         (GlobalAttributeSection): New class for special handling of global
4335         attributes (assembly, module).
4336         (AttributeSection.Emit): New method.
4337
4338         * class.cs: Implemented Attributable abstract methods.
4339         (MethodCore.LabelParameters): Moved to Parameter class.
4340         (Accessor): Is back simple class.
4341         (PropertyMethod): Implemented Attributable abstract class.
4342         (DelegateMethod): Implemented Attributable abstract class.
4343         (Event): New constructor for disctintion between normal Event
4344         and Event with accessors.
4345
4346         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4347
4348         * codegen.cs, const.cs, decl.cs, delegate.cs:
4349         (CommonAssemblyModulClass): Implemented Attributable abstract class
4350         and simplified.
4351
4352         * enum.cs: Implement IAttributeSupport interface.
4353         (EnumMember): New class for emum members. Implemented Attributable
4354         abstract class
4355
4356         * parameter.cs:
4357         (ParameterBase): Is abstract.
4358         (ReturnParameter): New class for easier [return:] attribute handling.
4359
4360         * typemanager.cs: Removed builder_to_attr.
4361
4362 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4363
4364         Fix bug #57151.
4365         * attribute.cs (Attribute.GetPositionalValue): New function.
4366         * class.cs (TypeContainer.VerifyMembers): New function.
4367         (TypeContainer.Emit): Use it.
4368         (ClassOrStruct): New base class for Class and Struct.
4369         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4370         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4371         class.
4372         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4373         then each non-static field should have a FieldOffset attribute.
4374         Otherwise, none of the fields should have a FieldOffset attribute.
4375         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4376         and FieldOffset attributes.
4377         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4378         (TypeManager.field_offset_attribute_type): New core types.
4379         (TypeManager.InitCoreTypes): Initialize them.
4380
4381 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4382
4383         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4384         Return correct type.
4385         From bug #58270.
4386
4387 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4388
4389         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4390         be implicitly converted to ulong.
4391         
4392         * expression.cs: The logic for allowing operator &, | and ^ worked
4393         was wrong, it worked before because we did not report an error in
4394         an else branch.  Fixes 57895.
4395
4396         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4397         allow volatile fields to be reference types.
4398
4399 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4400
4401         * driver.cs: Add support for /debug-
4402
4403 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4404
4405         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4406         Add a 'complain' parameter to silence errors.
4407         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4408         silently overlooked type-resolutions.
4409         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4410         to reflect changes.
4411         (Attributes.Search): New function.
4412         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4413         (Attributes.GetAttributeFullName): Remove hack.
4414         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4415         Update to reflect changes.
4416         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4417         Use Attributes.Search instead of nested loops.
4418
4419 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4420
4421         * decl.cs:
4422         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4423         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4424         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4425
4426         * report.cs: (Report.Warning): Renamed to Warning_T because of
4427         parameter collision.
4428
4429 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4430
4431         * expression.cs (MemberAccess.ResolveMemberAccess):
4432         Exit with non-zero status after Report.Error.
4433         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4434         Likewise.
4435         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4436
4437 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4438
4439         * support.cs: Don't hang when the file is empty.
4440
4441 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4442
4443         * support.cs: In SeekableStreamReader, compute the preamble size of the
4444           underlying stream. Position changes should take into account that initial
4445           count of bytes.
4446
4447 2004-05-03  Todd Berman  <tberman@sevenl.net>
4448
4449         * driver.cs: remove unused GetSysVersion function.
4450
4451 2004-05-03  Todd Berman  <tberman@sevenl.net>
4452
4453         * driver.cs: Remove the hack from saturday, as well as the hack
4454         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4455         link_paths to get that bit proper.
4456
4457 2004-05-01  Todd Berman  <tberman@sevenl.net>
4458
4459         * driver.cs: Try a LoadFrom before a Load, this checks the current
4460         path. This is currently a bug in mono that is be fixed, however, this
4461         provides a workaround for now. This will be removed when the bug
4462         is fixed.
4463
4464 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4465
4466         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4467         incomplete key pairs (#57941).
4468
4469 2004-05-01  Todd Berman  <tberman@sevenl.net>
4470
4471         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4472         from the GAC
4473
4474 2004-04-30  Jackson Harper  <jackson@ximian.com>
4475
4476         * codegen.cs: Open keys readonly.
4477         
4478 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4479
4480         * typemanager.cs: don't report cyclic struct layout when a struct
4481         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4482         which has 2 Pango.Rectangle fields.
4483
4484 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4485
4486         * expression.cs: Handle IntPtr comparisons with IL code
4487         rather than a method call.
4488
4489 2004-04-29  Martin Baulig  <martin@ximian.com>
4490
4491         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4492         the list of PropertyInfo's in class hierarchy and find the
4493         accessor.  Fixes #56013.
4494
4495 2004-04-29  Martin Baulig  <martin@ximian.com>
4496
4497         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4498
4499 2004-04-29  Martin Baulig  <martin@ximian.com>
4500
4501         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4502
4503         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4504
4505 2004-04-29  Martin Baulig  <martin@ximian.com>
4506
4507         * class.cs (ConstructorInitializer.Resolve): Check whether the
4508         parent .ctor is accessible.  Fixes #52146.
4509
4510 2004-04-29  Martin Baulig  <martin@ximian.com>
4511
4512         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4513
4514         * statement.cs (Using.EmitLocalVariableDecls): Use
4515         TypeManager.idisposable_type, not typeof (IDisposable).
4516         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4517
4518 2004-04-29  Martin Baulig  <martin@ximian.com>
4519
4520         * class.cs (Event.Define): Don't emit the field and don't set
4521         RTSpecialName and SpecialName for events on interfaces.  Fixes
4522         #57703. 
4523
4524 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4525
4526         Refactor Attribute.ApplyAttributes.
4527         * attribute.cs (Attributable): New base class for objects that can
4528         have Attributes applied on them.
4529         (Attribute): Make AttributeUsage fields public.
4530         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4531         (Attribute.IsInternalCall): New property.
4532         (Attribute.UsageAttr): Convert to a public read-only property.
4533         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4534         (Attribute.ResolveType, Attribute.Resolve)
4535         (Attribute.ScanForIndexerName): Update to reflect changes.
4536         (Attribute.CheckAttributeTarget): Re-format.
4537         (Attribute.ApplyAttributes): Refactor, to various
4538         Attributable.ApplyAttributeBuilder methods.
4539         * decl.cs (MemberCore): Make Attributable.
4540         * class.cs (Accessor): Make Attributable.
4541         (MethodData.ApplyAttributes): Use proper attribute types, not
4542         attribute names.
4543         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4544         (TypeContainer.ApplyAttributeBuilder)
4545         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4546         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4547         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4548         (Operator.ApplyAttributeBuilder): New factored-out methods.
4549         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4550         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4551         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4552         * parameter.cs (ParameterBase): New Attributable base class
4553         that can also represent Return types.
4554         (Parameter): Update to the changes.
4555
4556 2004-04-29  Jackson Harper  <jackson@ximian.com>
4557
4558         * driver.cs: Prefer the corlib system version when looking for
4559         assemblies in the GAC. This is still a hack, but its a better hack
4560         now.
4561         
4562 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4563
4564         * decl.cs, enum.cs: Improved error 3005 reporting.
4565   
4566         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4567         (related_symbols): New private member for list of symbols
4568         related to reported error/warning.
4569         
4570         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4571
4572 2004-04-29  Martin Baulig  <martin@ximian.com>
4573
4574         * ecore.cs (Expression.Constantify): If we're an enum and
4575         TypeManager.TypeToCoreType() doesn't give us another type, use
4576         t.UnderlyingSystemType.  Fixes #56178.  
4577
4578 2004-04-29  Martin Baulig  <martin@ximian.com>
4579
4580         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4581         interfaces and for each interface, only add members directly
4582         declared in that interface.  Fixes #53255.
4583
4584 2004-04-28  Martin Baulig  <martin@ximian.com>
4585
4586         * expression.cs (ConditionalLogicalOperator): Use a temporary
4587         variable for `left' to avoid that we evaluate it more than once;
4588         bug #52588.
4589
4590 2004-04-28  Martin Baulig  <martin@ximian.com>
4591
4592         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4593         `void[]' (CS1547).
4594
4595 2004-04-28  Martin Baulig  <martin@ximian.com>
4596
4597         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4598         void (CS1547).
4599
4600         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4601         whether the type is not void (CS1547).
4602
4603 2004-04-28  Martin Baulig  <martin@ximian.com>
4604
4605         * expression.cs (Unary.DoResolveLValue): Override this and report
4606         CS0131 for anything but Operator.Indirection.
4607
4608 2004-04-28  Martin Baulig  <martin@ximian.com>
4609
4610         Committing a patch from Ben Maurer; see bug #50820.
4611
4612         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4613         check for classes.
4614
4615         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4616         classes.        
4617
4618 2004-04-28  Martin Baulig  <martin@ximian.com>
4619
4620         Committing a patch from Ben Maurer; see bug #50820.
4621
4622         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4623         check for classes.
4624
4625         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4626         classes.        
4627
4628 2004-04-28  Martin Baulig  <martin@ximian.com>
4629
4630         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4631         (Block.AddLabel): Call DoLookupLabel() to only search in the
4632         current block.
4633
4634 2004-04-28  Martin Baulig  <martin@ximian.com>
4635
4636         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4637         comparing StringConstants and NullLiterals in Equality and Inequality.
4638
4639 2004-04-28  Jackson Harper  <jackson@ximian.com>
4640
4641         * driver.cs: Attempt to load referenced assemblies from the
4642         GAC. This is the quick and dirty version of this method that
4643         doesnt take into account versions and just takes the first
4644         canidate found. Will be good enough for now as we will not have more
4645         then one version installed into the GAC until I update this method.
4646
4647 2004-04-28  Martin Baulig  <martin@ximian.com>
4648
4649         * typemanager.cs (TypeManager.CheckStructCycles): New public
4650         static method to check for cycles in the struct layout.
4651
4652         * rootcontext.cs (RootContext.PopulateTypes): Call
4653         TypeManager.CheckStructCycles() for each TypeContainer.
4654         [Note: We only need to visit each type once.]
4655
4656 2004-04-28  Martin Baulig  <martin@ximian.com>
4657
4658         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4659
4660         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4661         success and added `out object value'.  Use a `bool resolved' field
4662         to check whether we've already been called rather than
4663         `ConstantValue != null' since this breaks for NullLiterals.
4664
4665 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4666
4667         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4668         setting of this flag, since the 'set' method may be non-public.
4669
4670 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4671
4672         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4673         check on current_vector.Block.
4674
4675 2004-04-27  Martin Baulig  <martin@ximian.com>
4676
4677         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4678         a field initializer.  Fixes #56459.
4679
4680 2004-04-27  Martin Baulig  <martin@ximian.com>
4681
4682         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4683         we're not attempting to use an indexer.  Fixes #52154.
4684
4685 2004-04-27  Martin Baulig  <martin@ximian.com>
4686
4687         * statement.cs (Return): Don't create a return label if we don't
4688         need it; reverts my change from January 20th.  Thanks to Ben
4689         Maurer for this.
4690
4691 2004-04-27  Martin Baulig  <martin@ximian.com>
4692
4693         According to the spec, `goto' can only leave a nested scope, but
4694         never enter it.
4695
4696         * statement.cs (Block.LookupLabel): Only lookup in the current
4697         block, don't recurse into parent or child blocks.
4698         (Block.AddLabel): Check in parent and child blocks, report
4699         CS0140/CS0158 if we find a duplicate.
4700         (Block): Removed this indexer for label lookups.
4701         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4702         this already does the error reporting for us.
4703
4704         * flowanalysis.cs
4705         (FlowBranching.UsageVector.Block): New public variable; may be null.
4706         (FlowBranching.CreateSibling): Added `Block' argument.
4707         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4708         label for the target of a `goto' and check whether we're not
4709         leaving a `finally'.
4710
4711 2004-04-27  Martin Baulig  <martin@ximian.com>
4712
4713         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4714         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4715         just for returns).
4716
4717 2004-04-27  Martin Baulig  <martin@ximian.com>
4718
4719         * statement.cs (Block.AddLabel): Also check for implicit blocks
4720         and added a CS0158 check.
4721
4722 2004-04-27  Martin Baulig  <martin@ximian.com>
4723
4724         * flowanalysis.cs (FlowBranchingLoop): New class.
4725         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4726         UsageVector's instead of an ArrayList.
4727         (FlowBranching.Label): Likewise.
4728         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4729         (FlowBranching.AddBreakVector): New method.
4730
4731 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4732
4733         * attribute.cs: Small regression fix: only convert the type if we
4734         the type is different, fixes System.Drawing build.
4735
4736 2004-04-27  Martin Baulig  <martin@ximian.com>
4737
4738         * attribute.cs (Attribute.Resolve): If we have a constant value
4739         for a named field or property, implicity convert it to the correct
4740         type.
4741
4742 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4743
4744         * statement.cs (Block.Block): Implicit blocks share
4745         'child_variable_names' fields with parent blocks.
4746         (Block.AddChildVariableNames): Remove.
4747         (Block.AddVariable): Mark variable as "used by a child block" in
4748         every surrounding block.
4749         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4750         been used in a child block, complain about violation of "Invariant
4751         meaning in blocks" rule.
4752         * cs-parser.jay (declare_local_variables): Don't use
4753         AddChildVariableNames.
4754         (foreach_statement): Don't create an implicit block: 'foreach'
4755         introduces a scope.
4756
4757 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4758
4759         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4760         converting from 0L to ulong.  Fixes 57522.
4761
4762 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4763
4764         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4765         derived class hides via 'new' keyword field from base class (test-242.cs).
4766         TODO: Handle this in the more general way.
4767         
4768         * class.cs (CheckBase): Ditto.
4769
4770 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4771
4772         * decl.cs (caching_flags): New member for storing cached values
4773         as bit flags.
4774         (MemberCore.Flags): New enum where bit flags for caching_flags
4775         are defined.
4776         (MemberCore.cls_compliance): Moved to caching_flags.
4777         (DeclSpace.Created): Moved to caching_flags.
4778
4779         * class.cs: Use caching_flags instead of DeclSpace.Created
4780         
4781 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4782
4783         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4784         if we are only a derived class, not a nested class.
4785
4786         * typemanager.cs: Same as above, but do this at the MemberLookup
4787         level (used by field and methods, properties are handled in
4788         PropertyExpr).   Allow for the qualified access if we are a nested
4789         method. 
4790
4791 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4792
4793         * class.cs: Refactoring.
4794         (IMethodData): New inteface; Holds links to parent members
4795         to avoid member duplication (reduced memory allocation).
4796         (Method): Implemented IMethodData interface.
4797         (PropertyBase): New inner classes for get/set methods.
4798         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4799         (Event): New inner classes for add/remove methods.
4800         (Event.DelegateMethod): Implemented IMethodData interface.
4801
4802         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4803         EmitContext (related to class.cs refactoring).
4804
4805 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4806
4807         * delegate.cs (Delegate.VerifyApplicability): If the number of
4808         arguments are the same as the number of parameters, first try to
4809         verify applicability ignoring  any 'params' modifier on the last
4810         parameter.
4811         Fixes #56442.
4812
4813 2004-04-08  Martin Baulig  <martin@ximian.com>
4814
4815         Merged latest changes into gmcs.  Please keep this comment in
4816         here, it makes it easier for me to see what changed in MCS since
4817         the last time I merged.
4818
4819 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4820
4821         * class.cs (TypeContainer.AddIndexer): Use
4822         'ExplicitInterfaceName' to determine if interface name was
4823         explicitly specified.  'InterfaceType' is not initialized at this time.
4824         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4825         Indexers array is already in the required order.  Initialize
4826         'IndexerName' only if there are normal indexers.
4827         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4828         (TypeContainer.Emit): Emit DefaultMember attribute only if
4829         IndexerName is initialized.
4830         Fixes #56300.
4831
4832 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4833
4834         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4835         Fixes #57007
4836
4837 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4838
4839         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4840         attributes.
4841         Fix for #56456.
4842
4843         * attribute.cs (Attribute.Resolve): Check for duplicate named
4844         attributes.
4845         Fix for #56463.
4846
4847 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4848
4849         * iterators.cs (MarkYield): track whether we are in an exception,
4850         and generate code accordingly.  Use a temporary value to store the
4851         result for our state.
4852
4853         I had ignored a bit the interaction of try/catch with iterators
4854         since their behavior was not entirely obvious, but now it is
4855         possible to verify that our behavior is the same as MS .NET 2.0
4856
4857         Fixes 54814
4858
4859 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4860
4861         * iterators.cs: Avoid creating temporaries if there is no work to
4862         do. 
4863
4864         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4865         Enumerations, use TypeManager.EnumToUnderlying and call
4866         recursively. 
4867
4868         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4869         bug #57013
4870
4871         (This.Emit): Use EmitContext.EmitThis to emit our
4872         instance variable.
4873
4874         (This.EmitAssign): Ditto.
4875
4876         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4877         codepaths, we will move all the functionality into
4878         Mono.CSharp.This 
4879
4880         (FieldExpr.EmitAssign): Ditto.
4881
4882         This fixes several hidden bugs that I uncovered while doing a code
4883         review of this today.
4884
4885         * codegen.cs (EmitThis): reworked so the semantics are more clear
4886         and also support value types "this" instances.
4887
4888         * iterators.cs: Changed so that for iterators in value types, we
4889         do not pass the value type as a parameter.  
4890
4891         Initialization of the enumerator helpers is now done in the caller
4892         instead of passing the parameters to the constructors and having
4893         the constructor set the fields.
4894
4895         The fields have now `assembly' visibility instead of private.
4896
4897 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4898
4899         * expression.cs (Argument.Resolve): Check if fields passed as ref
4900         or out are contained in a MarshalByRefObject.
4901
4902         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4903         another compiler type.
4904
4905 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4906
4907         * class.cs (Indexer.Define): use the new name checking method.
4908         Also, return false on an error.
4909         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4910         (is_identifier_[start/part]_character): make static.
4911
4912 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4913
4914         * expression.cs (Binary.ResolveOperator): Do no append strings
4915         twice: since we can be invoked more than once (array evaluation)
4916         on the same concatenation, take care of this here.  Based on a fix
4917         from Ben (bug #56454)
4918
4919 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4920
4921         * codegen.cs: Fix another case where CS1548 must be reported (when 
4922         delay-sign isn't specified and no private is available #56564). Fix
4923         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4924         error when MCS is used on the MS runtime and we need to delay-sign 
4925         (which seems unsupported by AssemblyBuilder - see #56621).
4926
4927 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4928
4929         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4930         (TypeManager.ComputeNamespaces): Faster implementation for
4931         Microsoft runtime.
4932
4933         * compiler.csproj: Updated AssemblyName to mcs.
4934
4935 2004-05-11  Jackson Harper  <jackson@ximian.com>
4936
4937         * Makefile: Preserve MONO_PATH
4938         
4939 2004-05-11  Jackson Harper  <jackson@ximian.com>
4940
4941         * Makefile: Use mono and mcs to build gmcs
4942         
4943 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4944
4945         * codegen.cs: Add patch from Robert Shade
4946         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4947         sync with mcs.
4948
4949 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4950
4951         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4952         incomplete key pairs (#57941).
4953
4954 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4955
4956         * codegen.cs: Fix another case where CS1548 must be reported (when 
4957         delay-sign isn't specified and no private is available #56564). Fix
4958         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4959         error when MCS is used on the MS runtime and we need to delay-sign 
4960         (which seems unsupported by AssemblyBuilder - see #56621).
4961
4962 2004-04-29  Jackson Harper  <jackson@ximian.com>
4963
4964         * Makefile: Set MONO_PATH to use the bootstrap corlib
4965         * driver.cs: Check the GAC for referenced assemblies.
4966                 
4967 2004-04-29  Martin Baulig  <martin@ximian.com>
4968
4969         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4970
4971 2004-04-07  Martin Baulig  <martin@ximian.com>
4972
4973         * expression.cs (Binary.ResolveOperator): Added special case for
4974         Equality/Inequality between a type parameter and a null literal.
4975
4976 2004-04-07  Martin Baulig  <martin@ximian.com>
4977
4978         * convert.cs: Check null literal -> type parameter conversions.
4979
4980 2004-04-07  Martin Baulig  <martin@ximian.com>
4981
4982         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4983         `class' and `struct' constraints.
4984
4985 2004-04-07  Martin Baulig  <martin@ximian.com>
4986
4987         * generic.cs (SpecialConstraint): New public enum.
4988         (Constraints.Resolve): Added support for the `class' and `struct'
4989         constraints.
4990
4991         * cs-parser.jay (type_parameter_constraint): Added support for the
4992         `class' and `struct' constraints.
4993
4994 2004-04-07  Martin Baulig  <martin@ximian.com>
4995
4996         * support.cs (GenericConstraints): Replaced `Types' by
4997         `ClassConstraint' and `InterfaceConstraints'; added
4998         `HasClassConstraint'.   
4999
5000 2004-04-07  Martin Baulig  <martin@ximian.com>
5001
5002         * generic.cs
5003         (Constraints.InterfaceConstraints): New public property.
5004         (Constraints.Types): Make this property public
5005         (TypeParameter): Implement IMemberContainer.
5006         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
5007         instead of a TypeBuilder/MethodBuilder; pass the interface
5008         constraints to TypeManager.AddTypeParameter().
5009         (TypeParameter.DefineType): Just take an EmitContext and no
5010         TypeBuilder/MethodBuilder.  Use the new public API.
5011
5012         * typemanager.cs (TypeManager.AddTypeParameter): Added
5013         `TypeExpr[]' argument; add the interfaces to the
5014         `builder_to_ifaces' hash.
5015         (TypeManager.LookupMemberContainer): For
5016         GenericTypeParameterBuilders, get the TypeParameter from the
5017         `builder_to_type_param'.
5018         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5019         the TypeParameter and call FindMembers on it.
5020
5021 2004-04-07  Martin Baulig  <martin@ximian.com>
5022
5023         * class.cs
5024         (MethodCore.GenericMethod): Moved this field here from Method.
5025         (MethodCore.IsDuplicateImplementation): Take the number of type
5026         parameters into account if we're a generic method.
5027
5028         * expression.cs (Invocation.InferTypeArguments): Don't return true
5029         if `arguments' is null; we still need to check whether we actually
5030         don't need to infer anything in this case.
5031         (MemberAccess): Merged the functionality from GenericMemberAccess
5032         into this class.
5033
5034         * generic.cs (GenericMemberAccess): Removed.
5035
5036 2004-04-05  Martin Baulig  <martin@ximian.com>
5037
5038         * decl.cs (MemberCore): For generic classes, interfaces and
5039         structs, `Name' now includes the number of type parameters
5040         ("Stack!1.Node!1").
5041         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5042         encode the number of type arguments in the type name.
5043
5044         * expression.cs (Expression.MemberLookup): Removed the
5045         `num_type_args' argument; we now encode the number of type
5046         arguments in the type name.
5047
5048         * ecore.cs (SimpleName): Encode the number of type arguments in
5049         the type name itself.
5050
5051         * generic.cs (ConstructedType): Likewise.
5052
5053         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5054         `MemberName'; we now include the number of type parameters in the
5055         type name.
5056
5057         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5058         (TypeManager.MemberLookup): Removed the
5059         `num_type_args' argument; we now encode the number of type
5060         arguments in the type name.     
5061
5062 2004-04-03  Martin Baulig  <martin@ximian.com>
5063
5064         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5065         (MemberCore.MemberName): Moved here from MemberBase.
5066         (DeclSpace.SetParameterInfo): Just take the constraints as an
5067         ArrayList; we already have the type parameters in our
5068         `MemberName'; also do the CS0080 reporting here.
5069
5070         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5071         `IDENTIFIER opt_type_parameter_list'; when constructing our
5072         `MemberName', it'll already include our type parameters.
5073         (class_declaration, interface_declaration): Likewise.
5074         (delegate_declaration): Likewise.
5075         (MakeName): Take a MemberName and return a MemberName.
5076         The following two changes are required to avoid shift/reduce conflicts:
5077         (member_name): Don't include a TypeName anymore; ie. this is now
5078         just 'IDENTIFIER opt_type_parameter_list'.
5079         (property_declaration, event_declaration): Use a
5080         `namespace_or_type_name' instead of a `member_name'.            
5081
5082 2004-04-03  Martin Baulig  <martin@ximian.com>
5083
5084         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5085         `MemberName' class.
5086         (TypeName): Formerly known as MemberName.
5087
5088         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5089         instead of a `MemberName'.
5090
5091         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5092         (member_name): New rule; create a MemberName.
5093
5094 2004-04-02  Martin Baulig  <martin@ximian.com>
5095
5096         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5097         (CS0305 and CS0308).
5098
5099 2004-04-02  Martin Baulig  <martin@ximian.com>
5100
5101         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5102         support for nested types.
5103
5104 2004-04-02  Martin Baulig  <martin@ximian.com>
5105
5106         * ecore.cs (IAlias): New public interface.
5107         (TypeExpr, TypeExpression): Implement IAlias.
5108         (TypeAliasExpression): New public class.
5109
5110         * namespace.cs (Namespace): Implement IAlias.
5111         (Namespace.Lookup): Return an IAlias instead on an object.
5112         (Namespace.DefineName): Take an IAlias instead of an object.
5113         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5114         an object.
5115         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5116         Expression.
5117         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5118         object.
5119         (NamespaceEntry.Lookup): Likewise.
5120
5121         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5122         instead of a Type.      
5123
5124         * decl.cs (DeclSpace): Implement IAlias.
5125         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5126
5127         * generic.cs (ConstructedType): Improved error checking.
5128
5129 2004-04-02  Martin Baulig  <martin@ximian.com>
5130
5131         * convert.cs: Added type parameter conversions.
5132
5133         * ecore.cs
5134         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5135         (ClassCast.Emit): If the source type is a type parameter, box it.
5136         If the target type is a type parameter, emit an `unbox.any'
5137         instead of a `classcast'.1      
5138
5139 2004-04-01  Martin Baulig  <martin@ximian.com>
5140
5141         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5142
5143 2004-04-01  Martin Baulig  <martin@ximian.com>
5144
5145         * generic.cs (ConstructedType.CheckConstraints): Use
5146         Convert.ImplicitStandardConversionExists(); user-defined implicit
5147         conversions are not allowed according to the spec.
5148
5149 2004-03-30  Martin Baulig  <martin@ximian.com>
5150
5151         * expression.cs (New): Added support for type parameters.
5152
5153         * typemanager.cs
5154         (TypeManager.activator_type): New public static field.
5155         (TypeManager.activator_create_instance): Likewise.
5156
5157 2004-03-30  Martin Baulig  <martin@ximian.com>
5158
5159         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5160         public method.
5161
5162 2004-03-30  Martin Baulig  <martin@ximian.com>
5163
5164         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5165         the spec here: the argument type must be convertible to the
5166         constraints.
5167
5168 2004-03-30  Martin Baulig  <martin@ximian.com>
5169
5170         * generic.cs
5171         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5172         TypeManager.AddTypeParameter().
5173         (ConstructedType.CheckConstraints): Re-enable this and actually
5174         check whether we have a constructor constraint.
5175
5176         * typemanager.cs
5177         (TypeManager.builder_to_type_param): New static field.
5178         (TypeManager.AddTypeParameter): New static method.
5179         (TypeManager.LookupTypeParameter): New public method.
5180
5181 2004-03-30  Martin Baulig  <martin@ximian.com>
5182
5183         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5184         the new API to actually define the constructor constraint.
5185
5186         * typemanager.cs
5187         (TypeManager.new_constraint_attr_type): New static field.
5188         (TypeManager.InitCoreTypes): Initialize it.
5189
5190 2004-03-30  Martin Baulig  <martin@ximian.com>
5191
5192         * generic.cs (Constraints): Completed error checking, use correct
5193         error numbers.
5194
5195 2004-03-29  Martin Baulig  <martin@ximian.com>
5196
5197         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5198
5199         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5200         public version which takes a `ParameterData pd' instead of an
5201         `ArrayList args'.
5202
5203 2004-03-29  Martin Baulig  <martin@ximian.com>
5204
5205         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5206         not a MethodInfo.       
5207
5208 2004-03-29  Martin Baulig  <martin@ximian.com>
5209
5210         * expression.cs (Argument.ResolveMethodGroup): If we're a
5211         ConstructedType, call GetMemberAccess() on it.  
5212
5213 2004-03-29  Martin Baulig  <martin@ximian.com>
5214
5215         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5216         (MethodCore.CheckGenericOverride): When overriding a generic
5217         method, check whether the constraints match.
5218
5219         * support.cs (GenericConstraints): New public interface.
5220         (ParameterData.GenericConstraints): New public method.
5221
5222         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5223         method parameter and compute our constraints if appropriate.
5224         (Parameter.GenericConstraints): New public property.
5225
5226         * generic.cs (Constraints): Implement GenericConstraints.
5227
5228 2004-03-29  Martin Baulig  <martin@ximian.com>
5229
5230         * decl.cs (MemberCache.FindMemberToOverride): Use
5231         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5232
5233 2004-03-29  Martin Baulig  <martin@ximian.com>
5234
5235         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5236
5237 2004-03-29  Martin Baulig  <martin@ximian.com>
5238
5239         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5240         not allowed on non-generic declarations").
5241
5242 2004-03-29  Martin Baulig  <martin@ximian.com>
5243
5244         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5245         public version of this method.
5246
5247         * class.cs (MethodCore.IsDuplicateImplementation): Use
5248         Invocation.InferTypeArguments() to check this.
5249
5250 2004-03-29  Martin Baulig  <martin@ximian.com>
5251
5252         * convert.cs: Use TypeManager.IsDelegateType() instead of
5253         comparing types correctly.
5254
5255 2004-03-29  Martin Baulig  <martin@ximian.com>
5256
5257         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5258         types directly to make it work for generic instances.
5259
5260         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5261
5262 2004-03-29  Martin Baulig  <martin@ximian.com>
5263
5264         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5265         support for arrays.     
5266
5267 2004-03-24  Martin Baulig  <martin@ximian.com>
5268
5269         * decl.cs (DeclSpace.FindType): Also use
5270         TypeManager.CheckGeneric() for types from the using clauses.
5271
5272 2004-03-23  Martin Baulig  <martin@ximian.com>
5273
5274         * expression.cs (Invocation.OverloadResolve): Added `bool
5275         may_fail' argument and use it instead of the Location.IsNull() hack.
5276
5277 2004-03-23  Martin Baulig  <martin@ximian.com>
5278
5279         * expression.cs (Invocation.InferType): Use correct type inference
5280         rules here.     
5281
5282 2004-03-23  Martin Baulig  <martin@ximian.com>
5283
5284         * ecore.cs (MethodGroupExpr.Name): Use
5285         TypeManager.CSharpSignature() instead of just the name.
5286
5287         * expression.cs (Invocation.OverloadResolve): Provide better error
5288         reporting.
5289         (Invocation.DoResolve): OverloadResolve() never returns null
5290         without reporting an error, so removed the error -6 reporting here.
5291
5292 2004-03-23  Martin Baulig  <martin@ximian.com>
5293
5294         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5295         generic methods.
5296
5297         * cs-parser.jay (delegate_declaration): Support generic delegates.
5298
5299         * delegate.cs: Support generic delegates.
5300
5301 2004-03-22  Martin Baulig  <martin@ximian.com>
5302
5303         * expression.cs (Invocation.InferParamsTypeArguments): New static
5304         method; does type inference for params arguments.
5305
5306 2004-03-21  Martin Baulig  <martin@ximian.com>
5307
5308         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5309         method; checks whether a method is a generic method.    
5310
5311         * expression.cs (Invocation.InferTypeArguments): New static method;
5312         infer type arguments for generic method invocation.
5313
5314         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5315         property; we set this to true if we're resolving a generic method
5316         invocation and the user specified type arguments, ie. we're not
5317         doing type inference.
5318
5319 2004-03-20  Martin Baulig  <martin@ximian.com>
5320
5321         * class.cs (MethodData.DeclaringType): New public property.
5322         (MethodData.Define): Set DeclaringType here.
5323         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5324         instead of OperatorMethodBuilder.DeclaringType.
5325
5326 2004-03-20  Martin Baulig  <martin@ximian.com>
5327
5328         * cs-tokenizer.cs (xtoken): Return a special
5329         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5330
5331         * cs-parser.jay (default_value_expression): Switch to the new
5332         syntax (14.5.13).
5333
5334 2004-03-19  Martin Baulig  <martin@ximian.com>
5335
5336         * decl.cs (MemberName): New class.  We use this to "construct"
5337         namespace_or_type_name's.
5338
5339         * generics.cs (TypeArguments.GetDeclarations): New public method;
5340         returns the type arguments as a string[] and reports a CS0081 if
5341         one of them is not an identifier.
5342
5343         * class.cs (MemberBase): The .ctor now takes the name as a
5344         MemberName instead of a string.
5345         (MemberBase.ExplicitInterfaceName): Changed type from string to
5346         Expression.
5347         (MemberBase.DoDefine): If we're an explicit implementation, the
5348         InterfaceType may be a generic instance.
5349
5350         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5351         (namespace_name): Call MemberName.GetName () to transform the
5352         MemberName into a string and ensure we don't have any type
5353         arguments.
5354         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5355         MemberName into an expression.
5356         (method_header): Use namespace_or_type_name instead of member_name.     
5357
5358 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5359
5360         * rootcontext.cs: Add new types to the boot resolution.
5361
5362         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5363         MulticastDelegate is not allowed.
5364
5365         * typemanager.cs: Add new types to lookup: System.TypedReference
5366         and ArgIterator.
5367
5368         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5369         check for TypedReference or ArgIterator, they are not allowed. 
5370
5371         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5372         makes us properly catch 1510 in some conditions (see bug 56016 for
5373         details). 
5374
5375 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5376
5377         * CryptoConvert.cs: update from corlib version
5378         with endian fixes.
5379
5380 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5381
5382         * class.cs (Indexer.Define): Check indexername declaration
5383
5384 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5385
5386         * attribute.cs (IsClsCompliant): Fixed problem with handling
5387         all three states (compliant, not-compliant, undetected).
5388
5389 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5390
5391         * attribute.cs (Attribute): Location is now public.
5392         (Resolve): Store resolved arguments (pos_values) in attribute class.
5393         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5394         (GetClsCompliantAttributeValue): New method that gets
5395         CLSCompliantAttribute value.
5396         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5397         if exists else null.
5398         (AttributeTester): New class for CLS-Compliant verification routines.
5399
5400         * class.cs (Emit): Add CLS-Compliant verification.
5401         (Method.GetSignatureForError): Implemented.
5402         (Constructor.GetSignatureForError): Implemented
5403         (Constructor.HasCompliantArgs): Returns if constructor has
5404         CLS-Compliant arguments.
5405         (Constructor.Emit): Override.
5406         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5407         is needed to test only parameters.
5408         (FieldBase.GetSignatureForError): Implemented.
5409         (TypeContainer): New member for storing base interfaces.
5410         (TypeContainer.FindMembers): Search in base interfaces too.
5411
5412         * codegen.cs (GetClsComplianceAttribute): New method that gets
5413         assembly or module CLSCompliantAttribute value.
5414         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5415         for assembly.
5416         (ModuleClass.Emit): Add error 3012 test.
5417
5418         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5419
5420         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5421         state for all decl types.
5422         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5423         if CLS-Compliant tests are required.
5424         (IsClsCompliaceRequired): New method. Analyze whether code
5425         must be CLS-Compliant.
5426         (IsExposedFromAssembly): New method. Returns true when MemberCore
5427         is exposed from assembly.
5428         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5429         value or gets cached value.
5430         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5431         is explicitly marked with CLSCompliantAttribute.
5432         (IsIdentifierClsCompliant): New abstract method. This method is
5433         used to testing error 3005.
5434         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5435         for identifier and parameters CLS-Compliant testing.
5436         (VerifyClsCompliance): New method. The main virtual method for
5437         CLS-Compliant verifications.
5438         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5439         null. I don't know why is null (too many public members !).
5440         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5441         and get value of first CLSCompliantAttribute that found.
5442
5443         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5444         (VerifyClsCompliance): Override and add extra tests.
5445
5446         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5447         clscheck- disable CLS-Compliant verification event if assembly is has
5448         CLSCompliantAttribute(true).
5449
5450         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5451         ApllyAttribute is now called in emit section as in the other cases.
5452         Possible future Emit integration.
5453         (IsIdentifierClsCompliant): New override.
5454         (VerifyClsCompliance): New override.
5455         (GetEnumeratorName): Returns full enum name.
5456
5457         * parameter.cs (GetSignatureForError): Implemented.
5458
5459         * report.cs (WarningData): New struct for Warning message information.
5460         (LocationOfPreviousError): New method.
5461         (Warning): New method. Reports warning based on the warning table.
5462         (Error_T): New method. Reports error based on the error table.
5463
5464         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5465         verifications are done here.
5466
5467         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5468
5469         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5470         CLSCompliantAttribute.
5471         (all_imported_types): New member holds all imported types from other
5472         assemblies.
5473         (LoadAllImportedTypes): New method fills static table with exported types
5474         from all referenced assemblies.
5475         (Modules): New property returns all assembly modules.
5476
5477 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5478
5479         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5480         throwing a parser error.
5481
5482         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5483         which removes the hardcoded get_/set_ prefixes for properties, as
5484         IL allows for the properties to be named something else.  
5485
5486         Bug #56013
5487
5488         * expression.cs: Do not override operand before we know if it is
5489         non-null.  Fix 56207
5490
5491 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5492
5493         * typemanager.cs: support for pinned variables.
5494
5495 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5496
5497         * decl.cs, typemanager.cs: Avoid using an arraylist
5498         as a buffer if there is only one result set.
5499
5500 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5501
5502         * expression.cs: Make sure you cant call a static method
5503         with an instance expression, bug #56174.
5504
5505 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5506
5507         * class.cs (IsDuplicateImplementation): Improve error reporting to
5508         flag 663 (method only differs in parameter modifier).
5509
5510         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5511         in preprocessor directives.
5512
5513         * location.cs (LookupFile): Allow for the empty path.
5514
5515         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5516         better approach for some of that patch, but its failing with the
5517         CharSet enumeration.  For now try/catch will do.
5518
5519         * typemanager.cs: Do not crash if a struct does not have fields.
5520         Fixes 56150.
5521
5522 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5523
5524         * expression.cs: cs0213, cant fix a fixed expression.
5525         fixes 50231.
5526
5527 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5528
5529         * cs-parser.jay: detect invalid embeded statements gracefully.
5530         bug #51113.
5531
5532 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5533
5534         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5535         As a regex:
5536         s/
5537         the invocation type may not be a subclass of the tye of the item/
5538         The type of the item must be a subclass of the invocation item.
5539         /g
5540
5541         Fixes bug #50820.
5542
5543 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5544
5545         * attribute.cs: Added methods to get a string and a bool from an
5546         attribute. Required to information from AssemblyKeyFileAttribute,
5547         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5548         * codegen.cs: Modified AssemblyName creation to include support for
5549         strongnames. Catch additional exceptions to report them as CS1548.
5550         * compiler.csproj: Updated include CryptoConvert.cs.
5551         * compiler.csproj.user: Removed file - user specific configuration.
5552         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5553         Mono.Security assembly. The original class is maintained and tested in
5554         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5555         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5556         like CSC 8.0 (C# v2) supports.
5557         * Makefile: Added CryptoConvert.cs to mcs sources.
5558         * rootcontext.cs: Added new options for strongnames.
5559
5560 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5561
5562         * driver.cs: For --expect-error, report error code `2'
5563         if the program compiled with no errors, error code `1' if
5564         it compiled with an error other than the one expected.
5565
5566 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5567
5568         * compiler.csproj: Updated for Visual Studio .NET 2003.
5569         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5570         * compiler.sln: Updated for Visual Studio .NET 2003.
5571
5572 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5573
5574         * expression.cs: Fix bug #47234. We basically need to apply the
5575         rule that we prefer the conversion of null to a reference type
5576         when faced with a conversion to 'object' (csc behaviour).
5577
5578 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5579
5580         * statement.cs: Shorter form for foreach, eliminates
5581         a local variable. r=Martin.
5582
5583 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5584
5585         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5586         checks if we can use brtrue/brfalse to test for 0.
5587         * expression.cs: use the above in the test for using brtrue/brfalse.
5588         cleanup code a bit.
5589
5590 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5591
5592         * expression.cs: Rewrite string concat stuff. Benefits:
5593
5594         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5595         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5596         rather than a concat chain.
5597
5598         * typemanager.cs: Add lookups for more concat overloads.
5599
5600 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5601
5602         * expression.cs: Emit shorter il code for array init.
5603
5604         newarr
5605         dup
5606         // set 1
5607
5608         // set 2
5609
5610         newarr
5611         stloc.x
5612
5613         ldloc.x
5614         // set 1
5615
5616         ldloc.x
5617         // set 2
5618
5619 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5620
5621         * statement.cs: Before, two switch blocks would be merged if the
5622         total size of the blocks (end_item - begin_item + 1) was less than
5623         two times the combined sizes of the blocks.
5624
5625         Now, it will only merge if after the merge at least half of the
5626         slots are filled.
5627
5628         fixes 55885.
5629
5630 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5631
5632         * class.cs : csc build fix for GetMethods(). See bug #52503.
5633
5634 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5635
5636         * expression.cs: Make sure fp comparisons work with NaN.
5637         This fixes bug #54303. Mig approved this patch a long
5638         time ago, but we were not able to test b/c the runtime
5639         had a related bug.
5640
5641 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5642
5643         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5644
5645 2004-03-19  Martin Baulig  <martin@ximian.com>
5646
5647         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5648         two overloads may unify for some type parameter substitutions and
5649         report a CS0408 if appropriate.
5650
5651 2004-03-19  Martin Baulig  <martin@ximian.com>
5652
5653         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5654         error here and not in our caller.
5655
5656 2004-03-19  Martin Baulig  <martin@ximian.com>
5657
5658         * interface.cs: Completely killed this file.
5659         (Interface): We're now a TypeContainer and live in class.cs.
5660
5661         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5662         argument; we're now also called for interfaces.
5663         (TypeContainer.DefineMembers): Allow this method being called
5664         multiple times.
5665         (TypeContainer.GetMethods): New public method; formerly known as
5666         Interface.GetMethod().  This is used by PendingImplementation.
5667         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5668         it's now private and non-static.
5669         (Interface): Moved this here; it's now implemented similar to
5670         Class and Struct.
5671         (Method, Property, Event, Indexer): Added `bool is_interface'
5672         argument to their .ctor's.
5673         (MemberBase.IsInterface): New public field.
5674
5675         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5676         instances instead of InterfaceMethod, InterfaceProperty, etc.
5677         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5678         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5679
5680 2004-03-19  Martin Baulig  <martin@ximian.com>
5681
5682         * class.cs (MethodCore.IsDuplicateImplementation): New private
5683         method which does the CS0111 checking.
5684         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5685         Use IsDuplicateImplementation().
5686
5687 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5688
5689         * decl.cs (FindMemberToOverride): New method to find the correct
5690         method or property to override in the base class.
5691         * class.cs
5692             - Make Method/Property use the above method to find the
5693               version in the base class.
5694             - Remove the InheritableMemberSignatureCompare as it is now
5695               dead code.
5696
5697         This patch makes large code bases much faster to compile, as it is
5698         O(n) rather than O(n^2) to do this validation.
5699
5700         Also, it fixes bug 52458 which is that nested classes are not
5701         taken into account when finding the base class member.
5702
5703         Reviewed/Approved by Martin.
5704
5705 2004-03-17  Martin Baulig  <martin@ximian.com>
5706
5707         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5708         of type arguments into account; use the `real_num_type_args'
5709         approach like in DoResolveAsTypeStep().
5710
5711         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5712         nested types.
5713
5714 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5715
5716         * interface.cs: In all interface classes removed redundant
5717         member initialization.
5718
5719 2004-03-16  Martin Baulig  <martin@ximian.com>
5720
5721         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5722
5723 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5724
5725         * decl.cs (DefineTypeAndParents): New helper method to define a
5726         type's containers before the type itself is defined;  This is a
5727         bug exposed by the recent changes to Windows.Forms when an
5728         implemented interface was defined inside a class that had not been
5729         built yet.   
5730
5731         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5732
5733         (Check): Loop correctly to report errors modifiers
5734         (UNSAFE was not in the loop, since it was the same as TOP).
5735
5736         * interface.cs: Every interface member now takes a ModFlags,
5737         instead of a "is_new" bool, which we set on the base MemberCore. 
5738
5739         Every place where we called "UnsafeOk" in the interface, now we
5740         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5741         the unsafe settings from the member declaration instead of the
5742         container interface. 
5743
5744         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5745
5746         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5747         `set_indexer_name' to the pending bits (one per type).
5748
5749         We fixed a bug today that was picking the wrong method to
5750         override, since for properties the existing InterfaceMethod code
5751         basically ignored the method name.  Now we make sure that the
5752         method name is one of the valid indexer names.
5753
5754 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5755  
5756         * support.cs (SeekableStreamReader): Keep track of stream byte
5757         positions and don't mix them with character offsets to the buffer.
5758
5759         Patch from Gustavo Giráldez
5760
5761 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5762
5763         * interface.cs (InterfaceSetGetBase): Removed double member
5764         initialization, base class does it as well.
5765
5766 2004-03-13  Martin Baulig  <martin@ximian.com>
5767
5768         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5769         when compiling corlib.
5770
5771 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5772
5773         * convert.cs (ExplicitConversion): We were reporting an error on
5774         certain conversions (object_type source to a value type, when the
5775         expression was `null') before we had a chance to pass it through
5776         the user defined conversions.
5777
5778         * driver.cs: Replace / and \ in resource specifications to dots.
5779         Fixes 50752
5780
5781         * class.cs: Add check for duplicate operators.  Fixes 52477
5782
5783 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5784
5785         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5786         that are in the middle of the statements, not only at the end.
5787         Fixes #54987
5788
5789         * class.cs (TypeContainer.AddField): No longer set the
5790         `HaveStaticConstructor' flag, now we call it
5791         `UserDefineStaticConstructor' to diferentiate the slightly
5792         semantic difference.
5793
5794         The situation is that we were not adding BeforeFieldInit (from
5795         Modifiers.TypeAttr) to classes that could have it.
5796         BeforeFieldInit should be set to classes that have no static
5797         constructor. 
5798
5799         See:
5800
5801         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5802
5803         And most importantly Zoltan's comment:
5804
5805         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5806
5807         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5808          before its static fields are used', i.e. initialization does not need
5809          to be triggered by the first access to the type. Setting this flag
5810          helps the JIT to compile better code, since it can run the static
5811          constructor at JIT time, and does not need to generate code to call it
5812          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5813          this flag for lots of classes like String. 
5814          
5815          csc sets this flag if the type does not have an explicit static 
5816          constructor. The reasoning seems to be that if there are only static
5817          initalizers for a type, and no static constructor, then the programmer
5818          does not care when this initialization happens, so beforefieldinit
5819          can be used.
5820          
5821          This bug prevents the AOT compiler from being usable, since it 
5822          generates so many calls to mono_runtime_class_init that the AOT code
5823          is much slower than the JITted code. The JITted code is faster, 
5824          because it does not generate these calls if the vtable is type is
5825          already initialized, which is true in the majority of cases. But the
5826          AOT compiler can't do this."
5827
5828 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5829
5830         * class.cs (MethodData.Emit): Refactor the code so symbolic
5831         information is generated for destructors;  For some reasons we
5832         were taking a code path that did not generate symbolic information
5833         before. 
5834
5835 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5836
5837         * class.cs: Create a Constructor.CheckBase method that
5838         takes care of all validation type code. The method
5839         contains some code that was moved from Define.
5840
5841         It also includes new code that checks for duplicate ctors.
5842         This fixes bug #55148.
5843
5844 2004-03-09  Joshua Tauberer <tauberer@for.net>
5845
5846         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5847         a { ... }-style array creation invokes EmitStaticInitializers
5848         which is not good for reference-type arrays.  String, decimal
5849         and now null constants (NullCast) are not counted toward
5850         static initializers.
5851
5852 2004-03-05  Martin Baulig  <martin@ximian.com>
5853
5854         * location.cs (SourceFile.HasLineDirective): New public field;
5855         specifies whether the file contains or is referenced by a "#line"
5856         directive.
5857         (Location.DefineSymbolDocuments): Ignore source files which
5858         either contain or are referenced by a "#line" directive.        
5859
5860 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5861
5862         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5863         direct access to our parent, so check the method inline there.
5864
5865 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5866
5867         * expression.cs (Invocation.EmitCall): Miguel's last commit
5868         caused a regression. If you had:
5869
5870             T t = null;
5871             t.Foo ();
5872
5873         In Foo the implict this would be null.
5874
5875 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5876
5877         * expression.cs (Invocation.EmitCall): If the method is not
5878         virtual, do not emit a CallVirt to it, use Call.
5879
5880         * typemanager.cs (GetFullNameSignature): Improve the method to
5881         cope with ".ctor" and replace it with the type name.
5882
5883         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5884         as an argument the ConstructorBuilder where it is being defined,
5885         to catch the recursive constructor invocations.
5886
5887 2004-03-16  Martin Baulig  <martin@ximian.com>
5888
5889         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5890         ConstructedType, call ResolveType() on it to get the type rather
5891         than just using `expr.Type'.
5892
5893 2004-03-16  Martin Baulig  <martin@ximian.com>
5894
5895         * generics.cs (ConstructedType.GetMemberAccess): Take the
5896         EmitContext instead on the TypeExpr and use
5897         ec.TypeContainer.CurrentType/ec.ContainerType.
5898
5899 2004-03-16  Martin Baulig  <martin@ximian.com>
5900
5901         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5902         parameters before aliases.
5903
5904 2004-03-16  Martin Baulig  <martin@ximian.com>
5905
5906         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5907         New oublic function; checks whether two generic instances may become
5908         equal under some instantiations (26.3.1).
5909
5910         * class.cs (TypeContainer.Define): Call
5911         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5912         error.
5913
5914 2004-03-16  Martin Baulig  <martin@ximian.com>
5915
5916         * class.cs (TypeContainer.GetClassBases): Moved
5917         Error_TypeParameterAsBase() here and also check whether the base
5918         class is not an attribute.
5919
5920 2004-03-16  Martin Baulig  <martin@ximian.com>
5921
5922         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5923
5924 2004-03-16  Martin Baulig  <martin@ximian.com>
5925
5926         * class.cs (Error_TypeParameterAsBase): Use correct error number
5927         here (CS0689).  
5928
5929 2004-03-16  Martin Baulig  <martin@ximian.com>
5930
5931         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5932         for generics.
5933
5934         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5935         error reporting.
5936
5937 2004-03-15  Martin Baulig  <martin@ximian.com>
5938
5939         * typemanager.cs (TypeManager.GetFullName): New public method.
5940         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5941         argument; only return members with the correct number of type
5942         arguments.
5943         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5944         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5945         whether the number of type arguments matches.
5946
5947         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5948         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5949
5950         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5951         field; it's set by the protected .ctor when we're actually a
5952         GenericMemberAccess.
5953         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5954         arguments and pass it to MemberLookupFinal ().
5955
5956         * ecore.cs (Expression.MemberLookup): Added `int
5957         num_type_arguments' argument; only return members with the correct
5958         number of type arguments.
5959         (Expression.MemberLookupFailed): Check whether the MemberLookup
5960         failed because we did not have the correct number of type
5961         arguments; report CS0305 in this case.
5962
5963         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5964         `e.ResolveAsTypeTerminal()' already did so.
5965
5966 2004-03-15  Martin Baulig  <martin@ximian.com>
5967
5968         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5969         we're a ConstructedType; in this case, the caller must report an
5970         error (for instance CS0131).
5971
5972         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5973         (TypeArguments.Resolve): Actually report errors here.
5974
5975 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5976
5977         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5978         `set_indexer_name' to the pending bits (one per type).
5979
5980         We fixed a bug today that was picking the wrong method to
5981         override, since for properties the existing InterfaceMethod code
5982         basically ignored the method name.  Now we make sure that the
5983         method name is one of the valid indexer names.
5984
5985 2004-03-15  Martin Baulig  <martin@ximian.com>
5986
5987         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5988         for generic instances.
5989
5990 2004-03-13  Martin Baulig  <martin@ximian.com>
5991
5992         * class.cs (TypeContainer.DefineType): Call
5993         TypeManager.AddUserType() immediately after creating the
5994         TypeBuilder; pass all type parameters when creating the
5995         CurrentType.
5996
5997         * decl.cs (DeclSpace.FindNestedType): New public method.
5998         (DeclSpace.FindType): Added `int num_type_args' argument; only
5999         return types with the correct number of type parameters.
6000         (DeclSpace.CountTypeParams): New public property.
6001
6002         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
6003         the number of type parameters; defaults to zero.
6004
6005         * generic.cs (TypeArguments.Count): New public property.
6006         (ConstructedType.DoResolveAsTypeStep): First call
6007         ds.FindNestedType() to find out whether we're nested in the
6008         current generic type; in this case, we inherit all type parameters
6009         from the current class.
6010
6011         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
6012         num_type_args' argument.
6013         (RootContext.LookupType): Added overloaded version which takes the
6014         number of type arguments; only return types with the correct
6015         number of type arguments.
6016
6017         * typemanager.cs (TypeManager.CheckGeneric): New public function;
6018         checks whether `Type t' has `int num_type_args'.
6019
6020 2004-03-13  Martin Baulig  <martin@ximian.com>
6021
6022         * generic.cs (GenericMethod.DefineType): New method; calls
6023         DefineType() on all the type parameters.
6024
6025         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6026         (MethodData.Define): If we're a generic method, call
6027         GenericMethod.DefineType() to define the type parameters.       
6028
6029 2004-03-10  Martin Baulig  <martin@ximian.com>
6030
6031         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6032         instead of IsAssignableFrom.    
6033
6034 2004-03-10  Martin Baulig  <martin@ximian.com>
6035
6036         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6037
6038         * support.cs (ParameterData.HasArrayParameter): New property.
6039         (ReflectionParameters.ctor): Take a MethodBase instead of a
6040         ParameterInfo[].  If we have any type parameters, get the generic
6041         method definition and ask it whether we have variable arguments.
6042
6043 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6044
6045         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6046         routines to check if a type is an enumerable/enumerator allow
6047         classes that implement the IEnumerable or IEnumerator interfaces.
6048
6049         * class.cs (Property, Operator): Implement IIteratorContainer, and
6050         implement SetYields.
6051
6052         (Property.Define): Do the block swapping for get_methods in the
6053         context of iterators.   We need to check if Properties also
6054         include indexers or not.
6055
6056         (Operator): Assign the Block before invoking the
6057         OperatorMethod.Define, so we can trigger the Iterator code
6058         replacement. 
6059
6060         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6061         Property and Operator classes are not created when we parse the
6062         declarator but until we have the block completed, so we use a
6063         singleton SimpleIteratorContainer.Simple to flag whether the
6064         SetYields has been invoked.
6065
6066         We propagate this setting then to the Property or the Operator to
6067         allow the `yield' to function.
6068
6069 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6070
6071         * codegen.cs: Implemented attribute support for modules.
6072         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6073         Assembly/Module functionality.
6074
6075         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6076         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6077         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6078
6079 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6080
6081         * interface.cs (FindMembers): The operation is performed on all base
6082         interfaces and not only on the first. It is required for future CLS Compliance patch.
6083
6084 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6085
6086         * statement.cs, codegen.cs:
6087         This patch deals with patterns such as:
6088
6089         public class List : IEnumerable {
6090
6091                 public MyEnumerator GetEnumerator () {
6092                         return new MyEnumerator(this);
6093                 }
6094
6095                 IEnumerator IEnumerable.GetEnumerator () {
6096                         ...
6097                 }
6098                 
6099                 public struct MyEnumerator : IEnumerator {
6100                         ...
6101                 }
6102         }
6103
6104         Before, there were a few things we did wrong:
6105         1) we would emit callvirt on a struct, which is illegal
6106         2) we emited ldarg when we needed to emit ldarga
6107         3) we would mistakenly call the interface methods on an enumerator
6108         type that derived from IEnumerator and was in another assembly. For example:
6109
6110         public class MyEnumerator : IEnumerator
6111
6112         Would have the interface methods called, even if there were public impls of the
6113         method. In a struct, this lead to invalid IL code.
6114
6115 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6116
6117         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6118           renamed to Emit.
6119
6120         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6121
6122 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6123
6124         * cs-parser.jay: Fix small regression: we were not testing V2
6125         compiler features correctly.
6126
6127         * interface.cs: If the emit context is null, then create one
6128
6129 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6130
6131         * decl.cs (GetSignatureForError): New virtual method to get full name
6132           for error messages.
6133
6134         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6135           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6136
6137         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6138           Duplicated members and code in these classes has been removed.
6139           Better encapsulation in these classes.
6140
6141 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6142
6143         * assign.cs (Assign.DoResolve): When dealing with compound
6144         assignments, there is a new rule in ECMA C# 2.4 (might have been
6145         there before, but it is documented here) that states that in:
6146
6147         a op= b;
6148
6149         If b is of type int, and the `op' is a shift-operator, then the
6150         above is evaluated as:
6151
6152         a = (int) a op b 
6153
6154         * expression.cs (Binary.ResolveOperator): Instead of testing for
6155         int/uint/long/ulong, try to implicitly convert to any of those
6156         types and use that in pointer arithmetic.
6157
6158         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6159         method to print information for from the type, not from the
6160         null-method we were given.
6161
6162 2004-02-01  Duncan Mak  <duncan@ximian.com>
6163
6164         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6165         parsing for cmd, fixes bug #53694.
6166
6167 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6168
6169         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6170         in the member name duplication tests. Property and operator name duplication
6171         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6172
6173 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6174
6175         * interface.cs (PopulateMethod): Fixed crash when interface method
6176         returns not existing type (error test cs0246-3.cs).
6177
6178 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6179
6180         * cs-parser.jay (interface_accessors): Re-write actions to also
6181         store attributes attached to get and set methods. Fix spelling
6182         while at it.
6183
6184         (inteface_property_declaration): Modify accordingly.
6185
6186         (InterfaceAccessorInfo): New helper class to store information to pass
6187         around between rules that use interface_accessors.
6188
6189         * interface.cs (Emit): Apply attributes on the get and set
6190         accessors of properties and indexers too.
6191
6192         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6193         right MethodBuilder when applying attributes to the get and set accessors.
6194
6195 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6196
6197         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6198
6199 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6200
6201         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6202
6203 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6204
6205         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6206         changes that treat `yield' specially when present before `break'
6207         or `return' tokens.
6208
6209         * cs-tokenizer.cs: yield is no longer a keyword.
6210
6211 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6212
6213         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6214         setting for default constructors.
6215         For default constructors are almost every time set wrong Modifier. The
6216         generated IL code has been alright. But inside mcs this values was
6217         wrong and this was reason why several of my CLS Compliance tests
6218         failed.
6219
6220 2004-02-27  Martin Baulig  <martin@ximian.com>
6221
6222         * generics.cs (ConstructedType.ResolveType): Make the nested type
6223         stuff actually work.
6224
6225 2004-02-25  Martin Baulig  <martin@ximian.com>
6226
6227         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6228         property; returns the type parameters just from the current type,
6229         ie. with the ones from outer classes.
6230         (DeclSpace.LookupGeneric): First search in the current class, then
6231         in outer classes.
6232         (DeclSpace.initialize_type_params): When hiding a type parameter
6233         from an outer class, put it into the `type_param_list' anyways.
6234
6235         * expression.cs (MemberAccess.expr): Made this field protected.
6236
6237         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6238         the type parameters from the current class.
6239
6240         * generic.cs (ConstructedType.ResolveType): Support nested generic
6241         types by taking the type parameters which we inherit from outer
6242         classes into account.
6243         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6244         support for nested generic types.
6245
6246 2004-02-23  Martin Baulig  <martin@ximian.com>
6247
6248         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6249         field and check whether we're nested inside a generic type.
6250         (DeclSpace.ResolveType): If we're resolving to a generic type
6251         definition, create a ConstructedType and return its resolved type.
6252         (DeclSpace.initialize_type_params): New private method;
6253         initializes the `type_param_list' field from the type parameters
6254         from this and all enclosing classes.
6255         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6256         we're already initialized.
6257
6258 2004-02-23  Martin Baulig  <martin@ximian.com>
6259
6260         * class.cs (Method.Define): Create the generic method before
6261         calling DoDefine().
6262         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6263         the TypeContainer one); we use this for generic methods.
6264
6265         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6266         parent's TypeBuilder.
6267
6268 2004-02-18  Martin Baulig  <martin@ximian.com>
6269
6270         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6271         to check for equality.
6272
6273 2004-02-05  Martin Baulig  <martin@ximian.com>
6274
6275         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6276         `ec.TypeContainer.CurrentType', use it instead of
6277         `ec.ContainerType' to check whether we're in the type's ctor.
6278
6279 2004-01-29  Martin Baulig  <martin@ximian.com>
6280
6281         * expression.cs (Invocation.DoResolve): If we're a
6282         `ConstructedType', then we're actually a generic method, so
6283         rewrite the expr as a GenericMemberAccess.
6284
6285         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6286         here; manually parse it into a string.
6287
6288 2004-01-28  Martin Baulig  <martin@ximian.com>
6289
6290         * typemanager.cs (TypeManager.IsEqual): New static method.
6291         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6292         check for equality instead of using `=='.
6293
6294 2004-01-26  Martin Baulig  <martin@ximian.com>
6295
6296         * decl.cs (DeclSpace.CurrentType): New public field.
6297
6298         * expression.cs (This.ResolveBase): If we have an
6299         `ec.TypeContainer.CurrentType', use it instead of
6300         `ec.ContainerType'.
6301
6302         * class.cs (TypeContainer.DefineType): If we're a generic type,
6303         create the `CurrentType' (unresolved).
6304         (TypeContainer.GenericType): New private field.
6305         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6306         it and store it in `GenericType' before creating the MemberCache.
6307         (TypeContainer.GetMembers): If we have a `GenericType', call
6308         TypeManager.FindMembers() on it.
6309
6310         * interface.cs (Interface.GenericType): New private field.
6311         (Interface.DefineType): If we're a generic type, create the
6312         `CurrentType' (unresolved).
6313         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6314         and store it in `GenericType' before creating the MemberCache.
6315         (Interface.GetMembers): If we have a `GenericType', call
6316         TypeManager.FindMembers() on it.
6317
6318 2004-01-22  Martin Baulig  <martin@ximian.com>
6319
6320         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6321         not a QualifiedIdentifier.  This is what `type_name_expression'
6322         was previously doing.
6323         (type_name_expression): Removed; the code is now in
6324         `namespace_or_type_name'.
6325         (qualified_identifier): Removed, use `namespace_or_type_name'
6326         instead.
6327         (QualifiedIdentifier): Removed this class.      
6328
6329 2004-01-22  Martin Baulig  <martin@ximian.com>
6330
6331         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6332         not a string as alias name.
6333
6334 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6335
6336         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6337         #52730 bug, and instead compute correctly the need to use a
6338         temporary variable when requesting an address based on the
6339         static/instace modified of the field and the constructor.
6340  
6341 2004-01-21  Martin Baulig  <martin@ximian.com>
6342
6343         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6344         class and namespace before looking up aliases.  Fixes #52517.
6345
6346 2004-01-21  Martin Baulig  <martin@ximian.com>
6347
6348         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6349         assinged in a 'try'; fixes exception4.cs.
6350
6351 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6352         * class.cs : Implemented parameter-less constructor for TypeContainer
6353
6354         * decl.cs: Attributes are now stored here. New property OptAttributes
6355
6356         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6357
6358         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6359
6360 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6361
6362         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6363           (CSharpSignature): New method for indexer and property signature.
6364
6365 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6366
6367         * pending.cs (IsVirtualFilter): Faster implementation.
6368
6369 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6370
6371         * typemanager.cs: Avoid inclusion of same assembly more than once.
6372
6373 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6374
6375         * cs-parser.jay: Fixed problem where the last assembly attribute
6376           has been applied also to following declaration (class, struct, etc.)
6377           
6378 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6379
6380         * class.cs: Added error CS0538, CS0539 reporting.
6381         Fixed crash on Microsoft runtime when field type is void.
6382
6383         * cs-parser.jay: Added error CS0537 reporting.
6384
6385         * pending.cs: Added error CS0535 reporting.
6386         Improved error report for errors CS0536, CS0534.
6387
6388 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6389
6390         Merge a few bits from the Anonymous Method MCS tree.
6391
6392         * statement.cs (ToplevelBlock): New class for toplevel methods,
6393         will hold anonymous methods, lifted variables.
6394
6395         * cs-parser.jay: Create toplevel blocks for delegates and for
6396         regular blocks of code. 
6397
6398 2004-01-20  Martin Baulig  <martin@ximian.com>
6399
6400         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6401         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6402         and `NeedExplicitReturn'; added `IsLastStatement'.
6403         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6404         have a `ReturnLabel' or we're not unreachable.
6405
6406         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6407         child's reachability; don't just override ours with it.  Fixes
6408         #58058 (lluis's example).
6409         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6410         InFinally(), InLoop(), InSwitch() and
6411         BreakCrossesTryCatchBoundary() methods.
6412
6413         * statement.cs (Return): Do all error checking in Resolve().
6414         Unless we are the last statement in a top-level block, always
6415         create a return label and jump to it.
6416         (Break, Continue): Do all error checking in Resolve(); also make
6417         sure we aren't leaving a `finally'.
6418         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6419         statement in a top-level block.
6420         (Block.Flags): Added `IsDestructor'.
6421         (Block.IsDestructor): New public property.
6422
6423 2004-01-20  Martin Baulig  <martin@ximian.com>
6424
6425         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6426
6427 2004-01-20  Martin Baulig  <martin@ximian.com>
6428
6429         * statement.cs (Statement.ResolveUnreachable): New public method.
6430         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6431         (Block.Resolve): Resolve unreachable statements.
6432
6433 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6434
6435         * expression.cs: We need to fix the case where we do
6436         not have a temp variable here.
6437
6438         * assign.cs: Only expression compound assignments need
6439         temporary variables.
6440
6441 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6442
6443         * flowanalysis.cs: Reduce memory allocation in a few ways:
6444           - A block with no variables should not allocate a bit
6445             vector for itself.
6446           - A method with no out parameters does not need any tracking
6447             for assignment of the parameters, so we need not allocate
6448             any data for it.
6449           - The arrays:
6450                 public readonly Type[] VariableTypes;
6451                 public readonly string[] VariableNames;
6452             Are redundant. The data is already stored in the variable
6453             map, so we need not allocate another array for it.
6454           - We need to add alot of checks for if (params | locals) == null
6455             due to the first two changes.
6456
6457 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6458
6459         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6460         implement IMemoryLocation, we store a copy on a local variable and
6461         take the address of it.  Patch from Benjamin Jemlich
6462
6463         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6464         to use a special "type_name_expression" rule which reduces the
6465         number of "QualifiedIdentifier" classes created, and instead
6466         directly creates MemberAccess expressions.
6467
6468 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6469
6470         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6471         that fixes #52853.  Null literal assignment to ValueType
6472
6473         * class.cs (MethodData.Emit): Instead of checking the name of the
6474         method to determine if its a destructor, create a new derived
6475         class from Method called Destructor, and test for that.  
6476
6477         * cs-parser.jay: Create a Destructor object instead of a Method.  
6478
6479         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6480
6481         Fixes: 52933
6482
6483 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6484
6485         * expression.cs (Binary.ResolveOperator): Perform an implicit
6486         conversion from MethodGroups to their delegate types on the
6487         Addition operation.
6488
6489         * delegate.cs: Introduce a new class DelegateCreation that is the
6490         base class for `NewDelegate' and `ImplicitDelegateCreation',
6491         factor some code in here.
6492
6493         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6494         conversion from MethodGroups to compatible delegate types. 
6495
6496         * ecore.cs (Expression.Resolve): Do not flag error 654
6497         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6498         we allow conversions from MethodGroups to delegate types now.
6499
6500         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6501         assignments in v2 either.
6502
6503 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6504
6505         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6506         static read-only fields in ctors.
6507
6508         Applied patch from Benjamin Jemlich 
6509
6510         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6511
6512 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6513
6514         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6515         here to return true, as they can be used like this:
6516
6517                 (XXX) int.MEMBER ()
6518
6519         Fixed 49836 and all the other dups
6520
6521 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6522
6523         * driver.cs: Implement /win32res and /win32icon.
6524
6525 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6526
6527         * cs-parser.jay: Add a rule to improve error handling for the
6528         common mistake of placing modifiers after the type.
6529
6530 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6531
6532         * cs-parser.jay (interface_event_declaration): Catch
6533         initialization of events on interfaces, and report cs0068
6534
6535         * cs-parser.jay (interface_event_declaration): Catch
6536         initialization of events. 
6537
6538         * ecore.cs: Better report missing constructors.
6539
6540         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6541         the error reporting done in the wrong place.  Fix.
6542
6543         * expression.cs (Binary.ResolveOperator): Catch the 
6544         operator + (E x, E y) error earlier, and later allow for implicit
6545         conversions in operator +/- (E e, U x) from U to the underlying
6546         type of E.
6547
6548         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6549         52596, if the container class is abstract, the default constructor
6550         is protected otherwise its public (before, we were always public).
6551
6552         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6553         fixed statement.
6554
6555         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6556         Jemlich that fixes bug #52597, MCS was generating invalid code for
6557         idisposable structs.   Thanks to Ben for following up with this
6558         bug as well.
6559
6560 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6561
6562         * driver.cs: Allow assemblies without code to be generated, fixes
6563         52230.
6564
6565 2004-01-07  Nick Drochak <ndrochak@gol.com>
6566
6567         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6568
6569 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6570
6571         * cs-parser.jay: Add rules to improve error reporting if fields or
6572         methods are declared at the namespace level (error 116)
6573
6574         * Add rules to catch event add/remove
6575
6576 2004-01-04  David Sheldon <dave-mono@earth.li>
6577
6578   * expression.cs: Added matching ")" to error message for 
6579   CS0077
6580
6581 2004-01-03 Todd Berman <tberman@gentoo.org>
6582
6583         * ecore.cs, attribute.cs:
6584         Applying fix from #52429.
6585
6586 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6587
6588         * ecore.cs, expression.cs, statement.cs:
6589         Total rewrite of how we handle branching. We
6590         now handle complex boolean expressions with fewer
6591         jumps. As well if (x == 0) no longer emits a ceq.
6592
6593         if (x is Foo) is much faster now, because we generate
6594         better code.
6595
6596         Overall, we get a pretty big improvement on our benchmark
6597         tests. The code we generate is smaller and more readable.
6598
6599         I did a full two-stage bootstrap. The patch was reviewed
6600         by Martin and Miguel.
6601
6602 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6603
6604         * cs-parser.jay: Make primary_expression not take a QI.
6605         we dont need this because the member_access rule covers
6606         us here. So we replace the rule with just IDENTIFIER.
6607
6608         This has two good effects. First, we remove a s/r conflict.
6609         Second, we allocate many fewer QualifiedIdentifier objects.
6610
6611 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6612
6613         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6614         set the correct information via SRE. This prevents
6615         hanging on the MS runtime. Fixes #29374.
6616
6617 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6618
6619         * convert.cs: correctly handle conversions to value types
6620         from Enum and ValueType as unboxing conversions.
6621
6622         Fixes bug #52569. Patch by Benjamin Jemlich.
6623
6624 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6625
6626         * expression.cs (BetterConversion): Prefer int -> uint
6627         over int -> ulong (csc's behaviour). This fixed bug #52046.
6628
6629 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6630
6631         * decl.cs (MemberCache.FindMembers): now returns a
6632         MemberInfo [].
6633
6634         * typemanager.cs: In general, go with with ^^.
6635         (CopyNewMethods): take an IList.
6636         (RealMemberLookup): Only allocate an arraylist
6637         if we copy from two sets of methods.
6638
6639         This change basically does two things:
6640         1) Fewer array lists allocated due to CopyNewMethods.
6641         2) the explicit cast in MemberList costed ALOT.
6642
6643 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6644
6645         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6646         a hashtable to avoid needless string allocations when an identifier is
6647         used more than once (the common case).
6648
6649 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6650
6651         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6652         is broken, it will not return anything. So, we
6653         have to use the information we have in mcs to
6654         do the task.
6655
6656         * typemanager.cs: Add a cache for GetInterfaces,
6657         since this will now be used more often (due to ^^)
6658
6659         (GetExplicitInterfaces) New method that gets the
6660         declared, not effective, interfaces on a type
6661         builder (eg, if you have interface IFoo, interface
6662         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6663         { IBar }.
6664
6665         This patch makes MCS able to bootstrap itself on
6666         Windows again.
6667
6668 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6669
6670         * expression.cs: Remove the Nop's that Miguel put
6671         in by mistake.
6672
6673 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6674
6675         * report.cs, codegen.cs: Give the real stack trace to
6676         the error when an exception is thrown.
6677
6678 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6679
6680         * decl.cs: only allocate hashtables for ifaces if 
6681         it is an iface!
6682
6683 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6684
6685         * expression.cs: fix the error from cs0121-2.cs
6686         (a parent interface has two child interfaces that
6687         have a function with the same name and 0 params
6688         and the function is called through the parent).
6689
6690 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6691
6692         * class.cs, rootcontext.cs, typmanager.cs: do not
6693         leak pointers.
6694
6695 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6696
6697         * codegen.cs: remove stack for the ec flow branching.
6698         It is already a linked list, so no need.
6699
6700 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6701
6702         * Makefile: Allow custom profiler here.
6703
6704 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6705
6706         * typemanager.cs (LookupType):
6707           - Use a static char [], because split takes
6708             a param array for args, so it was allocating
6709             every time.
6710           - Do not store true in a hashtable, it boxes.
6711
6712 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6713
6714         * flowanalysis.cs: bytify common enums.
6715
6716 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6717
6718         * modifiers.cs: Add a new set of flags for the
6719         flags allowed on explicit interface impls.
6720         * cs-parser.jay: catch the use of modifiers in
6721         interfaces correctly.
6722         * class.cs: catch private void IFoo.Blah ().
6723
6724         All related to bug #50572.
6725
6726 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6727
6728         * decl.cs: Rewrite the consistant accessability checking.
6729         Accessability is not linear, it must be implemented in
6730         a tableish way. Fixes #49704.
6731
6732 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6733
6734         * expression.cs: Handle negation in a checked context.
6735         We must use subtraction from zero. Fixes #38674.
6736
6737 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6738
6739         * class.cs: Ignore static void main in DLLs.
6740         * rootcontext.cs: Handle the target type here,
6741         since we are have to access it from class.cs
6742         * driver.cs: account for the above.
6743
6744 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6745
6746         * report.cs: Give line numbers and files if available.
6747
6748 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6749
6750         * driver.cs: Implement /addmodule.
6751
6752         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6753         ModuleBuilders.
6754
6755 2003-12-20  Martin Baulig  <martin@ximian.com>
6756
6757         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6758         (FieldBase.IsAssigned): Removed this field.
6759         (FieldBase.SetAssigned): New public method.
6760         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6761
6762 2003-12-20  Martin Baulig  <martin@ximian.com>
6763
6764         * expression.cs (LocalVariableReference.DoResolve): Don't set
6765         `vi.Used' if we're called from DoResolveLValue().
6766
6767         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6768         returns the usage vector it just merged into the current one -
6769         pass this one to UsageWarning().
6770         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6771         of the `EmitContext', don't call this recursively on our children.
6772
6773 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6774
6775         * driver.cs: Implement /target:module.
6776
6777 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6778
6779         * support.cs (CharArrayHashtable): New helper class.
6780
6781         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6782         char arrays, not strings, so we can avoid creating a string in
6783         consume_identifier if the identifier is a keyword.
6784
6785 2003-12-16  Martin Baulig  <martin@ximian.com>
6786
6787         * statement.cs (LocalInfo.Assigned): Removed this property.
6788         (LocalInfo.Flags): Removed `Assigned'.
6789         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6790         and uses flow analysis.
6791         (Block.UsageWarning): Made this method private.
6792         (Block.Resolve): Call UsageWarning() if appropriate.
6793
6794         * expression.cs (LocalVariableReference.DoResolve): Always set
6795         LocalInfo.Used here.
6796
6797 2003-12-13  Martin Baulig  <martin@ximian.com>
6798
6799         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6800         any value here; we're now using flow analysis to figure out
6801         whether a statement/block returns a value.
6802
6803 2003-12-13  Martin Baulig  <martin@ximian.com>
6804
6805         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6806         working again.
6807         (FlowBranching.MergeFinally): Don't call
6808         `branching.CheckOutParameters()' here, this is called in
6809         MergeTopBlock().
6810         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6811         when adding the `finally' vector.       
6812
6813 2003-12-13  Martin Baulig  <martin@ximian.com>
6814
6815         * flowanalysis.cs
6816         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6817         actually work and also fix #48962.
6818
6819 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6820
6821         * decl.cs: Do not check System.Object for nested types,
6822         since we know it does not have any. Big bang for buck:
6823
6824         BEFORE:
6825            Run 1:   8.35 seconds
6826            Run 2:   8.32 seconds
6827            corlib:  17.99 seconds
6828         AFTER:
6829            Run 1:   8.17 seconds
6830            Run 2:   8.17 seconds
6831            corlib:  17.39 seconds
6832
6833 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6834
6835         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6836         time we are returning 0 members, so we save alot here.
6837
6838 2003-12-11  Martin Baulig  <martin@ximian.com>
6839
6840         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6841         `MergeChild()', also just take the `FlowBranching' as argument;
6842         call Merge() on it and return the result.
6843         (FlowBranching.Merge): We don't need to do anything if we just
6844         have one sibling.
6845
6846 2003-12-11  Martin Baulig  <martin@ximian.com>
6847
6848         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6849         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6850         Maurer for this idea.
6851
6852 2003-12-11  Martin Baulig  <martin@ximian.com>
6853
6854         * flowanalysis.cs (MergeResult): This class is now gone; we now
6855         use the `UsageVector' for this.  The reason for this is that if a
6856         branching just has one sibling, we don't need to "merge" them at
6857         all - that's the next step to do.
6858         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6859         `MergeResult'.
6860
6861 2003-12-11  Martin Baulig  <martin@ximian.com>
6862
6863         Reworked flow analyis and made it more precise and bug-free.  The
6864         most important change is that we're now using a special `Reachability'
6865         class instead of having "magic" meanings of `FlowReturns'.  I'll
6866         do some more cleanups and optimizations and also add some more
6867         documentation this week.
6868
6869         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6870         largely reworked this class.
6871         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6872         the new `Reachability' class instead of having "magic" values here.
6873         (FlowBranching): We're now using an instance of `Reachability'
6874         instead of having separate `Returns', `Breaks' etc. fields.
6875
6876         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6877         based on flow analysis; ignore the return value of block.Emit ().
6878
6879 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6880
6881         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6882         if they are private.
6883
6884 2003-12-09  Martin Baulig  <martin@ximian.com>
6885
6886         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6887         call them directly on the UsageVector.
6888
6889 2003-12-09  Martin Baulig  <martin@ximian.com>
6890
6891         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6892         Changed return type from `FlowReturns' to `Reachability'.
6893
6894 2003-12-09  Martin Baulig  <martin@ximian.com>
6895
6896         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6897         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6898         `Reachable' fields with a single `Reachability' one.
6899
6900 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6901
6902         * class.cs (FindMembers): Remove foreach's.
6903
6904         Bootstrap times:
6905
6906         BEFORE
6907                 Run 1:   8.74 seconds
6908                 Run 2:   8.71 seconds
6909
6910         AFTER
6911                 Run 1:   8.64 seconds
6912                 Run 2:   8.58 seconds
6913
6914
6915 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6916
6917         * cs-parser.jay:
6918         * gen-treedump.cs:
6919         * statement.cs:
6920         This patch does a few things:
6921                 1. EmptyStatement is now a singleton, so it is never reallocated.
6922                 2. All blah is EmptyStatement constructs have been changed to
6923                    blah == EmptyStatement.Value, which is much faster and valid
6924                    now that EmptyStatement is a singleton.
6925                 3. When resolving a block, rather than allocating a new array for
6926                    the non-empty statements, empty statements are replaced with
6927                    EmptyStatement.Value
6928                 4. Some recursive functions have been made non-recursive.
6929         Mainly the performance impact is from (3), however (1) and (2) are needed for
6930         this to work. (4) does not make a big difference in normal situations, however
6931         it makes the profile look saner.
6932
6933         Bootstrap times:
6934
6935         BEFORE
6936         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6937         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6938         Total memory allocated: 56397 KB
6939
6940         AFTER
6941         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6942         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6943         Total memory allocated: 55666 KB
6944
6945 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6946
6947         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6948         than the hashtable in a hashtable version
6949
6950         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6951         we always end up concating a string. This results in a huge perf
6952         loss, because many strings have to be tracked by the GC. In this
6953         patch, we first use a hashtable that works with two keys, so that
6954         the strings do not need to be concat'ed.
6955
6956         Bootstrap times:
6957         BEFORE
6958                 Run 1:   8.74 seconds
6959                 Run 2:   8.71 seconds
6960
6961         AFTER
6962                 Run 1:   8.65 seconds
6963                 Run 2:   8.56 seconds
6964
6965 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6966
6967         * Makefile: Add a new target `do-time' that does a quick and simple
6968         profile, leaving easy to parse output.
6969
6970 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6971
6972         * codegen.cs (Init): Create the dynamic assembly with 
6973         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6974
6975 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6976
6977         * support.cs: Make the PtrHashtable use only one
6978         instance of its comparer.
6979
6980 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6981
6982         * typemanager.cs: Fix lookup of GetNamespaces.
6983
6984 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6985
6986         * expression.cs: Removed redundant line.
6987
6988         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6989         ArrayLists, use for loops with bounds.  
6990
6991         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6992         arraylist.
6993
6994         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6995         arraylists, use for loop with bounds.
6996
6997         The above three changes give us a 0.071 second performance
6998         improvement out of 3.294 seconds down to 3.223.  On my machine
6999         the above changes reduced the memory usage by 1,387 KB during
7000         compiler bootstrap.
7001
7002         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7003         QualifiedIdentifiers.  Before we created a new string through
7004         concatenation, and mostly later on, the result would be
7005         manipulated by DecomposeQI through string manipulation.
7006
7007         This reduced the compiler memory usage for bootstrapping from
7008         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7009         compile times in 0.05 seconds.
7010
7011 2003-11-28  Dick Porter  <dick@ximian.com>
7012
7013         * support.cs: Do string compares with the Invariant culture.
7014
7015         * rootcontext.cs: 
7016         * gen-treedump.cs: 
7017         * expression.cs: 
7018         * driver.cs: 
7019         * decl.cs: 
7020         * codegen.cs: 
7021         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7022         the comparison is done with the Invariant culture.
7023
7024 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7025
7026         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7027         GetEnumerator method.
7028
7029         (ProbeCollectionType): Iterate starting at the most specific type
7030         upwards looking for a GetEnumerator
7031
7032         * expression.cs: Shift count can be up to 31 for int/uint and 63
7033         for long/ulong.
7034
7035 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7036
7037         * statement.cs (Block.LookupLabel): Also look for the label on the
7038         children blocks.  Use a hash table to keep track of visited
7039         nodes. 
7040
7041         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7042         we actually did transform the other operand, otherwise fall back
7043         to the common codepath that casts to long.
7044
7045         * cs-tokenizer.cs: Use the same code pattern as the int case.
7046         Maybe I should do the parsing myself, and avoid depending on the
7047         Parse routines to get this done.
7048
7049 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7050
7051         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7052         which fixes bug 51347.  This time test it.
7053
7054         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7055         attributes for example can not tell the difference between these.
7056         The difference was only a syntax feature of the language. 
7057
7058         * attribute.cs: Apply attributes to delegates.
7059
7060         * delegate.cs: Call the apply attributes method.
7061
7062 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7063
7064         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7065         comparing 0 vs Byte.MinValue, not the value
7066
7067         (ImplicitConversionRequired): When reporting a conversion error,
7068         use error 31 to print out the constant error instead of the
7069         simpler 29.
7070
7071         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7072         which fixes bug 51347.
7073
7074 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7075
7076         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7077         which fixes the -warnaserror command line option.
7078
7079 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7080
7081         * cfold.cs (DoNumericPromotions): During constant folding of
7082         additions on UIntConstant, special case intconstants with
7083         IntConstants like we do on the expression binary operator. 
7084
7085 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7086
7087         * convert.cs (ImplicitReferenceConversion): We were missing a case
7088         (System.Enum are not value types or class types, so we need to
7089         classify them separatedly).
7090
7091         * driver.cs: We do not support error 2007.
7092
7093 2003-11-12 Jackson Harper <jackson@ximian.com>
7094
7095         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7096         system directory. Also use the full file name so users can
7097         libraries names mscorlib-o-tron.dll in a non system dir.
7098         
7099 2004-01-04  David Sheldon <dave-mono@earth.li>
7100
7101         * expression.cs: Added matching ")" to error message for CS0077.
7102
7103 2003-12-19  Martin Baulig  <martin@ximian.com>
7104
7105         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7106         static method; see documentation in the method.
7107         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7108
7109         * convert.cs (Convert.ImplicitReferenceConversion,
7110         Convert.ImplicitReferenceConversionExists): Add support for
7111         generic type declarations; see gen-36.cs.
7112
7113 2003-12-19  Martin Baulig  <martin@ximian.com>
7114
7115         * pending.cs (Pending.InterfaceMethod): Use
7116         `Type.IsAssignableFrom()' instead of `=='.
7117
7118 2003-12-18  Martin Baulig  <martin@ximian.com>
7119
7120         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7121         byref types first.
7122
7123         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7124         `expr_type.Equals (target_type)' instead of `=='.
7125
7126 2003-12-08  Martin Baulig  <martin@ximian.com>
7127
7128         * generics.cs (Constraints.Types): Removed.
7129         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7130         to Type's.
7131         (Constraints.ResolveTypes): New public method; resolves the
7132         TypeExpr's to Type's.
7133         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7134         longer takes the constraints.
7135         (TypeParameter.DefineMethod): Likewise.
7136         (TypeParameter.DefineType): New public method.  Calls
7137         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7138         the constraints.
7139
7140 2003-12-08  Martin Baulig  <martin@ximian.com>
7141
7142         * convert.cs (Convert.ImplicitConversionStandard): Use
7143         `expr_type.Equals (target_type)' instead of `=='.
7144
7145 2003-12-08  Martin Baulig  <martin@ximian.com>
7146
7147         * typemanager.cs (TypeManager.GetReferenceType): Call
7148         `Type.MakeByRefType ()'.
7149
7150 2003-12-08  Martin Baulig  <martin@ximian.com>
7151
7152         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7153         just has some special meaning in some situations.  For instance,
7154         it is allowed to use `where' as the name of a variable etc.
7155
7156 2003-12-04  Martin Baulig  <martin@ximian.com>
7157
7158         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7159         `Type.MakeArrayType()' for array types.
7160
7161 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7162
7163         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7164         debugging message.
7165
7166         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7167         corlib to compile.
7168
7169 2003-11-16  Martin Baulig  <martin@ximian.com>
7170
7171         * codegen.cs (EmitContext.IsGeneric): Removed.
7172
7173         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7174         ResolveGeneric() on the DeclSpace.
7175
7176 2003-11-16  Martin Baulig  <martin@ximian.com>
7177
7178         * generic.cs (TypeArguments.Resolve):
7179         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7180         `ResolveType()' on it to get the Type.
7181
7182 2003-11-15  Martin Baulig  <martin@ximian.com>
7183
7184         * generic.cs (ConstructedType.GetInterfaces): Override this.
7185
7186 2003-11-14  Martin Baulig  <martin@ximian.com>
7187
7188         * interface.cs (Interface.DefineType): Define all type parameters
7189         before adding the interfaces we inherit.
7190
7191 2003-11-11  Martin Baulig  <martin@ximian.com>
7192
7193         * generic.cs (ConstructedType.ResolveType): Always call
7194         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7195
7196 2003-11-10  Martin Baulig  <martin@ximian.com>
7197
7198         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7199         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7200         calling `ResolveType()' on them, directly assign their `Type'.
7201
7202 2003-11-08  Martin Baulig  <martin@ximian.com>
7203
7204         * generic.cs (ConstructedType): Override `IsClass' etc.
7205
7206 2003-11-08  Martin Baulig  <martin@ximian.com>
7207
7208         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7209         return value and the `out parent' parameter.
7210         (TypeContainer.DefineType): Moved the CS0644 check into
7211         GetClassBases().  Don't pass the interface types to the
7212         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7213         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7214
7215         * ecore.cs (TypeExpr.IsAttribute): New property.
7216         (TypeExpr.GetInterfaces): New method.
7217
7218         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7219         TypeExpr instead of a Type.
7220         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7221         (Interface.DefineType): Don't pass the interface types to the
7222         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7223         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7224
7225         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7226         instead of a `Type[]'.
7227         (TypeManager.RegisterBuilder): Likewise.
7228         (TypeManager.AddUserInterface): Likewise.
7229         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7230         `Type[]' and also return a `TypeExpr[]'.
7231         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7232
7233 2003-11-08  Martin Baulig  <martin@ximian.com>
7234
7235         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7236         Expression.     
7237
7238 2003-11-08  Martin Baulig  <martin@ximian.com>
7239
7240         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7241         TypeManager.ResolveExpressionTypes().
7242
7243         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7244         instead of an Expression.
7245         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7246         (TypeExpression): New public class; formerly known as `TypeExpr'.
7247
7248         * expression.cs (ComposedCast): Derive from TypeExpr.
7249
7250         * typemanager.cs (TypeManager.system_*_expr): These are now
7251         TypExpr's instead of Expression's.
7252         (TypeManager.ResolveExpressionTypes): New public static function;
7253         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7254         of them.        
7255
7256 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7257
7258         * expression.cs (New.DoResolve): Do not dereference value that
7259         might be a null return.
7260
7261         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7262         sure that the constant value has the right type.  Fixes an
7263         unreported bug, similar to 50425.
7264
7265         * const.cs (Const.LookupConstantValue): Call
7266         ImplicitStandardConversionExists before doing a conversion to
7267         avoid havng the TypeManager.ChangeType do conversions.
7268
7269         Reduced the number of casts used
7270
7271         (Const.ChangeType): New routine to enable reuse of the constant
7272         type changing code from statement.
7273
7274         * typemanager.cs (ChangeType): Move common initialization to
7275         static global variables.
7276
7277         Fixes #50425.
7278
7279         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7280         every value type to go through, even if it was void.  Fix that. 
7281
7282         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7283         character of the define, and the is_identifier_part_character for
7284         the rest of the string.
7285
7286 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7287
7288         * expression.cs (UnaryMutator.EmitCode): When I updated
7289         LocalVariableReference.DoResolve, I overdid it, and dropped an
7290         optimization done on local variable references.
7291
7292 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7293
7294         * ecore.cs: Convert the return from Ldlen into an int.
7295
7296 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7297
7298         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7299         the accessibility, this is a special case for toplevel non-public
7300         classes (internal for instance).
7301
7302 2003-10-20  Nick Drochak <ndrochak@gol.com>
7303
7304         * ecore.cs: Fix typo and build.  Needed another right paren.
7305
7306 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7307
7308         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7309         `internal' case regular and protected, but not allowing protected
7310         to be evaluated later.  Bug 49840
7311
7312 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7313
7314         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7315         to kb.Nlast, and not the kb.nFirst to isolate the switch
7316         statement.
7317
7318         Extract the underlying type, so enumerations of long/ulong are
7319         treated like long/ulong.
7320
7321 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7322
7323         * expression.cs (New): Overload the meaning of RequestedType to
7324         track the possible creation of the NewDelegate type, since
7325         DoResolve is invoked more than once for new constructors on field
7326         initialization.
7327
7328         See bugs: #48800 and #37014
7329
7330         * cs-parser.jay (declare_local_constants): Take an arraylist
7331         instead of a single constant.
7332
7333         (local_constant_declaration): It should take a
7334         constant_declarators, not a constant_declarator.  Fixes 49487
7335
7336         * convert.cs: Fix error report.
7337
7338 2003-10-13 Jackson Harper <jackson@ximian.com>
7339
7340         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7341         bug #49611
7342         
7343 2003-11-03  Martin Baulig  <martin@ximian.com>
7344
7345         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7346         `out bool has_type_arg'; if set, we need to pass the type to
7347         ig.Emit().
7348         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7349         Stelem_Any/Ldelem_Any for generic parameters.   
7350
7351 2003-11-02  Martin Baulig  <martin@ximian.com>
7352
7353         * expression.cs (Invocation.EmitCall): Use
7354         `TypeManager.IsValueType()' to check whether it's a value type.
7355         Don't set `struct_call' when calling a method on a type parameter.
7356
7357 2003-11-02  Martin Baulig  <martin@ximian.com>
7358
7359         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7360         and removed the TypeBuilder argument.
7361
7362         * typemanager.cs (TypeManager.IsValueType): Return
7363         `t.IsGenericParameter || t.IsValueType'.
7364
7365 2003-10-25  Martin Baulig  <martin@ximian.com>
7366
7367         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7368         call ConstructedType.Resolve() on it.
7369
7370         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7371
7372 2003-10-25  Martin Baulig  <martin@ximian.com>
7373
7374         * class.cs (TypeContainer.GetClassBases): Changed
7375         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7376         CS8214 reporting here.
7377         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7378         instead of a `Type' for our parent.  In case of a recursive
7379         declaration (see tests/gen-23.cs for an example), our parent is a
7380         ConstructedType and it doesn't have its type set.  So, first
7381         create our own TypeBuilder, then call constructed.Resolve() to get
7382         the parent's type and finally TypeBuilder.SetParent() it.
7383
7384         * ecore.cs (TypeExpr.Name): New public virtual property.
7385
7386         * generic.cs
7387         (ConstructedType): We're now a TypeExpr and not just an Expression.
7388         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7389         arguments here; this is done later.
7390         (ConstructedType.Resolve): New public method to resolve the type
7391         arguments and bind them.
7392
7393 2003-10-21  Martin Baulig  <martin@ximian.com>
7394
7395         * convert.cs: Use `TypeManager.IsValueType' instead of
7396         'type.IsValueType' everywhere.
7397
7398         * typemanager.cs (TypeManager.IsValueType): Return true for type
7399         parameters.  The reason for this is that we need to box a type
7400         parameter when converting it to a reference type.
7401
7402         * cs-parser.jay: Added support for default value expressions.
7403
7404         * generics.cs (DefaultValueExpression): New public class.       
7405
7406 2003-10-17  Martin Baulig  <martin@ximian.com>
7407
7408         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7409         TypeContainer so we can also use this for Interfaces.
7410         (TypeParameter.Resolve): Likewise.
7411
7412         * interface.cs (Interface.DefineType): Added support for generic
7413         interfaces.
7414
7415         * cs-parser.jay: Added support for generic structs and interfaces.
7416
7417 2003-10-17  Martin Baulig  <martin@ximian.com>
7418
7419         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7420         call generic methods :-)
7421
7422 2003-10-16  Martin Baulig  <martin@ximian.com>
7423
7424         * cs-parser.jay (namespace_or_type_name): Only create a
7425         GenericMemberAccess if we actually have type arguments.
7426
7427 2003-10-13  Martin Baulig  <martin@ximian.com>
7428
7429         * class.cs (Method.Define): If we're a generic method, call
7430         TypeBuilder.DefineGenericMethod () before resolving
7431         the parameters.
7432         (MethodData): Added .ctor which takes an additional MethodBuilder
7433         argument; this is used for generic methods.
7434         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7435         we already have a MethodBuilder.
7436
7437 2003-10-10  Martin Baulig  <martin@ximian.com>
7438
7439         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7440         instead of a `DeclSpace'.  This is used for generic methods.
7441
7442         * cs-parser.jay (method_header): Added support for generic
7443         methods; create a `GenericMethod' instance and pass it to the
7444         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7445         parameters and locals.
7446
7447         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7448         since we already have the location.  Check whether we're a generic
7449         type declaration or a generic method and create the correct type
7450         parameter.
7451
7452         * generic.cs (TypeParameter.DefineMethod): New public method.
7453         (GenericMethod): New public class; derives from DeclSpace and is
7454         used for generic methods.       
7455
7456 2003-10-09  Martin Baulig  <martin@ximian.com>
7457
7458         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7459         to the .ctor.
7460         (MethodCore.DoDefineParameters): Removed the TypeContainer
7461         argument; use the DeclSpace which was passed to the .ctor instead.
7462         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7463         TypeContainer; we only need a DeclSpace here.
7464
7465 2003-10-09  Martin Baulig  <martin@ximian.com>
7466
7467         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7468         to the .ctor.
7469         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7470         EmitContext's .ctor.    
7471
7472 2003-10-09  Martin Baulig  <martin@ximian.com>
7473
7474         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7475         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7476         AsAccessible(), moved them as well.
7477
7478         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7479
7480 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7481
7482         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7483         generation for >=, as spotted by Paolo, bug 48679.  
7484         Patch from David Waite.
7485
7486         * cs-tokenizer.cs: Add handling for #pragma.
7487
7488         * cs-parser.jay: Allow for both yield and yield return in the
7489         syntax.  The anti-cobolization of C# fight will go on!
7490
7491         * class.cs (TypeBuilder.DefineType): Catch error condition here
7492         (Parent.DefineType erroring out and returning null).
7493
7494         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7495         coping with enumerations variables, we were mistakenly processing
7496         them as a regular value type instead of built-in types.  Fixes the
7497         bug #48063
7498
7499         * typemanager.cs (IsBuiltinOrEnum): New method.
7500
7501 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7502
7503         * cs-parser.jay: Upgrade: yield now needs the return clause.
7504
7505 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7506
7507         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7508
7509 2003-09-29  Martin Baulig  <martin@ximian.com>
7510
7511         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7512         inflated generic methods.
7513
7514         * generics.cs (ConstructedType): Distinguish between open and
7515         closed constructed types; correctly resolve the arguments.
7516
7517 2003-09-22  Martin Baulig  <martin@ximian.com>
7518
7519         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7520         all type arguments meet their constraints.
7521
7522 2003-09-19  Martin Baulig  <martin@ximian.com>
7523
7524         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7525         `MemberCache parent' argument.  Normally, an interface doesn't
7526         have a parent type except System.Object, but we use this in gmcs
7527         for generic type parameters.
7528
7529 2003-09-18  Martin Baulig  <martin@ximian.com>
7530
7531         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7532         on `type.IsInterface'; don't check whether the type has a parent
7533         to determine whether it's an interface.
7534
7535 2003-09-17  Martin Baulig  <martin@ximian.com>
7536
7537         * generic.cs (ConstructedType.ToString): Always use `name' as the
7538         type name.
7539
7540 2003-09-15  Martin Baulig  <martin@ximian.com>
7541
7542         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7543
7544         * generic.cs (Constraints.Resolve): New public method; this is
7545         called to resolve the constraint types and to check whether all
7546         the constraints are correct.
7547         (Constraints.Types): New public property.
7548         (TypeParameter.Resolve): New public method; resolves all the
7549         type's constraints.
7550
7551         * class.cs (TypeContainer.DefineType): Call
7552         TypeParameter.Resolve() before actually defining the type.
7553
7554 2003-09-15  Martin Baulig  <martin@ximian.com>
7555
7556         * class.cs (TypeContainer.DefineType): Added an error flag to
7557         avoid reporting duplicate CS0146's ("class definition is
7558         circular.").
7559
7560         * driver.cs (Driver.MainDriver): Abort if
7561         RootContext.ResolveTree() reported any errors.
7562
7563 2003-09-07  Martin Baulig  <martin@ximian.com>
7564
7565         * report.cs (Error, Warning): Added overloaded versions which take
7566         a `params object[] args' and call String.Format().
7567
7568 2003-09-07  Martin Baulig  <martin@ximian.com>
7569
7570         * decl.cs (DeclSpace..ctor): Don't call
7571         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7572         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7573         (DeclSpace.RecordDecl): New method.
7574
7575         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7576
7577 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7578
7579         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7580         value attributes to be applied to ParameterBuilders.
7581
7582         * class.cs (MethodCore.LabelParameters): Make static and more
7583         generic so that it can be used from other places - like interface
7584         methods, for instance.
7585
7586         * interface.cs (Interface.Emit): Call LabelParameters before
7587         emitting attributes on the InterfaceMethod.
7588
7589 2003-09-07  Martin Baulig  <martin@ximian.com>
7590
7591         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7592         if the number of type parameters doesn't match.
7593
7594 2003-09-04  Martin Baulig  <martin@ximian.com>
7595
7596         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7597         for arrays of generic type params (ie. `!0[]').
7598
7599 2003-09-04  Martin Baulig  <martin@ximian.com>
7600
7601         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7602         for the moment.
7603
7604 2003-09-04  Martin Baulig  <martin@ximian.com>
7605
7606         * decl.cs (DeclSpace.LookupGeneric): New method.
7607         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7608         moment.
7609
7610         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7611         argument, not just a string.
7612         (TypeParameter.Define): New public method; this is called to
7613         actually define the generic parameter; after this, you can use the
7614         new `Type' property to get the type.
7615
7616 2003-09-04  Martin Baulig  <martin@ximian.com>
7617
7618         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7619         is now an ArrayList; initialize the result of the `TypeParameters'
7620         property here.
7621         (DeclSpace.GetGenericData): Removed.
7622         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7623         implement this in a different way.
7624         (DeclSpace.GetTypeParameters): Removed; there's now a
7625         `TypeParameters' property.
7626         (DeclSpace.TypeParameters): New public property.
7627
7628         * generic.cs (Constraints): Make this class public.
7629         (TypeParameter): New public class.
7630
7631 2003-09-04  Martin Baulig  <martin@ximian.com>
7632
7633         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7634         generic parameters.
7635
7636         * class.cs (TypeContainer.DefineType): Call
7637         TypeBuilder.DefineGenericParameter () on all generic parameters if
7638         this is a generic type.
7639
7640 2003-08-28  Martin Baulig  <martin@ximian.com>
7641
7642         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7643         sample-stack.il".
7644
7645         * sample-hello.cs: Compile this with gmcs: "gmcs
7646         /r:sample-stack.dll sample-hello.cs".
7647
7648 2003-08-28  Martin Baulig  <martin@ximian.com>
7649
7650         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7651         the parameters to the generic type.
7652
7653 2003-08-28  Martin Baulig  <martin@ximian.com>
7654
7655         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7656
7657 2003-08-28  Martin Baulig  <martin@ximian.com>
7658
7659         * cs-parser.jay (opt_type_argument_list): Use
7660         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7661         (primary_expression): Replace `qualified_identifier' with `type_name'.
7662         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7663
7664         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7665         parser to check whether it is syntactically a type parameter list;
7666         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7667         this case.
7668
7669 2003-08-26  Martin Baulig  <martin@ximian.com>
7670
7671         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7672         resolving aliases; fixes #47927.
7673
7674 2003-08-26  Martin Baulig  <martin@ximian.com>
7675
7676         * statement.cs (Using.DoResolve): This is internally emitting a
7677         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7678         do not always return.  Fixes #47681.
7679
7680 2003-08-26  Martin Baulig  <martin@ximian.com>
7681
7682         * decl.cs (MemberCore): Moved WarningNotHiding(),
7683         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7684         into MemberBase.
7685         (AdditionResult): Make this nested in DeclSpace.
7686         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7687         argument; call NamespaceEntry.Define() unless we're nested in a
7688         class or struct.
7689
7690         * namespace.cs (Namespace.DefineName): New public function.  This
7691         is called from DeclSpace's .ctor to add 
7692         (Namespace.Lookup): Include DeclSpaces in the lookup.
7693
7694         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7695
7696         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7697
7698 2003-08-25  Martin Baulig  <martin@ximian.com>
7699
7700         * convert.cs (Convert.ExplicitReferenceConversion): When
7701         converting from an interface type to a class, unbox if the target
7702         type is a struct type.  Fixes #47822.
7703
7704 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7705
7706         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7707         #47854.
7708
7709 2003-08-22  Martin Baulig  <martin@ximian.com>
7710
7711         * class.cs (TypeManager.DefineType): When defining a nested type,
7712         call DefineType() on our parent; fixes #47801.
7713
7714 2003-08-22  Martin Baulig  <martin@ximian.com>
7715
7716         * class.cs (MethodData.Define): While checking if a method is an
7717         interface implementation, improve the test a bit more to fix #47654.
7718
7719 2003-08-22  Martin Baulig  <martin@ximian.com>
7720
7721         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7722         correctly; fixes #47722.
7723
7724 2003-08-22  Martin Baulig  <martin@ximian.com>
7725
7726         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7727         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7728
7729         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7730
7731 2003-08-22  Martin Baulig  <martin@ximian.com>
7732
7733         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7734         can only be assigned in static constructors.  Fixes #47161.
7735
7736 2003-08-22  Martin Baulig  <martin@ximian.com>
7737
7738         Rewrote and improved the flow analysis code.
7739
7740         * flowbranching.cs (FlowBranching): Make this class abstract.
7741         (FlowBranching.CreateBranching): New static function to create a
7742         new flow branching.
7743         (FlowBranchingBlock, FlowBranchingException): New classes.
7744         (FlowBranching.UsageVector.Type): New public readonly field.
7745         (FlowBranching.UsageVector.Breaks): Removed the setter.
7746         (FlowBranching.UsageVector.Returns): Removed the setter.
7747         (FlowBranching.UsageVector): Added Break(), Return(),
7748         NeverReachable() and Throw() methods to modify the reachability.
7749         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7750         done by FlowBranching.Merge().
7751         (FlowBranching.UsageVector.MergeChild): New method; merges the
7752         merge result into the current vector.
7753         (FlowBranching.Merge): New abstract method to merge a branching.
7754
7755 2003-08-12  Martin Baulig  <martin@ximian.com>
7756
7757         * expression.cs (Indirection.CacheTemporaries): Create the
7758         LocalTemporary with the pointer type, not its element type.
7759
7760 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7761
7762         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7763         token was a keyword or not.
7764
7765         Add `error' options where an IDENTIFIER was expected;  Provide
7766         CheckToken and CheckIdentifierToken convenience error reporting
7767         functions. 
7768
7769         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7770
7771         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7772         NameSpaceEntry NameSpaceEntry.
7773
7774         (LookupInterfaceOrClass): Avoid creating a full qualified name
7775         from namespace and name: avoid doing lookups when we know the
7776         namespace is non-existant.   Use new Tree.LookupByNamespace which
7777         looks up DeclSpaces based on their namespace, name pair.
7778
7779         * driver.cs: Provide a new `parser verbose' to display the
7780         exception thrown during parsing.  This is turned off by default
7781         now, so the output of a failure from mcs is more graceful.
7782
7783         * namespace.cs: Track all the namespaces defined in a hashtable
7784         for quick lookup.
7785
7786         (IsNamespace): New method
7787
7788 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7789
7790         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7791         we know that we need to concatenate (full typename can never be
7792         null). 
7793
7794         * class.cs: ditto.
7795
7796         * statement.cs: Use a bitfield;  Do not initialize to null things
7797         which are done by the constructor by default.
7798
7799         * cs-parser.jay: bug fix, parameter was 4, not 3.
7800
7801         * expression.cs: Just use the property;
7802
7803         * statement.cs: No need for GetVariableInfo method.
7804
7805 2003-08-08  Martin Baulig  <martin@ximian.com>
7806
7807         * flowanalysis.cs (FlowReturns): This is now nested in the
7808         `FlowBranching' class.
7809         (MyBitVector): Moved this here from statement.cs.
7810         (FlowBranching.SiblingType): New enum type.
7811         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7812
7813 2003-08-07  Martin Baulig  <martin@ximian.com>
7814
7815         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7816         `FlowBranching' class and called `BranchingType'.
7817
7818 2003-08-07  Martin Baulig  <martin@ximian.com>
7819
7820         * flowanalysis.cs: Moved all the control flow analysis code into
7821         its own file.
7822
7823 2003-08-07  Martin Baulig  <martin@ximian.com>
7824
7825         * assign.cs (Assign.DoResolve): `target' must either be an
7826         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7827         #37319.
7828
7829 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7830
7831         * expression.cs (BinaryMethod): This kind of expression is created by the
7832         Binary class if it determines that the operator has to be handled
7833         by a method.
7834
7835         (BinaryDelegate): This kind of expression is created if we are
7836         dealing with a + or - operator on delegates.
7837
7838         (Binary): remove method, argumetns, and DelegateOperator: when
7839         dealing with methods, 
7840
7841         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7842
7843         * statement.cs (Block): use bitfields for the three extra booleans
7844         we had in use.   Remove unused topblock parameter.
7845
7846         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7847
7848         * assign.cs: Drop extra unneeded tests.
7849
7850 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7851
7852         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7853
7854         * statement.cs (Foreach): Use VariableStorage instead of
7855         LocalBuilders.   
7856
7857         * codegen.cs (VariableStorage): New class used by clients that
7858         require a variable stored: locals or fields for variables that
7859         need to live across yield.
7860
7861         Maybe provide a convenience api for EmitThis+EmitLoad?
7862
7863         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7864         these bad boys.
7865
7866 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7867
7868         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7869         RemapParameterLValue): New methods that are used to turn a
7870         precomputed FieldInfo into an expression like this:
7871
7872                 instance.FieldInfo
7873
7874         The idea is to use this instead of making LocalVariableReference
7875         have more than one meaning.
7876
7877         * cs-parser.jay: Add error production to BASE.
7878
7879         * ecore.cs: Deal with TypeManager.GetField returning null, which
7880         is now a valid return value.
7881
7882         (FieldExprNoAddress): New expression for Fields whose address can
7883         not be taken.
7884
7885         * expression.cs (LocalVariableReference): During the resolve
7886         phases, create new expressions if we are in a remapping context.
7887         Remove code that dealt with remapping here.
7888
7889         (ParameterReference): same.
7890
7891         (ProxyInstance): New expression, like the `This' expression, but
7892         it is born fully resolved.  We know what we are doing, so remove
7893         the errors that are targeted to user-provided uses of `this'.
7894
7895         * statement.cs (Foreach): our variable is now stored as an
7896         Expression;  During resolution, follow the protocol, dont just
7897         assume it will return this.
7898
7899 2003-08-06  Martin Baulig  <martin@ximian.com>
7900
7901         * support.cs (SeekableStreamReader.cs): New public class.
7902
7903         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7904         SeekableStreamReader instead of the normal StreamReader.
7905
7906 2003-08-04  Martin Baulig  <martin@ximian.com>
7907
7908         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7909         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7910         deambiguate casts and delegate invocations.
7911         (parenthesized_expression): Use the new tokens to ensure this is
7912         not a cast of method invocation.
7913
7914         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7915         when reading a `)' and Deambiguate_CloseParens () was previously
7916         called.
7917
7918         * expression.cs (ParenthesizedExpression): New class.  This is
7919         just used for the CS0075 test.
7920         (Binary.DoResolve): Check for CS0075.   
7921
7922 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7923
7924         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7925         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7926         reference comparison.
7927
7928         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7929         examine the ReturnType for equality - this is necessary in the
7930         cases of implicit and explicit operators whose signature also
7931         includes the return type.
7932
7933 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7934
7935         * namespace.cs: Cache the result of the namespace computation,
7936         instead of computing it every time.
7937
7938 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7939
7940         * decl.cs: Use a global arraylist that we reuse over invocations
7941         to avoid excesive memory consumption.  Reduces memory usage on an
7942         mcs compile by one meg (45 average).
7943
7944         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7945         private, work around that.
7946
7947 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7948
7949         * literal.cs (IntLiteral): Define Zero and One static literals. 
7950
7951         * cs-parser.jay (integer_literal): use static literals to reduce
7952         memory usage for the most used literals (0, 1 and -1).  211kb
7953         reduced in memory usage.
7954
7955         Replace all calls to `new ArrayList' with `new
7956         ArrayList(4)' which is a good average number for most allocations,
7957         and also requires only 16 bytes of memory for its buffer by
7958         default. 
7959
7960         This reduced MCS memory usage in seven megabytes for the RSS after
7961         bootstrapping.
7962
7963 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7964
7965         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7966         handle params methods the correct way by forming only one
7967         applicable set with params and normal methods in them. Earlier we
7968         were looking at params methods only if we found no normal methods
7969         which was not the correct thing to do.
7970
7971         (Invocation.BetterFunction): Take separate arguments indicating
7972         when candidate and the best method are params methods in their
7973         expanded form.
7974
7975         This fixes bugs #43367 and #46199.
7976
7977         * attribute.cs: Documentation updates.
7978
7979         (CheckAttribute): Rename to CheckAttributeTarget.
7980         (GetValidPlaces): Rename to GetValidTargets.
7981
7982         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7983         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7984
7985         Fixes bug #44468.
7986
7987 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7988
7989         * codegen.cs: Compute IsGeneric correctly.
7990
7991         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7992         resolution. 
7993
7994         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7995         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7996         regressions, and I was chasing more bugs than I required.
7997
7998         * interface.cs: Use expressions for base type names (like classes
7999         and structs have been doing for a while now), and resolve that.
8000         This patch should probably go into head as well.
8001
8002         This makes it one less user of FindType.
8003
8004 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8005
8006         This compiler can not self host currently.  Need to fix that.
8007         
8008         * Makefile: compile to `gmcs.exe'
8009
8010         * driver.cs: Turn on v2 by default on gmcs.
8011
8012         * generic.cs (ConstructedType): Does no longer take a container
8013         type argument;  That will be taken care of later.
8014
8015         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8016         Use SimpleName to resolve for now, so we can continue the work on
8017         the parser, until we get Type.GetType that understands generics.
8018
8019         (ConstructedType.ToString): Implement
8020
8021         (TypeArguments.Resolve): Resolve the child expressions as types. 
8022         
8023         * cs-parser.jay: Rename interface_constraints to
8024         type_parameter_constraints
8025
8026         (namespace_or_type_name): Only use constructed types for the basic
8027         construction, we will deal with identifier<...> later.
8028
8029         (type/type_name): No longer call DecomposeQI, as
8030         namespace_or_type_name is always decoded now.
8031         
8032 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8033
8034         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8035         closely: we eliminate methods in base types when we have an
8036         applicable method in a top-level type.
8037
8038         Please see section 14.5.5.1 for an exact description of what goes
8039         on. 
8040
8041         This fixes bug #45127 and a host of other related to corlib compilation.
8042
8043         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8044         array is the method corresponding to the top-level type (this is
8045         because of the changes made to icall.c) so we change this
8046         accordingly.
8047
8048         (MethodGroupExpr.Name): This too.
8049
8050         * typemanager.cs (GetElementType): New method which does the right
8051         thing when compiling corlib. 
8052
8053         * everywhere: Make use of the above in the relevant places.
8054
8055 2003-07-22  Martin Baulig  <martin@ximian.com>
8056
8057         * cs-parser.jay (invocation_expression): Moved
8058         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8059         `cast_expression', but create a InvocationOrCast which later
8060         resolves to either an Invocation or a Cast.
8061
8062         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8063         method; call this before EmitStatement() to make sure that this
8064         expression can be used as a statement.
8065
8066         * expression.cs (InvocationOrCast): New class; resolves to either
8067         an Invocation or a Cast.
8068
8069         * statement.cs (StatementExpression): Call ResolveStatement() on
8070         the ExpressionStatement before emitting it.
8071
8072 2003-07-21  Martin Baulig  <martin@ximian.com>
8073
8074         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8075         `ref' and `out' attributes match; fixes #46220.
8076         (MemberAccess.ResolveMemberAccess): You can't reference a type
8077         through an expression; fixes #33180.
8078         (Indexers.GetIndexersForType): Don't return the indexers from
8079         interfaces the class implements; fixes #46502.
8080
8081 2003-07-21  Martin Baulig  <martin@ximian.com>
8082
8083         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8084         CS0661 checks; fixes bug #30442.
8085
8086 2003-07-21  Martin Baulig  <martin@ximian.com>
8087
8088         * decl.cs (AdditionResult): Added `Error'.
8089
8090         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8091
8092         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8093         cs0031.cs actually work.
8094
8095  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8096  
8097         * cs-parser.jay (namespace_name): do not use
8098         namespace_or_type_name, use qualified_identifier, because
8099         namespace_or_type_name will soon return a composed expression
8100         instead of a string.
8101  
8102         (namespace_or_type_name): Instead of returning a string, now this
8103         production returns an expression.
8104  
8105         * codegen.cs (EmitContext): Setup IsGeneric property based on
8106         whether our DeclSpace is generic, our the method is generic.
8107  
8108         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8109         the method is generic.
8110  
8111         * cs-parser.jay (type_arguments, opt_type_argument_list,
8112         type_parameters, type_parameter_list, opt_type_parameter_list,
8113         type_parameter,, opt_type_parameter_constraints_clauses,
8114         type_parameter_constraints_clauses,
8115         type_parameter_constraint_clause, type_parameter_constraint,
8116         interface_constraints): Add new production
8117  
8118         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8119         DeclSpace is generic or not.
8120  
8121         (DeclSpace.SetParameterInfo): New routine, used to set the
8122         parameter info for a type.
8123  
8124         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8125         returns a GenericTypeExpr
8126  
8127         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8128         generic, lookup the generic argument.
8129  
8130         * attribute.cs: Do not allow TypeParameterExpressions in
8131         Attributes.
8132  
8133         * class.cs: Do not allow the Main method to be defined in a
8134         Generic container.
8135  
8136         * expression.cs (SizeOf): Do not allow generic types to be used as
8137         arguments to sizeof.
8138  
8139         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8140         it: whether a type is generic or not.  Only works for types we are
8141         currently building for now.
8142         
8143 2003-07-20  Martin Baulig  <martin@ximian.com>
8144
8145         * namespace.cs: Fixed that bug which caused a crash when compiling
8146         the debugger's GUI.
8147
8148 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8149
8150         * typemanager.cs (LookupTypeReflection): Never expose types which
8151         are NotPublic, NestedPrivate, NestedAssembly, or
8152         NestedFamANDAssem.  We used to return these, and later do a check
8153         that would report a meaningful error, but the problem is that we
8154         would not get the real match, if there was a name override.
8155
8156 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8157
8158         * namespace.cs (Namespace, Name): Do not compute the namespace
8159         name dynamically, compute it in the constructor.  This reduced
8160         memory usage by 1697 KB.
8161
8162         * driver.cs: Use --pause to pause at the end.
8163
8164 2003-07-17  Peter Williams  <peter@newton.cx>
8165
8166         * Makefile: Change the name of the test target so that it doesn't
8167         conflict with the recursive test target.
8168
8169 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8170
8171         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8172         AddressOf): Do not use EmitThis, that was wrong, use the actual
8173         this pointer.
8174
8175 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8176
8177         * class.cs (MethodData.Define): While checking if a method is an
8178         interface implementation, improve the test: If we are not public
8179         (use new test here: use the computed MethodAttributes directly,
8180         instead of the parsed modifier flags) check if the `implementing'
8181         method comes from an interface or not.
8182
8183         * pending.cs (VerifyPendingMethods): Slightly better error
8184         message.
8185
8186         * makefile: add test target that does the mcs bootstrap.
8187
8188 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8189
8190         * interface.cs (Define): Do nothing here since there are no
8191         members to populate etc. Move the attribute emission out of here
8192         since this was just totally the wrong place to put it. Attribute
8193         application happens during the 'Emit' phase, not in the 'Define'
8194         phase.
8195
8196         (Emit): Add this method and move the attribute emission here
8197
8198         * rootcontext.cs (EmitCode): Call the Emit method on interface
8199         types too.
8200
8201 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8202
8203         * expression.cs (OverloadResolve): Report error only if Location
8204         is not 'Null' which means that there was a probe going on.
8205
8206 2003-07-14  Martin Baulig  <martin@ximian.com>
8207
8208         * expression.cs (ConditionalLogicalOperator): New public class to
8209         implement user defined conditional logical operators.
8210         This is section 14.11.2 in the spec and bug #40505.
8211
8212 2003-07-14  Martin Baulig  <martin@ximian.com>
8213
8214         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8215
8216 2003-07-14  Martin Baulig  <martin@ximian.com>
8217
8218         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8219
8220         * ecore.cs (IVariable.VerifyFixed): New interface method.
8221
8222         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8223         operator, check whether the variable is actually fixed.  Fixes bug
8224         #36055.  Set a variable definitely assigned when taking its
8225         address as required by the spec.
8226
8227         * statement.cs (LocalInfo.IsFixed): New field.
8228         (LocalInfo.MakePinned): Set `IsFixed' to true.
8229
8230 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8231
8232         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8233         for .ctors, ensure that we only ask for members declared in the
8234         attribute type (BindingFlags.DeclaredOnly).
8235
8236         Fixes bug #43632.
8237
8238         * expression.cs (Error_WrongNumArguments): Report error 1501
8239         correctly the way CSC does.
8240
8241 2003-07-13  Martin Baulig  <martin@ximian.com>
8242
8243         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8244         lookup on the fully qualified name, to make things like "X.X" work
8245         where "X.X" is a fully qualified type name, but we also have a
8246         namespace "X" in the using list.  Fixes #41975.
8247
8248 2003-07-13  Martin Baulig  <martin@ximian.com>
8249
8250         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8251         function. If we're a CompoundAssign, we need to create an embedded
8252         CompoundAssign, not an embedded Assign.
8253         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8254         Fixes #45854.
8255
8256 2003-07-13  Martin Baulig  <martin@ximian.com>
8257
8258         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8259         work to fix bug #46088.
8260
8261 2003-07-13  Ravi Pratap <ravi@ximian.com>
8262
8263         * class.cs (Operator.Emit): Do not emit attributes here - it is
8264         taken care of by the Method class that we delegate too. This takes
8265         care of bug #45876.
8266
8267 2003-07-10  Martin Baulig  <martin@ximian.com>
8268
8269         * expression.cs (TypeOfVoid): New class.
8270         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8271
8272 2003-07-10  Martin Baulig  <martin@ximian.com>
8273
8274         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8275         bug #35957.
8276
8277 2003-07-10  Martin Baulig  <martin@ximian.com>
8278
8279         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8280         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8281
8282         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8283
8284         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8285
8286 2003-07-10  Martin Baulig  <martin@ximian.com>
8287
8288         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8289         of decimal.  Fixes #42850.
8290
8291         NOTE: I also fixed the created byte blob, but this doesn't work on
8292         the MS runtime and csc never produces any byte blobs for decimal
8293         arrays.
8294
8295 2003-07-10  Martin Baulig  <martin@ximian.com>
8296
8297         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8298         structs; fixes #32068.
8299         (Block.AddChildVariableNames): Fixed #44302.
8300
8301 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8302
8303         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8304
8305 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8306
8307         * attribute.cs: And this test is onger needed.
8308
8309 2003-07-08  Martin Baulig  <martin@ximian.com>
8310
8311         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8312         inaccessible types.  Fixes #36313.
8313
8314         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8315
8316         * namespace.cs (NamespaceEntry): Create implicit entries for all
8317         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8318         implicit entries for N1.N2 and N1.
8319
8320 2003-07-08  Martin Baulig  <martin@ximian.com>
8321
8322         Rewrote the handling of namespaces to fix a lot of the issues
8323         wrt. `using' aliases etc.
8324
8325         * namespace.cs (Namespace): Splitted this class into a
8326         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8327
8328         * typemanager.cs (TypeManager.IsNamespace): Removed.
8329         (TypeManager.ComputeNamespaces): Only compute namespaces from
8330         loaded assemblies here, not the namespaces from the assembly we're
8331         currently compiling.
8332
8333 2003-07-08  Martin Baulig  <martin@ximian.com>
8334
8335         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8336
8337 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8338
8339         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8340         already fixed it.  
8341
8342         I thought about the memory savings here, but LookupTypeReflection
8343         is used under already very constrained scenarios.  Compiling
8344         corlib or mcs only exposes one hit, so it would not really reduce
8345         any memory consumption.
8346
8347 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8348
8349         * typemanager.cs: fixes bug #45889 by only adding public types from
8350         other assemblies to the list of known types.
8351
8352 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8353
8354         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8355         on the type we resolved.
8356
8357 2003-07-05  Martin Baulig  <martin@ximian.com>
8358
8359         * pending.cs (PendingImplementation.ParentImplements): Don't
8360         create the proxy if the parent is abstract.
8361
8362         * class.cs (TypeContainer.DefineIndexers): Process explicit
8363         interface implementations first.  Fixes #37714.
8364
8365 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8366
8367         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8368         defined recursively;  but since we modify the input parameters
8369         (left is set to `this' temporarily), we reset this value if the
8370         left_is_explicit is false, which gives the original semantics to
8371         the code.  
8372
8373         * literal.cs (NullPointer): new class used to represent a null
8374         literal in a pointer context.
8375
8376         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8377         type is a pointer, use a NullPointer object instead of a
8378         NullLiteral.   Closes 43687
8379
8380         (ExplicitConversion): Convert pointer values using
8381         the conv opcode to the proper type.
8382
8383         * ecore.cs (New): change ValueTypeVariable property into a method,
8384         that returns whether the valuetype is suitable for being used.
8385
8386         * expression.cs (Binary.DoNumericPromotions): Only return if we
8387         the int constant was a valid uint, and we can return both left and
8388         right as uints.  If not, we continue processing, to trigger the
8389         type conversion.  This fixes 39018.
8390
8391         * statement.cs (Block.EmitMeta): During constant resolution, set
8392         the CurrentBlock property on the emitcontext, so that we resolve
8393         constants propertly.
8394
8395 2003-07-02  Martin Baulig  <martin@ximian.com>
8396
8397         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8398         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8399
8400         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8401         than emitting it here.
8402
8403         * statement.cs: Fixed some more flow analysis bugs.
8404
8405 2003-07-02  Martin Baulig  <martin@ximian.com>
8406
8407         * class.cs (MethodData.Define): When implementing interface
8408         methods, set Final unless we're Virtual.
8409
8410         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8411         check work for interface methods.
8412
8413 2003-07-01  Martin Baulig  <martin@ximian.com>
8414
8415         * ecore.cs (EmitContext.This): Replaced this property with a
8416         GetThis() method which takes a Location argument.  This ensures
8417         that we get the correct error location for a CS0188.
8418
8419 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8420
8421         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8422         ImplicitStandardConversion.
8423
8424         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8425
8426 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8427
8428         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8429         optimization.
8430
8431 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8432
8433         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8434         constructors.
8435
8436         (MethodData.Define): Turn off initlocals for unsafe methods.
8437
8438 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8439
8440         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8441         complete;  Fixes #37521.
8442
8443         * delegate.cs: Use Modifiers.TypeAttr to compute the
8444         TypeAttributes, instead of rolling our own.  This makes the flags
8445         correct for the delegates.
8446
8447 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8448
8449         * class.cs (Constructor.Define): Set the private flag for static
8450         constructors as well.
8451
8452         * cs-parser.jay (statement_expression): Set the return value to
8453         null, to avoid a crash when we catch an error.
8454
8455 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8456
8457         * cs-parser.jay: Applied patch from Jackson that adds support for
8458         extern and unsafe modifiers to destructor declarations.
8459
8460         * expression.cs: Report error 21 if the user is trying to index a
8461         System.Array.
8462
8463         * driver.cs: Add an error message, suggested by the bug report.
8464
8465         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8466         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8467
8468 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8469
8470         * namespace.cs: Add some information to reduce FAQs.
8471
8472 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8473
8474         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8475         underlying enumeration types.  Fixes #43915.
8476
8477         * expression.cs: Treat ushort/short as legal values to be used in
8478         bitwise operations.
8479
8480 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8481
8482         * delegate.cs: transfer custom attributes for paramenters from
8483         the delegate declaration to Invoke and BeginInvoke.
8484
8485 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8486
8487         * attribute.cs: handle custom marshalers and emit marshal info
8488         for fields, too.
8489
8490 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8491
8492         * makefile.gnu: Added anonymous.cs to the compiler sources.
8493
8494 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8495
8496         * iterators.cs: Change the name of the proxy class to include two
8497         underscores.
8498
8499         * cs-parser.jay: Update grammar to include anonymous methods.
8500
8501         * anonymous.cs: new file.
8502
8503 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8504
8505         * class.cs (Field.Define): Add missing test for pointers and
8506         safety. 
8507
8508 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8509
8510         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8511         we use the stobj opcode.
8512
8513         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8514         since it wasn't the correct fix. 
8515
8516         It still is puzzling that we are required to use stobj for IntPtr
8517         which seems to be a ValueType.
8518
8519 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8520
8521         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8522         during regular simple name resolution.   Now, the trick is that
8523         instead of returning for processing the simplename, we do a
8524         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8525         contextual lookup type).   If a match is found, return that, if
8526         not, return for further composition.
8527
8528         This fixes long-standing 30485.
8529
8530         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8531         using the address to initialize an object, do an Stobj instead of
8532         using the regular Stelem.
8533
8534         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8535         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8536         Because if we are a BaseIndexerAccess that value will be true.
8537         Fixes 43643.
8538
8539         * statement.cs (GotoCase.Resolve): Return after reporting an
8540         error, do not attempt to continue. 
8541
8542         * expression.cs (PointerArithmetic.Emit): If our operand is a
8543         long, convert our constants to match the operand before
8544         multiplying.  Convert to I type before adding.   Fixes 43670.
8545
8546 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8547
8548         * enum.cs (ImplicitConversionExists) : Rename to
8549         ImplicitEnumConversionExists to remove ambiguity. 
8550
8551         * ecore.cs (NullCast): New type of cast expression class which
8552         basically is very similar to EmptyCast with the difference being
8553         it still is a constant since it is used only to cast a null to
8554         something else
8555         (eg. (string) null)
8556
8557         * convert.cs (ImplicitReferenceConversion): When casting a null
8558         literal, we return a NullCast.
8559
8560         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8561         should be around anymore.
8562
8563         The renaming (reported was slightly wrong). Corrections:
8564
8565         ConvertImplicitStandard -> ImplicitConversionStandard
8566         ConvertExplicitStandard -> ExplicitConversionStandard
8567
8568         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8569         before passing them in !
8570
8571         * convert.cs (ImplicitConversionStandard): When comparing for
8572         equal expr and target types, ensure that expr is not a
8573         NullLiteral.
8574
8575         In general, we must not be checking (expr_type ==
8576         target_type) in the top level conversion methods
8577         (ImplicitConversion, ExplicitConversion etc). This checking is
8578         done in the methods that they delegate to.
8579
8580 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8581
8582         * convert.cs: Move Error_CannotConvertType,
8583         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8584         ImplicitNumericConversion, ImplicitConversionExists,
8585         ImplicitUserConversionExists, StandardConversionExists,
8586         FindMostEncompassedType, FindMostSpecificSource,
8587         FindMostSpecificTarget, ImplicitUserConversion,
8588         ExplicitUserConversion, GetConversionOperators,
8589         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8590         TryImplicitIntConversion, Error_CannotConvertImplicit,
8591         ConvertImplicitRequired, ConvertNumericExplicit,
8592         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8593         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8594         its own file.
8595
8596         Perform the following renames:
8597
8598         StandardConversionExists -> ImplicitStandardConversionExists
8599         ConvertImplicit -> ImplicitConversion
8600         ConvertImplicitStandard -> ImplicitStandardConversion
8601         TryImplicitIntConversion -> ImplicitIntConversion
8602         ConvertImplicitRequired -> ImplicitConversionRequired
8603         ConvertNumericExplicit -> ExplicitNumericConversion
8604         ConvertReferenceExplicit -> ExplicitReferenceConversion
8605         ConvertExplicit -> ExplicitConversion
8606         ConvertExplicitStandard -> ExplicitStandardConversion
8607
8608 2003-05-19  Martin Baulig  <martin@ximian.com>
8609
8610         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8611         (TypeInfo): Added support for structs having structs as fields.
8612
8613         * ecore.cs (FieldExpr): Implement IVariable.
8614         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8615         VariableInfo for the field.
8616
8617 2003-05-18  Martin Baulig  <martin@ximian.com>
8618
8619         * expression.cs (This.DoResolve): Report a CS0027 if we're
8620         emitting a field initializer.
8621
8622 2003-05-18  Martin Baulig  <martin@ximian.com>
8623
8624         * expression.cs (This.ResolveBase): New public function.
8625         (This.DoResolve): Check for CS0188.
8626
8627         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8628         This.Resolve().
8629
8630         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8631         `instance_expression' to null if we don't have any non-static
8632         methods.
8633
8634 2003-05-18  Martin Baulig  <martin@ximian.com>
8635
8636         Reworked the way how local variables and parameters are handled by
8637         the flow analysis code.
8638
8639         * statement.cs (TypeInfo, VariableMap): New public classes.
8640         (VariableInfo): New public class.  This is now responsible for
8641         checking whether a variable has been assigned.  It is used for
8642         parameters and local variables.
8643         (Block.EmitMeta): Take the InternalParameters as argument; compute
8644         the layout of the flow vectors here.
8645         (Block.LocalMap, Block.ParameterMap): New public properties.
8646         (FlowBranching): The .ctor doesn't get the InternalParameters
8647         anymore since Block.EmitMeta() now computes the layout of the flow
8648         vector.
8649         (MyStructInfo): This class is now known as `StructInfo' and nested
8650         in `TypeInfo'; we don't access this directly anymore.
8651
8652         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8653         property and removed IsAssigned(), IsFieldAssigned(),
8654         SetAssigned() and SetFieldAssigned(); we now call them on the
8655         VariableInfo so we don't need to duplicate this code everywhere.
8656
8657         * expression.cs (ParameterReference): Added `Block block' argument
8658         to the .ctor.
8659         (LocalVariableReference, ParameterReference, This): The new
8660         VariableInfo class is now responsible for all the definite
8661         assignment stuff.
8662
8663         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8664         IsParameterAssigned, SetParameterAssigned): Removed.
8665
8666 2003-05-18  Martin Baulig  <martin@ximian.com>
8667
8668         * typemanager.cs (InitCoreTypes): Try calling
8669         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8670         the 3-args-version.  Corlib now also needs our `void_type'.
8671         (GetMethod): Added overloaded version which takes an optional
8672         `bool report_errors' to allow lookups of optional methods.
8673
8674 2003-05-12  Martin Baulig  <martin@ximian.com>
8675
8676         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8677         only used for locals and not for parameters.
8678
8679 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8680
8681         * support.cs (InternalParameters.ParameterType): Return the
8682         ExternalType of the parameter.
8683
8684         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8685         they were unused.
8686
8687 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8688
8689         * class.cs (MethodData.Define): Do not set the `newslot' on
8690         interface members, if they are also flagged as "override".
8691
8692         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8693         better code for ++i and i++.  This only works for static fields
8694         and local variables.
8695
8696         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8697         want to pull the DeclSpace out of the builder_to_declspace instead
8698         of the TypeBuilder (like in TypeContainer.FindMembers).
8699
8700         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8701         instead of LookupTypeContainer.  Fixes the crash on .NET for
8702         looking up interface members.
8703
8704         * const.cs: Create our own emit context during the Definition
8705         stage, so that constants are evaluated in the proper context, when
8706         a recursive definition happens.
8707
8708 2003-05-11  Martin Baulig  <martin@ximian.com>
8709
8710         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8711         new block for a switch section.
8712         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8713         the adding/lookup in the switch block.  Fixes #39828.
8714
8715 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8716
8717         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8718         functionality: I needed to convert the data after I had performed
8719         the add/sub operation into the operands type size.
8720
8721         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8722         pass the type for the box operation, otherwise the resulting
8723         object would have been of type object.
8724
8725         (BoxedCast): Add constructor to specify the type to box as.
8726
8727 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8728
8729         * iterators.cs: I was reusing the `count' variable inadvertently,
8730         take steps to not allow this to happen.
8731
8732 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8733
8734         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8735         by creating an array at the point where the params starts and
8736         putting all those arguments there, then adjusting the size of the
8737         array.
8738
8739 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8740
8741         * expression.cs (New.AddressOf): Implement interface
8742         IMemoryLocation.  This is used when the `new' operator is used in
8743         the context of an invocation to a method on a value type.
8744
8745         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8746         example. 
8747
8748         * namespace.cs: Also check the using aliases here.
8749
8750         * driver.cs: Move the test for using validity after the types have
8751         been entered, so we do a single pass that also includes the using
8752         aliases. 
8753
8754         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8755         in the regular case.   CreateSiblingForFinally is doing extra
8756         error checking.
8757
8758         * attribute.cs (GetAttributeArgumentExpression): Store the result
8759         on an out value, and use the return value to indicate failure
8760         instead of using null (which is a valid return for Constant.GetValue).
8761
8762         * statement.cs: Perform the analysis flow for the increment
8763         portion after the statement, because this will be the real flow of
8764         execution.  Fixes #42385
8765
8766         * codegen.cs (EmitContext.EmitArgument,
8767         EmitContext.EmitStoreArgument): New helper functions when the
8768         RemapToProxy flag is set.
8769
8770         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8771         function.
8772
8773         Add support for remapping parameters. 
8774
8775         * iterators.cs: Propagate parameter values;  Store parameter
8776         values in the proxy classes.
8777
8778 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8779
8780         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8781         need a proxy reference;  I do not know what I was thinking
8782
8783         * cs-parser.jay (constructor_initializer): catch another error,
8784         and display nice message.
8785
8786         (field_declaration): catch void field declaration
8787         to flag a better error. 
8788
8789         * class.cs (MemberBase.CheckBase): Report an error instead of a
8790         warning if a new protected member is declared in a struct. 
8791         (Field.Define): catch the error of readonly/volatile.
8792
8793         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8794
8795         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8796         volatile variable is taken
8797
8798 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8799
8800         * statement.cs (Fixed.Resolve): Report an error if we are not in
8801         an unsafe context.
8802
8803 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8804
8805         * typemanager.cs: reuse the code that handles type clashes for
8806         delegates and enumerations.
8807
8808         * class.cs (Report28): Always report.
8809
8810         * expression.cs (EncodeAsAttribute): Allow nulls here.
8811
8812 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8813
8814         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8815         the functionality for testing whether an expression is valid for
8816         an attribute here.  Also handle the case of arrays of elements
8817         being stored. 
8818
8819         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8820         encoding a linear array into an array of objects that are suitable
8821         to be passed to an CustomAttributeBuilder.
8822
8823         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8824
8825         * ecore.cs: (FieldExpr): Handle field remapping here.
8826
8827         * iteratators.cs: Pass the instance variable (if the method is an
8828         instance method) to the constructors, so we can access the field
8829         variables on the class.
8830
8831         TODO: Test this with structs.  I think the THIS variable on
8832         structs might have to be a pointer, and not a refenrece
8833
8834 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8835
8836         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8837         local variables to fields in a proxy class.
8838
8839         * iterators.cs (PopulateProxy): Rename our internal fields to
8840         <XXX>.  
8841         Create a <THIS> field if we are an instance method, so we can
8842         reference our parent container variables.
8843         (MapVariable): Called back from the EmitContext code to enter a
8844         new variable to field mapping into the proxy class (we just create
8845         a FieldBuilder).
8846
8847         * expression.cs
8848         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8849         for using the remapped locals to fields.
8850
8851         I placed the code here, because that gives the same semantics to
8852         local variables, and only changes the Emit code.
8853
8854         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8855         statements inside iterators.
8856         (VariableInfo): Add a FieldBuilder for the cases when we are
8857         remapping local variables to fields in a proxy class
8858
8859         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8860         current_block != null.
8861
8862         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8863         not cope with strings, as it has been moved to the
8864         TableSwitchEmit.  Fixed bug in switch generation.
8865
8866         * expression.cs (New.DoResolve): Provide more context for the user
8867         when reporting an error.
8868
8869         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8870         pointers. 
8871
8872         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8873         check the permissions for it.  Note than in a type-resolution
8874         context the check was already present in DeclSpace.ResolveType,
8875         but was missing from the MemberAccess.
8876
8877         (ArrayCreation.CheckIndices): warn if the user has
8878         more nested levels of expressions, but there are no more
8879         dimensions specified.  Avoids crash on bug 41906.
8880
8881 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8882
8883         * statement.cs (Block): replace Implicit bool, for a generic
8884         flags.   
8885         New flag: `Unchecked'.  This is used during the EmitMeta phase
8886         (which is out-of-line with the regular Resolve/Emit process for a
8887         statement, as this is done ahead of time, but still gets a chance
8888         to call constant resolve).
8889
8890         (Block.Flags): new enum for adding a new flag.
8891
8892         (Block.EmitMeta): track the state of unchecked.
8893
8894         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8895         to enable constant resolution to work there as well.
8896
8897 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8898
8899         * typemanager.cs (ienumerable_type): Also look up
8900         System.Collections.IEnumerable. 
8901
8902 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8903
8904         TODO: Test more than one conditional per method.
8905
8906         * class.cs (Indexer.Define): Report the location where the user is
8907         referencing the unsupported feature.
8908
8909         (MethodData): Overload the use of `conditionals' to
8910         minimize the creation of needless ArrayLists.   This saves roughly
8911         212kb on my machine.
8912
8913         (Method): Implement the new IIteratorContainer interface.
8914         (Method.SetYields): Implement the method by setting the ModFlags
8915         to contain METHOD_YIELDS.
8916
8917         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8918         which just got set to null.
8919
8920         * iterators.cs: New file.
8921
8922         (Yield, YieldBreak): New statements.
8923
8924         * statement.cs (Return.Resolve): Flag an error if we are used in
8925         an iterator method.
8926
8927         * codegen.cs (InIterator): New flag set if the code is being
8928         compiled in an iterator method.
8929
8930         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8931         internal modifier, and we just use it to avoid adding extra
8932         fields, as this is seldom used.  
8933
8934         * cs-parser.jay: Add yield_statement (yield and yield break).
8935
8936         * driver.cs: New flag -v2 to turn on version 2 features. 
8937
8938         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8939         hashtable when v2 is enabled.
8940
8941 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8942
8943         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8944         there is already a namespace defined with this name.
8945
8946         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8947         people upgraded their corlibs.
8948
8949         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8950         always use fully qualified types, no need to use the compiler
8951         front end.
8952
8953         (TypeManager.IsNamespace): Use binarysearch.
8954
8955         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8956         AddDelegate): I did not quite use the new IsValid API properly: I
8957         have to pass the short-name and the fullname.  I was passing only
8958         the basename instead of the fullname sometimes. 
8959
8960         (TypeContainer.DefineType): call NamespaceClash.
8961
8962         * interface.cs (Interface.DefineType): use NamespaceClash before
8963         defining the type.
8964
8965         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8966         defining the type.
8967
8968         * enum.cs: (Enum.DefineType): use NamespaceClash before
8969         defining the type.
8970
8971         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8972         speed increase.  First, use the negative_hits cache when we get a
8973         negative.  Second, add the type with its full original name
8974         instead of the new . and + encoded name (reflection uses + to
8975         separate type from a nested type).  Use LookupTypeReflection
8976         directly which bypasses the type->name hashtable (that we already
8977         know does not contain the type.
8978
8979         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8980         location/container type. 
8981
8982         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8983
8984 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8985
8986         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8987
8988         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8989         method is being referenced in the method group from a static
8990         context, and report error 120 if so.
8991
8992         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8993         Error118. 
8994
8995         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8996         is created, we create the A namespace).
8997
8998         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8999         Fixes #41591
9000
9001 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9002
9003         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9004         invocation to ModuleBuilder.GetType with the same values will
9005         return a new type instance, so we need to cache its return
9006         values. 
9007
9008         * expression.cs (Binary.ResolveOperator): Only allow the compare
9009         operators on enums if they are of the same type.
9010
9011         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9012         types of ValueType on their own case.  Before we were giving them
9013         the same treatment as objects.
9014
9015         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9016         fullname.  Short name is used to compare against container name.
9017         Fullname is used to check against defined namespace names.
9018
9019         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9020         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9021
9022         (Method.CheckBase): Call parent.
9023         (MemberBase.CheckBase): Check for protected members on sealed
9024         classes.
9025         (PropertyBase.CheckBase): Call parent.
9026         (Field.Define): Call parent.
9027
9028         * report.cs: Negative error codes are now mapped to 8000 - code,
9029         so that the display is render more nicely.
9030
9031         * typemanager.cs: Do not use try/catch, instead report a regular
9032         error. 
9033
9034         (GetPointerType, GetReferenceType): These methods provide
9035         mechanisms to obtain the T* and T& from a T.  We had the code
9036         previously scattered around the code base, and it also used
9037         TypeManager.LookupType that would go through plenty of caches.
9038         This one goes directly to the type source.
9039
9040         In some places we did the Type.GetType followed by
9041         ModuleBuilder.GetType, but not in others, so this unifies the
9042         processing as well.
9043
9044         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9045         statements now that we have namespace information.
9046
9047         * typemanager.cs (IsNamespace): New method, returns whether the
9048         string presented is a namespace or not.
9049
9050         (ComputeNamespaces): New public entry point, computes the list of
9051         available namespaces, using the GetNamespaces API call in Mono, or
9052         the slower version in MS.NET.   
9053
9054         Now before we start the semantic analysis phase, we have a
9055         complete list of namespaces including everything that the user has
9056         provided.
9057
9058         Deleted old code to cache namespaces in .nsc files.
9059
9060 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9061
9062         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9063         class/struct location definition Location for the implicit
9064         constructor location.
9065
9066         (Operator.Define): Use the location of the operator for the
9067         implicit Method definition.
9068
9069         (Constructor.Emit): use the constructor location for the implicit
9070         base initializer constructor.
9071
9072         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9073         and the Expression class now contains two new methods:
9074
9075         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9076         isolate type lookup from the rest of the resolution process.
9077
9078         Since we use Expressions to hold type definitions due to the way
9079         we parse the input we have historically overloaded Resolve to
9080         perform the Type lookups if a special flag is passed.  Now this is
9081         eliminated and two methods take their place. 
9082
9083         The differences in the two methods between xStep and xTerminal is
9084         that xStep is involved in our current lookup system that uses
9085         SimpleNames to compose a name, while xTerminal is used just to
9086         catch the case where the simplename lookup failed.
9087
9088 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9089
9090         * expression.cs (ResolveMemberAccess): Remove redundant code.
9091         TypeExpr expressions are always born fully resolved.
9092
9093         * interface.cs (PopulateMethod): Do not lookup the types twice.
9094         We were doing it once during SemanticAnalysis and once during
9095         PopulateMethod.
9096
9097         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9098         in local variable type definitions, were being returned as a
9099         SimpleName (we decomposed everything into a string), that is
9100         because primary_expression was being used instead of a type in the
9101         grammar (reduce/reduce conflicts).
9102
9103         The part that was wrong is that we converted the expression into a
9104         string (an oversimplification in one hand, compounded with primary
9105         expressions doing string concatenation).
9106
9107         So things like:
9108
9109         A.B.C [] x;
9110
9111         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9112         using clauses from working on this particular context.  And a type
9113         was being matched directly against "A.B.C[]".
9114
9115         We now use the correct approach, and allow for ComposedCast to be
9116         part of the unary expression.  So the "A.B.C []" become a composed
9117         cast of "A.B.C" (as a nested group of MemberAccess with a
9118         SimpleName at the end) plus the rank composition "[]". 
9119
9120         Also fixes 35567
9121
9122 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9123
9124         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9125         for the access level checking.
9126
9127         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9128         `TypeContainer container', because I kept getting confused when I
9129         was debugging this code.
9130
9131         * expression.cs (Indexers): Instead of tracking getters/setters,
9132         we now track them in parallel.  We create one arraylist less, but
9133         most importantly it is possible now for the LValue code to find a
9134         matching get for a set.
9135
9136         (IndexerAccess.DoResolveLValue): Update the code.
9137         GetIndexersForType has been modified already to extract all the
9138         indexers from a type.  The code assumed it did not.
9139
9140         Also make the code set the correct return type for the indexer.
9141         This was fixed a long time ago for properties, but was missing for
9142         indexers.  It used to be void_type.
9143
9144         (Binary.Emit): Test first for doubles instead of
9145         floats, as they are more common.
9146
9147         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9148         when dealing with floats and the <=, >= operators.  This fixes bug
9149         #39314 
9150
9151         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9152         to load the array value by emitting a load on the foreach variable
9153         type.  This was incorrect.  
9154
9155         We now emit the code to load an element using the the array
9156         variable type, and then we emit the conversion operator.
9157
9158         Fixed #40176
9159
9160 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9161
9162         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9163
9164 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9165
9166         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9167         test for protection before we test for signatures. 
9168
9169         (MethodSignature.ToString): implement.
9170
9171         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9172         to the case where we reduced into a LongConstant.
9173
9174         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9175         depend on whether the information is acurrate, because the
9176         Microsoft runtime will always claim that the array type is public,
9177         regardless of the real state.
9178
9179         If the type is a pointer, another problem happens: the type is
9180         reported as non-public in Microsoft.  
9181
9182         In both cases we have to call CheckAccessLevel recursively with
9183         the underlying type as the argument to be tested.
9184
9185 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9186
9187         * assign.cs (Assign.Emit): If we are dealing with a compound
9188         assignment expression, we should use the code path that stores the
9189         intermediate result in a temporary value.  This fixes #40903.
9190
9191         *expression.cs (Indirection.ToString): Provide ToString method for
9192         debugging. 
9193
9194 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9195
9196         * class.cs: Null out fields holding references to Block objects so
9197         they can be garbage collected.
9198
9199         * expression.cs (OverloadResolve): Remove unused local.
9200
9201 2003-04-07  Martin Baulig  <martin@ximian.com>
9202
9203         * codegen.cs (EmitContext.CurrentFile): New public field.
9204         (EmitContext.Mark): Use the CurrentFile to check whether the
9205         location is in the correct file.
9206         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9207
9208 2003-04-07  Martin Baulig  <martin@ximian.com>
9209
9210         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9211
9212         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9213         location.  [FIXME: The location argument which gets passed to this
9214         method is sometimes wrong!]
9215
9216 2003-04-07  Nick Drochak <ndrochak@gol.com>
9217
9218         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9219
9220 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9221
9222         * expression.cs (Indirection.EmitAssign): We were using the
9223         temporary, but returning immediately instead of continuing the
9224         EmitAssing flow.
9225
9226 2003-04-06  Martin Baulig  <martin@ximian.com>
9227
9228         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9229         if it's a nested child, but also deriving from the outer class.
9230         See test 190.cs.
9231
9232         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9233         nested child, but also deriving from the outer class.  See
9234         test-190.cs.
9235         (FilterWithClosure): We may access private members of the outer
9236         class if we're a nested child and deriving from the outer class.
9237         (RealMemberLookup): Only set `closure_private_ok' if the
9238         `original_bf' contained BindingFlags.NonPublic.
9239
9240 2003-04-05  Martin Baulig  <martin@ximian.com>
9241
9242         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9243         probe if its a type parameter, and if so, flag an error.
9244
9245         * decl.cs: Move here the SetParameterInfo code from class.cs.
9246         Handle IsGeneric here.
9247
9248         Handle a variety of errors in the parameter info definition.
9249
9250         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9251         type parameters here.
9252
9253         * cs-parser.jay (class_declaration): report errors for parameters
9254         here as well.
9255
9256 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9257
9258         * generic.cs: New file, contains support code for generics.
9259
9260         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9261         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9262
9263         Update parser for the above removals.
9264
9265         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9266         now taken care of in the parser.
9267
9268 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9269
9270         * class.cs (Event.Define): Do not allow abstract events to have
9271         initializers. 
9272
9273 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9274
9275         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9276         block in event declarations.
9277
9278         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9279         value type, get its address.
9280
9281         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9282         leaving a class on the stack instead of a boolean value (int
9283         0/1).  Change the code so we compare against null, and then the
9284         result against zero.
9285
9286         * class.cs (TypeContainer.GetClassBases): We were checking for the
9287         parent class being sealed too late.
9288
9289         * expression.cs (Binary.Emit): For <= and >= when dealing with
9290         floating point values, use cgt.un and clt.un instead of cgt and
9291         clt alone.
9292
9293 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9294
9295         * statement.cs: Apply the same optimization as MS: skip the 
9296         GetEnumerator returning an IEnumerator, and use the one returning a 
9297         CharEnumerator instead. This allows us to avoid the try-finally block 
9298         and the boxing.
9299
9300 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9301
9302         * cs-parser.jay: Attributes cannot be applied to
9303                          namespaces. Fixes #40473
9304
9305 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9306
9307         * class.cs:
9308         (Add*): check if the name is valid using the full name for constants,
9309         fields, properties and events.
9310
9311 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9312
9313         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9314         char constants to be part of the enumeration.
9315
9316         * expression.cs (Conditional.DoResolve): Add support for operator
9317         true. Implements the missing functionality from 14.12
9318
9319         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9320         operator true/false as required by the spec.
9321
9322         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9323         implicit conversion to boolean.
9324
9325         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9326         also one where the type implements `operator true'. 
9327
9328         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9329         get an expression that will invoke operator true based on an
9330         expression.  
9331
9332         (GetConversionOperators): Removed the hack that called op_True
9333         here.  
9334
9335         (Expression.ResolveBoolean): Move this from Statement.
9336
9337 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * ecore.cs (FieldExpr): do not allow initialization of initonly
9340         fields on derived classes
9341
9342 2003-03-13  Martin Baulig  <martin@ximian.com>
9343
9344         * statement.cs (Block.Emit): Call ig.BeginScope() and
9345         ig.EndScope() when compiling with debugging info; call
9346         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9347
9348 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9349
9350         * expression.cs (Indexers): Do not construct immediately, allow
9351         for new members to be appended as we go.  Fixes 38143
9352
9353 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9354
9355         * expression.cs: save/restore context when resolving an unchecked
9356         expression.
9357
9358 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9359
9360         * cfold.cs: Catch division by zero in modulus operator during
9361         constant folding.
9362
9363 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * interface.cs (Interface.DefineMembers): Avoid defining members
9366         twice. 
9367
9368 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * driver.cs: handle the +/- options for -noconfig
9371
9372         * statement.cs (Unckeched.Resolve): Also track the state of
9373         unchecked in the Resolve phase.
9374
9375 2003-02-27  Martin Baulig  <martin@ximian.com>
9376
9377         * ecore.cs (Expression.MemberLookup): Don't create a
9378         MethodGroupExpr for something which is not a method.  Fixes #38291.
9379
9380 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9381
9382         * class.cs (MemberBase.CheckParameters): Also check that the type
9383         is unmanaged if it is a pointer.
9384
9385         * expression.cs (SizeOf.Resolve): Add location information.
9386
9387         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9388         a managed type is declared.
9389
9390         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9391         parameter modifiers as well.  Fixes bug 38606
9392
9393         * class.cs: Very sad.  Am backing out the speed up changes
9394         introduced by the ArrayList -> Array in the TypeContainer, as they
9395         were not actually that much faster, and introduced a bug (no error
9396         reports on duplicated methods).
9397
9398         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9399         source first, this will guarantee that we have a valid expression
9400         before calling in lower levels functions that will require a
9401         resolved object.  Then use this original_source in the
9402         target.ResolveLValue instead of the original source that was
9403         passed to us.
9404
9405         Another change.  Use target.Resolve instead of LValueResolve.
9406         Although we are resolving for LValues, we will let the Assign code
9407         take care of that (it will be called again from Resolve).  This
9408         basically allows code like this:
9409
9410         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9411         class Y { void A (X x) { x [0] += o; }
9412
9413         The problem was that the indexer was trying to resolve for
9414         set_Item (idx, object o) and never finding one.  The real set_Item
9415         was set_Item (idx, X).  By delaying the process we get the right
9416         semantics. 
9417
9418         Fixes bug 36505
9419
9420 2003-02-23  Martin Baulig  <martin@ximian.com>
9421
9422         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9423         while calling DoEmit ().
9424
9425         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9426         source files; if you use the #line directive inside a method, the
9427         compiler stops emitting line numbers for the debugger until it
9428         reaches the end of the method or another #line directive which
9429         restores the original file.
9430
9431 2003-02-23  Martin Baulig  <martin@ximian.com>
9432
9433         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9434
9435 2003-02-23  Martin Baulig  <martin@ximian.com>
9436
9437         * statement.cs (Block.AddChildVariableNames): We need to call this
9438         recursively, not just for our immediate children.
9439
9440 2003-02-23  Martin Baulig  <martin@ximian.com>
9441
9442         * class.cs (Event.Define): Always make the field private, like csc does.
9443
9444         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9445         actually work, fixes bug #37521.
9446
9447 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9448
9449         * delegate.cs: When creating the various temporary "Parameters"
9450         classes, make sure that we call the ComputeAndDefineParameterTypes
9451         on those new parameters (just like we do with the formal ones), to
9452         allow them to be resolved in the context of the DeclSpace.
9453
9454         This fixes the bug that Dick observed in Bugzilla #38530.
9455
9456 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9457
9458         * expression.cs (ResolveMemberAccess): When resolving a constant,
9459         do not attempt to pull a constant if the value was not able to
9460         generate a valid constant.
9461
9462         * const.cs (LookupConstantValue): Do not report more errors than required.
9463
9464 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9465
9466         * expression.cs: fixes bug #38328.
9467
9468 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9469
9470         * class.cs: Changed all the various members that can be part of a
9471         class from being an ArrayList to be an Array of the right type.
9472         During the DefineType type_list, interface_list, delegate_list and
9473         enum_list are turned into types, interfaces, delegates and enums
9474         arrays.  
9475
9476         And during the member population, indexer_list, event_list,
9477         constant_list, field_list, instance_constructor_list, method_list,
9478         operator_list and property_list are turned into their real arrays.
9479
9480         Although we could probably perform this operation earlier, for
9481         good error reporting we need to keep the lists and remove the
9482         lists for longer than required.
9483
9484         This optimization was triggered by Paolo profiling the compiler
9485         speed on the output of `gen-sample-program.pl' perl script. 
9486
9487         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9488         not crash in methods like MemberLookupFailed that use this field.  
9489
9490         This problem arises when the compiler fails to resolve a type
9491         during interface type definition for example.
9492
9493 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9494
9495         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9496         inherit from System.Object, so we have to stop at null, not only
9497         when reaching System.Object.
9498
9499 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9500
9501         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9502         DeclaredOnly because the parent indexer might have had a different
9503         name, but did not loop until the top of the hierarchy was reached.
9504
9505         The problem this one fixes is 35492: when a class implemented an
9506         indexer from an interface, we were getting the interface method
9507         (which was abstract) and we were flagging an error (can not invoke
9508         abstract method).
9509
9510         This also keeps bug 33089 functioning, and test-148 functioning.
9511
9512         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9513         out if a method is special is to see if it is declared in a
9514         property or event, or whether it is one of the predefined operator
9515         names.   This should fix correctly #36804.
9516
9517 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9518
9519         The goal here is to remove the dependency on EmptyCast.Peel ().
9520         Killing it completely.
9521
9522         The problem is that currently in a number of places where
9523         constants are expected, we have to "probe" for an EmptyCast, and
9524         Peel, which is not the correct thing to do, as this will be
9525         repetitive and will likely lead to errors. 
9526
9527         The idea is to remove any EmptyCasts that are used in casts that
9528         can be reduced to constants, so we only have to cope with
9529         constants. 
9530
9531         This bug hunt was triggered by Bug 37363 and the desire to remove
9532         the duplicate pattern where we were "peeling" emptycasts to check
9533         whether they were constants.  Now constants will always be
9534         constants.
9535
9536         * ecore.cs: Use an enumconstant here instead of wrapping with
9537         EmptyCast.  
9538
9539         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9540         throwing me off.  By handling this we can get rid of a few hacks.
9541
9542         * statement.cs (Switch): Removed Peel() code.
9543
9544 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9545
9546         * class.cs: Location information for error 508
9547
9548         * expression.cs (New.DoResolve): Add a guard against double
9549         resolution of an expression.  
9550
9551         The New DoResolve might be called twice when initializing field
9552         expressions (see EmitFieldInitializers, the call to
9553         GetInitializerExpression will perform a resolve on the expression,
9554         and later the assign will trigger another resolution
9555
9556         This leads to bugs (#37014)
9557
9558         * delegate.cs: The signature for EndInvoke should contain any ref
9559         or out parameters as well.  We were not doing this in the past. 
9560
9561         * class.cs (Field.Define): Do not overwrite the type definition
9562         inside the `volatile' group.  Turns out that volatile enumerations
9563         were changing the type here to perform a validity test, which
9564         broke conversions. 
9565
9566 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9567
9568         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9569         and structs, we do not want to load the instance variable
9570
9571         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9572         enum_type has to be handled like an object reference (implicit
9573         conversions exists from this to object), but the regular IsClass
9574         and IsValueType tests will never return true for this one.
9575
9576         Also we use TypeManager.IsValueType instead of type.IsValueType,
9577         just for consistency with the rest of the code (this is only
9578         needed if we ever use the construct exposed by test-180.cs inside
9579         corlib, which we dont today).
9580
9581 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9582
9583         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9584         just InternalCall.
9585
9586 2003-02-09  Martin Baulig  <martin@ximian.com>
9587
9588         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9589         (Namespace.DefineNamespaces): New static public method; this is
9590         called when we're compiling with debugging to add all namespaces
9591         to the symbol file.
9592
9593         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9594         pass it to the Namespace's .ctor.
9595
9596         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9597         and MethodBase arguments; pass the namespace ID to the symwriter;
9598         pass the MethodBase instead of the token to the symwriter.
9599         (SymbolWriter.DefineNamespace): New method to add a namespace to
9600         the symbol file.
9601
9602 2003-02-09  Martin Baulig  <martin@ximian.com>
9603
9604         * symbolwriter.cs: New file.  This is a wrapper around
9605         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9606         methods here in near future.
9607
9608 2003-02-09  Martin Baulig  <martin@ximian.com>
9609
9610         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9611         ILGenerator.MarkSequencePoint() which are actually used by the
9612         symbol writer.
9613
9614 2003-02-09  Martin Baulig  <martin@ximian.com>
9615
9616         * location.cs (SourceFile): New public sealed class.  This
9617         contains the name and an index which is used in the location's token.
9618         (Location): Reserve an appropriate number of bits in the token for
9619         the source file instead of walking over that list, this gives us a
9620         really huge performance improvement when compiling with debugging.
9621
9622         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9623         `SourceFile' argument instead of a string.
9624         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9625         but don't parse/tokenize here, we need to generate the list of all
9626         source files before we do that.
9627         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9628         the files.
9629
9630         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9631         instead of a string.
9632
9633         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9634         of a string.
9635
9636 2003-02-09  Martin Baulig  <martin@ximian.com>
9637
9638         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9639         filename on `#line default'.
9640
9641 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9642
9643         * statement.cs: don't clear the pinned var when the fixed statement
9644         returns from the method (fixes bug#37752).
9645
9646 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9647
9648         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9649         to IsValueType.
9650
9651 2003-02-07  Martin Baulig  <martin@ximian.com>
9652
9653         * driver.cs: Removed the `--debug-args' command line argument.
9654
9655         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9656         automatically by the AsssemblyBuilder.
9657         (CodeGen.InitializeSymbolWriter): We don't need to call any
9658         initialization function on the symbol writer anymore.  This method
9659         doesn't take any arguments.
9660
9661 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9662
9663         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9664         from referenced assemblies as well.
9665
9666 2003-02-02  Martin Baulig  <martin@ximian.com>
9667
9668         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9669
9670 2003-02-02  Martin Baulig  <martin@ximian.com>
9671
9672         * class.cs (Constructor.Emit): Open the symbol writer before
9673         emitting the constructor initializer.
9674         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9675         single-stepping through constructor initializers.
9676
9677 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9678
9679         * class.cs: Handle error 549: do not allow virtual methods in
9680         sealed classes. 
9681
9682 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9683
9684         * decl.cs: Check access levels when resolving types
9685
9686 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9687
9688         * statement.cs: Add parameters and locals set in catch blocks that might 
9689         return to set vector
9690
9691 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9692
9693         * class.cs (Operator): Set the SpecialName flags for operators.
9694
9695         * expression.cs (Invocation.DoResolve): Only block calls to
9696         accessors and operators on SpecialName methods.
9697
9698         (Cast.TryReduce): Handle conversions from char constants.
9699
9700
9701 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9702
9703         * statement.cs: small memory and time optimization in FlowBranching.
9704
9705 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9706
9707         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9708         problem that the last fix but in the other sid (Set).
9709
9710         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9711         access when there is no indexer in the hierarchy.
9712
9713 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9714
9715         * class.cs: Combine some if statements.
9716
9717 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9718
9719         * driver.cs: fixed bug #37187.
9720
9721 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9722
9723         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9724         any indexer, it's needed to build a list with all the indexers in the
9725         hierarchy (AllGetters), else we have problems. Fixes #35653.
9726
9727 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9728
9729         * class.cs (MethodData.Define): It is wrong for an interface
9730         implementation to be static in both cases: explicit and implicit.
9731         We were only handling this in one case.
9732
9733         Improve the if situation there to not have negations.
9734
9735         * class.cs (Field.Define): Turns out that we do not need to check
9736         the unsafe bit on field definition, only on usage.  Remove the test.
9737
9738 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9739
9740         * driver.cs: use assembly.Location instead of Codebase (the latest
9741         patch made mcs fail when using MS assemblies).
9742
9743 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9744
9745         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9746         get the path to *corlib.dll.
9747
9748 2003-01-21  Nick Drochak <ndrochak@gol.com>
9749
9750         * cs-tokenizer.cs:
9751         * pending.cs:
9752         * typemanager.cs: Remove compiler warnings
9753
9754 2003-01-20  Duncan Mak  <duncan@ximian.com>
9755
9756         * AssemblyInfo.cs: Bump the version number to 0.19.
9757
9758 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9759
9760         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9761
9762 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9763
9764         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9765
9766 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9767
9768         * cs-parser.jay: Small fix: we were not comparing the constructor
9769         name correctly.   Thanks to Zoltan for the initial pointer.
9770
9771 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9772
9773         * cs-tokenizer.cs: Set file name when specified with #line
9774
9775 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9776
9777         * cs-parser.jay: Only perform the constructor checks here if we
9778         are named like the class;  This will help provider a better
9779         error.  The constructor path is taken when a type definition is
9780         not found, but most likely the user forgot to add the type, so
9781         report that rather than the constructor error.
9782
9783 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9784
9785         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9786         allocations.
9787
9788 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9789
9790         * cs-parser.jay: Add cleanup call.
9791
9792 2003-01-13  Duncan Mak  <duncan@ximian.com>
9793
9794         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9795         consistent with other methods.
9796
9797 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9798
9799         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9800
9801 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9802
9803         * attribute.cs: only set GuidAttr to true when we have a
9804         GuidAttribute.
9805
9806 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9807
9808         * ecore.cs:
9809         * expression.cs:
9810         * typemanager.cs: fixes to allow mcs compile corlib with the new
9811         Type.IsSubclassOf fix.
9812
9813 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9814
9815         * expression.cs (LocalVariableReference.DoResolve): Classify a
9816         constant as a value, not as a variable.   Also, set the type for
9817         the variable.
9818
9819         * cs-parser.jay (fixed_statement): take a type instead of a
9820         pointer_type, so we can produce a better error message later.
9821
9822         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9823         as an error.  
9824
9825         (For.DoEmit): Make inifinite loops have a
9826         non-conditional branch back.
9827
9828         (Fixed.DoEmit): First populate the pinned variables, then emit the
9829         statement, then clear the variables.  Before I was emitting the
9830         code once for each fixed piece.
9831
9832
9833 2003-01-08  Martin Baulig  <martin@ximian.com>
9834
9835         * statement.cs (FlowBranching.MergeChild): A break in a
9836         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9837
9838 2003-01-08  Martin Baulig  <martin@ximian.com>
9839
9840         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9841         lives in the same number space than `param_map'.  Fixes #36154.
9842
9843 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9844
9845         * cs-parser.jay (constructor_declaration): Set the
9846         Constructor.ModFlags before probing for it.  This makes the
9847         compiler report 514, 515 and 132 (the code was there, but got
9848         broken). 
9849
9850         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9851         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9852         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9853
9854 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9855
9856         * enum.cs: create the enum static fields using the enum type.
9857
9858 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9859
9860         * class.cs: don't try to create the ParamBuilder for the return
9861         type if it's not needed (and handle it breaking for the ms runtime
9862         anyway).
9863
9864 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9865
9866         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9867
9868 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9869
9870         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9871         the command.   This showed up while compiling the JANET source
9872         code, which used \r as its only newline separator.
9873
9874 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * class.cs (Method.Define): If we are an operator (because it
9877         reuses our code), then set the SpecialName and HideBySig.  #36128
9878
9879 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9880
9881         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9882         exception, report error 120 `object reference required'.
9883
9884         * driver.cs: Add --pause option, used during to measure the size
9885         of the process as it goes with --timestamp.
9886
9887         * expression.cs (Invocation.DoResolve): Do not allow methods with
9888         SpecialName to be invoked.
9889
9890 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9891
9892         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9893         number before adding it.
9894
9895 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9896
9897         * ecore.cs (StandardImplicitConversion): When in an unsafe
9898         context, we allow conversion between void * to any other pointer
9899         type. This fixes bug #35973.
9900
9901 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9902
9903         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9904         is not thrown when extensionless outputs are used 
9905
9906 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9907
9908         * rootcontext.cs: fixed compilation of corlib.
9909
9910 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9911
9912         * attribute.cs (Attributes.Contains): Add new method.
9913
9914         * class.cs (MethodCore.LabelParameters): if the parameter is an
9915         `out' parameter, check that no attribute `[In]' has been passed.
9916
9917         * enum.cs: Handle the `value__' name in an enumeration.
9918
9919 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9920
9921         * decl.cs: Added special case to allow overrides on "protected
9922         internal" methods
9923
9924 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9925
9926         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9927         since it makes much more sense.
9928
9929         (Attributes.ctor): Don't require a Location parameter.
9930
9931         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9932
9933         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9934         since we already have that information per attribute.
9935
9936         * everywhere : make appropriate changes.
9937
9938         * class.cs (LabelParameters): Write the code which actually
9939         applies attributes to the return type. We can't do this on the MS
9940         .NET runtime so we flag a warning in the case an exception is
9941         thrown.
9942
9943 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * const.cs: Handle implicit null conversions here too.
9946
9947 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9948
9949         * class.cs (MethodCore.LabelParameters): Remove the extra
9950         Type [] parameter since it is completely unnecessary. Instead
9951         pass in the method's attributes so that we can extract
9952         the "return" attribute.
9953
9954 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9955
9956         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9957         of ignoring it and letting the compile continue.
9958
9959         * typemanager.cs (ChangeType): use an extra argument to return an
9960         error condition instead of throwing an exception.
9961
9962 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9963
9964         * expression.cs (Unary.TryReduce): mimic the code for the regular
9965         code path.  Perform an implicit cast in the cases where we can
9966         implicitly convert to one of the integral types, and then reduce
9967         based on that constant.   This fixes bug #35483.
9968
9969 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9970
9971         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9972
9973 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9974
9975         * namespace.cs: fixed bug #35489.
9976
9977 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9978
9979         * class.cs: Remove some dead code.
9980
9981         * cs-parser.jay: Estimate the number of methods needed
9982         (RootContext.MethodCount);
9983
9984         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9985         numbers instead of StringBuilders.
9986
9987         * support.cs (PtrHashtable): Add constructor with initial size;
9988         We can now reduce reallocations of the method table.
9989
9990 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9991
9992         * attribute.cs (ApplyAttributes): Keep track of the emitted
9993         attributes on a per-target basis. This fixes bug #35413.
9994
9995 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9998         default to the Windows 1252 encoding.
9999
10000         (UnixParseOption): Support version, thanks to Alp for the missing
10001         pointer. 
10002
10003         * AssemblyInfo.cs: Add nice assembly information.
10004
10005         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10006         (bug 35169).
10007
10008         * cs-parser.jay: Allow a trailing comma before the close bracked
10009         in the attribute_section production.
10010
10011         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10012         address of the instance was being taken, I will take this out,
10013         because we take the address of the object immediately here.
10014
10015 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10016
10017         * typemanager.cs (AreMultipleAllowed): Take care of the most
10018         obvious case where attribute type is not in the current assembly -
10019         stupid me ;-)
10020
10021 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10022
10023         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10024         definitions, instead of doing that afterwards.  
10025
10026         Also we use a nice little hack, depending on the constructor, we
10027         know if we are a "composed" name or a simple name.  Hence, we
10028         avoid the IndexOf test, and we avoid 
10029
10030         * codegen.cs: Add code to assist in a bug reporter to track down
10031         the source of a compiler crash. 
10032
10033 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10034
10035         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10036         types have been emitted for a given element and flag an error
10037         if something which does not have AllowMultiple set is used more
10038         than once.
10039
10040         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10041         attribute types and their corresponding AllowMultiple properties
10042
10043         (AreMultipleAllowed): Check the property for a given type.
10044
10045         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10046         property in the case we have a TypeContainer.
10047
10048         (Attributes.AddAttribute): Detect duplicates and just skip on
10049         adding them. This trivial fix catches a pretty gross error in our
10050         attribute emission - global attributes were being emitted twice!
10051
10052         Bugzilla bug #33187 is now fixed.
10053
10054 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10055
10056         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10057         instead of pp_and).
10058
10059         * expression.cs (Binary.ResolveOperator): I can only use the
10060         Concat (string, string, string) and Concat (string, string,
10061         string, string) if the child is actually a concatenation of
10062         strings. 
10063
10064 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10065
10066         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10067         context where we need a 2-character lookahead.
10068
10069         * pending.cs (PendingImplementation): Rework so we can keep track
10070         of interface types all the time, and flag those which were
10071         implemented by parents as optional.
10072
10073 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10074
10075         * expression.cs (Binary.ResolveOperator): Use
10076         String.Concat(string,string,string) or
10077         String.Concat(string,string,string,string) when possible. 
10078
10079         * typemanager: More helper methods.
10080
10081
10082 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10083
10084         * pending.cs: remove the bogus return from GetMissingInterfaces()
10085         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10086
10087 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10088
10089         * namespace.cs: avoid duplicated 'using xxx' being added to
10090         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10091         when we get more than one 'using' statement for the same namespace.
10092         Report a CS0105 warning for it.
10093
10094 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10095
10096         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10097         of calling getChar/putback, uses internal knowledge of it.    
10098
10099         (xtoken): Reorder tokenizer so most common patterns are checked
10100         first.  This reduces the compilation time in another 5% (from 8.11s
10101         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10102
10103         The parsing time is 22% of the compilation in mcs, and from that
10104         64% is spent on the tokenization process.  
10105
10106         I tried using a binary search for keywords, but this is slower
10107         than the hashtable.  Another option would be to do a couple of
10108         things:
10109
10110                 * Not use a StringBuilder, instead use an array of chars,
10111                   with a set value.  Notice that this way we could catch
10112                   the 645 error without having to do it *afterwards*.
10113
10114                 * We could write a hand-parser to avoid the hashtable
10115                   compares altogether.
10116
10117         The identifier consumption process takes 37% of the tokenization
10118         time.  Another 15% is spent on is_number.  56% of the time spent
10119         on is_number is spent on Int64.Parse:
10120
10121                 * We could probably choose based on the string length to
10122                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10123                   computations. 
10124
10125         Another 3% is spend on wrapping `xtoken' in the `token' function.
10126
10127         Handle 0xa0 as whitespace (#34752)
10128
10129 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10130
10131         * typemanager.cs (IsCLRType): New routine to tell whether a type
10132         is one of the builtin types.  
10133
10134         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10135         typecode in more places instead of doing pointer comparissions.
10136         We could leverage some knowledge about the way the typecodes are
10137         laid out.
10138
10139         New code to cache namespaces in assemblies, it is currently not
10140         invoked, to be used soon.
10141
10142         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10143
10144         * expression.cs (Binary.ResolveOperator): specially handle
10145         strings, and do not perform user-defined operator overloading for
10146         built-in types.
10147
10148 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10149
10150         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10151         internalcall as it is a pretty simple operation;  Avoid whenever
10152         possible to call Char.IsLetter.
10153
10154         (consume_identifier): Cut by half the number of
10155         hashtable calls by merging the is_keyword and GetKeyword behavior.
10156
10157         Do not short-circuit, because if we do, we
10158         report errors (ie, #if false && true would produce an invalid
10159         directive error);
10160
10161
10162 2002-11-24  Martin Baulig  <martin@ximian.com>
10163
10164         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10165         check constant ranges and report a CS0221.  Fixes #33186.
10166
10167 2002-11-24  Martin Baulig  <martin@ximian.com>
10168
10169         * cs-parser.jay: Make this work for uninitialized variable
10170         declarations in the `for' initializer.  Fixes #32416.
10171
10172 2002-11-24  Martin Baulig  <martin@ximian.com>
10173
10174         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10175         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10176
10177 2002-11-24  Martin Baulig  <martin@ximian.com>
10178
10179         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10180         argument; if true, we also check for user-defined conversions.
10181         This is only needed if both arguments are of a user-defined type.
10182         Fixes #30443, added test-175.cs.
10183         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10184
10185         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10186
10187 2002-11-24  Martin Baulig  <martin@ximian.com>
10188
10189         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10190         function to get the store opcode.
10191         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10192         only emit the Ldelema if the store opcode is Stobj.  You must run
10193         both test-34 and test-167 to test this.  Fixes #34529.
10194
10195 2002-11-23  Martin Baulig  <martin@ximian.com>
10196
10197         * ecore.cs (Expression.MemberLookup): Added additional
10198         `qualifier_type' argument which is used when we're being called
10199         from MemberAccess.DoResolve() and null if we're called from a
10200         SimpleName lookup.
10201         (Expression.MemberLookupFailed): New method to report errors; this
10202         does the CS1540 check and reports the correct error message.
10203
10204         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10205         argument for the CS1540 check and redone the way how we're dealing
10206         with private members.  See the comment in the source code for details.
10207         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10208         `closure_start_type' to `closure_qualifier_type' and check whether
10209         it's not null.  It was not this filter being broken, it was just
10210         being called with the wrong arguments.
10211
10212         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10213         and pass it the correct `qualifier_type'; this also does the error
10214         handling for us.
10215
10216 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10217
10218         * expression.cs (Invocation.EmitParams): If the we are dealing
10219         with a non-built-in value type, load its address as well.
10220
10221         (ArrayCreation): Use a a pretty constant instead
10222         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10223         static initializers.  
10224
10225         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10226         because they are not really value types, just glorified integers. 
10227
10228         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10229
10230         * ecore.cs: Remove redundant code for enumerations, make them use
10231         the same code path as everything else, fixes the casting issue
10232         with enumerations in Windows.Forms.
10233
10234         * attribute.cs: Do only cast to string if it is a string, the
10235         validation happens later.
10236
10237         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10238         people upgrade their corlibs.
10239
10240         * ecore.cs: Oops, enumerations were not following the entire code path
10241
10242 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10243
10244         * typemanager.cs (FilterWithClosure): Commented out the test for
10245         1540 in typemanager.cs, as it has problems when accessing
10246         protected methods from a parent class (see test-174.cs). 
10247
10248         * attribute.cs (Attribute.ValidateGuid): new method.
10249         (Attribute.Resolve): Use above.
10250
10251 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10252
10253         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10254
10255         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10256         handling for enumerations, as we only needed the TypeContainer
10257         functionality to begin with (this is required for the fix below to
10258         work for enums that reference constants in a container class for
10259         example). 
10260
10261         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10262
10263         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10264         a valid TypeBuilder to perform lookups on.o
10265
10266         * class.cs (InheritableMemberSignatureCompare): Use true in the
10267         call to GetGetMethod and GetSetMethod, because we are comparing
10268         the signature, and we need to get the methods *even* if they are
10269         private. 
10270
10271         (PropertyBase.CheckBase): ditto.
10272
10273         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10274         GotoCase.Resolve): Use Peel on EmpytCasts.
10275
10276         * ecore.cs (EmptyCast): drop child, add Peel method.
10277
10278 2002-11-17  Martin Baulig  <martin@ximian.com>
10279
10280         * ecore.cs (EmptyCast.Child): New public property.
10281
10282         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10283         label resolved to an EmptyCast.  Fixes #34162.
10284         (GotoCase.Resolve): Likewise.
10285         (Block.EmitMeta): Likewise.
10286
10287 2002-11-17  Martin Baulig  <martin@ximian.com>
10288
10289         * expression.cs (Invocation.BetterConversion): Prefer int over
10290         uint; short over ushort; long over ulong for integer literals.
10291         Use ImplicitConversionExists instead of StandardConversionExists
10292         since we also need to check for user-defined implicit conversions.
10293         Fixes #34165.  Added test-173.cs.
10294
10295 2002-11-16  Martin Baulig  <martin@ximian.com>
10296
10297         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10298         with the `true' and `false' literals.  Fixes #33151.
10299
10300 2002-11-16  Martin Baulig  <martin@ximian.com>
10301
10302         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10303         October 22nd; don't do the cs1540 check for static members.
10304
10305         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10306         now using our own filter here and doing the cs1540 check again.
10307
10308 2002-11-16  Martin Baulig  <martin@ximian.com>
10309
10310         * support.cs (InternalParameters): Don't crash if we don't have
10311         any fixed parameters.  Fixes #33532.
10312
10313 2002-11-16  Martin Baulig  <martin@ximian.com>
10314
10315         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10316         when looking up static methods to make this work on Windows.
10317         Fixes #33773.
10318
10319 2002-11-16  Martin Baulig  <martin@ximian.com>
10320
10321         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10322         a setter rather than using PropertyInfo.CanWrite.
10323
10324 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10325
10326         * class.cs: Allow acces to block member by subclasses. Fixes build
10327         breaker.
10328
10329 2002-11-14  Martin Baulig  <martin@ximian.com>
10330
10331         * class.cs (Constructor.Emit): Added the extern/block check.
10332         Fixes bug #33678.
10333
10334 2002-11-14  Martin Baulig  <martin@ximian.com>
10335
10336         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10337         iteration while looking for indexers, this is needed because the
10338         indexer may have a different name in our base classes.  Fixed the
10339         error reporting (no indexers at all, not get accessor, no
10340         overloaded match).  Fixes bug #33089.
10341         (IndexerAccess.DoResolveLValue): Likewise.
10342
10343 2002-11-14  Martin Baulig  <martin@ximian.com>
10344
10345         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10346         indexers.  Fixes the first part of bug #33089.
10347         (MethodSignature.InheritableMemberSignatureCompare): Added support
10348         for properties.
10349
10350 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10351
10352         * attribute.cs (Attribute.Resolve): Catch the
10353         NullReferenceException and report it since it isn't supposed to
10354         happen. 
10355
10356 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10357
10358         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10359         LogicalOr and LogicalAnd that can benefit from recursively
10360         handling EmitBranchable.  The code now should be nice for Paolo.
10361
10362 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10365         the Type lookups, as we perform quite a number of lookups on
10366         non-Types.  This can be removed once we can deterministically tell
10367         whether we have a type or a namespace in advance.
10368
10369         But this might require special hacks from our corlib.
10370
10371         * TODO: updated.
10372
10373         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10374         and double which avoids a conversion from an integer to a double.
10375
10376         * expression.cs: tiny optimization, avoid calling IsConstant,
10377         because it effectively performs the lookup twice.
10378
10379 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10380
10381         But a bogus return here to keep the semantics of the old code
10382         until the Mono runtime is fixed.
10383
10384         * pending.cs (GetMissingInterfaces): New method used to remove all
10385         the interfaces that are already implemented by our parent
10386         classes from the list of pending methods. 
10387
10388         * interface.cs: Add checks for calls after ResolveTypeExpr.
10389
10390 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10391
10392         * class.cs (Class.Emit): Report warning 67: event not used if the
10393         warning level is beyond 3.
10394
10395         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10396         being a NullLiteral.
10397
10398         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10399         specifiers. 
10400
10401         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10402         path that might fail if a type can not be resolved.
10403
10404         * expression.cs (Binary.Emit): Emit unsigned versions of the
10405         operators. 
10406
10407         * driver.cs: use error 5.
10408
10409 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10410
10411         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10412
10413 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10414
10415         * cs-parser.jay (switch_section): A beautiful patch from Martin
10416         Baulig that fixed 33094.
10417
10418 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10419
10420         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10421         Check whether the base is abstract and report an error if so.
10422
10423         * expression.cs (IndexerAccess.DoResolveLValue,
10424         IndexerAccess.DoResolve): ditto. 
10425
10426         (Invocation.DoResolve): ditto.
10427
10428         (Invocation.FullMethodDesc): Improve the report string.
10429
10430         * statement.cs (Block): Eliminate IsVariableDefined as it is
10431         basically just a wrapper for GetVariableInfo.
10432
10433         * ecore.cs (SimpleName): Use new 
10434
10435         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10436         type, as we return the actual parameter ref/unref state on a
10437         different call.
10438
10439 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * support.cs: Return proper flags REF/OUT fixing the previous
10442         commit.  
10443
10444         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10445         not used to mean `ref' but `ref or out' in ParameterReference
10446
10447         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10448         full type signature instead of calling TypeManger.CSharpName
10449         ourselves. 
10450
10451         * support.cs (InternalParameters.ParameterDesc): Do not compare
10452         directly to the modflags, because REF/OUT will actually be bitsets
10453         if set. 
10454
10455         * delegate.cs (VerifyMethod): Check also the modifiers.
10456
10457         * cs-tokenizer.cs: Fix bug where floating point values with an
10458         exponent where a sign was missing was ignored.
10459
10460         * driver.cs: Allow multiple assemblies to be specified in a single
10461         /r: argument
10462
10463 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10464
10465         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10466         because identifiers after a parenthesis would end up in this kind
10467         of production, and we needed to desamiguate it for having casts
10468         like:
10469
10470                 (UserDefinedType *) xxx
10471
10472 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10473
10474         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10475         we should set on the Bindingflags.NonPublic, but not turn on
10476         private_ok.  private_ok controls whether a Private member is
10477         returned (this is chekced on the filter routine), while the
10478         BindingFlags.NonPublic just controls whether private/protected
10479         will be allowed.   This fixes the problem part of the problem of
10480         private properties being allowed to be used in derived classes.
10481
10482         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10483         so we can call the children DoResolveLValue method (this will
10484         properly signal errors on lvalue assignments to base properties)
10485
10486         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10487         getter are null, and we have a property info, we know that this
10488         happened because the lookup failed, so we report an error 122 for
10489         protection level violation.
10490
10491         We also silently return if setter and getter are null in the
10492         resolve functions, this condition only happens if we have flagged
10493         the error before.  This is the other half of the problem. 
10494
10495         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10496         not have accessibility information, that is why we were returning
10497         true in the filter function in typemanager.cs.
10498
10499         To properly report 122 (property is inaccessible because of its
10500         protection level) correctly, we report this error in ResolveAccess
10501         by failing if both the setter and the getter are lacking (ie, the
10502         lookup failed). 
10503
10504         DoResolve and DoLResolve have been modified to check for both
10505         setter/getter being null and returning silently, the reason being
10506         that I did not want to put the knowledge about this error in upper
10507         layers, like:
10508
10509         int old = Report.Errors;
10510         x = new PropertyExpr (...);
10511         if (old != Report.Errors)
10512                 return null;
10513         else
10514                 return x;
10515
10516         So the property expr is returned, but it is invalid, so the error
10517         will be flagged during the resolve process. 
10518
10519         * class.cs: Remove InheritablePropertySignatureCompare from the
10520         class, as we no longer depend on the property signature to compute
10521         whether it is possible to implement a method or not.
10522
10523         The reason is that calling PropertyInfo.GetGetMethod will return
10524         null (in .NET, in Mono it works, and we should change this), in
10525         cases where the Get Method does not exist in that particular
10526         class.
10527
10528         So this code:
10529
10530         class X { public virtual int A { get { return 1; } } }
10531         class Y : X { }
10532         class Z : Y { public override int A { get { return 2; } } }
10533
10534         Would fail in Z because the parent (Y) would not have the property
10535         defined.  So we avoid this completely now (because the alternative
10536         fix was ugly and slow), and we now depend exclusively on the
10537         method names.
10538
10539         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10540         reference method, instead of using the property.
10541
10542         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10543         routines are gone now.
10544
10545         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10546         names, they were incorrectly named.
10547
10548         * cs-tokenizer.cs: Return are more gentle token on failure. 
10549
10550         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10551         had an out-of-sync index variable, which caused it to remove from
10552         the list of pending methods the wrong method sometimes.
10553
10554 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10555
10556         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10557         CanWrite, because those refer to this particular instance of the
10558         property, and do not take into account the fact that we can
10559         override single members of a property.
10560
10561         Constructor requires an EmitContext.  The resolution process does
10562         not happen here, but we need to compute the accessors before,
10563         because the resolution does not always happen for properties.
10564
10565         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10566         subclass, before we did not update this flag, but we did update
10567         bindingflags. 
10568
10569         (GetAccessors): Drop this routine, as it did not work in the
10570         presence of partially overwritten set/get methods. 
10571
10572         Notice that this broke the cs1540 detection, but that will require
10573         more thinking. 
10574
10575 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10576
10577         * class.cs:
10578         * codegen.cs:
10579         * driver.cs: issue a warning instead of an error if we don't support
10580         debugging for the platform. Also ignore a couple of errors that may
10581         arise when trying to write the symbols. Undo my previous patch.
10582
10583 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10584
10585         * driver.cs: ignore /debug switch except for Unix platforms.
10586
10587 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10588
10589         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10590
10591 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10592
10593         * driver.cs: Do not make mcs-debug conditional, so we do not break
10594         builds that use it.
10595
10596         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10597         review this patch.  But basically after all the children variables
10598         have been merged, the value of "Breaks" was not being set to
10599         new_breaks for Switch blocks.  I think that it should be set after
10600         it has executed.  Currently I set this to the value of new_breaks,
10601         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10602         conservative, but I do not understand this code very well.
10603
10604         I did not break anything in the build, so that is good ;-)
10605
10606         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10607
10608 2002-10-20  Mark Crichton  <crichton@gimp.org>
10609
10610         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10611
10612 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10613
10614         * cfold.cs: Fixed compile blocker.
10615
10616 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10617
10618         * driver.cs: I was chekcing the key, not the file.
10619
10620 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10621
10622         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10623         message that we were generating - we just need to silently return
10624         a null.
10625
10626 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10627
10628         * class.cs (Event.Define): Change my previous commit, as this
10629         breaks the debugger.  This is a temporary hack, as it seems like
10630         the compiler is generating events incorrectly to begin with.
10631
10632         * expression.cs (Binary.ResolveOperator): Added support for 
10633         "U operator - (E x, E y)"
10634
10635         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10636         y)".
10637
10638         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10639         init-only variables, but this path did not take into account that
10640         there might be also instance readonly variables.  Correct this
10641         problem. 
10642
10643         This fixes bug 32253
10644
10645         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10646         delegates as well.
10647
10648         * driver.cs: Change the extension for modules to `netmodule'
10649
10650         * cs-parser.jay: Improved slightly the location tracking for
10651         the debugger symbols.
10652
10653         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10654         modifiers that were specified instead of the hardcoded value
10655         (FamAndAssem).  This was basically ignoring the static modifier,
10656         and others.  Fixes 32429.
10657
10658         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10659         fixed a bug in the process (32476)
10660
10661         * expression.cs (ArrayAccess.EmitAssign): Patch from
10662         hwang_rob@yahoo.ca that fixes bug 31834.3
10663
10664 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10665
10666         * driver.cs: Make the module extension .netmodule.
10667
10668 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10669
10670         * driver.cs: Report an error if the resource file is not found
10671         instead of crashing.
10672
10673         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10674         false, like Emit does.
10675
10676 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10677
10678         * typemanager.cs: Remove unused private member.  Also reported mcs
10679         bug to report this as a warning like csc.
10680
10681 2002-10-15  Martin Baulig  <martin@gnome.org>
10682
10683         * statement.cs (Statement.Emit): Made this a virtual method; emits
10684         the line number info and calls DoEmit().
10685         (Statement.DoEmit): New protected abstract method, formerly knows
10686         as Statement.Emit().
10687
10688         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10689
10690 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10691
10692         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10693         have fixed a remaining problem: not every AddXXXX was adding a
10694         fully qualified name.  
10695
10696         Now everyone registers a fully qualified name in the DeclSpace as
10697         being defined instead of the partial name.  
10698
10699         Downsides: we are slower than we need to be due to the excess
10700         copies and the names being registered this way.  
10701
10702         The reason for this is that we currently depend (on the corlib
10703         bootstrap for instance) that types are fully qualified, because
10704         we dump all the types in the namespace, and we should really have
10705         types inserted into the proper namespace, so we can only store the
10706         basenames in the defined_names array.
10707
10708 2002-10-10  Martin Baulig  <martin@gnome.org>
10709
10710         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10711         from bug #31834, see the bug report for a testcase which is
10712         miscompiled.
10713
10714 2002-10-10  Martin Baulig  <martin@gnome.org>
10715
10716         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10717         flow analysis code for this.
10718
10719         * statement.cs (Do, While, For): Tell the flow analysis code about
10720         infinite loops.
10721         (FlowBranching.UsageVector): Added support for infinite loops.
10722         (Block.Resolve): Moved the dead code elimination here and use flow
10723         analysis to do it.
10724
10725 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10726
10727         * class.cs (Field.Define): Catch cycles on struct type
10728         definitions. 
10729
10730         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10731         fields if the fields are static.  We only need to check instance
10732         fields. 
10733
10734         * expression.cs (As.DoResolve): Test for reference type.
10735
10736         * statement.cs (Using.ResolveExpression): Use
10737         ConvertImplicitRequired, not ConvertImplicit which reports an
10738         error on failture
10739         (Using.ResolveLocalVariableDecls): ditto.
10740
10741         * expression.cs (Binary.ResolveOperator): Report errors in a few
10742         places where we had to.
10743
10744         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10745
10746 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10747
10748         * expression.cs: Use StoreFromPtr instead of extracting the type
10749         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10750
10751         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10752         an enumeration value to a System.Enum, but System.Enum is not a
10753         value type, but an class type, so we need to box.
10754
10755         (Expression.ConvertExplicit): One codepath could return
10756         errors but not flag them.  Fix this.  Fixes #31853
10757
10758         * parameter.cs (Resolve): Do not allow void as a parameter type.
10759
10760 2002-10-06  Martin Baulig  <martin@gnome.org>
10761
10762         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10763         if it's a class type and not a struct.  Fixes #31815.
10764
10765 2002-10-06  Martin Baulig  <martin@gnome.org>
10766
10767         * statement.cs: Reworked the flow analysis code a bit to make it
10768         usable for dead code elimination.
10769
10770 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10771
10772         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10773
10774 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10777         to fix the test 165, will investigate deeper.
10778
10779 2002-10-04  Martin Baulig  <martin@gnome.org>
10780
10781         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10782         finally blocks actually work.
10783         (Try.Resolve): We don't need to create a sibling for `finally' if
10784         there is no finally block.
10785
10786 2002-10-04  Martin Baulig  <martin@gnome.org>
10787
10788         * class.cs (Constructor.Define): The default accessibility for a
10789         non-default constructor is private, not public.
10790
10791 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10792
10793         * class.cs (Constructor): Make AllowedModifiers public, add
10794         EXTERN.
10795
10796         * cs-parser.jay: Perform the modifiers test here, as the
10797         constructor for the Constructor class usually receives a zero
10798         because of the way we create it (first we create, later we
10799         customize, and we were never checking the modifiers).
10800
10801         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10802         is a version of LookupTypeReflection that includes the type-name
10803         cache.  This can be used as a fast path for functions that know
10804         the fully qualified name and are only calling into *.GetType() to
10805         obtain a composed type.
10806
10807         This is also used by TypeManager.LookupType during its type
10808         composition.
10809
10810         (LookupType): We now also track the real type name, as sometimes
10811         we can get a quey for the real type name from things like
10812         ComposedCast.  This fixes bug 31422.
10813
10814         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10815         complete type fullname, it does not have to go through the type
10816         resolution system to obtain the composed version of the type (for
10817         obtaining arrays or pointers).
10818
10819         (Conditional.Emit): Use the EmitBoolExpression to
10820         generate nicer code, as requested by Paolo.
10821
10822         (ArrayCreation.CheckIndices): Use the patch from
10823         hwang_rob@yahoo.ca to validate the array initializers. 
10824
10825 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10826
10827         * class.cs (ConstructorInitializer.Emit): simplify code by using
10828         Invocation.EmitCall, and at the same time, fix the bugs in calling
10829         parent constructors that took variable arguments. 
10830
10831         * ecore.cs (Expression.ConvertNumericExplicit,
10832         Expression.ImplicitNumericConversion): Remove the code that
10833         manually wrapped decimal (InternalTypeConstructor call is now gone
10834         as well).
10835
10836         * expression.cs (Cast.TryReduce): Also handle decimal types when
10837         trying to perform a constant fold on the type.
10838
10839         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10840
10841         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10842         that only turned off an error report, and did nothing else. 
10843
10844 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10845
10846         * driver.cs: Handle and ignore /fullpaths
10847
10848 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10849
10850         * expression.cs (Binary.ResolveOperator): Catch the case where
10851         DoNumericPromotions returns true, 
10852
10853         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10854
10855 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10858         report error 70.
10859
10860 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10861
10862         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10863         conversion exists, but it is also required that the conversion be
10864         performed.  This manifested in "(Type64Enum) 2".  
10865
10866         * class.cs (TypeManager.AddMethod): The fix is not to change
10867         AddEnum, because that one was using a fully qualified name (every
10868         DeclSpace derivative does), but to change the AddMethod routine
10869         that was using an un-namespaced name.  This now correctly reports
10870         the duplicated name.
10871
10872         Revert patch until I can properly fix it.  The issue
10873         is that we have a shared Type space across all namespaces
10874         currently, which is wrong.
10875
10876         Options include making the Namespace a DeclSpace, and merge
10877         current_namespace/current_container in the parser.
10878
10879 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10880
10881         * cs-parser.jay: Improve error reporting when we get a different
10882         kind of expression in local_variable_type and
10883         local_variable_pointer_type. 
10884
10885         Propagate this to avoid missleading errors being reported.
10886
10887         * ecore.cs (ImplicitReferenceConversion): treat
10888         TypeManager.value_type as a target just like object_type.   As
10889         code like this:
10890
10891         ValueType v = 1;
10892
10893         Is valid, and needs to result in the int 1 being boxed before it
10894         is assigned to the value type v.
10895
10896         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10897         to validate the enumeration name.
10898
10899         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10900         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10901         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10902
10903         * ecore.cs (TryImplicitIntConversion): When doing an
10904         implicit-enumeration-conversion, check if the type is 64-bits and
10905         perform a conversion before passing to EnumConstant.
10906
10907 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10908
10909         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10910         report ambiguous type references.  Unlike the MS version, we
10911         report what the ambiguity is.   Innovation at work ;-)
10912
10913         (DeclSpace.FindType): Require a location argument to
10914         display when we display an ambiguous error.
10915
10916         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10917
10918         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10919
10920         * expression.cs (EmitDynamicInitializers): Apply patch from
10921         hwang_rob@yahoo.ca that fixes the order in which we emit our
10922         initializers. 
10923
10924 2002-09-21  Martin Baulig  <martin@gnome.org>
10925
10926         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10927         delegate takes no arguments.
10928
10929 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10930
10931         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10932         from integers.
10933
10934         * expression.cs: Extract the underlying type.
10935
10936         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10937
10938         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10939
10940 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10941
10942         * class.cs (TypeContainer.DefineType): We can not use the nice
10943         PackingSize with the size set to 1 DefineType method, because it
10944         will not allow us to define the interfaces that the struct
10945         implements.
10946
10947         This completes the fixing of bug 27287
10948
10949         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10950         means also structs.  This fixes part of the problem. 
10951         (Expresion.ImplicitReferenceConversionExists): ditto.
10952
10953         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10954         error if there were no errors reported during the type lookup
10955         process, to avoid duplicates or redundant errors.  Without this
10956         you would get an ambiguous errors plus a type not found.  We have
10957         beaten the user enough with the first error.  
10958
10959         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10960         reference. 
10961
10962         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10963         during the resolution process, stop the lookup, this avoids
10964         repeated error reports (same error twice).
10965
10966         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10967
10968         * typemanager.cs (LookupType): Redo the type lookup code to match
10969         the needs of System.Reflection.  
10970
10971         The issue is that System.Reflection requires references to nested
10972         types to begin with a "+" sign instead of a dot.  So toplevel
10973         types look like: "NameSpace.TopLevelClass", and nested ones look
10974         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10975         levels. 
10976
10977 2002-09-19  Martin Baulig  <martin@gnome.org>
10978
10979         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10980         says that a method always returns or always throws an exception,
10981         don't report the CS0161.
10982
10983         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10984         set `Returns = new_returns'.
10985
10986 2002-09-19  Martin Baulig  <martin@gnome.org>
10987
10988         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10989         to an enum constant, check for a CS0176.
10990
10991 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10994         for operators that must be in pairs and report errors.
10995
10996         * ecore.cs (SimpleName.DoResolveType): During the initial type
10997         resolution process, when we define types recursively, we must
10998         check first for types in our current scope before we perform
10999         lookups in the enclosing scopes.
11000
11001         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11002
11003         (Invocation.VerifyArgumentsCompat): Call
11004         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11005         I thought we were supposed to always call this, but there are a
11006         few places in the code where we dont do it.
11007
11008 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11009
11010         * driver.cs: Add support in -linkres and -resource to specify the
11011         name of the identifier.
11012
11013 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11014
11015         * ecore.cs (StandardConversionExists): Sync with the conversion
11016         code: allow anything-* to void* conversions.
11017
11018         (FindMostSpecificSource): Use an Expression argument
11019         instead of a Type, because we might be handed over a Literal which
11020         gets a few more implicit conversions that plain types do not.  So
11021         this information was being lost.
11022
11023         Also, we drop the temporary type-holder expression when not
11024         required.
11025
11026 2002-09-17  Martin Baulig  <martin@gnome.org>
11027
11028         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11029         this is an explicit interface implementation.
11030
11031 2002-09-17  Martin Baulig  <martin@gnome.org>
11032
11033         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11034         different `IndexerName' attributes.
11035
11036         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11037         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11038         virtual CommonResolve().
11039
11040 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11041
11042         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11043         and convert that to the UnderlyingType.
11044
11045         * statement.cs (Foreach.Resolve): Indexers are just like variables
11046         or PropertyAccesses.
11047
11048         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11049         inside quoted strings, we were not doing this before.
11050
11051 2002-09-16  Martin Baulig  <martin@gnome.org>
11052
11053         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11054         resolve it.  This is needed for the definite assignment check of the
11055         instance expression, fixes bug #29846.
11056         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11057
11058 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11059
11060         * parameter.cs: Fix compile error.  Cannot reference static member
11061         from an instance object.  Is this an mcs bug?
11062
11063 2002-09-14  Martin Baulig  <martin@gnome.org>
11064
11065         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11066         multiple times.  Fixes bug #30295, added test-166.cs.
11067
11068 2002-09-14  Martin Baulig  <martin@gnome.org>
11069
11070         * statement.cs (Block.Emit): Don't emit unreachable code.
11071         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11072         `break' statements.
11073         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11074
11075 2002-09-14  Martin Baulig  <martin@gnome.org>
11076
11077         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11078         is set.
11079
11080 2002-09-14  Martin Baulig  <martin@gnome.org>
11081
11082         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11083         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11084         be false on the ms runtime.
11085
11086 2002-09-13  Martin Baulig  <martin@gnome.org>
11087
11088         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11089         the CS0038 error message.
11090
11091 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11092
11093         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11094         constant inside, return it.
11095
11096 2002-09-12  Martin Baulig  <martin@gnome.org>
11097
11098         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11099         implicit conversion can be done between enum types.
11100
11101         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11102         check whether an implicit conversion to the current enum's UnderlyingType
11103         exists and report an error if not.
11104
11105         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11106         without debugging support.
11107
11108         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11109         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11110
11111 2002-09-12  Martin Baulig  <martin@gnome.org>
11112
11113         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11114
11115         * ecore.cs (IMemberExpr.DeclaringType): New property.
11116         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11117         nonstatic member of an outer type (CS0038).
11118
11119 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11120
11121         * driver.cs: Activate the using-error detector at warning level
11122         4 (at least for MS-compatible APIs).
11123
11124         * namespace.cs (VerifyUsing): Small buglett fix.
11125
11126         * pending.cs (PendingImplementation): pass the container pointer. 
11127
11128         * interface.cs (GetMethods): Allow for recursive definition.  Long
11129         term, I would like to move every type to support recursive
11130         definitions, not the current ordering mechanism that we have right
11131         now.
11132
11133         The situation is this: Attributes are handled before interfaces,
11134         so we can apply attributes to interfaces.  But some attributes
11135         implement interfaces, we will now handle the simple cases
11136         (recursive definitions will just get an error).  
11137
11138         * parameter.cs: Only invalidate types at the end if we fail to
11139         lookup all types.  
11140
11141 2002-09-09  Martin Baulig  <martin@gnome.org>
11142
11143         * ecore.cs (PropertyExpr.Emit): Also check for
11144         TypeManager.system_int_array_get_length so this'll also work when
11145         compiling corlib.  Fixes #30003.
11146
11147 2002-09-09  Martin Baulig  <martin@gnome.org>
11148
11149         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11150         and throw an exception if we can't get the type's size.  Fixed #30040,
11151         added test-165.cs.
11152
11153 2002-09-09  Martin Baulig  <martin@gnome.org>
11154
11155         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11156
11157         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11158         context.  Fixes bug #30027.
11159
11160         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11161         virtual functions.  Fixes bug #30043, added test-164.cs.
11162
11163 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11164
11165         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11166
11167 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11168
11169         * driver.cs: Use an object to get the windows codepage since it's not a
11170         static property.
11171
11172 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11173
11174         * statement.cs (For.Emit): for infinite loops (test == null)
11175         return whether there is a break inside, not always "true".
11176
11177         * namespace.cs (UsingEntry): New struct to hold the name of the
11178         using definition, the location where it is defined, and whether it
11179         has been used in a successful type lookup.
11180
11181         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11182         strings.
11183
11184         * decl.cs: ditto.
11185
11186 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11187
11188         * attribute.cs : Fix incorrect code which relied on catching
11189         a NullReferenceException to detect a null being passed in
11190         where an object was expected.
11191
11192 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11193
11194         * statement.cs (Try): flag the catch variable as assigned
11195
11196         * expression.cs (Cast): Simplified by using ResolveType instead of
11197         manually resolving.
11198
11199         * statement.cs (Catch): Fix bug by using ResolveType.
11200
11201 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11202
11203         * expression.cs (BetterConversion): Special case for when we have
11204         a NullLiteral as the argument and we have to choose between string
11205         and object types - we choose string the way csc does.
11206
11207         * attribute.cs (Attribute.Resolve): Catch the
11208         NullReferenceException and report error #182 since the Mono
11209         runtime no more has the bug and having this exception raised means
11210         we tried to select a constructor which takes an object and is
11211         passed a null.
11212
11213 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11214
11215         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11216         message (1502, 1503) when we can't locate a method after overload
11217         resolution. This is much more informative and closes the bug
11218         Miguel reported.
11219
11220         * interface.cs (PopulateMethod): Return if there are no argument
11221         types. Fixes a NullReferenceException bug.
11222
11223         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11224         expressions too. Previously we were checking only in one place for
11225         positional arguments leaving out named arguments.
11226
11227         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11228         type to the enum type is not allowed. Remove code corresponding to
11229         that.
11230
11231         (ConvertNumericExplicit): Allow explicit conversions from
11232         the underlying type to enum type. This precisely follows the spec
11233         and closes a bug filed by Gonzalo.
11234
11235 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11236
11237         * compiler.csproj:
11238         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11239
11240 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11241
11242         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11243         it was important that we stored the right value after the
11244         reduction in `converted'.
11245
11246 2002-09-04  Martin Baulig  <martin@gnome.org>
11247
11248         * location.cs (Location.SymbolDocument): Use full pathnames for the
11249         source files.
11250
11251 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11254         of the expression resolve mechanism, because that will catch the
11255         SimpleName error failures.
11256
11257         (Conditional): If we can not resolve the
11258         expression, return, do not crash.
11259
11260 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11261
11262         * cs-tokenizer.cs:
11263         (location): display token name instead of its number.
11264
11265 2002-08-28  Martin Baulig  <martin@gnome.org>
11266
11267         * expression.cs (Binary.ResolveOperator): Don't silently return
11268         but return an error if an operator cannot be applied between two
11269         enum types.
11270
11271 2002-08-28  Martin Baulig  <martin@gnome.org>
11272
11273         * class.cs (Constructor.Define): Set the permission attributes
11274         correctly instead of making all constructors public.
11275
11276 2002-08-28  Martin Baulig  <martin@gnome.org>
11277
11278         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11279         for private members before reporting a CS0103; if we find anything,
11280         it's a CS0122.
11281
11282 2002-08-28  Martin Baulig  <martin@gnome.org>
11283
11284         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11285         to check whether `closure_start_type == closure_invocation_type',
11286         we also need to check whether `m.DeclaringType == closure_invocation_type'
11287         before bypassing the permission checks.  We might be accessing
11288         protected/private members from the base class.
11289         (TypeManager.RealMemberLookup): Only set private_ok if private
11290         members were requested via BindingFlags.NonPublic.
11291
11292         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11293
11294         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11295         MethodGroupExpr.IsExplicitImpl if appropriate.
11296         (Invocation.DoResolve): Don't report the CS0120 for explicit
11297         interface implementations.
11298
11299 2002-08-27  Martin Baulig  <martin@gnome.org>
11300
11301         * expression.cs (Invocation.DoResolve): If this is a static
11302         method and we don't have an InstanceExpression, we must report
11303         a CS0120.
11304
11305 2002-08-25  Martin Baulig  <martin@gnome.org>
11306
11307         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11308         `==' between a valuetype and an object.
11309
11310 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * ecore.cs (TypeExpr): Provide a ToString method.
11313
11314 2002-08-24  Martin Baulig  <martin@gnome.org>
11315
11316         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11317         now called proggie.dbg and it's a binary file.
11318
11319 2002-08-23  Martin Baulig  <martin@gnome.org>
11320
11321         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11322
11323 2002-08-23  Martin Baulig  <martin@gnome.org>
11324
11325         * struct.cs (MyStructInfo.ctor): Make this work with empty
11326         structs; it's not allowed to use foreach() on null.
11327
11328 2002-08-23  Martin Baulig  <martin@gnome.org>
11329
11330         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11331         writer the full pathname of the generated assembly.
11332
11333 2002-08-23  Martin Baulig  <martin@gnome.org>
11334
11335         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11336         A `finally' block never returns or breaks; improved handling of
11337         unreachable code.
11338
11339 2002-08-23  Martin Baulig  <martin@gnome.org>
11340
11341         * statement.cs (Throw.Resolve): Allow `throw null'.
11342
11343 2002-08-23  Martin Baulig  <martin@gnome.org>
11344
11345         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11346         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11347         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11348         MemberLookup would return a wrong event if this is an explicit
11349         interface implementation and the class has an event with the same
11350         name.
11351
11352 2002-08-23  Martin Baulig  <martin@gnome.org>
11353
11354         * statement.cs (Block.AddChildVariableNames): New public method.
11355         (Block.AddChildVariableName): Likewise.
11356         (Block.IsVariableNameUsedInChildBlock): Likewise.
11357         (Block.AddVariable): Check whether a variable name has already
11358         been used in a child block.
11359
11360         * cs-parser.jay (declare_local_variables): Mark all variable names
11361         from the current block as being used in a child block in the
11362         implicit block.
11363
11364 2002-08-23  Martin Baulig  <martin@gnome.org>
11365
11366         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11367         find the symbol writer.
11368
11369         * driver.cs: csc also allows the arguments to /define being
11370         separated by commas, not only by semicolons.
11371
11372 2002-08-23  Martin Baulig  <martin@gnome.org>
11373
11374         * interface.cs (Interface.GetMembers): Added static check for events.
11375
11376 2002-08-15  Martin Baulig  <martin@gnome.org>
11377
11378         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11379         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11380
11381         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11382         why the MethodData.EmitDestructor() change was necessary.
11383
11384 2002-08-20  Martin Baulig  <martin@gnome.org>
11385
11386         * class.cs (TypeContainer.FindMembers): Added static check for events.
11387
11388         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11389
11390         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11391         use Type.GetEvents(), not Type.FindMembers().
11392
11393 2002-08-20  Martin Baulig  <martin@gnome.org>
11394
11395         * decl.cs (MemberCache): Added a special method cache which will
11396         be used for method-only searched.  This ensures that a method
11397         search will return a MethodInfo with the correct ReflectedType for
11398         inherited methods.      
11399
11400 2002-08-20  Martin Baulig  <martin@gnome.org>
11401
11402         * decl.cs (DeclSpace.FindMembers): Made this public.
11403
11404 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11405
11406         * delegate.cs: fixed build on windows.
11407         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11408
11409 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11410
11411         * ecore.cs (StandardConversionExists): Return a false
11412         if we are trying to convert the void type to anything else
11413         since that is not allowed.
11414
11415         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11416         we flag error 70 in the event an event is trying to be accessed
11417         directly from outside the declaring type.
11418
11419 2002-08-20  Martin Baulig  <martin@gnome.org>
11420
11421         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11422         MemberCache from typemanager.cs to decl.cs.
11423
11424 2002-08-19  Martin Baulig  <martin@gnome.org>
11425
11426         * class.cs (TypeContainer): Implement IMemberContainer.
11427         (TypeContainer.DefineMembers): Create the MemberCache.
11428         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11429         return public members if BindingFlags.Public was given, check
11430         whether members are static.
11431
11432 2002-08-16  Martin Baulig  <martin@gnome.org>
11433
11434         * decl.cs (DeclSpace.Define): Splitted this in Define and
11435         DefineMembers.  DefineMembers is called first and initializes the
11436         MemberCache.
11437
11438         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11439         DefineMembers() on all our DeclSpaces.
11440
11441         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11442         but call DefineMembers() on all nested interfaces.  We call their
11443         Define() in our new Define() function.
11444
11445         * interface.cs (Interface): Implement IMemberContainer.
11446         (Interface.Define): Moved all code except the attribute stuf to
11447         DefineMembers().
11448         (Interface.DefineMembers): Initialize the member cache.
11449
11450         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11451         need this anymore since we can use MemberCache.FindMembers directly.
11452
11453 2002-08-19  Martin Baulig  <martin@gnome.org>
11454
11455         * typemanager.cs (MemberCache): When creating the cache for an
11456         interface type, add all inherited members.
11457         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11458         to `out bool used_cache' and documented it.
11459         (TypeManager.MemberLookup): If we already used the cache in the first
11460         iteration, we don't need to do the interfaces check.
11461
11462 2002-08-19  Martin Baulig  <martin@gnome.org>
11463
11464         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11465         here from IMemberFinder and don't implement this interface anymore.
11466         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11467
11468         * typemanager.cs (IMemberFinder): This interface is now only used by
11469         classes which actually support the member cache.
11470         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11471         since we only put DeclSpaces into this Hashtable.
11472         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11473         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11474
11475 2002-08-16  Martin Baulig  <martin@gnome.org>
11476
11477         * typemanager.cs (ICachingMemberFinder): Removed.
11478         (IMemberFinder.MemberCache): New property.
11479         (TypeManager.FindMembers): Merged this with RealFindMembers().
11480         This function will never be called from TypeManager.MemberLookup()
11481         so we can't use the cache here, just the IMemberFinder.
11482         (TypeManager.MemberLookup_FindMembers): Check whether the
11483         IMemberFinder has a MemberCache and call the cache's FindMembers
11484         function.
11485         (MemberCache): Rewrote larger parts of this yet another time and
11486         cleaned it up a bit.
11487
11488 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11489
11490         * driver.cs (LoadArgs): Support quoting.
11491
11492         (Usage): Show the CSC-like command line arguments.
11493
11494         Improved a few error messages.
11495
11496 2002-08-15  Martin Baulig  <martin@gnome.org>
11497
11498         * typemanager.cs (IMemberContainer.Type): New property.
11499         (IMemberContainer.IsInterface): New property.
11500
11501         The following changes are conditional to BROKEN_RUNTIME, which is
11502         defined at the top of the file.
11503
11504         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11505         class'es members, but add all members from TypeHandle.ObjectType
11506         if we're an interface.
11507         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11508         is the current type.
11509         (MemberCache.CacheEntry.Container): Removed this field.
11510         (TypeHandle.GetMembers): Include inherited members.
11511
11512 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11513
11514         * typemanager.cs: fixed compilation and added a comment on a field that
11515         is never used.
11516
11517 2002-08-15  Martin Baulig  <martin@gnome.org>
11518
11519         * class.cs (ConstructorInitializer.Resolve): In the
11520         Expression.MemberLookup call, use the queried_type as
11521         invocation_type.
11522
11523         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11524         declared' attribute, it's always true.
11525         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11526         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11527         temporary wrapper for FindMembers which tells MemberLookup whether
11528         members from the base classes are included in the return value.
11529         This will go away soon.
11530         (TypeManager.MemberLookup): Use this temporary hack here; once the
11531         new MemberCache is completed, we don't need to do the DeclaredOnly
11532         looping here anymore since the MemberCache will take care of this.
11533         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11534         (MemberCache): When creating the MemberCache for a class, get
11535         members from the current class and all its base classes.
11536         (MemberCache.CacheEntry.Container): New field.  This is a
11537         temporary hack until the Mono runtime is fixed to distinguish
11538         between ReflectedType and DeclaringType.  It allows us to use MCS
11539         with both the MS runtime and the unfixed Mono runtime without
11540         problems and without accecting performance.
11541         (MemberCache.SearchMembers): The DeclaredOnly looping from
11542         TypeManager.MemberLookup is now done here.      
11543
11544 2002-08-14  Martin Baulig  <martin@gnome.org>
11545
11546         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11547         Type.GetFields on dynamic types but get the fields from the
11548         corresponding TypeContainer.
11549         (MyStructInfo.GetStructInfo): Added check for enum types.
11550
11551         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11552         (MemberList.SyncRoot): Implemented.
11553         (TypeManager.FilterWithClosure): No need to check permissions if
11554         closure_start_type == closure_invocation_type, don't crash if
11555         closure_invocation_type is null.
11556
11557 2002-08-13  Martin Baulig  <martin@gnome.org>
11558
11559         Rewrote TypeContainer.FindMembers to use a member cache.  This
11560         gives us a speed increase of about 35% for the self-hosting MCS
11561         build and of about 15-20% for the class libs (both on GNU/Linux).
11562
11563         * report.cs (Timer): New class to get enhanced profiling.  This
11564         whole class is "TIMER" conditional since it remarkably slows down
11565         compilation speed.
11566
11567         * class.cs (MemberList): New class.  This is an IList wrapper
11568         which we're now using instead of passing MemberInfo[]'s around to
11569         avoid copying this array unnecessarily.
11570         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11571         (ICachingMemberFinder, IMemberContainer): New interface.
11572         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11573         has already been checked, otherwise use it for the name comparision.
11574         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11575         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11576         if possible.  Returns a MemberList, not a MemberInfo [].
11577         (TypeHandle): New class, implements IMemberContainer.  We create
11578         one instance of this class per type, it contains a MemberCache
11579         which is used to do the member lookups.
11580         (MemberCache): New class.  Each instance of this class contains
11581         all members of a type and a name-based hash table.
11582         (MemberCache.FindMembers): This is our new member lookup
11583         function.  First, it looks up all members of the requested name in
11584         the hash table.  Then, it walks this list and sorts out all
11585         applicable members and returns them.
11586
11587 2002-08-13  Martin Baulig  <martin@gnome.org>
11588
11589         In addition to a nice code cleanup, this gives us a performance
11590         increase of about 1.4% on GNU/Linux - not much, but it's already
11591         half a second for the self-hosting MCS compilation.
11592
11593         * typemanager.cs (IMemberFinder): New interface.  It is used by
11594         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11595         Enum, Delegate or Interface.
11596         (TypeManager.finder_to_member_finder): New PtrHashtable.
11597         (TypeManager.finder_to_container): Removed.
11598         (TypeManager.finder_to_delegate): Removed.
11599         (TypeManager.finder_to_interface): Removed.
11600         (TypeManager.finder_to_enum): Removed.
11601
11602         * interface.cs (Interface): Implement IMemberFinder.
11603
11604         * delegate.cs (Delegate): Implement IMemberFinder.
11605
11606         * enum.cs (Enum): Implement IMemberFinder.
11607
11608         * class.cs (TypeContainer): Implement IMemberFinder.
11609
11610 2002-08-12  Martin Baulig  <martin@gnome.org>
11611
11612         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11613
11614 2002-08-12  Martin Baulig  <martin@gnome.org>
11615
11616         * ecore.cs (ITypeExpression): New interface for expressions which
11617         resolve to a type.
11618         (TypeExpression): Renamed to TypeLookupExpression.
11619         (Expression.DoResolve): If we're doing a types-only lookup, the
11620         expression must implement the ITypeExpression interface and we
11621         call DoResolveType() on it.
11622         (SimpleName): Implement the new ITypeExpression interface.
11623         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11624         hack, the situation that we're only looking up types can't happen
11625         anymore when this method is called.  Moved the type lookup code to
11626         DoResolveType() and call it.
11627         (SimpleName.DoResolveType): This ITypeExpression interface method
11628         is now doing the types-only lookup.
11629         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11630         (ResolveFlags): Added MaskExprClass.
11631
11632         * expression.cs (MemberAccess): Implement the ITypeExpression
11633         interface.
11634         (MemberAccess.DoResolve): Added support for a types-only lookup
11635         when we're called via ITypeExpression.DoResolveType().
11636         (ComposedCast): Implement the ITypeExpression interface.
11637
11638         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11639         Expression.Resolve() with ResolveFlags.Type instead.
11640
11641 2002-08-12  Martin Baulig  <martin@gnome.org>
11642
11643         * interface.cs (Interface.Define): Apply attributes.
11644
11645         * attribute.cs (Attribute.ApplyAttributes): Added support for
11646         interface attributes.
11647
11648 2002-08-11  Martin Baulig  <martin@gnome.org>
11649
11650         * statement.cs (Block.Emit): Only check the "this" variable if we
11651         do not always throw an exception.
11652
11653         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11654         whether the property has a set accessor.
11655
11656 2002-08-11  Martin Baulig  <martin@gnome.org>
11657
11658         Added control flow analysis support for structs.
11659
11660         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11661         with control flow analysis turned off.
11662         (IVariable): New interface.
11663         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11664         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11665         (FieldExpr.DoResolve): Resolve the instance expression with flow
11666         analysis turned off and do the definite assignment check after the
11667         resolving when we know what the expression will resolve to.
11668
11669         * expression.cs (LocalVariableReference, ParameterReference):
11670         Implement the new IVariable interface, only call the flow analysis
11671         code if ec.DoFlowAnalysis is true.
11672         (This): Added constructor which takes a Block argument.  Implement
11673         the new IVariable interface.
11674         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11675         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11676         This does the definite assignment checks for struct members.
11677
11678         * class.cs (Constructor.Emit): If this is a non-static `struct'
11679         constructor which doesn't have any initializer, call
11680         Block.AddThisVariable() to tell the flow analysis code that all
11681         struct elements must be initialized before control returns from
11682         the constructor.
11683
11684         * statement.cs (MyStructInfo): New public class.
11685         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11686         argument to this indexer.  If non-zero, check an individual struct
11687         member, not the whole struct.
11688         (FlowBranching.CheckOutParameters): Check struct members.
11689         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11690         overloaded versions of these methods which take an additional
11691         `int field_idx' argument to check struct members.
11692         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11693         overloaded versions of these methods which take an additional
11694         `string field_name' argument to check struct member.s
11695         (VariableInfo): Implement the IVariable interface.
11696         (VariableInfo.StructInfo): New public property.  Returns the
11697         MyStructInfo instance of the variable if it's a struct or null.
11698         (Block.AddThisVariable): New public method.  This is called from
11699         Constructor.Emit() for non-static `struct' constructor which do
11700         not have any initializer.  It creates a special variable for the
11701         "this" instance variable which will be checked by the flow
11702         analysis code to ensure that all of the struct's fields are
11703         initialized before control returns from the constructor.
11704         (UsageVector): Added support for struct members.  If a
11705         variable/parameter is a struct with N members, we reserve a slot
11706         in the usage vector for each member.  A struct is considered fully
11707         initialized if either the struct itself (slot 0) or all its
11708         members are initialized.
11709
11710 2002-08-08  Martin Baulig  <martin@gnome.org>
11711
11712         * driver.cs (Driver.MainDriver): Only report an error CS5001
11713         if there were no compilation errors.
11714
11715         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11716         `UnsafeContext' property to determine whether the parent is in
11717         unsafe context rather than checking the parent's ModFlags:
11718         classes nested in an unsafe class are unsafe as well.
11719
11720 2002-08-08  Martin Baulig  <martin@gnome.org>
11721
11722         * statement.cs (UsageVector.MergeChildren): Distinguish between
11723         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11724         we return.  Added test17() and test18() to test-154.cs.
11725
11726 2002-08-08  Martin Baulig  <martin@gnome.org>
11727
11728         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11729         Family access, make sure the invoking type isn't a subclass of the
11730         queried type (that'd be a CS1540).
11731
11732         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11733         this method which takes an additional `Type invocation_type'.
11734
11735         * expression.cs (BaseAccess.DoResolve): Use the base type as
11736         invocation and query type.
11737         (MemberAccess.DoResolve): If the lookup failed and we're about to
11738         report a CS0122, try a lookup with the ec.ContainerType - if this
11739         succeeds, we must report a CS1540.
11740
11741 2002-08-08  Martin Baulig  <martin@gnome.org>
11742
11743         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11744         (MethodGroupExpr): Implement the IMemberExpr interface.
11745
11746         * expression (MemberAccess.ResolveMemberAccess): No need to have
11747         any special code for MethodGroupExprs anymore, they're now
11748         IMemberExprs.   
11749
11750 2002-08-08  Martin Baulig  <martin@gnome.org>
11751
11752         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11753         Family, FamANDAssem and FamORAssem permissions.
11754         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11755
11756 2002-08-08  Martin Baulig  <martin@gnome.org>
11757
11758         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11759         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11760         or loop block.
11761
11762 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11763
11764         * driver.cs: implemented /resource option to embed managed resources.
11765
11766 2002-08-07  Martin Baulig  <martin@gnome.org>
11767
11768         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11769         (FieldBase.HasFieldInitializer): New public property.
11770         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11771         returns the field initializer and makes sure it is only resolved once.
11772         (TypeContainer.EmitFieldInitializers): Call
11773         FieldBase.GetInitializerExpression to get the initializer, this ensures
11774         that it isn't resolved multiple times.
11775
11776         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11777         the resolving process (SimpleName/MemberLookup) that we're currently
11778         emitting a field initializer (which must not access any instance members,
11779         this is an error CS0236).
11780
11781         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11782         argument, if the `IsFieldInitializer' flag is set, we must report and
11783         error CS0236 and not an error CS0120.   
11784
11785 2002-08-07  Martin Baulig  <martin@gnome.org>
11786
11787         * ecore.cs (IMemberExpr): New public interface.
11788         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11789         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11790         if the expression is an IMemberExpr.
11791
11792         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11793         to be null, implicitly default to `this' if we're non-static in
11794         this case.  Simplified the code a lot by using the new IMemberExpr
11795         interface.  Also fixed bug #28176 here.
11796
11797 2002-08-06  Martin Baulig  <martin@gnome.org>
11798
11799         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11800         ParameterReferences during semantic analysis so that we can do a
11801         type-only search when resolving Cast, TypeOf and SizeOf.
11802         (block): Pass the `current_local_parameters' to the Block's
11803         constructor.
11804
11805         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11806         argument to the constructor.
11807         (ConstructorInitializer.Resolve): Create a temporary implicit
11808         block with the parameters.
11809
11810         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11811         references here if we aren't doing a type-only search.
11812
11813         * statement.cs (Block): Added constructor which takes a
11814         `Parameters parameters' argument.
11815         (Block.Parameters): New public property.
11816
11817         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11818         to `Parameters' and made it public readonly.
11819
11820 2002-08-06  Martin Baulig  <martin@gnome.org>
11821
11822         * ecore.cs (Expression.Warning): Made this public as well.
11823
11824         * report.cs (Report.Debug): Print the contents of collections.
11825
11826 2002-08-06  Martin Baulig  <martin@gnome.org>
11827
11828         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11829         used to tell Resolve() which kinds of expressions it may return.
11830         (Expression.Resolve): Added overloaded version of this method which
11831         takes a `ResolveFlags flags' argument.  This can be used to tell
11832         Resolve() which kinds of expressions it may return.  Reports a
11833         CS0118 on error.
11834         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11835         ResolveFlags.SimpleName.
11836         (Expression.Error118): Added overloaded version of this method which
11837         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11838         which kinds of expressions are allowed.
11839
11840         * expression.cs (Argument.ResolveMethodGroup): New public method.
11841         Resolves an argument, but allows a MethodGroup to be returned.
11842         This is used when invoking a delegate.
11843
11844         * TODO: Updated a bit.
11845
11846 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11847
11848         Fixed compilation with csc.
11849
11850         * ecore.cs: Expression.Error made public. Is this correct? Should
11851         Warning be made public too?
11852
11853         * expression.cs: use ea.Location instead of ea.loc.
11854         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11855
11856 2002-08-06  Martin Baulig  <martin@gnome.org>
11857
11858         * ecore.cs (Expression.loc): Moved the location here instead of
11859         duplicating it in all derived classes.
11860         (Expression.Location): New public property.
11861         (Expression.Error, Expression.Warning): Made them non-static and
11862         removed the location argument.
11863         (Expression.Warning): Added overloaded version which takes an
11864         `int level' argument.
11865         (Expression.Error118): Make this non-static and removed the
11866         expression and location arguments.
11867         (TypeExpr): Added location argument to the constructor.
11868
11869         * expression.cs (StaticCallExpr): Added location argument to
11870         the constructor.
11871         (Indirection, PointerArithmetic): Likewise.
11872         (CheckedExpr, UnCheckedExpr): Likewise.
11873         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11874         (StringPtr): Likewise.
11875
11876
11877 2002-08-05  Martin Baulig  <martin@gnome.org>
11878
11879         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11880
11881         * assign.cs (Assign.DoResolve): Check whether the source
11882         expression is a value or variable.
11883
11884         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11885         while resolving the corresponding blocks.
11886
11887         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11888         an error, don't silently return null.
11889
11890         * statement.cs (Block.AddVariable): Do the error reporting here
11891         and distinguish between CS0128 and CS0136.
11892         (Block.DoResolve): Report all unused labels (warning CS0164).
11893         (LabeledStatement): Pass the location to the constructor.
11894         (LabeledStatement.HasBeenReferenced): New property.
11895         (LabeledStatement.Resolve): Set it to true here.
11896
11897         * statement.cs (Return.Emit): Return success even after reporting
11898         a type mismatch error (CS0126 or CS0127), this is what csc does and
11899         it avoids confusing the users with any consecutive errors.
11900
11901 2002-08-05  Martin Baulig  <martin@gnome.org>
11902
11903         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11904
11905         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11906
11907         * expression.cs (MemberAccess.DoResolve): Silently return if an
11908         error has already been reported.
11909
11910         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11911         error has already been reported.
11912
11913 2002-08-05  Martin Baulig  <martin@gnome.org>
11914
11915         * statement.cs (UsageVector): Only initialize the `parameters'
11916         vector if we actually have any "out" parameters.
11917
11918 2002-08-05  Martin Baulig  <martin@gnome.org>
11919
11920         * expression.cs (Binary.ResolveOperator): When combining delegates,
11921         they must have the same type.
11922
11923 2002-08-05  Martin Baulig  <martin@gnome.org>
11924
11925         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11926         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11927         work with the ms runtime and we also don't need it: if we're a
11928         PropertyBuilder and not in the `indexer_arguments' hash, then we
11929         are a property and not an indexer.
11930
11931         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11932         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11933         since the latter one doesn't work with the ms runtime.
11934
11935 2002-08-03  Martin Baulig  <martin@gnome.org>
11936
11937         Fixed bugs #27998 and #22735.
11938
11939         * class.cs (Method.IsOperator): New public field.
11940         (Method.CheckBase): Report CS0111 if there's already a method
11941         with the same parameters in the current class.  Report CS0508 when
11942         attempting to change the return type of an inherited method.
11943         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11944         and it's not marked abstract or extern.
11945         (PropertyBase): New abstract base class for Property and Indexer.
11946         (PropertyBase.CheckBase): Moved here from Property and made it work
11947         for indexers.
11948         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11949         the same so we can reuse it there.
11950         (Property, Indexer): Derive from PropertyBase.
11951         (MethodSignature.inheritable_property_signature_filter): New delegate
11952         to find properties and indexers.
11953
11954         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11955         argument and improved error reporting.
11956
11957         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11958         EmptyReadOnlyParameters and made it a property.
11959
11960         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11961         version of this method which takes a `PropertyInfo indexer'.
11962         (TypeManager.RegisterIndexer): New method.
11963
11964         * class.cs: Added myself as author of this file :-)
11965
11966 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11967
11968         * class.cs: fixed compilation on windoze.
11969
11970 2002-08-03  Martin Baulig  <martin@gnome.org>
11971
11972         * interface.cs (Interface.GetInterfaceBases): Check whether all
11973         base interfaces are at least as accessible than the current one.
11974
11975         * class.cs (TypeContainer.GetClassBases): Check whether base types
11976         are at least as accessible than the current type.
11977         (TypeContainer.AsAccessible): Implemented and made non-static.
11978         (MemberBase.CheckParameters): Report errors if the accessibility
11979         checks fail.
11980
11981         * delegate.cs (Delegate.Delegate): The default visibility is
11982         internal for top-level types and private for nested types.
11983         (Delegate.Define): Report errors if the accessibility checks fail.
11984
11985         * enum.cs (Enum.Enum): The default visibility is internal for
11986         top-level types and private for nested types.
11987         (Enum.DefineType): Compute the correct visibility.
11988
11989         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11990         function which takes a `bool is_toplevel' instead of a TypeContainer.
11991
11992         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11993         builtin type.
11994
11995 2002-08-02  Martin Baulig  <martin@gnome.org>
11996
11997         * expression.cs (LocalVariableReferenc): Added constructor which
11998         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11999         (LocalVariableReference.IsReadOnly): New property.
12000         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12001         variable is readonly, use our own readonly flag to do this; you can
12002         use the new constructor to get a writable reference to a read-only
12003         variable.
12004
12005         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12006         reference to the local variable.
12007
12008 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12009
12010         * rootcontext.cs (ResolveCore): Also include System.Exception
12011
12012         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12013         we reach an EmptyStatement.
12014
12015         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12016         is also fine.
12017
12018         * expression.cs (Binary.ResolveOperator): Check error result in
12019         two places.
12020
12021         use brtrue/brfalse directly and avoid compares to null.
12022
12023 2002-08-02  Martin Baulig  <martin@gnome.org>
12024
12025         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12026         Fixes bug #28407, added test-155.cs.
12027
12028 2002-08-01  Martin Baulig  <martin@gnome.org>
12029
12030         * class.cs (Event.EmitDefaultMethod): Make this work with static
12031         events.  Fixes #28311, added verify-3.cs.
12032
12033 2002-08-01  Martin Baulig  <martin@gnome.org>
12034
12035         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12036         `is_disposable' fields.
12037         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12038         `hm.is_disposable' if we're using the collection pattern.
12039         (Foreach.EmitCollectionForeach): Use the correct type for the
12040         enumerator's local variable, only emit the try/finally block if
12041         necessary (fixes #27713).
12042
12043 2002-08-01  Martin Baulig  <martin@gnome.org>
12044
12045         * ecore.cs (Expression.report118): Renamed to Error118 and made
12046         it public static.
12047
12048         * statement.cs (Throw.Resolve): Check whether the expression is of
12049         the correct type (CS0118) and whether the type derives from
12050         System.Exception (CS0155).
12051         (Catch.Resolve): New method.  Do the type lookup here and check
12052         whether it derives from System.Exception (CS0155).
12053         (Catch.CatchType, Catch.IsGeneral): New public properties.
12054
12055         * typemanager.cs (TypeManager.exception_type): Added.
12056
12057 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12058
12059         * driver.cs: Updated About function.
12060
12061 2002-07-31  Martin Baulig  <martin@gnome.org>
12062
12063         Implemented Control Flow Analysis.
12064
12065         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12066         (EmitContext.CurrentBranching): Added.
12067         (EmitContext.StartFlowBranching): Added.
12068         (EmitContext.EndFlowBranching): Added.
12069         (EmitContext.KillFlowBranching): Added.
12070         (EmitContext.IsVariableAssigned): Added.
12071         (EmitContext.SetVariableAssigned): Added.
12072         (EmitContext.IsParameterAssigned): Added.
12073         (EmitContext.SetParameterAssigned): Added.
12074         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12075         Added control flow analysis stuff here.
12076
12077         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12078         resolve the expression as lvalue.
12079         (LocalVariableReference.DoResolve): Check whether the variable has
12080         already been assigned.
12081         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12082         the parameter as assigned here.
12083         (ParameterReference.DoResolve): Check whether the parameter has already
12084         been assigned.
12085         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12086         expression as lvalue.
12087
12088         * statement.cs (FlowBranching): New class for the flow analysis code.
12089         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12090         (LabeledStatement.IsDefined): New public property.
12091         (LabeledStatement.AddUsageVector): New public method to tell flow
12092         analyis that the label may be reached via a forward jump.
12093         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12094         flow analysis.
12095         (VariableInfo.Number): New public field.  This is used by flow analysis
12096         to number all locals of a block.
12097         (Block.CountVariables): New public property.  This is the number of
12098         local variables in this block (including the locals from all parent
12099         blocks).
12100         (Block.EmitMeta): Number all the variables.
12101
12102         * statement.cs: Added flow analysis support to all classes.
12103
12104 2002-07-31  Martin Baulig  <martin@gnome.org>
12105
12106         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12107         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12108         then use this argument.
12109
12110         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12111
12112         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12113         use this to specify /define options.
12114
12115 2002-07-29  Martin Baulig  <martin@gnome.org>
12116
12117         * statement.cs (Fixed): Moved all code that does variable lookups
12118         and resolvings from Emit to Resolve.
12119
12120         * statement.cs (For): Moved all code that does variable lookups
12121         and resolvings from Emit to Resolve.
12122
12123         * statement.cs (Using): Moved all code that does variable lookups
12124         and resolvings from Emit to Resolve.
12125
12126 2002-07-29  Martin Baulig  <martin@gnome.org>
12127
12128         * attribute.cs (Attribute.Resolve): Explicitly catch a
12129         System.NullReferenceException when creating the
12130         CustromAttributeBuilder and report a different warning message.
12131
12132 2002-07-29  Martin Baulig  <martin@gnome.org>
12133
12134         * support.cs (ParameterData.ParameterName): Added method to
12135         get the name of a parameter.
12136
12137         * typemanager.cs (TypeManager.IsValueType): New public method.
12138
12139 2002-07-29  Martin Baulig  <martin@gnome.org>
12140
12141         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12142         is a flag which specifies that it's either ref or out.
12143         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12144         the out parameter to `out Parameter.Modifier mod', also set the
12145         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12146
12147         * support.cs (InternalParameters.ParameterModifier): Distinguish
12148         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12149         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12150
12151         * expression.cs (Argument.GetParameterModifier): Distinguish
12152         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12153         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12154
12155 2002-07-29  Martin Baulig  <martin@gnome.org>
12156
12157         * expression.cs (ParameterReference.ParameterReference): Added
12158         `Location loc' argument to the constructor.
12159
12160         * cs-parser.jay: Pass location to ParameterReference.
12161
12162 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * statement.cs (Try): Initialize the location.
12165
12166         * cs-parser.jay: pass location to Try.
12167
12168         * expression.cs (Unary.Reduce): Change the prototype to return
12169         whether a constant fold could be performed or not.  The result is
12170         returned in an out parameters.  In the case of Indirection and
12171         AddressOf, we want to perform the full tests.
12172
12173 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12174
12175         * statement.cs (Statement.Emit): Flag dead code.
12176
12177 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12178
12179         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12180
12181 2002-07-27  Martin Baulig  <martin@gnome.org>
12182
12183         * class.cs (MethodData.Define): Put back call to
12184         TypeManager.AddMethod(), accidentally commented this out.
12185
12186         * report.cs (Debug): New public method to print debugging information,
12187         this is `[Conditional ("DEBUG")]'.
12188
12189 2002-07-26  Martin Baulig  <martin@gnome.org>
12190
12191         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12192         (switch_statement): Push the current_block to the switch_stack and
12193         pop it again when we're done with the switch.
12194         (switch_section): The new block is a child of the current_block.
12195         Fixes bug #24007, added test-152.cs.
12196
12197 2002-07-27  Martin Baulig  <martin@gnome.org>
12198
12199         * expression.cs (Invocation.EmitArguments): When calling a varargs
12200         function with only its fixed arguments, we need to pass an empty
12201         array.
12202
12203 2002-07-27  Martin Baulig  <martin@gnome.org>
12204
12205         Mono 0.13 has been released.
12206
12207 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12208
12209         * driver.cs: Rename --resource to --linkres, because that is what
12210         we do currently, we dont support --resource yet.
12211
12212         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12213
12214 2002-07-25  Martin Baulig  <martin@gnome.org>
12215
12216         * class.cs (MethodData): New public class.  This is a `method builder'
12217         class for a method or one accessor of a Property/Indexer/Event.
12218         (MethodData.GetMethodFlags): Moved here from MemberBase.
12219         (MethodData.ApplyAttributes): Likewise.
12220         (MethodData.ApplyObsoleteAttribute): Likewise.
12221         (MethodData.ApplyConditionalAttribute): Likewise.
12222         (MethodData.ApplyDllImportAttribute): Likewise.
12223         (MethodData.CheckAbstractAndExternal): Likewise.
12224         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12225         (MethodData.Emit): Formerly known as Method.Emit().
12226         (MemberBase): Moved everything which was specific to a single
12227         accessor/method to MethodData.
12228         (Method): Create a new MethodData and call Define() and Emit() on it.
12229         (Property, Indexer, Event): Create a new MethodData objects for each
12230         accessor and call Define() and Emit() on them.
12231
12232 2002-07-25  Martin Baulig  <martin@gnome.org>
12233
12234         Made MethodCore derive from MemberBase to reuse the code from there.
12235         MemberBase now also checks for attributes.
12236
12237         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12238         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12239         as virtual.
12240         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12241         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12242         (MemberBase.ApplyAttributes): New virtual method; applies the
12243         attributes to a method or accessor.
12244         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12245         (MemberBase.ApplyConditionalAttribute): Likewise.
12246         (MemberBase.ApplyDllImportAttribute): Likewise.
12247         (MemberBase.CheckAbstractAndExternal): Likewise.
12248         (MethodCore.ParameterTypes): This is now a property instead of a
12249         method, it's initialized from DoDefineParameters().
12250         (MethodCore.ParameterInfo): Removed the set accessor.
12251         (MethodCore.DoDefineParameters): New protected virtual method to
12252         initialize ParameterTypes and ParameterInfo.
12253         (Method.GetReturnType): We can now simply return the MemberType.
12254         (Method.GetMethodFlags): Override the MemberBase version and add
12255         the conditional flags.
12256         (Method.CheckBase): Moved some code from Define() here, call
12257         DoDefineParameters() here.
12258         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12259         here to avoid some larger code duplication.
12260         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12261         ensure that abstract and external accessors don't declare a body.
12262
12263         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12264         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12265         lookup in the attribute's parent classes, so we need to abort as soon
12266         as we found the first match.
12267         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12268         the attribute has no arguments.
12269
12270         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12271         of a Method.
12272
12273 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12274
12275         * cs-parser.jay: reverted previous patch.
12276
12277 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12278
12279         * cs-parser.jay: fixed bug #22119.
12280
12281 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12282
12283         * attribute.cs: fixed compilation. The error was:
12284         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12285         be assigned to before control leaves the current method."
12286         [FIXME:  Filed as bug #28186: MCS must report this error.]
12287
12288 2002-07-25  Martin Baulig  <martin@gnome.org>
12289
12290         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12291         method to pull the condition name ouf of a Conditional attribute.
12292         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12293         the obsolete message and error flag out of an Obsolete attribute.
12294
12295         * class.cs (Method.GetMethodFlags): New public method to get the
12296         TypeManager.MethodFlags for this method.
12297         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12298         private methods.
12299         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12300         if we're overriding a virtual function, set the new private variable
12301         `parent_method'; call the new TypeManager.AddMethod().
12302
12303         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12304         the MethodBuilder and the Method in a PtrHashtable.
12305         (TypeManager.builder_to_method): Added for this purpose.
12306         (TypeManager.MethodFlags): Added IsObsoleteError.
12307         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12308         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12309         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12310         the message from the attribute.
12311
12312 2002-07-24  Martin Baulig  <martin@gnome.org>
12313
12314         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12315         preprocessor directives, ensure that the argument to #define/#undef is
12316         exactly one identifier and that it's actually an identifier.
12317
12318         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12319         did not work ....
12320
12321 2002-07-24  Martin Baulig  <martin@gnome.org>
12322
12323         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12324         initialize it to TypeManager.object_type in the constructor.
12325         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12326         of the `hm.get_current' method if we're using the collection pattern.
12327         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12328         for the explicit conversion to make it work when we're using the collection
12329         pattern and the `Current' property has a different return type than `object'.
12330         Fixes #27713.
12331
12332 2002-07-24  Martin Baulig  <martin@gnome.org>
12333
12334         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12335         does not match, but don't report any errors.  This method is called in
12336         order for all methods in a MethodGroupExpr until a matching method is
12337         found, so we don't want to bail out if the first method doesn't match.
12338         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12339         matches, report the 123.  Fixes #28070.
12340
12341 2002-07-24  Martin Baulig  <martin@gnome.org>
12342
12343         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12344         TypeManager.TypeToCoreType() to the top of the method so the
12345         following equality checks will work.  Fixes #28107.
12346
12347 2002-07-24  Martin Baulig  <martin@gnome.org>
12348
12349         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12350         operand is of type uint, and the other operand is of type sbyte,
12351         short or int, the operands are converted to type long." -
12352         Actually do what this comment already told us.  Fixes bug #28106,
12353         added test-150.cs.
12354
12355 2002-07-24  Martin Baulig  <martin@gnome.org>
12356
12357         * class.cs (MethodBase): New abstract class.  This is now a base
12358         class for Property, Indexer and Event to avoid some code duplication
12359         in their Define() and DefineMethods() methods.
12360         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12361         generic methods for Define() and DefineMethods().
12362         (FieldBase): Derive from MemberBase, not MemberCore.
12363         (Property): Derive from MemberBase, not MemberCore.
12364         (Property.DefineMethod): Moved all the code from this method to the
12365         new MethodBase.DefineAccessor(), just call it with appropriate
12366         argumetnts.
12367         (Property.Define): Call the new Property.DoDefine(), this does some
12368         sanity checks and we don't need to duplicate the code everywhere.
12369         (Event): Derive from MemberBase, not MemberCore.
12370         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12371         accessors, this will also make them work with interface events.
12372         (Indexer): Derive from MemberBase, not MemberCore.
12373         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12374         (Indexer.Define): Use the new MethodBase functions.
12375
12376         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12377         argument to the constructor.
12378         (Interface.FindMembers): Added support for interface events.
12379         (Interface.PopluateEvent): Implemented.
12380
12381         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12382
12383 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12384
12385         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12386         but this is required to check for a method name being the same as
12387         the containing class.  
12388
12389         Handle this now.
12390
12391 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12392
12393         * interface.cs: initialize variable.
12394
12395 2002-07-23  Martin Baulig  <martin@gnome.org>
12396
12397         Implemented the IndexerName attribute in interfaces.
12398
12399         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12400         name if this is an explicit interface implementation.
12401         (Indexer.InterfaceIndexerName): New public variable.  If we're
12402         implementing an interface indexer, this is the IndexerName in that
12403         interface.  Otherwise, it's the IndexerName.
12404         (Indexer.DefineMethod): If we're implementing interface indexer,
12405         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12406         and Pending.ImplementIndexer methods.
12407         (Indexer.Define): Also define the PropertyBuilder if we're
12408         implementing an interface indexer and this is neither an explicit
12409         interface implementation nor do the IndexerName match the one in
12410         the interface.
12411
12412         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12413         If a method is defined here, then we always need to create a proxy
12414         for it.  This is used when implementing interface indexers.
12415         (Pending.IsInterfaceIndexer): New public method.
12416         (Pending.ImplementIndexer): New public method.
12417         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12418         This is used when implementing interface indexers to define a proxy
12419         if necessary.
12420         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12421         define a proxy if necessary.
12422
12423         * interface.cs (Interface.IndexerName): New public variable.
12424         (Interface.PopulateIndexer): Set the IndexerName.
12425         (Interface.DefineIndexers): New private method.  Populate all the
12426         indexers and make sure their IndexerNames match.
12427
12428         * typemanager.cs (IndexerPropertyName): Added support for interface
12429         indexers.
12430
12431 2002-07-22  Martin Baulig  <martin@gnome.org>
12432
12433         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12434         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12435         ret if HasReturnLabel.
12436         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12437         variables.
12438
12439         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12440         and set the ec.LoopBeginTryCatchLevel.
12441         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12442         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12443         the current ec.TryCatchLevel, the branch goes out of an exception
12444         block.  In this case, we need to use Leave and not Br.
12445
12446 2002-07-22  Martin Baulig  <martin@gnome.org>
12447
12448         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12449         block unless the block does not always return or it is contained in
12450         another try { ... } catch { ... } block.  Fixes bug #26506.
12451         Added verify-1.cs to the test suite.
12452
12453 2002-07-22  Martin Baulig  <martin@gnome.org>
12454
12455         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12456         then we do not always return.  Fixes bug #24985.
12457
12458 2002-07-22  Martin Baulig  <martin@gnome.org>
12459
12460         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12461         lookup on a per-class level; ie. walk up the class hierarchy until we
12462         found at least one applicable method, then choose the best among them.
12463         Fixes bug #24463 and test-29.cs.
12464
12465 2002-07-22  Martin Baulig  <martin@gnome.org>
12466
12467         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12468         return types of the methods.  The return type is not part of the
12469         signature and we must not check it to make the `new' modifier work.
12470         Fixes bug #27999, also added test-147.cs.
12471         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12472
12473         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12474         on the method's return type.
12475
12476 2002-07-21  Martin Baulig  <martin@gnome.org>
12477
12478         * assign.cs: Make this work if the rightmost source is a constant and
12479         we need to do an implicit type conversion.  Also adding a few more tests
12480         to test-38.cs which should have caught this.
12481
12482         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12483         target in the makefile for this.  The makefile.gnu is primarily intended
12484         for end-users who don't want to debug the compiler.
12485
12486 2002-07-21  Martin Baulig  <martin@gnome.org>
12487
12488         * assign.cs: Improved the Assign class so it can now handle embedded
12489         assignments (X = Y = Z = something).  As a side-effect this'll now also
12490         consume less local variables.  test-38.cs now passes with MCS, added
12491         a few new test cases to that test.
12492
12493 2002-07-20  Martin Baulig  <martin@gnome.org>
12494
12495         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12496         instructions.  Fixes bug #27977, also added test-146.cs.
12497
12498 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12499
12500         * cs-tokenizer.cs: fixed getHex ().
12501
12502 2002-07-19  Martin Baulig  <martin@gnome.org>
12503
12504         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12505         not Type.GetType() to lookup the array type.  This is needed when
12506         we're constructing an array of a user-defined type.
12507         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12508         single-dimensional arrays, but also for single-dimensial arrays of
12509         type decimal.
12510
12511 2002-07-19  Martin Baulig  <martin@gnome.org>
12512
12513         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12514         this function is called, it's not allowed to share LocalBuilders
12515         among ILGenerators.
12516
12517 2002-07-19  Martin Baulig  <martin@gnome.org>
12518
12519         * expression.cs (Argument.Resolve): Report an error 118 when trying
12520         to pass a type as argument.
12521
12522 2002-07-18  Martin Baulig  <martin@gnome.org>
12523
12524         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12525         Conv_R_Un for the signed `long' type.
12526
12527 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12528
12529         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12530         `expr' for the temporary result, as that will fail if we do
12531         multiple resolves on the same expression.
12532
12533 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12534
12535         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12536         ec.TypeContainer for looking up aliases. 
12537
12538         * class.cs (TypeContainer): Remove LookupAlias from here.
12539
12540         * decl.cs (DeclSpace); Move here.
12541
12542 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12543
12544         * class.cs (FindMembers): Only call filter if the constructor
12545         bulider is not null.
12546
12547         Also handle delegates in `NestedTypes' now.  Now we will perform
12548         type lookups using the standard resolution process.  This also
12549         fixes a bug.
12550
12551         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12552         This uses Expressions (the limited kind that can be parsed by the
12553         tree) instead of strings.
12554
12555         * expression.cs (ComposedCast.ToString): Implement, used to flag
12556         errors since now we have to render expressions.
12557
12558         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12559         FormArrayType. 
12560
12561         * ecore.cs (SimpleName.ToString): ditto.
12562
12563         * cs-parser.jay: Instead of using strings to assemble types, use
12564         Expressions to assemble the type (using SimpleName, ComposedCast,
12565         MemberAccess).  This should fix the type lookups in declarations,
12566         because we were using a different code path for this.
12567
12568         * statement.cs (Block.Resolve): Continue processing statements
12569         even when there is an error.
12570
12571 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12572
12573         * class.cs (Event.Define): Also remove the `remove' method from
12574         the list of pending items.
12575
12576         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12577         generate more compact code. 
12578
12579 2002-07-17  Martin Baulig  <martin@gnome.org>
12580
12581         * const.cs (Const.LookupConstantValue): Add support for constant
12582         `unchecked' and `checked' expressions.
12583         Also adding test case test-140.cs for this.
12584
12585 2002-07-17  Martin Baulig  <martin@gnome.org>
12586
12587         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12588         check whether mi.ReturnType implements the IEnumerator interface; the
12589         `==' and the IsAssignableFrom() will fail in this situation.
12590
12591 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12592
12593         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12594         here too.
12595
12596 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12597
12598         * expression.cs: fixed bug #27811.
12599
12600 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12601
12602         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12603         Molaro: when we are a ref, the value already contains a pointer
12604         value, do not take the address of it.
12605
12606 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12607         * removed mb-parser.jay and mb-tokenizer.cs
12608
12609 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12610
12611         * expression.cs: check against the building corlib void type.
12612
12613 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12614
12615         * ecore.cs: fix for valuetype static readonly fields: when 
12616         initializing them, we need their address, not the address of a copy.
12617
12618 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12619
12620         * typemanager.cs: register also enum_type in corlib.
12621
12622 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12623
12624         * class.cs: allow calling this (but not base) initializers in structs.
12625
12626 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12627
12628         * ecore.cs: make sure we compare against the building base types
12629         in GetTypeSize ().
12630
12631 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12632
12633         * typemanager.cs: fix TypeToCoreType() to handle void and object
12634         (corlib gets no more typerefs after this change).
12635
12636 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * expression.cs (ArrayCreation.EmitArrayArguments): use
12639         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12640
12641         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12642         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12643         array indexes, the runtime actually forbids them.
12644
12645         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12646         for array arguments here.
12647
12648         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12649         instead of the default for ValueTypes.
12650
12651         (New.DoEmit): Use IsValueType instead of
12652         IsSubclassOf (value_type)
12653         (New.DoResolve): ditto.
12654         (Invocation.EmitCall): ditto.
12655
12656         * assign.cs (Assign): ditto.
12657
12658         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12659         Statements *are* currently doing part of their resolution during
12660         Emit.  
12661
12662         Expressions do always resolve during resolve, but statements are
12663         only required to propagate resolution to their children.
12664
12665 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12666
12667         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12668
12669         (LoadAssembly): Do not add the dll if it is already specified
12670
12671         (MainDriver): Add the System directory to the link path at the end,
12672         after all the other -L arguments. 
12673
12674         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12675         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12676         ldelem.u1) and using the opposite for sbytes.
12677
12678         This fixes Digger, and we can finally run it.
12679
12680         * driver.cs (UnixParseOption): Move the option parsing here.  
12681         (CSCParseOption): Implement CSC-like parsing of options.
12682
12683         We now support both modes of operation, the old Unix way, and the
12684         new CSC-like way.  This should help those who wanted to make cross
12685         platform makefiles.
12686
12687         The only thing broken is that /r:, /reference: and /lib: are not
12688         implemented, because I want to make those have the same semantics
12689         as the CSC compiler has, and kill once and for all the confussion
12690         around this.   Will be doing this tomorrow.
12691
12692         * statement.cs (Unsafe.Resolve): The state is checked during
12693         resolve, not emit, so we have to set the flags for IsUnsfe here.
12694
12695 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12696
12697         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12698         not catch the Error_ObjectRefRequired in SimpleName (as it is
12699         possible to have a class/instance variable name that later gets
12700         deambiguated), we have to check this here.      
12701
12702 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12703
12704         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12705         make static and put into Expression.
12706
12707         (Event.Define): Register the private field of the event with the 
12708         TypeManager so that GetFieldFromEvent can get at it.
12709
12710         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12711         keep track of the private field associated with an event which
12712         has no accessors.
12713
12714         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12715         private field.
12716
12717         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12718
12719 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12720
12721         * expression.cs (Binary.EmitBranchable): this routine emits the
12722         Binary expression in a branchable context.  This basically means:
12723         we need to branch somewhere, not just get the value on the stack.
12724
12725         This works together with Statement.EmitBoolExpression.
12726
12727         * statement.cs (Statement.EmitBoolExpression): Use
12728         EmitBranchable. 
12729
12730 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12731
12732         * statement.cs (For): Reduce the number of jumps in loops.
12733
12734         (For): Implement loop inversion for the For statement.
12735
12736         (Break): We can be breaking out of a Try/Catch controlled section
12737         (foreach might have an implicit try/catch clause), so we need to
12738         use Leave instead of Br.
12739
12740         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12741         now).  If the instace expression supports IMemoryLocation, we use
12742         the AddressOf method from the IMemoryLocation to extract the
12743         address instead of emitting the instance.
12744
12745         This showed up with `This', as we were emitting the instance
12746         always (Emit) instead of the Address of This.  Particularly
12747         interesting when This is a value type, as we dont want the Emit
12748         effect (which was to load the object).
12749
12750 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12751
12752         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12753
12754         * statement.cs (Checked): Set the CheckedState during the resolve
12755         process too, as the ConvCast operations track the checked state on
12756         the resolve process, and not emit.
12757
12758         * cs-parser.jay (namespace_member_declaration): Flag that we have
12759         found a declaration when we do.  This is used to flag error 1529
12760
12761         * driver.cs: Report ok when we display the help only.
12762
12763 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12764
12765         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12766
12767 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12768
12769         * cs-tokenizer.cs (define): We also have to track locally the
12770         defines.  AllDefines is just used for the Conditional Attribute,
12771         but we also need the local defines for the current source code. 
12772
12773 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12774
12775         * statement.cs (While, For, Do): These loops can exit through a
12776         Break statement, use this information to tell whether the
12777         statement is the last piece of code.
12778
12779         (Break): Flag that we break.
12780
12781         * codegen.cs (EmitContexts): New `Breaks' state variable.
12782
12783 2002-07-03  Martin Baulig  <martin@gnome.org>
12784
12785         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12786         modifiers in method declarations in structs.  Otherwise, you won't
12787         be able to override things like Object.Equals().
12788
12789 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12790
12791         * class.cs (Method, Property, Indexer): Do not allow the public
12792         modifier to be used in explicit interface implementations.
12793
12794         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12795         override modifiers in method declarations in structs
12796
12797 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12798
12799         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12800         integer or real overflow, report an error
12801
12802 2002-07-02  Martin Baulig  <martin@gnome.org>
12803
12804         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12805         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12806         to tell the runtime about our newly created System.Object and
12807         System.ValueType types.
12808
12809 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12812         struct instead of Ldarg/Starg.
12813
12814 2002-07-02  Martin Baulig  <martin@gnome.org>
12815
12816         * expression.cs (Indirection.Indirection): Call
12817         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12818
12819 2002-07-02  Martin Baulig  <martin@gnome.org>
12820
12821         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12822         ValueType, call TypeManager.TypeToCoreType() on it.
12823         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12824         the OpCodes.Newarr argument.
12825
12826 2002-07-02  Martin Baulig  <martin@gnome.org>
12827
12828         * expression.cs (Invocation.EmitCall): When compiling corlib,
12829         replace all calls to the system's System.Array type to calls to
12830         the newly created one.
12831
12832         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12833         System.Array methods.
12834         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12835         from the system's System.Array type which must be replaced.
12836
12837 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12838
12839         * typemanager.cs: load unverifiable_code_ctor so we can build
12840         corlib using the correct type. Avoid using GetTypeCode() with
12841         TypeBuilders.
12842         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12843         TypeManager.object_type to allow building corlib.
12844
12845 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12846
12847         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12848
12849 2002-07-01  Martin Baulig  <martin@gnome.org>
12850
12851         * class.cs: Make the last change actually work, we need to check
12852         whether `ifaces != null' to avoid a crash.
12853
12854 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12855
12856         * class.cs: when we build structs without fields that implement
12857         interfaces, we need to add the interfaces separately, since there is
12858         no API to both set the size and add the interfaces at type creation
12859         time.
12860
12861 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12862
12863         * expression.cs: the dimension arguments to the array constructors
12864         need to be converted if they are a long.
12865
12866 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12867
12868         * class.cs: don't emit ldarg.0 if there is no parent constructor
12869         (fixes showstopper for corlib).
12870
12871 2002-06-29  Martin Baulig  <martin@gnome.org>
12872
12873         MCS now compiles corlib on GNU/Linux :-)
12874
12875         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12876         ie. check for MethodImplOptions.InternalCall.
12877
12878         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12879         and TypeManager.attribute_type are null, so we must explicitly check
12880         whether parent is not null to find out whether it's an attribute type.
12881         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12882         and SetBuilder, not only if the property is neither abstract nor external.
12883         This is necessary to set the MethodImplOptions on the accessor methods.
12884         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12885         SetBuilder, see Property.Emit().
12886
12887         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12888         populate "System.Object", "System.ValueType" and "System.Attribute" since
12889         they've already been populated from BootCorlib_PopulateCoreTypes().
12890
12891 2002-06-29  Martin Baulig  <martin@gnome.org>
12892
12893         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12894         is the NullLiteral, we also need to make sure that target_type is not
12895         an enum type.   
12896
12897 2002-06-29  Martin Baulig  <martin@gnome.org>
12898
12899         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12900         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12901         before calling BootstrapCorlib_ResolveDelegate ().
12902
12903 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12904
12905         * statement.cs: fixed build-breaker. All tests passed ok.
12906
12907 2002-06-27  Martin Baulig  <martin@gnome.org>
12908
12909         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12910         for System.Decimal when compiling corlib.
12911
12912 2002-06-27  Martin Baulig  <martin@gnome.org>
12913
12914         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12915         switch blocks which contain nothing but a default clause.
12916
12917 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12918
12919        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12920
12921 2002-06-27  Martin Baulig  <martin@gnome.org>
12922
12923         * ecore.cs (PropertyExpr.PropertyExpr): Call
12924         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12925
12926         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12927         is already a TypeBuilder.
12928
12929 2002-06-27  Martin Baulig  <martin@gnome.org>
12930
12931         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12932         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12933         the "from an array-type to System.Array" case.  This makes it work
12934         when compiling corlib.
12935
12936 2002-06-27  Martin Baulig  <martin@gnome.org>
12937
12938         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12939         non-static PropertyExpr, set its InstanceExpression.  This makes
12940         the `ICollection.Count' property work in System/Array.cs.
12941
12942 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12943
12944         * driver.cs: Made error handling more consistent.  Errors now
12945         tracked by Report class, so many methods which used to return int
12946         now return void.  Main() now prints success/failure and 
12947         errors/warnings message.
12948
12949         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12950         the magic number return values (123 and 124).  Now, if the
12951         expected error occurs, the compiler exits with success (exit value
12952         0).  If the compilation completes without seeing that particular
12953         error, the compiler exits with failure (exit value 1).  The
12954         makefile in mcs/errors has been changed to handle the new behaviour.
12955
12956         * report.cs: Made 'expected error' number a property and renamed
12957         it from 'Probe' to 'ExpectedError'.
12958
12959         * genericparser.cs: Removed error handling support, since it is
12960         now all done by Report class.
12961
12962         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12963         class, so parse() no longer returns an int.
12964
12965         * namespace.cs: Use Report.Error instead of GenericParser.error
12966
12967 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12968
12969         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12970         TypeContainer.AddOperator): At the front of the list put the
12971         explicit implementations, so they get resolved/defined first. 
12972
12973 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12974
12975         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12976         interface type is implemented by this TypeContainer.  Used during
12977         explicit interface implementation.
12978
12979         (Property.Define, Indexer.Define, Method.Define): Validate that
12980         the given interface in the explicit implementation is one of the
12981         base classes for the containing type.
12982
12983         Also if we are explicitly implementing an interface, but there is
12984         no match in the pending implementation table, report an error.
12985
12986         (Property.Define): Only define the property if we are
12987         not explicitly implementing a property from an interface.  Use the
12988         correct name also for those properties (the same CSC uses,
12989         although that is really not needed).
12990
12991         (Property.Emit): Do not emit attributes for explicitly implemented
12992         properties, as there is no TypeBuilder.
12993
12994         (Indexer.Emit): ditto.
12995
12996         Hiding then means that we do not really *implement* a pending
12997         implementation, which makes code fail.
12998
12999 2002-06-22  Martin Baulig  <martin@gnome.org>
13000
13001         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13002         the return value of Object.GetType().  [FIXME: we need to do this whenever
13003         we get a type back from the reflection library].
13004
13005 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13006
13007         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13008
13009 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * attribute.cs: Return null if we can not look up the type.
13012
13013         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13014         the interface types found.
13015
13016         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13017         interface types found.
13018
13019         * typemanager.cs (GetInterfaces): Make this routine returns alll
13020         the interfaces and work around the lame differences between
13021         System.Type and System.Reflection.Emit.TypeBuilder in the results
13022         result for GetInterfaces.
13023
13024         (ExpandInterfaces): Given an array of interface types, expand and
13025         eliminate repeated ocurrences of an interface.  This expands in
13026         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13027         be IA, IB, IC.
13028
13029 2002-06-21  Martin Baulig  <martin@gnome.org>
13030
13031         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13032         on System.Enum.
13033
13034 2002-06-21  Martin Baulig  <martin@gnome.org>
13035
13036         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13037         and called with one of the core types, return the corresponding typebuilder for
13038         that type.
13039
13040         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13041         element type.
13042
13043 2002-06-21  Martin Baulig  <martin@gnome.org>
13044
13045         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13046         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13047         (Expression.ConvertReferenceExplicit): Likewise.
13048
13049         * expression.cs (ElementAccess.DoResolve): Likewise.
13050         (ElementAccess.DoResolveLValue): Likewise.
13051
13052 2002-06-10  Martin Baulig  <martin@gnome.org>
13053
13054         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13055         add the "value" parameter to the parameter list.
13056
13057         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13058         to our caller.
13059
13060 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13061
13062         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13063         the argument to an int, uint, long or ulong, per the spec.  Also
13064         catch negative constants in array creation.
13065
13066 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13067
13068         * class.cs: do not allow the same interface to appear twice in
13069         the definition list.
13070
13071 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13072
13073         * ecore.cs: don't use ldlen with System.Array.
13074
13075 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13076
13077         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13078
13079 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13080
13081         * modifiers.cs: produce correct field attributes for protected
13082         internal. Easy fix so miguel can work on ther harder stuff:-)
13083
13084 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13085
13086         * pending.cs: New file.  Move the code from class.cs here.
13087         Support clearning the pending flag for all methods (when not doing
13088         explicit interface implementation).
13089
13090 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13091
13092         * rootcontext.cs: added a couple more types needed to bootstrap.
13093
13094 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13097         constructor in the type, instead of any constructor in the type
13098         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13099         a bug in the Mono runtime when applying the params attribute). 
13100
13101 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13102         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13103
13104 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13105
13106         * expression.cs (Unary.ResolveOperator): Use TypeManager
13107         to resolve the type.
13108
13109 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13110
13111         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13112         attached.
13113
13114         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13115         with each member too.
13116
13117         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13118         field builders too - this takes care of the enum member case.
13119
13120 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13121
13122         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13123         address-of operator on both value types and pointers.
13124
13125 2002-06-10  Martin Baulig  <martin@gnome.org>
13126
13127         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13128         PropertyBuilder to the `property_builders' list.
13129
13130         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13131         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13132         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13133         find any indexers which are inherited from an interface.
13134
13135 2002-06-09  Martin Baulig  <martin@gnome.org>
13136
13137         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13138         the same type as the constant if necessary.  There's also a test-130.cs
13139         for this.
13140
13141         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13142
13143         * typemanager.cs (TypeManager.ChangeType): Previously known as
13144         Enum.ChangeEnumType().
13145
13146 2002-06-09  Martin Baulig  <martin@gnome.org>
13147
13148         * expression.cs (Cast.TryReduce): Added support for consts.
13149
13150 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13151
13152         * class.cs (Accessor): Hold attributes information so we can pass
13153         it along.
13154
13155         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13156         Modify to pass in attributes attached to the methods.
13157
13158         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13159
13160         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13161         to handle the Accessor kind :-)
13162
13163         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13164
13165 2002-06-08  Martin Baulig  <martin@gnome.org>
13166
13167         * expression.cs (Unary.TryReduceNegative): Added support for
13168         ULongConstants.
13169
13170 2002-06-08  Martin Baulig  <martin@gnome.org>
13171
13172         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13173         name can't be found in the `defined_names' - the caller will do a
13174         MemberLookup in this case and thus find methods in System.Enum
13175         such as Enum.IsDefined().
13176
13177 2002-06-08  Martin Baulig  <martin@gnome.org>
13178
13179         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13180         Convert.ChangeType() which works with TypeBuilder created types.
13181         (Enum.LookupEnumValue, Enum.Define): Use it here.
13182
13183         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13184         `TypeBuilder.BaseType != null' check.
13185         (TypeContainer.FindMembers): Only lookup parent members if we
13186         actually have a parent.
13187         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13188         (ConstructorInitializer.Resolve): Likewise.
13189
13190         * interface.cs (Interface.FindMembers): Added
13191         `TypeBuilder.BaseType != null' check.
13192
13193         * rootcontext.cs (RootContext.ResolveCore): Added
13194         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13195         classes_second_stage.
13196
13197         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13198         debug_type and trace_type when compiling with --nostdlib.       
13199
13200 2002-06-07  Martin Baulig  <martin@gnome.org>
13201
13202         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13203         (AddField): Set it to true when adding a non-static field.
13204         (DefineType): Use `have_nonstatic_fields' to find out whether we
13205         have non-static fields, not `Fields != null'.
13206
13207 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13208
13209         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13210         dereferencing a null on the static-field code path)
13211
13212 2002-05-30  Martin Baulig  <martin@gnome.org>
13213
13214         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13215         to take command line arguments.  Use reflection to call the new
13216         custom `Initialize' function on the symbol writer and pass it the
13217         command line arguments.
13218
13219         * driver.cs (--debug-args): New command line argument to pass command
13220         line arguments to the symbol writer.
13221
13222 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13223
13224         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13225         the target type for indexers and properties.  Thanks to Joe for
13226         catching this.
13227
13228 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13229
13230         * typemanager.cs (MethodFlags): returns the method flags
13231         (Obsolete/ShouldIgnore) that control warning emission and whether
13232         the invocation should be made, or ignored. 
13233
13234         * expression.cs (Invocation.Emit): Remove previous hack, we should
13235         not do this on matching a base type, we should do this based on an attribute
13236
13237         Only emit calls to System.Diagnostics.Debug and
13238         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13239         on the command line.
13240
13241         * rootcontext.cs: Global settings for tracing and debugging.
13242
13243         * cs-tokenizer.cs (define): New utility function to track
13244         defines.   Set the global settings for TRACE and DEBUG if found.
13245
13246 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13247
13248         * interface.cs (Populate*): Pass in the TypeContainer as well as
13249         the DeclSpace as parameters so that we can create EmitContexts and
13250         then use that to apply attributes etc.
13251
13252         (PopulateMethod, PopulateEvent, PopulateProperty)
13253         (PopulateIndexer): Apply attributes everywhere.
13254
13255         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13256         etc.
13257
13258         (ApplyAttributes): Update accordingly.
13259
13260         We now apply interface attributes for all members too.
13261
13262 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13263
13264         * class.cs (Indexer.Define); Correctly check if we are explicit
13265         implementation (instead of checking the Name for a ".", we
13266         directly look up if the InterfaceType was specified).
13267
13268         Delay the creation of the PropertyBuilder.
13269
13270         Only create the PropertyBuilder if we are not an explicit
13271         interface implementation.   This means that explicit interface
13272         implementation members do not participate in regular function
13273         lookups, and hence fixes another major ambiguity problem in
13274         overload resolution (that was the visible effect).
13275
13276         (DefineMethod): Return whether we are doing an interface
13277         implementation. 
13278
13279         * typemanager.cs: Temporary hack until we get attributes in
13280         interfaces (Ravi is working on that) and we get IndexerName
13281         support in interfaces.
13282
13283         * interface.cs: Register the indexers as properties.
13284
13285         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13286         warning, I have verified that this is a bug in the .NET runtime
13287         (JavaScript suffers of the same problem).
13288
13289         * typemanager.cs (MemberLookup): When looking up members for
13290         interfaces, the parent of an interface is the implicit
13291         System.Object (so we succeed in searches of Object methods in an
13292         interface method invocation.  Example:  IEnumerable x;  x.ToString
13293         ()) 
13294
13295 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * class.cs (Event): Events should also register if they do
13298         implement the methods that an interface requires.
13299
13300         * typemanager.cs (MemberLookup); use the new GetInterfaces
13301         method. 
13302
13303         (GetInterfaces): The code used to lookup interfaces for a type is
13304         used in more than one place, factor it here. 
13305
13306         * driver.cs: Track the errors at the bottom of the file, we kept
13307         on going.
13308
13309         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13310         instance if the method we are calling is static!
13311
13312 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13313
13314         * attribute.cs (ApplyAttributes): Make this function filter out
13315         the IndexerName attribute (as that attribute in reality is never
13316         applied) and return the string constant for the IndexerName
13317         attribute. 
13318
13319         * class.cs (TypeContainer.Emit): Validate that all the indexers
13320         have the same IndexerName attribute, and if so, set the
13321         DefaultName attribute on the class. 
13322
13323         * typemanager.cs: The return value might contain other stuff (not
13324         only methods).  For instance, consider a method with an "Item"
13325         property and an Item method.
13326
13327         * class.cs: If there is a problem with the parameter types,
13328         return. 
13329
13330 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13331
13332         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13333         looks at user defined conversion after making a call to 
13334         StandardConversionExists - we need this for overload resolution.
13335
13336         * expression.cs : Update accordingly the various method calls.
13337
13338         This fixes 2 bugs filed against implicit user defined conversions 
13339
13340 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13341
13342         * statement.cs: Track the result of the assignment.
13343
13344 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * expression.cs (MemberAccess): Improved error reporting for
13347         inaccessible members.
13348
13349 2002-05-22  Martin Baulig  <martin@gnome.org>
13350
13351         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13352         itself with debugging support.
13353
13354 2002-05-22  Martin Baulig  <martin@gnome.org>
13355
13356         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13357         Removed, this isn't needed anymore.
13358
13359 2002-05-20  Martin Baulig  <martin@gnome.org>
13360
13361         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13362         be underlying type for an enum.
13363
13364 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13365
13366         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13367         that splits out the loading of just the core types.
13368
13369         * rootcontext.cs (ResolveCore): Split the struct resolution in
13370         two, so we can load the enumeration underlying types before any
13371         enums are used.
13372
13373         * expression.cs (Is): Bandaid until we fix properly Switch (see
13374         bug #24985 for details).
13375
13376         * typemanager.cs (ImplementsInterface): The hashtable will contain
13377         a null if there are no interfaces implemented.
13378
13379 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * cs-parser.jay (indexer_declarator): It is fine to have array
13382         parameters
13383
13384 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13385
13386         * typemanager.cs: (RegisterBuilder): New function used to register
13387         TypeBuilders that implement interfaces.  Since
13388         TypeBuilder.GetInterfaces (as usual) does not work with lame
13389         Reflection.Emit. 
13390         (AddUserType): register interfaces.
13391
13392         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13393         dealing with TypeBuilder.  Also, arrays are showing up as
13394         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13395         methods can not be invoked on them!
13396
13397         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13398         (ImplicitReferenceConversionExists): Split out from
13399         StandardConversionExists. 
13400
13401         * expression.cs (As): We were only implementing one of the three
13402         cases for the as operator.  We now implement them all.
13403         (Is): Implement the various other cases for Is as well.
13404
13405         * typemanager.cs (CACHE): New define used to control if we want or
13406         not the FindMembers cache.  Seems to have a negative impact on
13407         performance currently
13408
13409         (MemberLookup): Nested types have full acess to
13410         enclosing type members
13411
13412         Remove code that coped with instance/static returns for events, we
13413         now catch this in RealFindMembers.
13414
13415         (RealFindMembers): only perform static lookup if the instance
13416         lookup did not return a type or an event.  
13417
13418 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13419
13420         * assign.cs (CompoundAssign): We pass more semantic information
13421         now to Compound Assignments than we did before: now we have all
13422         the information at hand, and now we resolve the target *before* we
13423         do the expression expansion, which allows the "CacheValue" method
13424         to have the effect we intended (before, a [x] += 1 would generate
13425         two differen ArrayAccess expressions from the ElementAccess,
13426         during the resolution process).
13427
13428         (CompoundAssign.DoResolve): Resolve target and original_source here.
13429
13430 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * expression.cs (ArrayAccess): dropped debugging information. 
13433
13434         * typemanager.cs: Small bug fix: I was always returning i_members,
13435         instead of one of i_members or s_members (depending on which had
13436         the content).
13437
13438         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13439         method is invoked before any code generation takes place, and it
13440         is a mechanism to inform that the expression will be invoked more
13441         than once, and that the method should use temporary values to
13442         avoid having side effects
13443
13444         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13445
13446         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13447         implementation.
13448
13449         * expression.cs (Indirection, ArrayAccess): Add support for
13450         CacheTemporaries in these two bad boys. 
13451
13452         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13453         ldobj or ldind_ref.  
13454         (StoreFromPtr): Handle stobj as well.
13455
13456         * expression.cs (UnaryMutator): Share more code.
13457
13458         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13459         down: I was not tracking the Filter function as well, which
13460         was affecting the results of the cache.
13461
13462 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13463
13464         * attribute.cs: Remove the hack to handle the CharSet property on
13465         StructLayouts. 
13466
13467 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13468
13469         * attribute.cs (DoResolve): More uglyness, we now only try to
13470         resolve the attribute partially, to extract the CharSet
13471         information (only if we are a StructLayout attribute).  Otherwise 
13472
13473         (GetExtraTypeInfo): Add some code to conditionally kill in the
13474         future this.   I am more and more convinced that the .NET
13475         framework has special code to handle the attribute setting on
13476         certain elements.
13477
13478         * expression.cs (IsParamsMethodApplicable): Revert my previous
13479         foreach change here, it was wrong.
13480
13481 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13482
13483         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13484         (pp_expr): do not abort on unknown input, just return.
13485         (eval): abort if there are pending chars.
13486
13487         * attribute.cs (Attribute.Resolve): Positional parameters are
13488         optional.  Deal with that case.
13489
13490         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13491         the Ansi/Unicode/Auto information for the type.
13492
13493         (TypeContainer.DefineType): instantiate the EmitContext here, as
13494         we will be using it during the type definition (to resolve
13495         attributes) and during the emit phase.
13496
13497         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13498         to pull type information out of the attributes
13499
13500         (Attribute.Resolve): track the constructor builder, and allow for
13501         multiple invocations (structs and classes will use this).
13502
13503         * ecore.cs (MemberLookupFinal): new version with all the
13504         parameters customizable.
13505
13506         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13507         constructors.  Return if the result value is null (as the error
13508         would have been flagged already by MemberLookupFinal)
13509
13510         Do not allow instances of abstract classes or interfaces to be
13511         created.
13512
13513         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13514         We have to compare the assembly property here when dealing with
13515         FamANDAssem and Assembly access modifiers, because we might be
13516         creating an assembly from *modules* (that means that we are not
13517         getting TypeBuilders for types defined in other modules that are
13518         part of this assembly).
13519
13520         (Method.Emit): If the method is marked abstract and has a body,
13521         emit an error. 
13522
13523         (TypeContainer.DefineMembers): If both the defined member and the
13524         parent name match are methods, then do not emit any warnings: let
13525         the Method.Define routine take care of flagging warnings.  But if
13526         there is a mismatch (method overrides something else, or method is
13527         overriwritten by something, then emit warning).
13528
13529         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13530         set to null, this means `do not check for the return type on the
13531         signature'. 
13532
13533         (Method.Define): set the return type for the method signature to
13534         null, so that we get methods with the same name and parameters and
13535         different return types.  This is used to flag warning 114 (you are
13536         hiding a method, and you probably want to use the new/override
13537         keywords instead).
13538
13539         * typemanager.cs (MemberLookup): Implemented proper access
13540         control, closing a long standing set of bug reports.  The problem
13541         was that the Framework only has two bits: Public and NonPublic,
13542         and NonPublic includes private and protected methods, but we need
13543         to enforce the FamANDAssem, FamOrAssem and Family. 
13544
13545 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13546
13547         * statement.cs (GotoCase): Return true: Ammounts to giving up
13548         knowledge on whether we return or not, and letting the other case
13549         be responsible for it.
13550
13551 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * driver.cs: Do not load directories for each file processed, only
13554         do it if there is a pattern.
13555
13556         * ecore.cs: Report readonly assigns here as well, as we might have
13557         been resolved only by MemberAccess.
13558
13559         (SimpleName.SimpleNameResolve): Also be useful for LValue
13560         resolution.   We need this to propagate assign to local readonly variables
13561
13562         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13563         do not want to reuse potential criteria memory.
13564
13565         * class.cs (MyEventBuilder): Set reflected_type;
13566
13567         * ecore.cs (Constantify): Added support for constifying bools.
13568
13569         (RootContext.LookupType): Added a cache for values looked up in
13570         the declaration space.
13571
13572         * typemanager.cs (FindMembers): Now is a front-end to
13573         RealFindMembers, and provides a two-level hashtable-based cache to
13574         the request.  
13575
13576         15% performance improvement: from 22.5 to 19.2 seconds.
13577
13578         * expression.cs (IsParamsMethodApplicable): use foreach.
13579         (Invocation.DoResolve): ditto.
13580         (New.DoResolve): ditto.
13581         (ArrayCreation.DoResolve): ditto.
13582
13583         * ecore.cs (FindMostEncompassingType): use foreach.
13584
13585         * delegate.cs (NewDelegate.DoResolve): Use foreach
13586
13587         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13588         (RemoveMethods): use foreach.
13589
13590         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13591         nested foreach statements instead of for, and also break out of
13592         the inner loop once a match is found.
13593
13594         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13595
13596 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13597
13598         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13599         we actually unwrap the expression to allow for extra information
13600         to be extracted. 
13601
13602         * expression.cs: Use Shr_Un on unsigned operations. 
13603
13604 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13605
13606         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13607         applicable operators was not being considered correctly. This closes
13608         the bug Miguel reported.
13609
13610 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13611
13612         * attribute.cs: check that the type derives from System.Attribute
13613         and report the correct error in that case (moved the duplicate code to
13614         its own method, too).
13615
13616 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13617
13618         * attribute.cs: lookup attribute type name as the spec says: first the
13619         bare attribute name and then name + "Attribute" (nant compiles with
13620         mcs after this fix).
13621
13622 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13625         Because of the way we parse things, we should try to see if a
13626         UIntConstant can fit in an integer.
13627
13628 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13629
13630         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13631         when we are in an explicit context.
13632
13633         (ConvertReferenceExplicit): When converting from Iface type S to Class
13634         T make sure the rules are implemented as an OR.
13635
13636         * parameter.cs (ParameterType): Make it a property for now although the
13637         purpose really isn't anything immediate.
13638
13639         * expression.cs (Is*Applicable): Do better checking on the parameter type
13640         of a ref/out parameter. The ones from the system assemblies are already 
13641         marked with the correct type so we don't need to do any correction.
13642
13643         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13644         the object type is standard too so include that.
13645
13646 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13647
13648         * ecore.cs (StandardConversionExists): Augment with missing code:
13649         deal with IntConstant, LongConstants and Enumerations.
13650
13651         * assign.cs: Report the error, instead of failing silently
13652
13653         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13654         typecontainer that they are declared, because the
13655         typecontainer/namespace will have the list of using clauses that
13656         need to be applied.
13657
13658         Assembly Attributes were escaping the normal registration
13659         mechanism. 
13660
13661         (EmitCode): Apply attributes within an EmitContext that represents
13662         the container they were declared on.
13663
13664         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13665
13666 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13667
13668         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13669         Revamp completely - make much cleaner as we now operate only
13670         on a set of Types.
13671
13672         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13673         to implement the logic detailed in the spec more correctly.
13674
13675         (UserDefinedConversion): Update accordingly.
13676
13677 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * statement.cs: Return flow analysis information up.
13680
13681         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13682         and the default.
13683
13684         (token): Do not consume an extra character before calling
13685         decimal_digits.
13686
13687 2002-05-06  Piers Haken <piersh@friskit.com>
13688
13689         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13690
13691 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13692
13693         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13694         EmitContext during the instance constructor initializer
13695         resolution, to stop access to instance variables.
13696
13697         This is mandated by the spec, last paragraph of the `constructor
13698         initializers' section. 
13699
13700 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13701
13702         * cs-parser.jay, class.cs (Accessor): new class used to represent
13703         an accessor (get or set).  In the past we used `null' to represent
13704         a missing accessor.  But this is ambiguous because there was no
13705         way to tell in abstract indexers/properties if one of them was
13706         specified.
13707
13708         Now there is a way of addressing that.
13709
13710         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13711         instead of FindMembers.
13712
13713         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13714         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13715
13716         * attribute.cs: Treat indexers and properties as the same in terms
13717         of applying attributes
13718
13719         * ecore.cs (FindMostEncompassedType): Use statically initialized
13720         EmptyExpressions()s like we do elsewhere to avoid creating useless
13721         objects (and we take this out of the tight loop).
13722
13723         (GetConversionOperators): Move the code to extract the actual
13724         operators to a separate routine to clean things up.
13725
13726 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13729         events are always registered FieldBuilders.
13730
13731         * class.cs (FieldBase): New class shared by Fields 
13732
13733         * delegate.cs: If we are a toplevel delegate, use our full name.
13734         If we are a nested delegate, then only use our tail name.
13735
13736 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13737
13738         * expression.cs (IsApplicable): Ensure that we add the "&" to
13739         ref/out types before comparing it with the type of the argument.
13740
13741         (IsParamsMethodApplicable): Ditto.
13742
13743         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13744         silly me ;-)
13745
13746         * delegate.cs : Handle the case when we have more than one applicable
13747         method. Flag an error only when we finish checking all.
13748
13749 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * expression.cs: Add support for boolean static initializers.
13752
13753 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13754
13755         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13756
13757         * parameter.cs (ComputeParameterTypes,
13758         ComputeAndDefineParameterTypes): Better error handling: now we
13759         clear the `types' cache if we fail during any of the type lookups.
13760         We also return the status code correctly to our caller
13761
13762         * delegate.cs: If we fail to define a delegate, abort the extra
13763         steps. 
13764
13765         * expression.cs (Binary.ResolveOperator): for
13766         operator==(object,object) and operator !=(object, object) we also
13767         have to verify that there is an implicit conversion from one to
13768         the other.
13769
13770         (ArrayAccess.DoResolve): Array Access can operate on
13771         non-variables. 
13772
13773 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * assign.cs (CompoundAssign): A new class used as a "flag" that
13776         the assignment actually is happening as part of a compound
13777         assignment operator.
13778
13779         During compound assignment, a few new rules exist to enable things
13780         like:
13781
13782         byte b |= 1 + 2
13783
13784         From the spec:
13785
13786         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13787         to the type of x) if y is implicitly convertible to the type of x,
13788         and the operator is a builtin operator and the return type of the
13789         operator is explicitly convertible to the type of x. 
13790
13791         * rootcontext.cs: Reset warning level to 2.  4 catches various
13792         "interesting" features in mcs, we must clean this up at some
13793         point, but currently am trying to kill other bugs ;-)
13794
13795         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13796         in container classes as well.  
13797
13798         * expression.cs (Binary.ResolveOperator): Handle string case
13799         before anything else (as operator overloading does emit an error
13800         before doing anything else).
13801
13802         This code could go away when we move to a table driven model, but
13803         i could not come up with a good plan last night.
13804
13805 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13806
13807         * typemanager.cs (CSharpName): reimplementation using regex.
13808         * class.cs: added null check for fields in Emit
13809         * rootcontext.cs: set warninglevel to 4
13810
13811 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13812
13813         * typemanager.cs (CSharpName): reimplemented with Lupus
13814         suggestion.
13815
13816 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13817
13818         * statement.cs (If): correclty implement Resolve, because we were
13819         not catching sem errors in there.  The same process is needed
13820         everywhere else. 
13821         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13822
13823
13824         (Statement.Warning_DeadCodeFound): Factorize code.
13825         (While): Report dead code here too.
13826
13827         (Statement): Added Resolve virtual method to allow
13828         for resolution split from the emit code.
13829
13830 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13831
13832         * statement.cs (EmitBoolExpression): No longer try to resolve the
13833         expression here.    
13834         (MakeBoolean): New utility function that resolve, implicitly
13835         converts to boolean and tags the expression. 
13836
13837
13838         (If, Do): Implement dead code elimination.
13839         (While): Implement loop inversion
13840
13841         (Do, While, For, If): Resolve the expression prior to calling our
13842         code generation.
13843
13844 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13845
13846         * class.cs:
13847           - added method Report28 (warning: program has more than one entry point)
13848           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13849           - modified method Method.Define, the part at the end of the method
13850
13851         * rootcontext.cs: added static public Location EntryPointLocation;
13852           
13853         * ../errors/cs0028.cs : Add test case for the above warning.              
13854
13855         * typemanager.cs:
13856           - modified method CSharpName to allow arrays of primitive type to
13857             be printed nicely (e.g. instead of System.Int32[][] it now prints
13858             int[][])
13859           - added method CSharpSignature: returns the signature of a method
13860             in string format to be used in reporting errors, warnings, etc.
13861
13862         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13863         with String.Empty.
13864
13865 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13866
13867         * delegate.cs (Define): Fix extremely silly bug where I was
13868         setting the type of the 'object' parameter of the BeginInvoke
13869         method to System.IAsyncResult instead of System.Object ;-)
13870
13871 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13872
13873         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13874         here. 
13875
13876         (Constructor.Emit): return if we fail to initialize the
13877         constructor.  Another door closed!  
13878
13879         * expression.cs (New.DoResolve): Improve error message (from -6 to
13880         1501).  Use DeclaredOnly lookup to find the exact constructor.
13881
13882         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13883         loop.  This is useful.
13884
13885         * cs-parser.jay: Adjust the default parameters so that destructors
13886         have the proper signature.
13887
13888 2002-04-26  Martin Baulig  <martin@gnome.org>
13889
13890         * driver.cs (LoadAssembly): If `assembly' contains any characters
13891         which are only valid in path names and not in assembly names
13892         (currently slash, backslash and point), use Assembly.LoadFrom ()
13893         instead of Assembly.Load () on the `assembly' (before iteration
13894         over the link_paths).
13895
13896 2002-04-26  Martin Baulig  <martin@gnome.org>
13897
13898         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13899
13900 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13901
13902         * class.cs (Property): use the new typemanager.MemberLookup
13903
13904         (TypeContainer.MemberLookup): Implement using the
13905         TypeManager.MemberLookup now. 
13906
13907         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13908         and return MemberInfos, so that these can be used without an
13909         EmitContext (what we had before).
13910
13911 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * expression.cs: Fix the case where the argument to params if the
13914         type of the params.  I omitted handling this before.   Fixed
13915
13916 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13917
13918         * driver.cs: Call BootCorlib_PopulateCoreType
13919
13920         * class.cs (Property.CheckBase): Check for properties only, not
13921         for all members. 
13922
13923         * interface.cs: Temporary hack: try/catch around the
13924         CustomAttributeBuilder, because I am getting an exception that I
13925         do not understand.
13926
13927         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13928         types whose definitions are required to be there (attributes are
13929         defined before standard types).
13930
13931         Compute definitions as we boot the various types, as they are used
13932         immediately (value_type class will need object_type, but if we do
13933         not initialize object_type, we will pass a null, which will let
13934         the runtime pick the System.Object from the existing corlib, which
13935         is not what we want).
13936
13937 2002-04-22  Patrik Torstensson <totte@labs2.com>
13938
13939         * cs-tokenizer.cs: fixed a number of trim() issues.
13940
13941 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13942
13943         * expression.cs (Argument.Type): Ensure that we return the correct
13944         type when we have out or ref parameters [in which case we 
13945         append a "&"].
13946
13947 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * class.cs (Property, Indexer): Allow extern modifier in there. 
13950
13951         * typemanager.cs (InitBaseTypes): Initializes object_type and
13952         value_type, since those will be used early on during the bootstrap
13953         process to compile corlib.
13954
13955         (InitCoreTypes): Move code from here to InitBaseTypes.
13956
13957 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13958
13959         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13960         single-dimension arrays as using the ldlen opcode.  
13961
13962         Daniel Lewis discovered this optimization.  
13963
13964         * typemanager.cs: Add signature for System.Array::get_Length
13965
13966 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13967
13968         * statement.cs: report the error when the foreach does not apply to an
13969         array nor a collection.
13970
13971 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13972
13973         * expression.cs: Add implicit conversions to the operator ~.
13974
13975         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13976
13977         * typemanager.cs: Locate the decimal constructor.
13978
13979 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13980
13981         * attribute.cs: use the new property of TypeOf.
13982         * expression.cs: added 'get' property around typearg.
13983
13984         These changes fix a build breaker reported by NickD. Is this the
13985         correct way to fix?  If not, please, revert my changes and make it
13986         work :-).
13987
13988 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13989
13990         * attribute.cs: Add support for typeof in attribute invocations.
13991         I am not sure that this is right though.
13992
13993 2002-04-14  Duncan Mak  <duncan@ximian.com>
13994
13995         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13996         Binary.Operator.Division case.
13997
13998 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13999
14000         * class.cs (DefineType): Ensure that we do a proper check on
14001         attribute types and also register it with the TypeManager.
14002
14003         (TypeContainer.Targets): The default for attribute types is
14004         AttributeTargets.All.
14005
14006         * attribute.cs (ApplyAttributes): Registering the attribute type
14007         is done elsewhere, not when we discover we have a Usage attribute.
14008
14009 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14010
14011         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14012         and get rid of is_delegate parameter.
14013
14014         * everywhere : update.
14015
14016 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14017
14018         * cs-parser.jay (compilation_unit): Revamp completely to use
14019         some new ideas that I got from Rhys' grammar to solve the problems
14020         with assembly level attributes.
14021
14022         (outer_declaration): New grammar production.
14023
14024         (attribute_sections): Add.
14025
14026         (opt_attributes): Base on attribute_sections
14027
14028         (namespace_declaration): Allow opt_attributes to tackle the case
14029         when we have assembly level attributes - we are clever in this
14030         regard now ;-)
14031
14032         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14033         attributes in the non-global context.
14034
14035         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14036         instead of SetGlobalAttributes.
14037
14038         * class.cs, rootcontext.cs : Ensure we define and generate 
14039         attribute types before anything else.
14040
14041         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14042         and flag the new error -20 for the case when the attribute type
14043         does not have valid targets specified. csc does not catch this.
14044
14045         * ../errors/errors.txt : update for error # -20
14046
14047 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14048
14049         * support.cs (InternalParameters.ParameterModifier): Do some null
14050         checking and return sane values.
14051
14052         * class.cs (Method.Define): If we are a PInvoke method, ensure
14053         that we are static and extern. Report error # 601
14054
14055         * ../errors/cs0601.cs : Add test case for the above error.
14056
14057 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14058
14059         * rootcontext.cs (attribute_types): We need to keep type of
14060         all attribute types separately and emit code for them first.
14061
14062         (RegisterAttribute) : Implement.
14063
14064         * class.cs (DefineType): Check if the current Type is a custom
14065         attribute type and register it accordingly.
14066
14067         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14068         adding the first attribute twice and rename to
14069
14070         (SetGlobalAttributes): this.
14071
14072         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14073         lookups.
14074
14075         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14076         if we are processing global arguments. Hmm, I am unsure of this.
14077
14078 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14079
14080         * expression.cs: added static array of strings to avoid calling
14081         Enum.ToString () for Operator in Binary. Significant recover of
14082         performance.
14083
14084 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14085
14086         * class.cs (FindMembers): Allow the Builders of the various
14087         members to be null.  If they are skip them.  This only happens
14088         during the PInvoke declaration.
14089
14090 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14091
14092         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14093         failure, so we do not keep going afterwards.
14094
14095         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14096         wanted to pass `false' as the `is_delegate' argument.  If this is
14097         the case, why not use delegate_type == null to mean `is_delegate =
14098         false' and anything else as is_delegate = true.
14099
14100 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14101
14102         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14103         code for the section, not the beginning of the tests.
14104
14105 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14106
14107         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14108
14109         * expression.cs (Binary): same.  Warn about errors where we have
14110         Enum/Enum in operator + as well.
14111
14112 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14113
14114         * statement.cs:
14115                 - added support for switch(bool)
14116                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14117                 - add TableSwitchEmit() to handle table-based switch statements
14118
14119 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14120
14121         * expression.cs (Invocation.OverloadResolve): Factor out code which
14122         does parameter compatibility checking with arguments so that we can 
14123         re-use the code even from Delegate.VerifyApplicability
14124
14125         (VerifyArgumentsCompat): Move above code here.
14126
14127         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14128         and instead make a call to the above method.
14129
14130 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14131
14132         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14133         We use it to keep track of classes which are attribute types.
14134
14135 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14136
14137         * delegate.cs (Delegate.Define): Correctly define the types in the
14138         presence of fixed and array parameters.
14139
14140         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14141         doing FindMembers.
14142
14143         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14144         include NonPublic after the first iteration.
14145
14146         * class.cs (Indexer.CheckBase): Only check if both parents are
14147         non-null. 
14148
14149         * cs-parser.jay (accessor_body): If empty, set to null.
14150
14151         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14152         same code path here to resolve constants names that we did have in
14153         MemberAccess.DoResolve.  There is too much code duplicated here.
14154
14155 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14156
14157         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14158
14159         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14160         to MakeUnionSet.
14161
14162         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14163         tokens, numbers and strings.
14164
14165         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14166         parenthesis.
14167
14168         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14169         asyncronous parameters and the regular parameters.  
14170
14171         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14172         specify the target directory.
14173
14174         * expression.cs: (This.DoResolve): Simplify
14175         (As.Emit): Optimize, do not generate IsInst if the expression is
14176         always of the given type.
14177
14178         (Is.DoResolve): Bug fix, we were reporting both always/never for
14179         the is expression.
14180
14181         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14182         creating too many unnecessary arrays.
14183
14184 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14185
14186         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14187         fields instead of rolling our own initializer.   Takes care of all
14188         implicit conversions, and drops unnecessary static checks/argument.
14189
14190 2002-03-31  Dick Porter  <dick@ximian.com>
14191
14192         * driver.cs: use the GetDirectories() return values properly, and
14193         use "/" as path separator.
14194
14195 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14196
14197         * expression.cs (Unary): Optimize - - expr into expr.
14198         (Binary): Optimize a + (-b) into a -b.
14199
14200         * codegen.cs (CodeGen): Made all methods static.
14201
14202 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14203
14204         * rootcontext.cs: 
14205
14206         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14207         TypeBuilder property.
14208
14209         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14210         instead. 
14211
14212         * tree.cs: Removed the various RecordXXXX, and replaced with a
14213         single RecordDecl.  Removed all the accessor methods, and just
14214         left a single access point Type 
14215
14216         * enum.cs: Rename DefineEnum to DefineType.
14217
14218         * decl.cs: New abstract method `DefineType' used to unify the
14219         Defines for Enumerations, Interfaces, TypeContainers and
14220         Delegates.
14221
14222         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14223         LookupBaseClasses method that used to live in class.cs and
14224         interface.cs here, and renamed to FindType.
14225
14226         * delegate.cs: Implement DefineType.  Take advantage of the
14227         refactored pattern for locating the parent builder without taking
14228         the parent_builder argument (which we know does not work if we are
14229         nested, and triggering a toplevel definition).
14230
14231 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14232
14233         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14234         accessibility of a member has changed during override and report
14235         an error if so.
14236
14237         * class.cs (Method.Define, Property.Define): Only complain on
14238         overrides if the method is private, any other accessibility is
14239         fine (and since we just checked the permission is the same, we are
14240         good to go).
14241
14242         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14243         and elif are processed always.  The other pre-processing
14244         directives are only processed if we are "taking" the path
14245
14246 2002-03-29  Martin Baulig  <martin@gnome.org>
14247
14248         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14249         current location is not Null.
14250
14251         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14252         a separate method so we can profile it.
14253
14254         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14255         `span.Seconds' are just seconds, but no minutes or hours.
14256         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14257
14258 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14259
14260         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14261         Remove the gratuitous set of Final:
14262
14263                                 // If an interface implementation, then we can set Final.
14264                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14265                                     implementing.DeclaringType.IsInterface)
14266                                         flags |= MethodAttributes.Final;
14267
14268         I do not know what I was smoking when I used that.
14269
14270
14271         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14272         step into fixing the name resolution issues for delegates and
14273         unifying the toplevel name resolution.
14274
14275 2002-03-28  Martin Baulig  <martin@gnome.org>
14276
14277         * class.cs (Method.Emit): If we have a symbol writer, call its
14278         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14279         tell it about the current method.
14280
14281         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14282         writer that we're going to emit the first byte of IL code for a new
14283         statement (a new source line).
14284         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14285         EmitContext.Mark() before emitting any code.
14286
14287         * location.cs (SymbolDocument): Return null when we're Null.
14288
14289         * statement.cs (Statement): Moved the `Location loc' variable here.
14290         (Statement.EmitBoolExpression): If we have a symbol writer, call
14291         ec.Mark() before emitting any code to tell it that we're at the
14292         beginning of a new statement.
14293         (StatementExpression): Added `Location' argument to the constructor.
14294         (Block): Added public readonly variable `StartLocation' and public
14295         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14296         (Block): Added constructor which takes a start and end location.
14297         (Block.SetEndLocation): New method. This sets the end location.
14298         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14299         local variables we create.
14300         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14301         each statement and do also mark the begin and end of the block.
14302
14303         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14304         tell it the current lexer.Location, use Location.Null for the end of the
14305         block.
14306         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14307         current block, set its end location using SetEndLocation().
14308         (statement_expression): StatementExpression constructor now takes the
14309         lexer.Location as additional argument.
14310         (for_statement, declare_local_variables): Likewise.
14311         (declare_local_variables): When creating a new implicit block, use the
14312         new Block constructor and pass it the lexer.Location.
14313
14314 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14315
14316         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14317         members also on the parent interfaces recursively.
14318
14319 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14320
14321         * report.cs: Use new formats, since Gonzalo finished the missing
14322         bits. 
14323
14324         * expression.cs (Binary.ResolveOperator): added missing operator|
14325         operator& and operator^ for bool/bool.
14326
14327         * cs-parser.jay: CheckDef now takes a Location argument that is
14328         used to report errors more precisly (instead of reporting the end
14329         of a definition, we try to track something which is a lot closer
14330         to the source of the problem).
14331
14332         * cs-tokenizer.cs: Track global token use, so we can properly flag
14333         the use of #define/#undef after the first token has been seen.
14334
14335         Also, rename the reportXXXX to Error_DescriptiveName
14336
14337         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14338         TypeContainer, so that Enum and Interface can use this too.
14339
14340         * class.cs (TypeContainer.LookupInterfaceOrClass,
14341         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14342         `builder' argument.  Typically this was used to pass the parent
14343         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14344         the definition).  
14345
14346         The problem is that a nested class could trigger the definition of
14347         a toplevel class, and the builder would be obviously wrong in that
14348         case. 
14349
14350         So we drop this argument, and we compute dynamically the
14351         TypeBuilder/ModuleBuilder (the correct information was available
14352         to us anyways from DeclSpace.Parent)
14353
14354         * interface.cs (Interface.DefineInterface): Drop builder
14355         parameter cleanup like class.cs
14356
14357         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14358         like class.cs
14359
14360         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14361         values. 
14362
14363         (Try.Emit): Propagate the returns value from the statement.
14364
14365         (Return.Emit): Even if we are leavning 
14366
14367         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14368
14369         * modifiers.cs: Fix the computation of MethodAttributes flags.
14370
14371 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14372
14373         * driver.cs: allow compilation of files that start with '/'.
14374         Add a default case when checking the argument of --target.
14375
14376 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14377
14378         * interface.cs: Implement the same search algorithm for types in
14379         the interface code.
14380
14381         * delegate.cs: Do not allow multiple definition.
14382
14383         * Recovered ChangeLog that got accidentally amputated
14384
14385         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14386
14387         * rootcontext.cs: Load manually enum to allow core classes to
14388         contain enumerations.
14389
14390         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14391         Update to new static methods in TypeManager.
14392
14393         * typemanager.cs (GetMethod, GetConstructor): Use our
14394         implementation of FindMembers to find the members, since during
14395         corlib compilation, the types are TypeBuilders and GetMethod and
14396         GetConstructor do not work.
14397
14398         Make all methods in TypeManager static.
14399
14400         (InitCodeHelpers): Split the functionality from
14401         the InitCodeTypes function.
14402
14403         * driver.cs: Call InitCodeHelpers after we have populated the
14404         types. 
14405
14406         * cs-parser.jay (delegate_declaration): we did not used to compute
14407         the delegate name correctly for void delegates.
14408
14409 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14410
14411         * rootcontext.cs (RootContext): Init the interface_resolve_order
14412         and type_container_resolve_order always.
14413
14414         (ResolveCore, BootstrapCorlib_ResolveClass,
14415         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14416         compiler when compiling with --nostdlib
14417
14418         * class.cs (TypeContainer.DefineType): Check that our parent is
14419         not null.  This test is most important when we are bootstraping
14420         the core types.
14421
14422         * codegen.cs: Split out the symbol writing code.
14423
14424 2002-03-25  Martin Baulig  <martin@gnome.org>
14425
14426         * driver.cs (-g): Made -g an alias for --debug.
14427
14428 2002-03-24  Martin Baulig  <martin@gnome.org>
14429
14430         * codegen.cs (SymbolWriter): New public variable. Returns the
14431         current symbol writer.
14432         (CodeGen): Added `bool want_debugging_support' argument to the
14433          constructor. If true, tell the ModuleBuild that we want debugging
14434         support and ask it for the ISymbolWriter.
14435         (Save): If we have a symbol writer, call it's Close() method after
14436         saving the assembly.
14437
14438         * driver.c (--debug): New command line argument to create a
14439         debugger information file.
14440
14441         * location.cs (SymbolDocument): New public property. Returns an
14442         ISymbolDocumentWriter object for the current source file or null
14443         if we don't have a symbol writer.
14444
14445 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14446
14447         * driver.cs (LoadAssembly): Correctly return when all the paths
14448         have been tried and not before.
14449
14450         * statement.cs (Switch.Emit): return the actual coverage for this
14451         statement (returns/not-returns)
14452
14453         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14454         switch of the statement if we are the last switch section.  That
14455         kills two problems: try/catch problems (we used to emit an empty
14456         nop at the end) and switch statements where all branches would
14457         return. 
14458
14459 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14460
14461         * driver.cs: Add default assemblies (the equivalent to the
14462         Microsoft CSC.RSP file)
14463
14464         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14465         also update tokens_seen and set it to false.
14466
14467         * driver.cs: Implement --recurse for Mike.
14468
14469         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14470         correctly splitting out the paths.
14471
14472 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14473
14474         * interface.cs (Interface.PopulateProperty): Instead of using
14475         `parent' as the declaration space for the set parameters, use
14476         `this' 
14477
14478         * support.cs (InternalParameters): InternalParameters constructor
14479         takes a DeclSpace instead of a TypeContainer.
14480
14481         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14482         types are being initialized, load the address of it before calling
14483         the function.  
14484
14485         (New): Provide a mechanism to disable the generation of local
14486         value type temporaries when the caller will be providing us with
14487         an address to store it.
14488
14489         (ArrayCreation.EmitDynamicInitializers): Use it.
14490
14491 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14492
14493         * expression.cs (Invocation.EmitArguments): Only probe for array
14494         property if there is more than one argument.  Sorry about that.
14495
14496         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14497         empty param arrays.
14498
14499         * class.cs (Method.LabelParameters): Fix incorrect code path that
14500         prevented the `ParamArrayAttribute' from being applied to the
14501         params attribute.
14502
14503 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14504
14505         * support.cs (ReflectionParameters): Correctly compute whether the
14506         last argument is a params array.  Fixes the problem with
14507         string.Split ('a')
14508
14509         * typemanager.cs: Make the assemblies array always be non-null
14510         (empty, but non-null)
14511
14512         * tree.cs (RecordDecl): New function that abstracts the recording
14513         of names.  This reports error 101, and provides a pointer to the
14514         previous declaration.  Fixes a crash in the compiler.
14515
14516         * cs-parser.jay (constructor_declaration): Update to new grammar,
14517         and provide a constructor_body that can be empty.
14518
14519 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14520
14521         * driver.cs: Add support for --resources.
14522
14523         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14524         Make all types for the various array helper methods be integer.
14525
14526         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14527         CheckState to ConvCast.
14528
14529         (ConvCast): Now it takes a `checked' state argument, to avoid
14530         depending on the emit context for the conversion, and just using
14531         the resolve time setting.
14532
14533         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14534         instead of Invocation.EmitArguments.  We do not emit the original
14535         arguments, instead we emit those which have been converted to
14536         unsigned int expressions.
14537
14538         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14539
14540         * codegen.cs: ditto.
14541
14542         * expression.cs (LocalVariableReference): Drop the use of the
14543         Store function that depended on the variable index.
14544
14545         * statement.cs (VariableInfo): Drop the `Idx' property from this
14546         class, as this is not taking into account the indexes for
14547         temporaries tat we generate during the execution, getting the
14548         indexes wrong.
14549
14550         * class.cs: First emit class initializers, then call the parent
14551         constructor. 
14552
14553         * expression.cs (Binary): Fix opcode emision.
14554         (UnaryMutator.EmitCode): Support checked code generation
14555
14556         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14557         matches for events for both the Static and Instance scans,
14558         pointing to the same element.   Fix that.
14559
14560 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * rootcontext.cs (ResolveTree): Always set the
14563         interface_resolve_order, because nested interfaces will be calling
14564         into us.
14565
14566         * class.cs (GetInterfaceOrClass): Track the same resolution
14567         process used by TypeManager.LookupType.  This fixes the nested
14568         type lookups in class declarations (separate path from
14569         LookupType). 
14570
14571         (TypeContainer.DefineType): Also define nested interfaces.
14572         (TypeContainer.RegisterOrder): New public function used to
14573         register the order in which child interfaces need to be closed.
14574
14575         Nested interfaces need to be closed after their parents have been
14576         created. 
14577
14578         * interface.cs (InterfaceAttr): Put all the logic for computing
14579         the interface attribute here. 
14580
14581         (DefineInterface): Register our interface order with the
14582         RootContext or with the TypeContainer depending on the case.
14583
14584 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14585
14586         * cs-parser.jay: rework foreach statement to work with the new
14587         changes to the policy on SimpleNames.
14588
14589         * report.cs: support Stacktrace on warnings as well.
14590
14591         * makefile: drop --unsafe and /unsafe from the compile.
14592
14593 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14594
14595         * ecore.cs (StandardConversionExists): Modify to take an Expression
14596         as the first parameter. Ensure we do null -> reference type conversion
14597         checking.
14598
14599         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14600         temporary Expression objects.
14601
14602 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14603
14604         * interface.cs: workaround bug in method overloading resolution
14605         (there is already a bugzilla bug for it).
14606
14607 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14608
14609         We could also solve this problem by having a separate path for
14610         performing type lookups, instead of DoResolve, we could have a
14611         ResolveType entry point, and only participating pieces of the
14612         production (simplename, deref, array) would implement this. 
14613
14614         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14615         signal SimpleName to only resolve type names and not attempt to
14616         resolve anything else.
14617
14618         * expression.cs (Cast): Set the flag.
14619
14620         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14621
14622         * class.cs: Only report 108 if there is no `new' modifier.
14623
14624         * cs-parser.jay: rework foreach statement to work with the new
14625         changes to the policy on SimpleNames.
14626         
14627         * report.cs: support Stacktrace on warnings as well.
14628
14629         * makefile: drop --unsafe and /unsafe from the compile.
14630
14631 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14632
14633         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14634         lookups here, instead of doing that at parse time.  This means
14635         that our grammar will not introduce `LocalVariableReferences' as
14636         expressions at this point.  That solves the problem of code like
14637         this:
14638
14639         class X {
14640            static void Main ()
14641            { int X = 1;
14642             { X x = null }}}
14643
14644         This is only half the fix.  The full fix requires parameters to
14645         also be handled in this way.
14646
14647         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14648         makes the use more obvious of the DeclSpace.  The
14649         ec.TypeContainer.TypeBuilder is now only used to pull the
14650         TypeBuilder for it.
14651
14652         My theory is that I can get rid of the TypeBuilder completely from
14653         the EmitContext, and have typecasts where it is used (from
14654         DeclSpace to where it matters).  
14655
14656         The only pending problem is that the code that implements Aliases
14657         is on TypeContainer, and probably should go in DeclSpace.
14658
14659         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14660         lookups here, instead of doing that at parse time.  This means
14661         that our grammar will not introduce `LocalVariableReferences' as
14662         expressions at this point.  That solves the problem of code like
14663         this:
14664
14665         class X {
14666            static void Main ()
14667            { int X = 1;
14668             { X x = null }}}
14669
14670         This is only half the fix.  The full fix requires parameters to
14671         also be handled in this way.
14672
14673         * class.cs (Property.DefineMethod): When implementing an interface
14674         method, set newslot, when implementing an abstract method, do not
14675         set the flag (before we tried never setting it, or always setting
14676         it, which is the difference).
14677         (Indexer.DefineMethod): same.
14678         (Method.DefineMethod): same.
14679
14680         * ecore.cs: Only set the status used flag if we get back a Field.
14681
14682         * attribute.cs: Temporary hack, so Paolo can keep working.
14683
14684 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14685
14686         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14687         the unmanaged type in the case we have a MarshalAs attribute.
14688
14689         (Resolve): Handle the case when we are parsing the special MarshalAs
14690         attribute [we need to store the unmanaged type to use later]
14691
14692         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14693         MarshalAs Attribute.
14694
14695         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14696         on parameters and accordingly set the marshalling info.
14697
14698 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14699
14700         * class.cs: Optimizing slightly by removing redundant code after
14701         we switched to the `NoTypes' return value.
14702         (Property.DefineMethod): use NoTypes here too.
14703
14704         This fixes the bug I introduced in my last batch of changes.
14705
14706 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14707
14708         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14709
14710         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14711         Enums since those are types too. 
14712
14713         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14714
14715         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14716         thanks to a call during the lookup process.
14717
14718 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14719
14720         * statement.cs (Foreach): Lots of work to accomodate a particular
14721         kind of foreach statement that I had not kept in mind.  It is
14722         possible to have foreachs on classes that provide a GetEnumerator
14723         method that return objects that implement the "pattern" for using
14724         a foreach, there is no need to support GetEnumerator
14725         specifically. 
14726
14727         This is needed to compile nant.
14728
14729         * decl.cs: Only report 114 if the member is not `Finalize' and if
14730         the warning level is at least 2.
14731
14732         * class.cs: Moved the compare function from Method to
14733         MethodSignature. 
14734
14735         (MethodSignature.InheritableMemberSignatureCompare): Add new
14736         filter function that is used to extract inheritable methods from a
14737         class. 
14738
14739         (Method.Define): Use the new `inheritable_method_signature_filter'
14740         delegate
14741
14742         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14743         command. 
14744
14745 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14746
14747         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14748
14749         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14750
14751         * expression.cs: Pass location information to
14752         ConvertImplicitStandard. 
14753
14754         * class.cs: Added debugging code to track return values from
14755         interfaces. 
14756
14757 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * expression.cs (Is.DoResolve): If either side of the `is' is an
14760         interface, do not flag the warning.
14761
14762         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14763         for interfaces
14764
14765         * report.cs: Allow for --fatal to be used with --probe.
14766
14767         * typemanager.cs (NoTypes): Move the definition for the empty Type
14768         array here. 
14769
14770         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14771         properties. 
14772         (TypeContainer.DefineProxy): New function used to proxy to parent
14773         implementations when implementing interfaces.
14774         (TypeContainer.ParentImplements): used to lookup if our parent
14775         implements a public function that is required by an interface.
14776         (TypeContainer.VerifyPendingMethods): Hook this up.
14777
14778         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14779         `modules' and `assemblies' arraylists into arrays.  We only grow
14780         these are the very early start up of the program, so this improves
14781         the speedof LookupType (nicely measured).
14782
14783         * expression.cs (MakeByteBlob): Replaced unsafe code with
14784         BitConverter, as suggested by Paolo.
14785
14786         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14787         folding of string concatenation, but if either side is a string,
14788         and the other is not, then return null, and let the runtime use
14789         the concatenation on the string plus the object (using
14790         `Object.ToString'). 
14791
14792 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14793
14794         Constant Folding has been implemented now.
14795
14796         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14797         the error instead on types that are not supported in one's
14798         complement. 
14799
14800         * constant.cs (Constant and all children): New set of functions to
14801         perform implict and explicit conversions.
14802
14803         * ecore.cs (EnumConstant): Implement the new functions to perform
14804         conversion by proxying to the child expression.
14805
14806         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14807         own separate setting that can not be turned off from the command
14808         line using --unchecked or --checked and is only controlled using
14809         the checked/unchecked statements and expressions.  This setting is
14810         used by the constant folder to flag errors.
14811
14812         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14813         ConstantCheckState as well.   
14814
14815         During Resolve, they also have to flag the state, because the
14816         constant folder runs completely in the Resolve phase.
14817
14818         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14819         well.
14820
14821 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14822
14823         * cfold.cs: New file, this file contains the constant folder.
14824
14825         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14826         argument to track whether we are using the resulting address to
14827         load or store a value and provide better error messages. 
14828
14829         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14830         new AddressOf arguments.
14831
14832         * statement.cs (Foreach.EmitCollectionForeach): Update
14833
14834         * expression.cs (Argument.Emit): Call AddressOf with proper
14835         arguments to track usage.
14836
14837         (New.DoEmit): Call AddressOf with new arguments.
14838
14839         (Unary.Emit): Adjust AddressOf call.
14840
14841 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14842
14843         * cs-parser.jay (member_access): Change the case for pre-defined types
14844         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14845         this suggestion.
14846
14847         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14848         a method body.
14849
14850         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14851         essentially like methods and apply attributes like MethodImplOptions to them too.
14852
14853         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14854         not being null.
14855
14856         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14857         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14858         is the DeclSpace.
14859
14860         * Update code everywhere accordingly.
14861
14862         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14863
14864         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14865
14866 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14867
14868         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14869         try performing lookups against those instead of jumping straight into using
14870         the 'using' clauses.
14871
14872         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14873
14874         (LookupType): Perform lookups in implicit parents too.
14875
14876         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14877         sequence as RootContext.LookupType. 
14878
14879         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14880         the various cases of namespace lookups into this method.
14881
14882 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14883
14884         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14885         in positional arguments)
14886
14887         * class.cs (Operator): Update the AllowedModifiers to contain
14888         extern. 
14889
14890         * cs-parser.jay: Update operator declaration to allow for the
14891         operator body to be empty.
14892
14893         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14894         values. 
14895
14896 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14897
14898         * class.cs (Method.Emit): Label parameters.
14899
14900         * driver.cs: Return 1 or 0 as the program exit code.
14901
14902 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14903
14904         * expression.cs: Special case the `null' object when trying to
14905         auto-compute the type, as anything can be explicitly converted to
14906         that. 
14907
14908         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14909         spotting this Paolo.
14910
14911         (Expression.ImplicitNumericConversion): Perform comparissions of
14912         the type using the underlying type in the case of an enumeration
14913         rather than using the enumeration type for the compare.
14914
14915         Cope with the underlying == type case, which is not possible to
14916         catch before. 
14917
14918         (Expression.ConvertNumericExplicit): Perform comparissions of
14919         the type using the underlying type in the case of an enumeration
14920         rather than using the enumeration type for the compare.
14921
14922         * driver.cs: If the user does not supply an extension, assume .exe
14923
14924         * cs-parser.jay (if_statement): Rewrote so that we can track the
14925         location for the if statement.
14926
14927         * expression.cs (Binary.ConstantFold): Only concat strings when
14928         the operation is "+", not everything ;-)
14929
14930         * statement.cs (Statement.EmitBoolExpression): Take a location
14931         argument. 
14932         (If, While, Do): Track location.
14933
14934         * expression.cs (Binary.ResolveOperator): In the object + string
14935         case, I was missing a call to ConvertImplicit
14936
14937 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14938
14939         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14940         Location arguments. Ensure we use RootContext.LookupType to do our work
14941         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14942
14943         * interface.cs (PopulateMethod): Handle the type of the parameter being
14944         null gracefully.
14945
14946         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14947         have a params method with no fixed arguments and a call is made with no
14948         arguments.
14949
14950 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14951
14952         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14953         the verbatim-string-literal
14954
14955         * support.cs (InternalParameters.ParameterModifier): handle null
14956         fixed parameters.
14957         (InternalParameters.ParameterType): ditto.
14958
14959         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14960         duplicating the name of the variable parameter.
14961         (GetParameterByName): Fix bug where we were not looking up array
14962         paramters if they were the only present (thanks Paolo!).
14963         (GetParameterInfo): We only have an empty set of types if both
14964         fixed and array are set to null.
14965         (GetParameterInfo-idx): Handle FixedParameter == null
14966
14967         * cs-parser.jay: Handle the case where there is no catch
14968         statements (missing null test).
14969
14970 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14971
14972         * driver.cs (MainDriver): Be conservative on our command line
14973         handling.
14974
14975         Catch DirectoryNotFoundException when calling GetFiles.
14976
14977         (SplitPathAndPattern): Used to split the input specification into
14978         a path and a pattern that we can feed to Directory.GetFiles.
14979
14980 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14981
14982         * statement.cs (Fixed): Implement the last case of the Fixed
14983         statement (string handling).
14984
14985         * expression.cs (StringPtr): New class used to return a char * to
14986         a string;  Used by the Fixed statement.
14987
14988         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14989
14990         * expression.cs (Binary.ResolveOperator): Remove redundant
14991         MemberLookup pn parent type.
14992         Optimize union call, we do not need a union if the types are the same.
14993         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14994         type.
14995
14996         Specialize the use of MemberLookup everywhere, instead of using
14997         the default settings. 
14998
14999         (StackAlloc): Implement stackalloc keyword.
15000
15001         * cs-parser.jay: Add rule to parse stackalloc.
15002
15003         * driver.cs: Handle /h, /help, /?
15004
15005         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15006         before we supported unsafe code.
15007
15008         * makefile: add --unsafe to the self compilation of mcs.
15009
15010 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * expression.cs (PointerArithmetic): New class that is used to
15013         perform pointer arithmetic.
15014         (Binary.Resolve): Handle pointer arithmetic
15015         Handle pointer comparission.
15016         (ArrayPtr): Utility expression class that is used to take the
15017         address of an array.
15018
15019         (ElementAccess): Implement array access for pointers
15020
15021         * statement.cs (Fixed): Implement fixed statement for arrays, we
15022         are missing one more case before we are done.
15023
15024         * expression.cs (Indirection): Implement EmitAssign and set the
15025         ExprClass to Variable.  This allows pointer dereferences to be
15026         treated as variables, and to have values assigned to them.
15027
15028         * ecore.cs (Expression.StoreFromPtr): New utility function to
15029         store values dereferencing.
15030
15031 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15032
15033         * expression.cs (Binary.ResolveOperator): Ensure that we are
15034         not trying to operate on a void type - this fixes the reported
15035         bug.
15036
15037         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15038         the parent implementation is sealed.
15039
15040         * ../errors/cs0239.cs : Add.
15041
15042         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15043
15044         * typemanager.cs (unverifiable_code_type): Corresponds to 
15045         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15046         which have unsafe code in them.
15047
15048         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15049         unsafe context.
15050
15051 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15052
15053         * cs-tokenizer.cs: Add support for @"litreal strings"
15054
15055         Make tokenizer accept pre-processor directives
15056         on any column (remove the old C-like limitation). 
15057
15058         * rootcontext.cs (EmitCode): Emit any global attributes.
15059         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15060
15061         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15062
15063         * cs-parser.jay: Add support for global attributes.  
15064
15065 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15066
15067         * expression.cs (Indirection): New helper class.  Unary will
15068         create Indirection classes to be able to implement the
15069         IMemoryLocation interface on it.
15070
15071 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * cs-parser.jay (fixed_statement): reference the right statement.
15074
15075         * statement.cs (Fixed.Emit): Finish implementing the fixed
15076         statement for the &x case.
15077
15078 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * class.cs (Property.Define, Method.Define): Remove newslot when
15081         `implementing'.  
15082
15083         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15084         wrong.  NewSlot should only be used if the `new' keyword is present.
15085
15086         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15087         locating our system dir.  Sorry about this.
15088
15089 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15090
15091         * driver.cs (GetSystemDir): Compute correctly the location of our
15092         system assemblies.  I was using the compiler directory instead of
15093         the library directory.
15094
15095 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15096
15097         * expression.cs (BetterFunction): Put back in what Miguel commented out
15098         since it is the correct fix. The problem is elsewhere ;-)
15099
15100         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15101         parameters of the parms method are themselves compatible or not !
15102
15103         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15104         to check that a class implements an interface before saying that an implicit
15105         conversion was allowed. Use ImplementsInterface to do the checking.
15106
15107 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15108
15109         * class.cs (Method.Define): Track whether we are an explicit
15110         implementation or not.  And only call DefineMethodOverride if we
15111         are an explicit implementation.
15112
15113         (Property.DefineMethod): Ditto.
15114
15115 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15116
15117         * expression.cs (BetterFunction): Catch hideous bug which was
15118          preventing us from detecting ambiguous calls due to implicit casts i.e
15119         cs0121.
15120
15121 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * support.cs (Pair): Remove un-needed method.  I figured why I was
15124         getting the error in cs-parser.jay, the variable in a foreach loop
15125         is readonly, and the compiler does not really treat this as a variable.
15126
15127         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15128         instead of EQUALS in grammar.  
15129
15130         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15131
15132         * expression.cs (Unary.DoResolve): Check whether the argument is
15133         managed or not.
15134
15135 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15136
15137         * support.cs: Api for Pair to set a value.  Despite the fact that
15138         the variables are public the MS C# compiler refuses to compile
15139         code that accesses the field if the variable is part of a foreach
15140         statement. 
15141
15142         * statement.cs (Fixed): Begin implementation of the fixed
15143         statement.
15144
15145         (Block.AddVariable): Return the VariableInfo on success and null
15146         on failure instead of true/false. 
15147
15148         * cs-parser.jay (foreach): Catch errors on variables already
15149         defined (we were ignoring this value before) and properly unwind
15150         the block hierarchy
15151
15152         (fixed_statement): grammar for the fixed statement.
15153
15154 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15155
15156         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15157         pointer types to be incretemented.
15158
15159         (SizeOf): Implement.
15160
15161         * cs-parser.jay (pointer_member_access): Implement
15162         expr->IDENTIFIER production.
15163
15164         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15165         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15166         on safe contexts.
15167
15168         (Unary): Implement indirection.
15169
15170         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15171         use in non-unsafe context).
15172
15173         (SimpleName.DoResolve): Check for pointers in field access on safe
15174         contexts. 
15175
15176         (Expression.LoadFromPtr): Factor the load-indirect code in this
15177         function.  This was duplicated in UnboxCast and ParameterReference
15178
15179 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15180
15181         * expression.cs (ComposedCast): report an error if a pointer cast
15182         is used in a safe region.
15183
15184         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15185         pointer type casts in unsafe context.
15186
15187         * codegen.cs (EmitContext): Set up IsUnsafe.
15188
15189         * cs-parser.jay (non_expression_type): Add productions for pointer
15190         casts. 
15191
15192         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15193         code.  We should not use force into static mode if the method is
15194         not virtual.  Fixes bug in MIS
15195
15196         * statement.cs (Do.Emit, While.Emit, For.Emit,
15197         Statement.EmitBoolExpression): Add support to Do and While to
15198         propagate infinite loop as `I do return' semantics.
15199
15200         Improve the For case to also test for boolean constants.
15201
15202         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15203         to the list of attributes we can add.
15204
15205         Remove `EmitContext' argument.
15206
15207         * class.cs (Method.Define): Apply parameter attributes.
15208         (Constructor.Define): Apply parameter attributes.
15209         (MethodCore.LabelParameters): Move here the core of labeling
15210         parameters. 
15211
15212         * support.cs (ReflectionParameters.ParameterModifier,
15213         InternalParameters.ParameterModifier): Use IsByRef on the type and
15214         only return the OUT bit for these parameters instead of in/out/ref
15215         flags.
15216
15217         This is because I miss-understood things.  The ParameterInfo.IsIn
15218         and IsOut represent whether the parameter has the [In] and [Out]
15219         attributes set.  
15220
15221 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15222
15223         * ecore.cs (FieldExpr.Emit): Release temporaries.
15224
15225         * assign.cs (LocalTemporary.Release): new function.
15226
15227         * codegen.cs (EmitContext.GetTemporaryStorage,
15228         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15229         temporary storage.  Now we can "put back" localbuilders when we
15230         are done with them
15231
15232 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15233
15234         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15235         need to make a copy of the variable to generate verifiable code.
15236
15237 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15238
15239         * driver.cs: Compute dynamically the system directory.
15240
15241         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15242         Slower, but more generally useful.  Used by the abstract
15243         registering implementation. 
15244
15245         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15246         the rules for the special rule on Type/instances.  First check if
15247         we have the same name, and if so, try that special static path
15248         rather than the instance path.
15249
15250 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15251
15252         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15253         for, while and if.
15254
15255         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15256         Enum, ValueType, Delegate or Array for non-corlib compiles.
15257
15258         * cs-tokenizer.cs: Catch long identifiers (645)
15259
15260         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15261         piece of code.
15262
15263         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15264         fix, we were returning too early, so we were not registering
15265         pending methods from abstract classes.
15266
15267         Do not register pending methods if the class is abstract.
15268
15269         * expression.cs (Conditional.DoResolve): Report circular implicit
15270         conversions when we neecd to compute it for conditional
15271         expressions. 
15272
15273         (Is.DoResolve): If the expression is always of the provided type,
15274         flag warning 183.  If the expression can not ever be of the
15275         provided type flag warning 184.
15276
15277         * class.cs: Catch 169 as well.
15278
15279         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15280         read. 
15281
15282 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15283
15284         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15285
15286 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * interface.cs: (PopulateMethod): Check for pointers being defined
15289         only if the unsafe context is active.
15290         (PopulateProperty): ditto.
15291         (PopulateIndexer): ditto.
15292
15293         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15294         specified.  If pointers are present, make sure that they are
15295         present in an unsafe context.
15296         (Constructor, Constructor.Define): ditto.
15297         (Field, Field.Define): ditto.
15298         (Property, Property.Define): ditto.
15299         (Event, Event.Define): ditto.
15300
15301         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15302         hashtable if there are classes or structs defined.
15303
15304         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15305         code, as the constant resolution moved.
15306
15307         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15308         the metadata, so we can flag error 133. 
15309
15310         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15311         pointer is being declared in an unsafe context.
15312
15313 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15314
15315         * modifiers.cs (Modifiers.Check): Require a Location argument.
15316         Report error 227 for Unsafe use.
15317
15318         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15319
15320         * statement.cs (For.Emit): If the test is null, then report that
15321         we do `return', as we wont reach anything afterwards.
15322
15323         (Switch.SwitchGoverningType): Track the expression that matched
15324         the conversion.
15325
15326         * driver.cs: Allow negative numbers as an error code to flag.
15327
15328         * cs-parser.jay: Handle 1551.
15329
15330         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15331
15332 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15333
15334         * cs-parser.jay: Report 1518 (type declaration can only contain
15335         class, struct, interface, enum or delegate)
15336
15337         (switch_label): Report 1523 (keywords `case' or `default' must
15338         preced code)
15339
15340         (opt_switch_sections): Report 1522 (empty switch)
15341
15342         * driver.cs: Report 1515 (response file specified multiple times)
15343         Report 1516 (Source file specified multiple times).
15344
15345         * expression.cs (Argument.Resolve): Signal 1510
15346
15347         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15348         access not allowed in static code)
15349
15350 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15351
15352         * typemanager.cs (IsPointerType): Utility method which we are going
15353         to need a lot.
15354
15355         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15356         the object type, so we take care of that.
15357
15358         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15359
15360         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15361         added to non-params parameters :-)
15362
15363         * typemanager.cs (CSharpName): Include 'void' type too. 
15364
15365         (void_ptr_type): Include in the set of core types.
15366
15367         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15368         duplicating code.
15369
15370         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15371         an unsafe context.
15372
15373         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15374         completely forgotten about it.
15375
15376 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15377
15378         * cs-parser.jay (pointer_type): Add. This begins our implementation
15379         of parsing rules for unsafe code.
15380
15381         (unsafe_statement): Implement.
15382
15383         (embedded_statement): Modify to include the above.
15384
15385         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15386
15387         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15388         if the current context is an unsafe one.
15389
15390         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15391         are handled differently, we need separate rules for them.
15392
15393         (local_variable_declaration): Update to use local_variable_pointer_type
15394         to allow variable declarations of unmanaged pointer types.
15395
15396         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15397         in unsafe contexts.
15398
15399         * ../errors/cs0214.cs : Add.
15400
15401 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15402
15403         * makefile: remove 'response' file when cleaning.
15404
15405 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15406
15407         * cs-parser.jay: Report 1524.
15408
15409 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15410
15411         * typemanager.cs (RegisterMethod): drop checking if we have
15412         registered this from here
15413
15414 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15415
15416         * class.cs (Method.EmitDestructor): Implement calling our base
15417         destructor. 
15418
15419         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15420         value of InFinally.
15421
15422         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15423         this routine and will wrap the call in a try/catch block.  Deal
15424         with the case.
15425
15426 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15427
15428         * ecore.cs (Expression.MemberLookup): instead of taking a
15429         parameter `same_type' that was used to tell whether we could
15430         access private members we compute our containing type from the
15431         EmitContext.
15432
15433         (FieldExpr): Added partial support for volatile fields.  This does
15434         not work for volatile fields exposed from assemblies, as I can not
15435         figure out how to extract the modreq from it.
15436
15437         Updated all the source files to use this.
15438
15439         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15440         because it is referenced by MemberLookup very often. 
15441
15442 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15443
15444         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15445         TypeBuilder.GetCustomAttributes to retrieve what we need.
15446
15447         Get rid of redundant default_member_attr_type as this is the same as
15448         default_member_type which already exists.
15449
15450         * interface.cs, attribute.cs : Update accordingly.
15451
15452 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15453
15454         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15455         work for TYpeBuilders though.  Ravi, can you please fix this?
15456
15457         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15458
15459         * expression.cs (Argument.Emit): Handle the case of ref objects
15460         being passed to ref functions;  
15461
15462         (ParameterReference.EmitLoad): Loads the content of the pointer
15463         without dereferencing.
15464
15465 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15466
15467         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15468
15469 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15470
15471         * class.cs (Indexer.DefineMethod): Incorporate the interface
15472         type in the name of the method if we are doing explicit interface
15473         implementation.
15474
15475         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15476
15477         (BetterConversion): Fix extremely trivial bug where we were referring to
15478         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15479         again !
15480
15481         * ../errors/bug16.cs : Add although we have fixed it.
15482
15483 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * expression.cs (BaseIndexer): Begin implementation.
15486
15487         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15488
15489         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15490         production directly to remove a shift/reduce, and implement
15491         explicit interface implementation.
15492
15493         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15494         after a floating point suffix.
15495
15496         * expression.cs (DoNumericPromotions): Improved the conversion for
15497         uint/uint.  If we have a constant, we avoid doing a typecast to a
15498         larger type.
15499
15500         * class.cs (Indexer): Implement explicit interface implementation
15501         for indexers.
15502
15503 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15504
15505         * class.cs: make the default instance constructor public and hidebysig.
15506
15507 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15508
15509         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15510         so we can call it from elsewhere.
15511
15512         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15513         we emit it internally if the class has a defined indexer; otherwise the user
15514         emits it by decorating the class definition with the DefaultMemberAttribute.
15515
15516         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15517         attribute is not used on a type which defines an indexer.
15518
15519         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15520         character when we skip whitespace.
15521
15522         * ../errors/cs0646.cs : Add.
15523
15524 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15525
15526         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15527         again. 
15528
15529         * makefile: Add practical target `mcs3.exe' which builds the third
15530         generation compiler. 
15531
15532         * expression.cs (New): Fix structures constructor calling.
15533
15534         * class.cs (Property, Method, Indexer): Emit Final flag on the
15535         method if we are an interface implementation and we are not
15536         abstract. 
15537
15538         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15539         whether this property is referencing a `base' method.
15540
15541         * expression.cs (Invocation.EmitCall): take an extra argument:
15542         is_base, this is used to determine whether the `call' or
15543         `callvirt' opcode should be used.
15544
15545
15546         * delegate.cs: update EmitCall.
15547
15548         * class.cs (Method.Define): Set NewSlot for the cases where we are
15549         not implementing an interface method.
15550
15551         (Property.Define): ditto.
15552
15553 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15554
15555         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15556         'r'.  Allows mcs to parse itself fully.
15557
15558 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15559
15560         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15561         of the number of initializers that require the InitializeArray method.
15562
15563         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15564         update the above field where necessary.
15565
15566         (MakeByteBlob): Update accordingly.
15567
15568         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15569         greater than 2.
15570
15571         (EmitDynamicInitializers): Update in accordance with the new optimization.
15572
15573         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15574         same OpCode applies.
15575
15576         * cs-parser.jay : Fix some glaring errors I introduced.
15577
15578 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15579
15580         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15581         so that we can check for name clashes there too.
15582
15583         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15584         for interface indexers.
15585
15586         * interfaces.cs (Define): Emit the default member attribute.
15587
15588         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15589         variable was being referred to while setting the value ;-)
15590
15591 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15592
15593         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15594         byte-by-byte information when we know the data is zero.
15595
15596         Make the block always a multiple of 4, because
15597         DefineInitializedData has a bug.
15598
15599         * assign.cs: Fix, we should assign from the temporary, not from
15600         the source. 
15601
15602         * expression.cs (MakeByteBlob): Fix my incorrect code.
15603
15604 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15605
15606         * typemanager.cs (EnumToUnderlying): This function is used to get
15607         the underlying type from an enumeration, because it does not
15608         always work. 
15609
15610         * constant.cs: Use the I4_S form for values between -128 and 127.
15611
15612         * statement.cs (Block.LookupLabel): Looks up a label.
15613         (Block): Drop support for labeled blocks.
15614
15615         (LabeledStatement): New kind of statement that represents a label
15616         only.
15617
15618         (Goto): Finally implement this bad boy.
15619
15620         * cs-parser.jay: Update to reflect new mechanism to implement
15621         labels.
15622
15623 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15624
15625         * codegen.cs (EmitContext.This): a codegen property that keeps the
15626         a single instance of this instead of creating many different this
15627         instances. 
15628
15629         * delegate.cs (Delegate.DoResolve): Update to use the property;
15630
15631         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15632
15633         * expression.cs (BaseAccess.DoResolve): Ditto.
15634
15635 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15636
15637         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15638         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15639
15640         (InitCoreTypes): Update accordingly.
15641
15642         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15643         so we can quickly store the state.
15644
15645         (ApplyAttributes): Set the correct implementation flags
15646         for InternalCall methods.
15647
15648 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15649
15650         * expression.cs (EmitCall): if a method is not virtual, then do
15651         not use callvirt on it.
15652
15653         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15654         user defined stuff) requires the use of stobj, which takes an
15655         address on the stack instead of an array and an index.  So emit
15656         the Ldelema operation for it.
15657
15658         (EmitStoreOpcode): Use stobj for valuetypes.
15659
15660         (UnaryMutator.EmitCode): Use the right 1 value depending on
15661         whether we are dealing with int64/uint64, float or doubles.
15662
15663         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15664         constructors that I implemented last night.
15665
15666         (Constructor.IsDefault): Fix to work properly for static
15667         constructors.
15668
15669         * cs-parser.jay (CheckDef): report method signature errors.
15670         Update error number 103 to be 132.
15671
15672         * decl.cs: New AdditionResult enumeration value: MethodExists.
15673         Although we do this check for methods later on in the semantic
15674         analysis, catching repeated default constructors is so easy that
15675         we catch these here. 
15676
15677         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15678         promotions code.
15679
15680         (ParameterReference.EmitAssign, Emit): handle
15681         bools as bytes.
15682
15683         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15684         (ArrayAccess.EmitStoreOpcode): ditto.
15685
15686         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15687
15688         * expression.cs (MakeByteBlob): Complete all the missing types
15689         (uint, short, ushort, byte, sbyte)
15690
15691         * class.cs: Only init instance field initializers on instance
15692         constructors. 
15693
15694         Rename `constructors' to instance_constructors. 
15695
15696         (TypeContainer.AddConstructor): Only add constructors to the list
15697         if it is not static.
15698
15699         Make sure that we handle default_static_constructor independently
15700         everywhere where we handle instance_constructors
15701
15702 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * class.cs: Do not lookup or create a base initializer for a
15705         static constructor.
15706
15707         (ConstructorInitializer.Resolve): use the proper type to lookup
15708         for constructors.
15709
15710         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15711
15712         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15713         in DeclSpace. 
15714
15715         * decl.cs: CloseType is now an virtual method, the default
15716         implementation just closes this type.
15717
15718 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15719
15720         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15721         to PreserveSig by default. Also emit HideBySig on such methods.
15722
15723         Basically, set the defaults to standard values.
15724
15725         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15726         argument, if candidate is better, it can't be worse than the best !
15727
15728         (Invocation): Re-write bits to differentiate between methods being
15729         applicable in their expanded form and their normal form - for params
15730         methods of course.
15731
15732         Get rid of use_standard everywhere as only standard conversions are allowed
15733         in overload resolution. 
15734
15735         More spec conformance.
15736
15737 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15738
15739         * driver.cs: Add --timestamp, to see where the compiler spends
15740         most of its time.
15741
15742         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15743         `this' in static code.
15744
15745         (SimpleName.DoResolve): Implement in terms of a helper function
15746         that allows static-references to be passed upstream to
15747         MemberAccess.
15748
15749         (Expression.ResolveWithSimpleName): Resolve specially simple
15750         names when called by MemberAccess to implement the special
15751         semantics. 
15752
15753         (Expression.ImplicitReferenceConversion): Handle conversions from
15754         Null to reference types before others, as Null's type is
15755         System.Object. 
15756
15757         * expression.cs (Invocation.EmitCall): Handle the special case of
15758         calling methods declared on a reference type from a ValueType
15759         (Base classes System.Object and System.Enum)
15760
15761         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15762         the left hand side is a TypeExpr, not on every enumeration. 
15763
15764         (Binary.Resolve): If types are reference types, then do a cast to
15765         object on operators != and == of both arguments.
15766
15767         * typemanager.cs (FindMembers): Extract instance and static
15768         members if requested.
15769
15770         * interface.cs (PopulateProperty): Use void_type instead of null
15771         as the return type for the setter method.
15772
15773         (PopulateIndexer): ditto.
15774
15775 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15776
15777         * support.cs (ReflectionParameters): Fix minor bug where we
15778         were examining the wrong parameter for the ParamArray attribute.
15779
15780         Cope with requests for the type of the parameter at position
15781         greater than the params parameter's. We now return the element
15782         type of the params array as that makes more sense.
15783
15784         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15785         accordingly as we no longer have to extract the element type
15786         ourselves.
15787
15788         (Invocation.OverloadResolve): Update.
15789
15790 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15791
15792         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15793         against IEnumerator, test whether the return value is a descendant
15794         of the IEnumerator interface.
15795
15796         * class.cs (Indexer.Define): Use an auxiliary method to implement
15797         the other bits of the method definition.  Begin support for
15798         explicit interface implementation.
15799
15800         (Property.DefineMethod): Use TypeManager.void_type instead of null
15801         for an empty return value.
15802
15803 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15806         dealing with a FieldExpr which is composed of a FieldBuilder, in
15807         the code path we did extract the constant, but we should have
15808         obtained the underlying value to be able to cast it (otherwise we
15809         end up in an infinite loop, this is what Ravi was running into).
15810
15811         (ArrayCreation.UpdateIndices): Arrays might be empty.
15812
15813         (MemberAccess.ResolveMemberAccess): Add support for section
15814         14.5.4.1 that deals with the special case of E.I when E is a type
15815         and something else, that I can be a reference to a static member.
15816
15817         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15818         handle a particular array type to create byte blobs, it is just
15819         something we dont generate byteblobs for.
15820
15821         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15822         arguments. 
15823
15824         * location.cs (Push): remove the key from the hashtable that we
15825         are about to add.   This happens for empty files.
15826
15827         * driver.cs: Dispose files after we have parsed them.
15828
15829         (tokenize): new function that only runs the tokenizer on its
15830         input, for speed testing.
15831
15832 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15833
15834         * class.cs (Event.Define): Define the private field only if there
15835         are no accessors defined.
15836
15837         * expression.cs (ResolveMemberAccess): If there is no associated
15838         field with the event, that means we have an event defined with its
15839         own accessors and we should flag error cs0070 since transforming
15840         ourselves into a field is not valid in that case.
15841
15842         * ecore.cs (SimpleName.DoResolve): Same as above.
15843
15844         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15845         and charset to sane values.
15846
15847 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15848
15849         * assign.cs (DoResolve): Perform check on events only if they 
15850         are being accessed outside the declaring type.
15851
15852         * cs-parser.jay (event_declarations): Update rules to correctly
15853         set the type of the implicit parameter etc.
15854
15855         (add_accessor, remove_accessor): Set current local parameters.
15856
15857         * expression.cs (Binary): For delegate addition and subtraction,
15858         cast the return value from the method into the appropriate delegate
15859         type.
15860
15861 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15862
15863         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15864         of these as the workaround is unnecessary.
15865
15866         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15867         delegate data - none of that is needed at all.
15868
15869         Re-write bits to extract the instance expression and the delegate method
15870         correctly.
15871
15872         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15873         on delegates too.
15874
15875         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15876         of attaching attributes instead of duplicating code everywhere.
15877
15878         * everywhere : Update code to do attribute emission using the above method.
15879
15880 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * expression.cs (IsParamsMethodApplicable): if there are not
15883         parameters, return immediately.
15884
15885         * ecore.cs: The 0 literal can be implicity converted to an enum
15886         type. 
15887
15888         (SimpleName.DoResolve): First lookup the type, then lookup the
15889         members. 
15890
15891         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15892         want to get its address.  If the InstanceExpression is not
15893         addressable, store the result in a temporary variable, then get
15894         the address of it.
15895
15896         * codegen.cs: Only display 219 errors on warning level or above. 
15897
15898         * expression.cs (ArrayAccess): Make it implement the
15899         IMemoryLocation interface.
15900
15901         (Binary.DoResolve): handle the operator == (object a, object b)
15902         and operator != (object a, object b) without incurring into a
15903         BoxedCast (because 5 != o should never be performed).
15904
15905         Handle binary enumerator operators.
15906
15907         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15908         value type, otherwise use Ldelem_ref.
15909
15910         Use precomputed names;
15911
15912         (AddressOf): Implement address of
15913
15914         * cs-parser.jay (labeled_statement): Fix recursive block
15915         addition by reworking the production.
15916
15917         * expression.cs (New.DoEmit): New has a special case:
15918                 
15919                  If we are dealing with a ValueType, we have a few
15920                  situations to deal with:
15921                 
15922                     * The target of New is a ValueType variable, that is
15923                       easy, we just pass this as the variable reference
15924                 
15925                     * The target of New is being passed as an argument,
15926                       to a boxing operation or a function that takes a
15927                       ValueType.
15928                 
15929                       In this case, we need to create a temporary variable
15930                       that is the argument of New.
15931
15932
15933 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15934
15935         * rootcontext.cs (LookupType): Check that current_type is not null before
15936         going about looking at nested types.
15937
15938         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15939         not implement the IAssignMethod interface any more.
15940
15941         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15942         where we tranform them into FieldExprs if they are being resolved from within
15943         the declaring type.
15944
15945         * ecore.cs (SimpleName.DoResolve): Do the same here.
15946
15947         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15948
15949         * ../errors/bug10.cs : Add.
15950
15951         * ../errors/cs0070.cs : Add.
15952
15953         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15954
15955         * assign.cs : Get rid of EventIsLocal everywhere.
15956
15957 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15958
15959         * ecore.cs (ConvertIntLiteral): finished the implementation.
15960
15961         * statement.cs (SwitchLabel): Convert the value we are using as a
15962         key before looking up the table.
15963
15964 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15965
15966         * codegen.cs (EmitTopBlock): Require a Location argument now.
15967
15968         * cs-parser.jay (constructor_declarator): We need to setup
15969         current_local_parameters before we parse the
15970         opt_constructor_initializer, to allow the variables to be bound
15971         to the constructor arguments.
15972
15973         * rootcontext.cs (LookupType): First lookup nested classes in our
15974         class and our parents before we go looking outside our class.
15975
15976         * expression.cs (ConstantFold): Extract/debox the values at the
15977         beginnning. 
15978
15979         * rootcontext.cs (EmitCode): Resolve the constants first before we
15980         resolve the types.  This is not really needed, but it helps debugging.
15981
15982         * statement.cs: report location.
15983
15984         * cs-parser.jay: pass location to throw statement.
15985
15986         * driver.cs: Small bug fix.
15987
15988         * report.cs: Updated format to be 4-zero filled digits.
15989
15990 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15991
15992         * expression.cs (CheckIndices): Fix minor bug where the wrong
15993         variable was being referred to ;-)
15994
15995         (DoEmit): Do not call EmitStaticInitializers when the 
15996         underlying type is System.Object.
15997
15998 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15999
16000         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16001         and do the usual workaround for SRE.
16002
16003         * class.cs (MyEventBuilder.EventType): New member to get at the type
16004         of the event, quickly.
16005
16006         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16007
16008         * assign.cs (Assign.DoResolve): Handle the case when the target
16009         is an EventExpr and perform the necessary checks.
16010
16011         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16012         interface.
16013
16014         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16015
16016         (EventExpr): Set the type in the constructor itself since we 
16017         are meant to be born fully resolved.
16018
16019         (EventExpr.Define): Revert code I wrote earlier.
16020                 
16021         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16022         instance expression is null. The instance expression is a This in that case
16023         or a null, depending on whether it is a static method or not.
16024
16025         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16026         refers to more than one method.
16027
16028         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16029         and accordingly flag errors.
16030
16031 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16032
16033         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16034
16035 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16036
16037         * location.cs (ToString): Provide useful rutine.
16038
16039 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16042         objects, return the actual integral boxed.
16043
16044         * statement.cs (SwitchLabel): define an ILLabel for each
16045         SwitchLabel. 
16046
16047         (Switch.CheckSwitch): If the value is a Literal, extract
16048         the underlying literal.
16049
16050         Also in the unused hashtable we had, add the SwitchLabel so we can
16051         quickly look this value up.
16052
16053         * constant.cs: Implement a bunch of new constants.  Rewrite
16054         Literal based on this.  Made changes everywhere to adapt to this.
16055
16056         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16057         dereferencing array only once, and also copes with enumrations.
16058
16059         bytes are two bytes wide, not one.
16060
16061         (Cast): Perform constant conversions.
16062
16063         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16064         wrappers to the literals here.
16065
16066         * expression.cs (DoNumericPromotions): long literals can converted
16067         to ulong implicity (this is taken care of elsewhere, but I was
16068         missing this spot).
16069
16070         * ecore.cs (Expression.Literalize): Make the return type Literal,
16071         to improve type checking.
16072
16073         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16074
16075 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16076
16077         * literal.cs: Revert code from ravi that checked the bounds.  The
16078         bounds are sane by the definition of the type itself. 
16079
16080         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16081         need to actually look up in our parent hierarchy for interfaces
16082         implemented. 
16083
16084         * const.cs: Use the underlying type for enumerations
16085
16086         * delegate.cs: Compute the basename for the delegate creation,
16087         that should fix the delegate test case, and restore the correct
16088         Type Lookup semantics in rootcontext
16089
16090         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16091         referencing a nested type with the Reflection API is using the "+"
16092         sign. 
16093
16094         * cs-parser.jay: Do not require EOF token at the end.
16095
16096 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16097
16098         * rootcontext.cs (LookupType): Concatenate type names with
16099         a '.' instead of a '+' The test suite passes again.
16100
16101         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16102         field of the enumeration.
16103
16104         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16105         the case when the member is an EventExpr.
16106
16107         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16108         static has an associated instance expression.
16109
16110         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16111
16112         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16113
16114         * class.cs (Event.Define): Register event and perform appropriate checks
16115         for error #111.
16116
16117         We define the Add and Remove methods even if the use provides none because
16118         in that case, we provide default implementations ourselves.
16119
16120         Define a private field of the type of the event. This is done by the CSC compiler
16121         and we should be doing it too ;-)
16122
16123         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16124         More methods we use in code we generate.
16125
16126         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16127         is important.
16128
16129         (InitCoreTypes): Update accordingly for the above.
16130
16131         * class.cs (Event.Emit): Generate code for default accessors that we provide
16132
16133         (EmitDefaultMethod): Do the job in the above.
16134
16135         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16136         appropriate place.
16137
16138 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16139
16140         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16141         builders even if we were missing one.
16142
16143         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16144         pass the Basename as our class name instead of the Name.  The
16145         basename will be correctly composed for us.
16146
16147         * parameter.cs (Paramters): Now takes a Location argument.
16148
16149         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16150         make all the code call directly LookupType in RootContext and take
16151         this chance to pass the Location information everywhere.
16152
16153         * Everywhere: pass Location information.
16154
16155 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * class.cs (Constructor.Define): Updated way of detecting the
16158         length of the parameters.
16159
16160         (TypeContainer.DefineType): Use basename as the type name for
16161         nested types.
16162
16163         (TypeContainer.Define): Do not recursively define types here, as
16164         definition is taken care in order by the RootContext.
16165
16166         * tree.cs: Keep track of namespaces in a per-file basis.
16167
16168         * parameter.cs (Parameter.ComputeSignature): Update to use
16169         DeclSpace. 
16170
16171         (Parameters.GetSignature): ditto.
16172
16173         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16174         instead of a TypeContainer.
16175
16176         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16177         resolve names.  Because we need to be resolve in our context, not
16178         our parents.
16179
16180         * driver.cs: Implement response files.
16181
16182         * class.cs (TypeContainer.DefineType): If we are defined, do not
16183         redefine ourselves.
16184
16185         (Event.Emit): Emit the code for add/remove handlers.
16186         (Event.Define): Save the MethodBuilders for add/remove.
16187
16188         * typemanager.cs: Use pair here too.
16189
16190         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16191         DictionaryEntry requires the first argument to be non-null.  
16192
16193         (enum_declaration): Compute full name for registering the
16194         enumeration.
16195
16196         (delegate_declaration): Instead of using
16197         formal_parameter_list, use opt_formal_parameter_list as the list
16198         can be empty.
16199
16200         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16201         (EventParsing): New property that controls whether `add' and
16202         `remove' are returned as tokens or identifiers (for events);
16203
16204 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16205
16206         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16207         use MyEventBuilder only and let it wrap the real builder for us.
16208
16209         (MyEventBuilder): Revamp constructor etc.
16210
16211         Implement all operations that we perform on EventBuilder in precisely the same
16212         way here too.
16213
16214         (FindMembers): Update to use the EventBuilder member.
16215
16216         (Event.Emit): Update accordingly.
16217
16218 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16219
16220         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16221         by calling the appropriate methods.
16222
16223         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16224         useful.
16225
16226         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16227
16228 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16229
16230         * delegate.cs (Delegate.Populate): Check that the return type
16231         and various parameters types are indeed accessible.
16232
16233         * class.cs (Constructor.Define): Same here.
16234
16235         (Field.Define): Ditto.
16236
16237         (Event.Define): Ditto.
16238
16239         (Operator.Define): Check that the underlying Method defined itself
16240         correctly - so it's MethodBuilder should not be null.
16241
16242         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16243         expression happens to be null.
16244
16245         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16246         members but as of now we don't seem to be able to do anything really useful with it.
16247
16248         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16249         not the EventBuilder.
16250
16251 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16252
16253         * cs-tokenizer.cs: Add support for defines.
16254         Add support for #if, #elif, #else, #endif
16255
16256         (eval_var): evaluates a variable.
16257         (eval): stubbed for evaluating functions.
16258
16259         * cs-parser.jay: Pass the defines information
16260
16261         * driver.cs: Add --define command line option.
16262
16263         * decl.cs: Move MemberCore here.
16264
16265         Make it the base class for DeclSpace.  This allows us to catch and
16266         report 108 and 109 for everything now.
16267
16268         * class.cs (TypeContainer.Define): Extract all the members
16269         before populating and emit the warning 108 (new keyword required
16270         to override) instead of having each member implement this.
16271
16272         (MemberCore.Define): New abstract method, we will be using this in
16273         the warning reporting engine in Populate.
16274
16275         (Operator.Define): Adjust to new MemberCore protocol. 
16276
16277         * const.cs (Const): This does not derive from Expression, it is a
16278         temporary object we use to create fields, it is a MemberCore. 
16279
16280         * class.cs (Method.Define): Allow the entry point to be in a
16281         specific class.
16282
16283         * driver.cs: Rewrite the argument handler to clean it up a bit.
16284
16285         * rootcontext.cs: Made it just an auxiliary namespace feature by
16286         making everything static.
16287
16288         * driver.cs: Adapt code to use RootContext type name instead of
16289         instance variable.
16290
16291         * delegate.cs: Remove RootContext argument.
16292
16293         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16294         argument. 
16295
16296         * class.cs (Event.Define): The lookup can fail.
16297
16298         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16299
16300         * expression.cs: Resolve the this instance before invoking the code.
16301
16302 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16303
16304         * cs-parser.jay: Add a production in element_access that allows
16305         the thing to become a "type" reference.  This way we can parse
16306         things like "(string [])" as a type.
16307
16308         Note that this still does not handle the more complex rules of
16309         casts. 
16310
16311
16312         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16313
16314         * ecore.cs: (CopyNewMethods): new utility function used to
16315         assemble the list of methods from running FindMembers.
16316
16317         (MemberLookup): Rework FindMembers so that 
16318
16319 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * class.cs (TypeContainer): Remove Delegates who fail to be
16322         defined.
16323
16324         * delegate.cs (Populate): Verify that we dont get null return
16325         values.   TODO: Check for AsAccessible.
16326
16327         * cs-parser.jay: Use basename to emit error 574 (destructor should
16328         have the same name as container class), not the full name.
16329
16330         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16331         possible representation.  
16332
16333         Also implements integer type suffixes U and L.
16334
16335 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16336
16337         * expression.cs (ArrayCreation.DoResolve): We need to do the
16338         argument resolution *always*.
16339
16340         * decl.cs: Make this hold the namespace.  Hold the root context as
16341         well.
16342         (LookupType): Move here.
16343
16344         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16345
16346         * location.cs (Row, Name): Fixed the code, it was always returning
16347         references to the first file.
16348
16349         * interface.cs: Register properties defined through interfaces.
16350
16351         * driver.cs: Add support for globbing on the command line
16352
16353         * class.cs (Field): Make it derive from MemberCore as well.
16354         (Event): ditto.
16355
16356 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16357
16358         * class.cs (Event::Define): Check that the type of the event is a delegate
16359         type else flag error #66.
16360
16361         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16362         same.
16363
16364         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16365         values of EntryPoint, CharSet etc etc.
16366
16367         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16368
16369         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16370         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16371         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16372         which needs this to do its work.
16373
16374         * ../errors/cs0066.cs : Add.
16375
16376 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16379         helper functions.
16380
16381         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16382         clears out the parameters field.
16383         (MemberSignatureCompare): Cleanup
16384
16385         (MemberCore): New base class used to share code between MethodCore
16386         and Property.
16387
16388         (RegisterRequiredImplementations) BindingFlags.Public requires
16389         either BindingFlags.Instace or Static.  Use instance here.
16390
16391         (Property): Refactored code to cope better with the full spec.
16392
16393         * parameter.cs (GetParameterInfo): Return an empty array instead
16394         of null on error.
16395
16396         * class.cs (Property): Abstract or extern properties have no bodies.
16397
16398         * parameter.cs (GetParameterInfo): return a zero-sized array.
16399
16400         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16401         method modifier validation to the typecontainer so we can reuse
16402         this on properties.
16403
16404         (MethodCore.ParameterTypes): return an empty sized array of types.
16405
16406         (Property.Define): Test property modifier validity.
16407
16408         Add tests for sealed/override too.
16409
16410         (Method.Emit): abstract or extern methods have no bodies.
16411
16412 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16413
16414         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16415         thing.
16416
16417         (Method::Define, ::Emit): Modify accordingly.
16418
16419         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16420
16421         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16422
16423         * makefile: Pass in /unsafe.
16424
16425 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16426
16427         * class.cs (MakeKey): Kill routine.
16428
16429         * class.cs (TypeContainer.Define): Correctly define explicit
16430         method implementations (they require the full interface name plus
16431         the method name).
16432
16433         * typemanager.cs: Deply the PtrHashtable here and stop using the
16434         lame keys.  Things work so much better.
16435
16436         This of course broke everyone who depended on `RegisterMethod' to
16437         do the `test for existance' test.  This has to be done elsewhere.
16438
16439         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16440         the object stupid Equals method (because, that like fails all over
16441         the place).  We still do not use it.
16442
16443         * class.cs (TypeContainer.SetRequiredInterface,
16444         TypeContainer.RequireMethods): Killed these two routines and moved
16445         all the functionality to RegisterRequiredImplementations.
16446
16447         (TypeContainer.RegisterRequiredImplementations): This routine now
16448         registers all the implementations required in an array for the
16449         interfaces and abstract methods.  We use an array of structures
16450         which can be computed ahead of time to reduce memory usage and we
16451         also assume that lookups are cheap as most classes will not
16452         implement too many interfaces.
16453
16454         We also avoid creating too many MethodSignatures.
16455
16456         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16457         clear the "pending" bit if we find that there are problems with
16458         the declaration.
16459
16460         (TypeContainer.VerifyPendingMethods): Update to report errors of
16461         methods that look like implementations but are not.
16462
16463         (TypeContainer.Define): Add support for explicit interface method
16464         implementation. 
16465
16466 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16467
16468         * typemanager.cs: Keep track of the parameters here instead of
16469         being a feature of the TypeContainer.
16470
16471         * class.cs: Drop the registration of parameters here, as
16472         InterfaceMethods are also interface declarations.
16473
16474         * delegate.cs: Register methods with the TypeManager not only with
16475         the TypeContainer.  This code was buggy.
16476
16477         * interface.cs: Full registation here.
16478
16479 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * expression.cs: Remove reducer for binary expressions, it can not
16482         be done this way.
16483
16484         * const.cs: Put here the code that used to go into constant.cs
16485
16486         * constant.cs: Put here the code for constants, this is a new base
16487         class for Literals.
16488
16489         * literal.cs: Make Literal derive from Constant.
16490
16491 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16492
16493         * statement.cs (Return.Emit): Report error 157 if the user
16494         attempts to return from a finally block.
16495
16496         (Return.Emit): Instead of emitting a return, jump to the end of
16497         the function.
16498
16499         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16500         LocalBuilder to store the result of the function.  ReturnLabel is
16501         the target where we jump.
16502
16503
16504 2001-12-09  Radek Doulik  <rodo@ximian.com>
16505
16506         * cs-parser.jay: remember alias in current namespace
16507
16508         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16509         namespaces
16510
16511         * class.cs (LookupAlias): lookup alias in my_namespace
16512
16513         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16514         aliases hashtable
16515         (LookupAlias): lookup alias in this and if needed in parent
16516         namespaces
16517
16518 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * support.cs: 
16521
16522         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16523         making things static.  I need this to avoid passing the
16524         TypeContainer when calling ParameterType.
16525
16526         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16527         that did string manipulation to compute the type and then call
16528         GetType.  Use Parameter.ParameterType instead.
16529
16530         * cs-tokenizer.cs: Consume the suffix for floating values.
16531
16532         * expression.cs (ParameterReference): figure out whether this is a
16533         reference parameter or not.  Kill an extra variable by computing
16534         the arg_idx during emission.
16535
16536         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16537         function that returns whether a parameter is an out/ref value or not.
16538
16539         (Parameter.ParameterType): The type of the parameter (base,
16540         without ref/out applied).
16541
16542         (Parameter.Resolve): Perform resolution here.
16543         (Parameter.ExternalType): The full type (with ref/out applied).
16544
16545         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16546         support for expressions on the using statement.
16547
16548 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16549
16550         * statement.cs (Using.EmitLocalVariableDecls): Split the
16551         localvariable handling of the using statement.
16552
16553         (Block.EmitMeta): Keep track of variable count across blocks.  We
16554         were reusing slots on separate branches of blocks.
16555
16556         (Try.Emit): Emit the general code block, we were not emitting it. 
16557
16558         Check the type of the declaration to be an IDisposable or
16559         something that can be implicity converted to it. 
16560
16561         Emit conversions if required.
16562
16563         * ecore.cs (EmptyExpression): New utility class.
16564         (Expression.ImplicitConversionExists): New utility function.
16565
16566 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * statement.cs (Using): Implement.
16569
16570         * expression.cs (LocalVariableReference): Support read only variables.
16571
16572         * statement.cs: Remove the explicit emit for the Leave opcode.
16573         (VariableInfo): Add a readonly field.
16574
16575 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16576
16577         * ecore.cs (ConvCast): new class used to encapsulate the various
16578         explicit integer conversions that works in both checked and
16579         unchecked contexts.
16580
16581         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16582         properly generate the overflow opcodes.
16583
16584 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * statement.cs: The correct type for the EmptyExpression is the
16587         element_type, not the variable type.  Ravi pointed this out.
16588
16589 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16590
16591         * class.cs (Method::Define): Handle PInvoke methods specially
16592         by using DefinePInvokeMethod instead of the usual one.
16593
16594         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16595         above to do the task of extracting information and defining the method.
16596
16597 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16598
16599         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16600         of the condition for string type.
16601
16602         (Emit): Move that here. 
16603
16604         (ArrayCreation::CheckIndices): Keep string literals in their expression
16605         form.
16606
16607         (EmitDynamicInitializers): Handle strings appropriately.
16608
16609 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * codegen.cs (EmitContext): Replace multiple variables with a
16612         single pointer to the current Switch statement.
16613
16614         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16615         EmitContext.
16616
16617 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16618
16619         * statement.cs 
16620
16621         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16622         default'.
16623
16624         (Foreach.Emit): Foreach on arrays was not setting
16625         up the loop variables (for break/continue).
16626
16627         (GotoCase): Semi-implented.
16628
16629 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16630
16631         * attribute.cs (CheckAttribute): Handle system attributes by using
16632         Attribute.GetAttributes to examine information we need.
16633
16634         (GetValidPlaces): Same here.
16635
16636         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16637
16638         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16639
16640         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16641
16642         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16643
16644         (Method::Emit): Handle the case when we are a PInvoke method.
16645
16646 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16647
16648         * expression.cs: Use ResolveWithSimpleName on compound names.
16649
16650 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16651
16652         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16653         before trying to reduce it.
16654
16655         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16656
16657         * constant.cs (LookupConstantValue): Implement.
16658
16659         (EmitConstant): Use the above in emitting the constant.
16660
16661         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16662         that are user-defined by doing a LookupConstantValue on them.
16663
16664         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16665         too, like above.
16666
16667 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16670
16671         (BaseAccess.DoResolve): Implement.
16672
16673         (MemberAccess.DoResolve): Split this routine into a
16674         ResolveMemberAccess routine that can be used independently
16675
16676 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16677
16678         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16679         As that share bits of the implementation.  Is returns a boolean,
16680         while As returns the Type that is being probed.
16681
16682 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16683
16684         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16685         instead of a Literal - much easier.
16686
16687         (EnumInTransit): Remove - utterly useless :-)
16688
16689         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16690
16691         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16692
16693         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16694         chain when we have no associated expression.
16695
16696 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16697
16698         * constant.cs (Define): Use Location while reporting the errror.
16699
16700         Also emit a warning when 'new' is used and there is no inherited
16701         member to hide.
16702
16703         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16704         populated.
16705
16706         (LookupEnumValue): Implement to lookup an enum member's value and define it
16707         if necessary.
16708
16709         (Populate): Re-write accordingly to use the above routine.
16710
16711 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * expression.cs (This): Fix prototype for DoResolveLValue to
16714         override the base class DoResolveLValue.
16715
16716         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16717         declarations) 
16718
16719         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16720         (we need to load the address of the field here).  This fixes
16721         test-22. 
16722
16723         (FieldExpr.DoResolveLValue): Call the DoResolve
16724         function to initialize the Instance expression.
16725
16726         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16727         correctly the GetEnumerator operation on a value type.
16728
16729         * cs-parser.jay: Add more simple parsing error catches.
16730
16731         * statement.cs (Switch): Add support for string switches.
16732         Handle null specially.
16733
16734         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16735
16736 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16737
16738         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16739
16740         (declare_local_constant): New helper function.
16741
16742         * statement.cs (AddConstant): Keep a separate record of constants
16743
16744         (IsConstant): Implement to determine if a variable is a constant.
16745
16746         (GetConstantExpression): Implement.
16747
16748         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16749
16750         * statement.cs (IsVariableDefined): Re-write.
16751
16752 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16753
16754         * class.cs (TypeContainer::FindMembers): Look for constants
16755         in the case when we are looking for MemberTypes.Field
16756
16757         * expression.cs (MemberAccess::DoResolve): Check that in the
16758         case we are a FieldExpr and a Literal, we are not being accessed
16759         by an instance reference.
16760
16761         * cs-parser.jay (local_constant_declaration): Implement.
16762
16763         (declaration_statement): Implement for constant declarations.
16764
16765 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16766
16767         * statement.cs (Switch): Catch double defaults.
16768
16769         (Switch): More work on the switch() statement
16770         implementation.  It works for integral values now, need to finish
16771         string support.
16772
16773
16774 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16775
16776         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16777         integer literals into other integer literals.  To be used by
16778         switch. 
16779
16780 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16781
16782         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16783         some memory.
16784
16785         (EmitDynamicInitializers): Cope with the above since we extract data
16786         directly from ArrayData now.
16787
16788         (ExpectInitializers): Keep track of whether initializers are mandatory
16789         or not.
16790
16791         (Bounds): Make it a hashtable to prevent the same dimension being 
16792         recorded for every element in that dimension.
16793
16794         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16795         from being found.
16796
16797         Also fix bug which was causing the indices to be emitted in the reverse
16798         order.
16799
16800 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16801
16802         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16803         unfinished.  They do not work, because the underlying code is
16804         sloppy.
16805
16806 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16807
16808         * cs-parser.jay: Remove bogus fixme.
16809
16810         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16811         on Switch statement.
16812
16813 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16814
16815         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16816         the same. 
16817
16818         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16819         parameter. Apparently, any expression is allowed. 
16820
16821         (ValidateInitializers): Update accordingly.
16822
16823         (CheckIndices): Fix some tricky bugs thanks to recursion.
16824
16825         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16826         I was being completely brain-dead.
16827
16828         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16829         and re-write acordingly.
16830
16831         (DelegateInvocation): Re-write accordingly.
16832
16833         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16834
16835         (MakeByteBlob): Handle types more correctly.
16836
16837         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16838         initialization from expressions but it is incomplete because I am a complete
16839         Dodo :-|
16840
16841 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16842
16843         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16844         on If.  Basically, we have to return `true' (ie, we do return to
16845         our caller) only if both branches of the if return.
16846
16847         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16848         short-circuit operators, handle them as short circuit operators. 
16849
16850         (Cast.DoResolve): Resolve type.
16851         (Cast.Cast): Take an expression as the target type.
16852
16853         * cs-parser.jay (cast_expression): Remove old hack that only
16854         allowed a limited set of types to be handled.  Now we take a
16855         unary_expression and we resolve to a type during semantic
16856         analysis.
16857
16858         Use the grammar productions from Rhys to handle casts (this is
16859         not complete like Rhys syntax yet, we fail to handle that corner
16860         case that C# has regarding (-x), but we will get there.
16861
16862 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16863
16864         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16865         field which is an array type.
16866
16867         * cs-parser.jay (declare_local_variables): Support array initialization too.
16868
16869         * typemanager.cs (MakeKey): Implement.
16870
16871         (everywhere): Use the above appropriately.
16872
16873         * cs-parser.jay (for_statement): Update for array initialization while
16874         declaring variables.
16875
16876         * ecore.cs : The error message was correct, it's the variable's names that
16877         were misleading ;-) Make the code more readable.
16878
16879         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16880         the correct type etc.
16881
16882         (ConvertExplicit): Handle Enum types by examining the underlying type.
16883
16884 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16885
16886         * parameter.cs (GetCallingConvention): Always return
16887         CallingConventions.Standard for now.
16888
16889 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16890
16891         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16892         and `r' after calling DoNumericPromotions.
16893
16894         * ecore.cs: Fix error message (the types were in the wrong order).
16895
16896         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16897         BindingFlags.Instance as well 
16898
16899         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16900         implicit int literal conversion in an empty cast so that we
16901         propagate the right type upstream.
16902
16903         (UnboxCast): new class used to unbox value types.
16904         (Expression.ConvertExplicit): Add explicit type conversions done
16905         by unboxing.
16906
16907         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16908         the target type before applying the implicit LongLiterals to ULong
16909         literal cast.
16910
16911 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * cs-parser.jay (for_statement): Reworked the way For works: now
16914         we declare manually any variables that are introduced in
16915         for_initializer to solve the problem of having out-of-band code
16916         emition (that is what got for broken).
16917
16918         (declaration_statement): Perform the actual variable declaration
16919         that used to be done in local_variable_declaration here.
16920
16921         (local_variable_declaration): Do not declare anything, just pass
16922         the information on a DictionaryEntry
16923
16924 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16925
16926         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16927         re-write of the logic to now make it recursive.
16928
16929         (UpdateIndices): Re-write accordingly.
16930
16931         Store element data in a separate ArrayData list in the above methods.
16932
16933         (MakeByteBlob): Implement to dump the array data into a byte array.
16934
16935 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16936
16937         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16938         into CheckIndices.
16939
16940         * constant.cs (Define): Implement.
16941
16942         (EmitConstant): Re-write fully.
16943
16944         Pass in location info.
16945
16946         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16947         respectively.
16948
16949         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16950         DictionaryEntry since we need location info too.
16951
16952         (constant_declaration): Update accordingly.
16953
16954         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16955         code into another method : UpdateIndices.
16956
16957 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16958
16959         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16960         some type checking etc.
16961
16962 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16963
16964         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16965         bits to provide dimension info if the user skips doing that.
16966
16967         Update second constructor to store the rank correctly.
16968
16969 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16970
16971         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16972         and try to implement.
16973
16974         * ../errors/cs0150.cs : Add.
16975
16976         * ../errors/cs0178.cs : Add.
16977
16978 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * statement.cs: Implement foreach on multi-dimensional arrays. 
16981
16982         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16983         name of the params argument.
16984
16985         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16986         initializing the array.
16987
16988         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16989         we can use this elsewhere.
16990
16991         * statement.cs: Finish implementation of foreach for single
16992         dimension arrays.
16993
16994         * cs-parser.jay: Use an out-of-band stack to pass information
16995         around, I wonder why I need this.
16996
16997         foreach_block: Make the new foreach_block the current_block.
16998
16999         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17000         function used to return a static Parameters structure.  Used for
17001         empty parameters, as those are created very frequently.
17002
17003         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17004
17005 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17006
17007         * interface.cs : Default modifier is private, not public. The
17008         make verify test passes again.
17009
17010 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17011
17012         * support.cs (ReflectionParameters): Fix logic to determine
17013         whether the last parameter is a params one. Test 9 passes again.
17014
17015         * delegate.cs (Populate): Register the builders we define with
17016         RegisterParameterForBuilder. Test 19 passes again.
17017
17018         * cs-parser.jay (property_declaration): Reference $6 instead
17019         of $$ to get at the location.
17020
17021         (indexer_declaration): Similar stuff.
17022
17023         (attribute): Ditto.
17024
17025         * class.cs (Property): Register parameters for the Get and Set methods
17026         if they exist. Test 23 passes again.
17027
17028         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17029         call to EmitArguments as we are sure there aren't any params arguments. 
17030         Test 32 passes again.
17031
17032         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17033         IndexOutOfRangeException. 
17034
17035         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17036         Test 33 now passes again.
17037
17038 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17041         broke a bunch of things.  Will have to come up with a better way
17042         of tracking locations.
17043
17044         * statement.cs: Implemented foreach for single dimension arrays.
17045
17046 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17047
17048         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17049         an error.  This removes the lookup from the critical path.
17050
17051         * cs-parser.jay: Removed use of temporary_loc, which is completely
17052         broken. 
17053
17054 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * support.cs (ReflectionParameters.ParameterModifier): Report
17057         whether the argument is a PARAMS argument or not.
17058
17059         * class.cs: Set the attribute `ParamArrayAttribute' on the
17060         parameter argument.
17061
17062         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17063         and cons_param_array_attribute (ConstructorInfo for
17064         ParamArrayAttribute)., 
17065
17066         * codegen.cs: Emit the return using the `Return' statement, that
17067         way we can report the error correctly for missing return values. 
17068
17069         * class.cs (Method.Emit): Clean up.
17070
17071         * expression.cs (Argument.Resolve): Take another argument: the
17072         location where this argument is used.  Notice that this is not
17073         part of the "Argument" class as to reduce the size of the
17074         structure (we know the approximate location anyways).
17075
17076         Test if the argument is a variable-reference, if not, then
17077         complain with a 206.
17078
17079         (Argument.Emit): Emit addresses of variables.
17080
17081         (Argument.FullDesc): Simplify.
17082
17083         (Invocation.DoResolve): Update for Argument.Resolve.
17084
17085         (ElementAccess.DoResolve): ditto.
17086
17087         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17088         method should be virtual, as this method is always virtual.
17089
17090         (NewDelegate.DoResolve): Update for Argument.Resolve.
17091
17092         * class.cs (ConstructorInitializer.DoResolve): ditto.
17093
17094         * attribute.cs (Attribute.Resolve): ditto.
17095
17096 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17097
17098         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17099
17100         * expression.cs (ParameterReference): Drop IStackStorage and implement
17101         IAssignMethod instead. 
17102
17103         (LocalVariableReference): ditto.
17104
17105         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17106         IAssignMethod instead. 
17107
17108 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17109
17110         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17111         enumerations that are used in heavily used structures derive from
17112         byte in a laughable and pathetic attempt to reduce memory usage.
17113         This is the kind of pre-optimzations that you should not do at
17114         home without adult supervision.
17115
17116         * expression.cs (UnaryMutator): New class, used to handle ++ and
17117         -- separatedly from the other unary operators.  Cleans up the
17118         code, and kills the ExpressionStatement dependency in Unary.
17119
17120         (Unary): Removed `method' and `Arguments' from this class, making
17121         it smaller, and moving it all to SimpleCall, so I can reuse this
17122         code in other locations and avoid creating a lot of transient data
17123         strucutres when not required.
17124
17125         * cs-parser.jay: Adjust for new changes.
17126
17127 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * enum.cs (Enum.Populate): If there is a failure during
17130         definition, return
17131
17132         * cs-parser.jay (opt_enum_base): we used to catch type errors
17133         here, but this is really incorrect.  The type error should be
17134         catched during semantic analysis.
17135
17136 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17137
17138         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17139         current_local_parameters as expected since I, in my stupidity, had forgotten
17140         to do this :-)
17141
17142         * attribute.cs (GetValidPlaces): Fix stupid bug.
17143
17144         * class.cs (Method::Emit): Perform check on applicability of attributes.
17145
17146         (Constructor::Emit): Ditto.
17147
17148         (Field::Emit): Ditto.
17149
17150         (Field.Location): Store location information.
17151
17152         (Property, Event, Indexer, Operator): Ditto.
17153
17154         * cs-parser.jay (field_declaration): Pass in location for each field.
17155
17156         * ../errors/cs0592.cs : Add.
17157
17158 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17159
17160         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17161
17162         (InitCoreTypes): Update accordingly.
17163
17164         (RegisterAttrType, LookupAttr): Implement.
17165
17166         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17167         info about the same.
17168
17169         (Resolve): Update to populate the above as necessary.
17170
17171         (Error592): Helper.
17172
17173         (GetValidPlaces): Helper to the above.
17174
17175         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17176
17177         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17178
17179 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17180
17181         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17182
17183         * ../errors/cs0617.cs : Add.
17184
17185 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17186
17187         * enum.cs (Emit): Rename to Populate to be more consistent with what
17188         we expect it to do and when exactly it is called.
17189
17190         * class.cs, rootcontext.cs : Update accordingly.
17191
17192         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17193         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17194
17195         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17196
17197         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17198         of a fieldinfo using the above, when dealing with a FieldBuilder.
17199
17200 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17201
17202         * ../errors/cs0031.cs : Add.
17203
17204         * ../errors/cs1008.cs : Add.
17205
17206         * ../errrors/cs0543.cs : Add.
17207
17208         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17209         enum type.
17210
17211         (FindMembers): Implement.
17212
17213         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17214         enums and delegates too.
17215
17216         (enum_types): Rename to builder_to_enum.
17217
17218         (delegate_types): Rename to builder_to_delegate.
17219
17220         * delegate.cs (FindMembers): Implement.
17221
17222 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17223
17224         * typemanager.cs (IsEnumType): Implement.
17225
17226         * enum.cs (Emit): Re-write parts to account for the underlying type
17227         better and perform checking etc.
17228
17229         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17230         of the underlying type.
17231
17232         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17233         value
17234
17235         * enum.cs (error31): Helper to report error #31.
17236
17237         * cs-parser.jay (enum_declaration): Store location of each member too.
17238
17239         * enum.cs (member_to_location): New hashtable. 
17240
17241         (AddEnumMember): Update location hashtable.
17242
17243         (Emit): Use the location of each member while reporting errors.
17244
17245 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17246
17247         * cs-parser.jay: A for_initializer if is a
17248         local_variable_declaration really ammount to have an implicit
17249         block with the variable declaration and no initializer for for.
17250
17251         * statement.cs (For.Emit): Cope with null initializers.
17252
17253         This fixes the infinite loop on for initializers.
17254
17255 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17256
17257         * enum.cs: More cleanup.
17258
17259         * ecore.cs: Remove dead code.
17260
17261         * class.cs (Property.Emit): More simplification.
17262         (Event.Emit): ditto.
17263
17264         Reworked to have less levels of indentation.
17265
17266 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17267
17268         * class.cs (Property): Emit attributes.
17269
17270         (Field): Ditto.
17271
17272         (Event): Ditto.
17273
17274         (Indexer): Ditto.
17275
17276         (Operator): Ditto.
17277
17278         * enum.cs (Emit): Ditto.
17279
17280         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17281         Enums too.
17282
17283         * class.cs (Field, Event, etc.): Move attribute generation into the
17284         Emit method everywhere.
17285
17286         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17287         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17288         as we had no way of defining nested enums !
17289
17290         * rootcontext.cs : Adjust code accordingly.
17291
17292         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17293
17294 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17295
17296         * expression.cs (EvalConstantExpression): Move into ecore.cs
17297
17298         * enum.cs (Enum): Rename some members and make them public and readonly
17299         according to our convention.
17300
17301         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17302         nothing else.
17303
17304         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17305
17306         (Enum::Emit): Write a simple version for now which doesn't try to compute
17307         expressions. I shall modify this to be more robust in just a while.
17308
17309         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17310
17311         (TypeContainer::CloseType): Create the Enum types too.
17312
17313         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17314
17315         * expression.cs (EvalConstantExpression): Get rid of completely.
17316
17317         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17318         user-defined values and other cases.
17319
17320         (IsValidEnumLiteral): Helper function.
17321
17322         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17323         out there in the case we had a literal FieldExpr.
17324
17325         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17326
17327         (Literalize): Revamp a bit to take two arguments.
17328
17329         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17330
17331 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17332
17333         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17334
17335         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17336
17337         (Resolve): Use the above to ensure we have proper initializers.
17338
17339 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17340
17341         * expression.cs (Expression::EvalConstantExpression): New method to 
17342         evaluate constant expressions.
17343
17344         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17345
17346 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17347
17348         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17349         in an array.
17350
17351         (Binary.ResolveOperator): Handle operator != (object a, object b)
17352         and operator == (object a, object b);
17353
17354         (Binary.DoNumericPromotions): Indicate whether the numeric
17355         promotion was possible.
17356
17357         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17358         Implement.  
17359
17360         Made the ArrayAccess implement interface IAssignMethod instead of
17361         IStackStore as the order in which arguments are passed reflects
17362         this.
17363
17364         * assign.cs: Instead of using expr.ExprClass to select the way of
17365         assinging, probe for the IStackStore/IAssignMethod interfaces.
17366
17367         * typemanager.cs: Load InitializeArray definition.
17368
17369         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17370         static data that can be used to initialize arrays. 
17371
17372 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17373
17374         * expression.cs: Handle operator== and operator!= for booleans.
17375
17376         (Conditioal.Reduce): Implement reducer for the ?: operator.
17377
17378         (Conditional.Resolve): Implement dead code elimination.
17379
17380         (Binary.Resolve): Catch string literals and return a new
17381         concatenated string.
17382
17383         (Unary.Reduce): Implement reduction of unary expressions.
17384
17385         * ecore.cs: Split out the expression core handling here.
17386
17387         (Expression.Reduce): New method used to perform constant folding
17388         and CSE.  This is needed to support constant-expressions. 
17389
17390         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17391         targets, and optimize for !x.
17392
17393 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17394
17395         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17396         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17397         set custom atttributes.
17398
17399         * literal.cs (Literal::GetValue): New abstract method to return the actual
17400         value of the literal, cast as an object.
17401
17402         (*Literal): Implement GetValue method.
17403
17404         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17405         expressions to the arraylist but objects of type Argument.
17406
17407         * class.cs (TypeContainer::Emit): Emit our attributes too.
17408
17409         (Method::Emit, Constructor::Emit): Ditto.
17410
17411         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17412         to be ignoring earlier.
17413
17414 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17415
17416         * attribute.cs (AttributeSection::Define): Implement to do the business
17417         of constructing a CustomAttributeBuilder.
17418
17419         (Attribute): New trivial class. Increases readability of code.  
17420
17421         * cs-parser.jay : Update accordingly.
17422
17423         (positional_argument_list, named_argument_list, named_argument): New rules
17424
17425         (attribute_arguments): Use the above so that we are more correct.
17426
17427 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17428
17429         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17430         to perform all checks for a method with a params parameter.
17431
17432         (Invocation::OverloadResolve): Update to use the above method and therefore
17433         cope correctly with params method invocations.
17434
17435         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17436         params too.
17437
17438         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17439         constructors in our parent too because we can't afford to miss out on 
17440         protected ones ;-)
17441
17442         * attribute.cs (AttributeSection): New name for the class Attribute
17443
17444         Other trivial changes to improve readability.
17445
17446         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17447         use the new class names.
17448
17449 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17450
17451         * class.cs (Method::Define): Complete definition for params types too
17452
17453         (Indexer::Define): Ditto.
17454
17455         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17456         Cope everywhere with a request for info about the array parameter.
17457
17458 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17459
17460         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17461
17462         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17463         local_variable_type to extract the string corresponding to the type.
17464
17465         (local_variable_type): Fixup the action to use the new helper method.
17466
17467         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17468         go.
17469
17470         * expression.cs : Clean out code which uses the above.
17471
17472 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17473
17474         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17475         and bale out if necessary by returning a false.
17476
17477         (RegisterProperty): Ditto.
17478
17479         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17480         and print out appropriate error messages.
17481
17482         * interface.cs (everywhere): Ditto.
17483
17484         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17485         location to constructor.
17486
17487         * class.cs (Property, Event, Indexer): Update accordingly.
17488
17489         * ../errors/cs111.cs : Added.
17490
17491         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17492         of a method, as laid down by the spec.
17493
17494         (Invocation::OverloadResolve): Use the above method.
17495
17496 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17497
17498         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17499         now take a TypeContainer and a Parameters object.
17500
17501         (ParameterData): Modify return type of ParameterModifier method to be 
17502         Parameter.Modifier and not a string.
17503
17504         (ReflectionParameters, InternalParameters): Update accordingly.
17505
17506         * expression.cs (Argument::GetParameterModifier): Same here.
17507
17508         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17509         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17510         symbol in it at all so maybe this is only for now.
17511
17512 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17513
17514         * support.cs (InternalParameters): Constructor now takes an extra argument 
17515         which is the actual Parameters class.
17516
17517         (ParameterDesc): Update to provide info on ref/out modifiers.
17518
17519         * class.cs (everywhere): Update call to InternalParameters to pass in
17520         the second argument too.
17521
17522         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17523         to return the modifier info [ref/out etc]
17524
17525         (InternalParameters, ReflectionParameters): Implement the above.
17526
17527         * expression.cs (Argument::ParameterModifier): Similar function to return
17528         info about the argument's modifiers.
17529
17530         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17531         too.
17532
17533         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17534         a new SetFormalParameters object which we pass to InternalParameters.
17535
17536 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17537
17538         * expression.cs (NewArray): Merge into the ArrayCreation class.
17539
17540 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17541
17542         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17543         NewUserdefinedArray into one as there wasn't much of a use in having
17544         two separate ones.
17545
17546         * expression.cs (Argument): Change field's name to ArgType from Type.
17547
17548         (Type): New readonly property which returns the proper type, taking into 
17549         account ref/out modifiers.
17550
17551         (everywhere): Adjust code accordingly for the above.
17552
17553         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17554         whether we are emitting for a ref or out parameter.
17555
17556         * expression.cs (Argument::Emit): Use the above field to set the state.
17557
17558         (LocalVariableReference::Emit): Update to honour the flag and emit the
17559         right stuff.
17560
17561         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17562
17563         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17564
17565         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17566
17567         (ReflectionParameters, InternalParameters): Implement the above method.
17568
17569         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17570         reporting errors.
17571
17572         (Invocation::FullMethodDesc): Ditto. 
17573
17574 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17575
17576         * cs-parser.jay: Add extra production for the second form of array
17577         creation. 
17578
17579         * expression.cs (ArrayCreation): Update to reflect the above
17580         change. 
17581
17582         * Small changes to prepare for Array initialization.
17583
17584 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17585
17586         * typemanager.cs (ImplementsInterface): interface might be null;
17587         Deal with this problem;
17588
17589         Also, we do store negative hits on the cache (null values), so use
17590         this instead of calling t.GetInterfaces on the type everytime.
17591
17592 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17593
17594         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17595
17596         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17597         split functionality out into different classes.
17598
17599         (New::FormArrayType): Move into NewBuiltinArray.
17600
17601         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17602         quite useless.
17603
17604         (NewBuiltinArray): New class to handle creation of built-in arrays.
17605
17606         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17607         account creation of one-dimensional arrays.
17608
17609         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17610
17611         (NewUserdefinedArray::DoResolve): Implement.
17612
17613         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17614
17615         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17616         we maintain inside the TypeManager. This is necessary to perform lookups on the
17617         module builder.
17618
17619         (LookupType): Update to perform GetType on the module builders too.     
17620
17621         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17622
17623         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17624
17625 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17626
17627         * expression.cs (New::DoResolve): Implement guts of array creation.
17628
17629         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17630
17631 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17632
17633         * expression.cs: Fix bug I introduced lsat night that broke
17634         Delegates. 
17635
17636         (Expression.Resolve): Report a 246 error (can not resolve name)
17637         if we find a SimpleName in the stream.
17638
17639         (Expression.ResolveLValue): Ditto.
17640
17641         (Expression.ResolveWithSimpleName): This function is a variant of
17642         ResolveName, this one allows SimpleNames to be returned without a
17643         warning.  The only consumer of SimpleNames is MemberAccess
17644
17645 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17646
17647         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17648         might arrive here.  I have my doubts that this is correct.
17649
17650         * statement.cs (Lock): Implement lock statement.
17651
17652         * cs-parser.jay: Small fixes to support `lock' and `using'
17653
17654         * cs-tokenizer.cs: Remove extra space
17655
17656         * driver.cs: New flag --checked, allows to turn on integer math
17657         checking. 
17658
17659         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17660         Threading.Monitor.Exit 
17661
17662 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17665         Expression Class to be IndexerAccess.
17666
17667         Notice that Indexer::DoResolve sets the eclass to Value.
17668
17669 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17670
17671         * class.cs (TypeContainer::Emit): Emit code for indexers.
17672
17673         * assign.cs (IAssignMethod): New interface implemented by Indexers
17674         and Properties for handling assignment.
17675
17676         (Assign::Emit): Simplify and reuse code. 
17677
17678         * expression.cs (IndexerAccess, PropertyExpr): Implement
17679         IAssignMethod, clean up old code. 
17680
17681 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17682
17683         * typemanager.cs (ImplementsInterface): New method to determine if a type
17684         implements a given interface. Provides a nice cache too.
17685
17686         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17687         method.
17688
17689         (ConvertReferenceExplicit): Ditto.
17690
17691         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17692         various methods, with correct names etc.
17693
17694         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17695         Operator.UnaryNegation.
17696
17697         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17698         we have a unary plus or minus operator.
17699
17700         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17701         UnaryMinus.
17702
17703         * everywhere : update accordingly.
17704
17705         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17706         respectively.
17707
17708         * class.cs (Method::Define): For the case where we are implementing a method
17709         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17710         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17711
17712 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17713
17714         * interface.cs (FindMembers): Implement to work around S.R.E
17715         lameness.
17716
17717         * typemanager.cs (IsInterfaceType): Implement.
17718
17719         (FindMembers): Update to handle interface types too.
17720
17721         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17722         use IsAssignableFrom as that is not correct - it doesn't work.
17723
17724         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17725         and accordingly override EmitStatement.
17726
17727         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17728         using the correct logic :-)
17729
17730 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17731
17732         * ../errors/cs-11.cs : Add to demonstrate error -11 
17733
17734 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17735
17736         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17737         then pass this as a hint to ResolveLValue.
17738
17739         * expression.cs (FieldExpr): Add Location information
17740
17741         (FieldExpr::LValueResolve): Report assignment to readonly
17742         variable. 
17743
17744         (Expression::ExprClassFromMemberInfo): Pass location information.
17745
17746         (Expression::ResolveLValue): Add new method that resolves an
17747         LValue. 
17748
17749         (Expression::DoResolveLValue): Default invocation calls
17750         DoResolve. 
17751
17752         (Indexers): New class used to keep track of indexers in a given
17753         Type. 
17754
17755         (IStackStore): Renamed from LValue, as it did not really describe
17756         what this did.  Also ResolveLValue is gone from this interface and
17757         now is part of Expression.
17758
17759         (ElementAccess): Depending on the element access type
17760
17761         * typemanager.cs: Add `indexer_name_type' as a Core type
17762         (System.Runtime.CompilerServices.IndexerNameAttribute)
17763
17764         * statement.cs (Goto): Take a location.
17765
17766 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17767
17768         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17769         if two delegates are compatible.
17770
17771         (NewDelegate::DoResolve): Update to take care of the case when
17772         we instantiate a delegate from another delegate.
17773
17774         * typemanager.cs (FindMembers): Don't even try to look up members
17775         of Delegate types for now.
17776
17777 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17778
17779         * delegate.cs (NewDelegate): New class to take care of delegate
17780         instantiation.
17781
17782         * expression.cs (New): Split the delegate related code out into 
17783         the NewDelegate class.
17784
17785         * delegate.cs (DelegateInvocation): New class to handle delegate 
17786         invocation.
17787
17788         * expression.cs (Invocation): Split out delegate related code into
17789         the DelegateInvocation class.
17790
17791 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17792
17793         * expression.cs (New::DoResolve): Implement delegate creation fully
17794         and according to the spec.
17795
17796         (New::DoEmit): Update to handle delegates differently.
17797
17798         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17799         because of which we were printing out arguments in reverse order !
17800
17801         * delegate.cs (VerifyMethod): Implement to check if the given method
17802         matches the delegate.
17803
17804         (FullDelegateDesc): Implement.
17805
17806         (VerifyApplicability): Implement.
17807
17808         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17809         delegate invocations too.
17810
17811         (Invocation::Emit): Ditto.
17812
17813         * ../errors/cs1593.cs : Added.
17814
17815         * ../errors/cs1594.cs : Added.
17816
17817         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17818
17819 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17820
17821         * typemanager.cs (intptr_type): Core type for System.IntPtr
17822
17823         (InitCoreTypes): Update for the same.
17824
17825         (iasyncresult_type, asynccallback_type): Ditto.
17826
17827         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17828         correct.
17829
17830         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17831         too.
17832
17833         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17834         the builders for the 4 members of a delegate type :-)
17835
17836         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17837         type.
17838
17839         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17840
17841         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17842
17843 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17844
17845         * statement.cs (Break::Emit): Implement.   
17846         (Continue::Emit): Implement.
17847
17848         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17849         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17850         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17851         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17852         end loop
17853
17854         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17855         properties that track the label for the current loop (begin of the
17856         loop and end of the loop).
17857
17858 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17859
17860         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17861         use of emitting anything at all.
17862
17863         * class.cs, rootcontext.cs : Get rid of calls to the same.
17864
17865         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17866
17867         (Populate): Define the constructor correctly and set the implementation
17868         attributes.
17869
17870         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17871         have been defined.
17872
17873         (AddDelegateType): Implement.
17874
17875         (IsDelegateType): Implement helper method.
17876
17877         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17878
17879         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17880         and accordingly handle it.
17881
17882         * delegate.cs (Populate): Take TypeContainer argument.
17883         Implement bits to define the Invoke method. However, I still haven't figured out
17884         how to take care of the native int bit :-(
17885
17886         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17887         Qualify the name of the delegate, not its return type !
17888
17889         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17890         conversion.
17891
17892         (StandardConversionExists): Checking for array types turns out to be recursive.
17893
17894         (ConvertReferenceExplicit): Implement array conversion.
17895
17896         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17897
17898 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17899
17900         * cs-parser.jay (delegate_declaration): Store the fully qualified
17901         name as it is a type declaration.
17902
17903         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17904         readonly.
17905
17906         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17907         as TypeContainer::DefineType.
17908
17909         (Populate): Method in which all the definition of the various methods (Invoke)
17910         etc is done.
17911
17912         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17913         see.
17914
17915         (CloseDelegate): Finally creates the delegate.
17916
17917         * class.cs (TypeContainer::DefineType): Update to define delegates.
17918         (Populate, Emit and CloseType): Do the same thing here too.
17919
17920         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17921         delegates in all these operations.
17922
17923 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * expression.cs: LocalTemporary: a new expression used to
17926         reference a temporary that has been created.
17927
17928         * assign.cs: Handle PropertyAccess back here, so that we can
17929         provide the proper semantic access to properties.
17930
17931         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17932         a few more explicit conversions. 
17933
17934         * modifiers.cs: `NEW' modifier maps to HideBySig.
17935
17936         * expression.cs (PropertyExpr): Make this into an
17937         ExpressionStatement, and support the EmitStatement code path. 
17938
17939         Perform get/set error checking, clean up the interface.
17940
17941         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17942         them into toplevel access objects.
17943
17944 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17945
17946         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17947         SRE.
17948
17949         * typemanager.cs: Keep track here of our PropertyBuilders again to
17950         work around lameness in SRE.
17951
17952 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17953
17954         * expression.cs (LValue::LValueResolve): New method in the
17955         interface, used to perform a second resolution pass for LValues. 
17956
17957         (This::DoResolve): Catch the use of this in static methods.
17958
17959         (This::LValueResolve): Implement.
17960
17961         (This::Store): Remove warning, assigning to `this' in structures
17962         is 
17963
17964         (Invocation::Emit): Deal with invocation of
17965         methods on value types.  We need to pass the address to structure
17966         methods rather than the object itself.  (The equivalent code to
17967         emit "this" for structures leaves the entire structure on the
17968         stack instead of a pointer to it). 
17969
17970         (ParameterReference::DoResolve): Compute the real index for the
17971         argument based on whether the method takes or not a `this' pointer
17972         (ie, the method is static).
17973
17974         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17975         value types returned from functions when we need to invoke a
17976         method on the sturcture.
17977
17978
17979 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17980
17981         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17982         defining the type in the Modulebuilder or Typebuilder. This is to take
17983         care of nested types which need to be defined on the TypeBuilder using
17984         DefineNestedMethod.
17985
17986         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17987         methods in RootContext, only ported to be part of TypeContainer.
17988
17989         (TypeContainer::GetInterfaceOrClass): Ditto.
17990
17991         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17992
17993         * interface.cs (Interface::DefineInterface): New method. Does exactly
17994         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17995         too.
17996
17997         (Interface::GetInterfaces): Move from RootContext here and port.
17998
17999         (Interface::GetInterfaceByName): Same here.
18000
18001         * rootcontext.cs (ResolveTree): Re-write.
18002
18003         (PopulateTypes): Re-write.
18004
18005         * class.cs (TypeContainer::Populate): Populate nested types too.
18006         (TypeContainer::Emit): Emit nested members too.
18007
18008         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18009         instead just use the name argument passed in as it is already fully
18010         qualified.
18011
18012         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18013         to TypeContainer mapping to see if a type is user-defined.
18014
18015         * class.cs (TypeContainer::CloseType): Implement. 
18016
18017         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18018         the default constructor.
18019
18020         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18021         twice.
18022
18023         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18024
18025         * interface.cs (CloseType): Create the type here.
18026
18027         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18028         the hierarchy.
18029
18030         Remove all the methods which are now in TypeContainer.
18031
18032 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18033
18034         * delegate.cs (Define): Re-write bits to define the delegate
18035         correctly.
18036
18037 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18038
18039         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18040
18041         * expression.cs (ImplicitReferenceConversion): handle null as well
18042         as a source to convert to any reference type.
18043
18044         * statement.cs (Return): Perform any implicit conversions to
18045         expected return type.  
18046
18047         Validate use of return statement.  
18048
18049         * codegen.cs (EmitContext): Pass the expected return type here.
18050
18051         * class.cs (Method, Constructor, Property): Pass expected return
18052         type to EmitContext.
18053
18054 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * expression.cs: Make DoResolve take an EmitContext instead of a
18057         TypeContainer.
18058
18059         Replaced `l' and `location' for `loc', for consistency.
18060
18061         (Error, Warning): Remove unneeded Tc argument.
18062
18063         * assign.cs, literal.cs, constant.cs: Update to new calling
18064         convention. 
18065
18066         * codegen.cs: EmitContext now contains a flag indicating whether
18067         code is being generated in a static method or not.
18068
18069         * cs-parser.jay: DecomposeQI, new function that replaces the old
18070         QualifiedIdentifier.  Now we always decompose the assembled
18071         strings from qualified_identifier productions into a group of
18072         memberaccesses.
18073
18074 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18075
18076         * rootcontext.cs: Deal with field-less struct types correctly now
18077         by passing the size option to Define Type.
18078
18079         * class.cs: Removed hack that created one static field. 
18080
18081 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18082
18083         * statement.cs: Moved most of the code generation here. 
18084
18085 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18086
18087         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18088         seem very right.
18089
18090         (ElementAccess): Remove useless bits for now - keep checks as the spec
18091         says.
18092
18093 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18094
18095         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18096         and start performing checks according to the spec.
18097
18098 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18099
18100         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18101         rank_specifiers instead.
18102
18103         (rank_specifiers): Change the order in which the rank specifiers are stored
18104
18105         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18106
18107         * expression.cs (ElementAccess): Implement the LValue interface too.
18108
18109 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18110
18111         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18112         except that user defined conversions are not included.
18113
18114         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18115         perform the conversion of the return type, if necessary.
18116
18117         (New::DoResolve): Check whether we are creating an array or an object
18118         and accordingly do the needful.
18119
18120         (New::Emit): Same here.
18121
18122         (New::DoResolve): Implement guts of array creation.
18123
18124         (New::FormLookupType): Helper function.
18125
18126 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18127
18128         * codegen.cs: Removed most of the code generation here, and move the
18129         corresponding code generation bits to the statement classes. 
18130
18131         Added support for try/catch/finalize and throw.
18132
18133         * cs-parser.jay: Added support for try/catch/finalize.
18134
18135         * class.cs: Catch static methods having the flags override,
18136         virtual or abstract.
18137
18138         * expression.cs (UserCast): This user cast was not really doing
18139         what it was supposed to do.  Which is to be born in fully resolved
18140         state.  Parts of the resolution were being performed at Emit time! 
18141
18142         Fixed this code.
18143
18144 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18145
18146         * expression.cs: Implicity convert the result from UserCast.
18147
18148 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18149
18150         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18151         prevented it from working correctly. 
18152
18153         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18154         merely ConvertImplicit.
18155
18156 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18157
18158         * typemanager.cs: Make the LookupTypeContainer function static,
18159         and not per-instance.  
18160
18161         * class.cs: Make static FindMembers (the one that takes a Type
18162         argument). 
18163
18164         * codegen.cs: Add EmitForeach here.
18165
18166         * cs-parser.jay: Make foreach a toplevel object instead of the
18167         inline expansion, as we need to perform semantic analysis on it. 
18168
18169 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18170
18171         * expression.cs (Expression::ImplicitUserConversion): Rename to
18172         UserDefinedConversion.
18173
18174         (Expression::UserDefinedConversion): Take an extra argument specifying 
18175         whether we look for explicit user conversions too.
18176
18177         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18178
18179         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18180
18181         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18182         with the appropriate arguments.
18183
18184         * cs-parser.jay (cast_expression): Record location too.
18185
18186         * expression.cs (Cast): Record location info.
18187
18188         (Expression::ConvertExplicit): Take location argument.
18189
18190         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18191         to determine if we are doing explicit conversions.
18192
18193         (UserCast::Emit): Update accordingly.
18194
18195         (Expression::ConvertExplicit): Report an error if everything fails.
18196
18197         * ../errors/cs0030.cs : Add.
18198
18199 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18200
18201         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18202         virtual and newslot bits. 
18203
18204         * class.cs (TypeContainer::RegisterRequiredImplementations):
18205         Record methods we need.
18206
18207         (TypeContainer::MakeKey): Helper function to make keys for
18208         MethodBases, since the Methodbase key is useless.
18209
18210         (TypeContainer::Populate): Call RegisterRequiredImplementations
18211         before defining the methods.   
18212
18213         Create a mapping for method_builders_to_methods ahead of time
18214         instead of inside a tight loop.
18215
18216         (::RequireMethods):  Accept an object as the data to set into the
18217         hashtable so we can report interface vs abstract method mismatch.
18218
18219 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18220
18221         * report.cs: Make all of it static.
18222
18223         * rootcontext.cs: Drop object_type and value_type computations, as
18224         we have those in the TypeManager anyways.
18225
18226         Drop report instance variable too, now it is a global.
18227
18228         * driver.cs: Use try/catch on command line handling.
18229
18230         Add --probe option to debug the error reporting system with a test
18231         suite. 
18232
18233         * report.cs: Add support for exiting program when a probe
18234         condition is reached.
18235
18236 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18237
18238         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18239         we do a forcible conversion regardless of type, to check if 
18240         ForceConversion returns a null.
18241
18242         (Binary::error19): Use location to report error.
18243
18244         (Unary::error23): Use location here too.
18245
18246         * ../errors/cs0019.cs : Check in.
18247
18248         * ../errors/cs0023.cs : Check in.
18249
18250         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18251         case of a non-null MethodInfo object with a length of 0 !
18252
18253         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18254         an applicable member - according to the spec :-)
18255         Also fix logic to find members in base types.
18256
18257         (Unary::ResolveOperator): Same here.
18258
18259         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18260         as I was getting thoroughly confused between this and error19 :-)
18261
18262         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18263         (::FindMostEncompassedType): Implement.
18264         (::FindMostEncompassingType): Implement.
18265         (::StandardConversionExists): Implement.
18266
18267         (UserImplicitCast): Re-vamp. We now need info about most specific
18268         source and target types so that we can do the necessary conversions.
18269
18270         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18271         mathematical union with no duplicates.
18272
18273 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18276         in order from base classes to child classes, so that we can in
18277         child classes look up in our parent for method names and
18278         attributes (required for handling abstract, virtual, new, override
18279         constructs: we need to instrospect our base class, and if we dont
18280         populate the classes in order, the introspection might be
18281         incorrect.  For example, a method could query its parent before
18282         the parent has any methods and would determine that the parent has
18283         no abstract methods (while it could have had them)).
18284
18285         (RootContext::CreateType): Record the order in which we define the
18286         classes.
18287
18288 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18289
18290         * class.cs (TypeContainer::Populate): Also method definitions can
18291         fail now, keep track of this.
18292
18293         (TypeContainer::FindMembers): Implement support for
18294         DeclaredOnly/noDeclaredOnly flag.
18295
18296         (Constructor::Emit) Return the ConstructorBuilder.
18297
18298         (Method::Emit) Return the MethodBuilder. 
18299         Check for abstract or virtual methods to be public.
18300
18301         * rootcontext.cs (RootContext::CreateType): Register all the
18302         abstract methods required for the class to be complete and the
18303         interface methods that must be implemented. 
18304
18305         * cs-parser.jay: Report error 501 (method requires body if it is
18306         not marked abstract or extern).
18307
18308         * expression.cs (TypeOf::Emit): Implement.
18309
18310         * typemanager.cs: runtime_handle_type, new global type.
18311
18312         * class.cs (Property::Emit): Generate code for properties.
18313
18314 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18315
18316         * expression.cs (Unary::ResolveOperator): Find operators on base type
18317         too - we now conform exactly to the spec.
18318
18319         (Binary::ResolveOperator): Same here.
18320
18321         * class.cs (Operator::Define): Fix minor quirk in the tests.
18322
18323         * ../errors/cs0215.cs : Added.
18324
18325         * ../errors/cs0556.cs : Added.
18326
18327         * ../errors/cs0555.cs : Added.
18328
18329 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18330
18331         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18332         single integer which is really efficient
18333
18334 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18335
18336         *  expression.cs (Expression::ImplicitUserConversion): Use location
18337         even in the case when we are examining True operators.
18338  
18339         * class.cs (Operator::Define): Perform extensive checks to conform
18340         with the rules for operator overloading in the spec.
18341
18342         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18343         some of the other conversions mentioned in the spec.
18344
18345         * typemanager.cs (array_type): New static member for the System.Array built-in
18346         type.
18347
18348         (cloneable_interface): For System.ICloneable interface.
18349
18350         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18351         we start resolving the tree and populating types.
18352
18353         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18354  
18355 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * expression.cs (Expression::ExprClassFromMemberInfo,
18358         Expression::Literalize): Create literal expressions from
18359         FieldInfos which are literals.
18360
18361         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18362         type casts, because they were wrong.  The test suite in tests
18363         caught these ones.
18364
18365         (ImplicitNumericConversion): ushort to ulong requires a widening
18366         cast. 
18367
18368         Int32 constant to long requires widening cast as well.
18369
18370         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18371         for integers because the type on the stack is not i4.
18372
18373 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * expression.cs (report118): require location argument. 
18376
18377         * parameter.cs: Do not dereference potential null value.
18378
18379         * class.cs: Catch methods that lack the `new' keyword when
18380         overriding a name.  Report warnings when `new' is used without
18381         anything being there to override.
18382
18383         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18384
18385         * class.cs: Only add constructor to hashtable if it is non-null
18386         (as now constructors can fail on define).
18387
18388         (TypeManager, Class, Struct): Take location arguments.
18389
18390         Catch field instance initialization in structs as errors.
18391
18392         accepting_filter: a new filter for FindMembers that is static so
18393         that we dont create an instance per invocation.
18394
18395         (Constructor::Define): Catch errors where a struct constructor is
18396         parameterless 
18397
18398         * cs-parser.jay: Pass location information for various new
18399         constructs. 
18400
18401         * delegate.cs (Delegate): take a location argument.
18402
18403         * driver.cs: Do not call EmitCode if there were problesm in the
18404         Definition of the types, as many Builders wont be there. 
18405
18406         * decl.cs (Decl::Decl): Require a location argument.
18407
18408         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18409         into integers, and find the most appropiate integer for it.
18410
18411         * literal.cs: Implement ULongLiteral.
18412
18413         * rootcontext.cs: Provide better information about the location of
18414         failure when CreateType fails.
18415
18416 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18417
18418         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18419         as well.
18420
18421         * expression.cs (Binary::CheckShiftArguments): Add missing type
18422         computation.
18423         (Binary::ResolveOperator): Add type to the logical and and logical
18424         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18425         before.
18426
18427         (Binary::DoNumericPromotions): In the case where either argument
18428         is ulong (and most signed types combined with ulong cause an
18429         error) perform implicit integer constant conversions as well.
18430
18431 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18432
18433         * expression.cs (UserImplicitCast): Method should always be
18434         non-null. 
18435         (Invocation::BetterConversion): Simplified test for IntLiteral.
18436
18437         (Expression::ImplicitNumericConversion): Split this routine out.
18438         Put the code that performs implicit constant integer conversions
18439         here. 
18440
18441         (Expression::Resolve): Become a wrapper around DoResolve so we can
18442         check eclass and type being set after resolve.
18443
18444         (Invocation::Badness): Remove this dead function
18445
18446         (Binary::ResolveOperator): Do not compute the expensive argumnets
18447         unless we have a union for it.
18448
18449         (Probe::Emit): Is needs to do an isinst and then
18450         compare against null.
18451
18452         (::CanConvert): Added Location argument.  If the Location argument
18453         is null (Location.Null), then we do not report errors.  This is
18454         used by the `probe' mechanism of the Explicit conversion.  We do
18455         not want to generate an error for something that the user
18456         explicitly requested to be casted.  But the pipeline for an
18457         explicit cast first tests for potential implicit casts.
18458
18459         So for now, if the Location is null, it means `Probe only' to
18460         avoid adding another argument.   Might have to revise this
18461         strategy later.
18462
18463         (ClassCast): New class used to type cast objects into arbitrary
18464         classes (used in Explicit Reference Conversions).
18465
18466         Implement `as' as well.
18467
18468         Reverted all the patches from Ravi below: they were broken:
18469
18470                 * The use of `level' as a mechanism to stop recursive
18471                   invocations is wrong.  That was there just to catch the
18472                   bug with a strack trace but not as a way of addressing
18473                   the problem.
18474
18475                   To fix the problem we have to *understand* what is going
18476                   on and the interactions and come up with a plan, not
18477                   just get things going.
18478
18479                 * The use of the type conversion cache that I proposed
18480                   last night had an open topic: How does this work across
18481                   protection domains.  A user defined conversion might not
18482                   be public in the location where we are applying the
18483                   conversion, a different conversion might be selected
18484                   (ie, private A->B (better) but public B->A (worse),
18485                   inside A, A->B applies, but outside it, B->A will
18486                   apply).
18487
18488                 * On top of that (ie, even if the above is solved),
18489                   conversions in a cache need to be abstract.  Ie, `To
18490                   convert from an Int to a Short use an OpcodeCast', not
18491                   `To convert from an Int to a Short use the OpcodeCast on
18492                   the variable 5' (which is what this patch was doing).
18493
18494 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18495
18496         * expression.cs (Invocation::ConversionExists): Re-write to use
18497         the conversion cache
18498
18499         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18500         cache all conversions done, not just user-defined ones.
18501
18502         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18503         to determine if a conversion exists instead of acutually trying to 
18504         perform the conversion. It's faster too.
18505
18506         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18507         and only then attempt the implicit conversion.
18508
18509 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18510
18511         * expression.cs (ConvertImplicit): Use a cache for conversions
18512         already found. Check level of recursion and bail out if necessary.
18513
18514 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18515
18516         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18517         Export standard methods that we expect for string operations.
18518
18519         * statement.cs (Block::UsageWarning): Track usage of variables and
18520         report the errors for not used variables.
18521
18522         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18523         operator. 
18524
18525 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18526
18527         * codegen.cs: remove unnneded code 
18528
18529         * expression.cs: Removed BuiltinTypeAccess class
18530
18531         Fix the order in which implicit conversions are
18532         done.  
18533
18534         The previous fixed dropped support for boxed conversions (adding a
18535         test to the test suite now)
18536
18537         (UserImplicitCast::CanConvert): Remove test for source being null,
18538         that code is broken.  We should not feed a null to begin with, if
18539         we do, then we should track the bug where the problem originates
18540         and not try to cover it up here.
18541
18542         Return a resolved expression of type UserImplicitCast on success
18543         rather than true/false.  Ravi: this is what I was talking about,
18544         the pattern is to use a static method as a "constructor" for
18545         objects. 
18546
18547         Also, do not create arguments until the very last minute,
18548         otherwise we always create the arguments even for lookups that
18549         will never be performed. 
18550
18551         (UserImplicitCast::Resolve): Eliminate, objects of type
18552         UserImplicitCast are born in a fully resolved state. 
18553
18554         * typemanager.cs (InitCoreTypes): Init also value_type
18555         (System.ValueType). 
18556
18557         * expression.cs (Cast::Resolve): First resolve the child expression.
18558
18559         (LValue): Add new method AddressOf to be used by
18560         the `&' operator.  
18561
18562         Change the argument of Store to take an EmitContext instead of an
18563         ILGenerator, because things like FieldExpr need to be able to call
18564         their children expression to generate the instance code. 
18565
18566         (Expression::Error, Expression::Warning): Sugar functions for
18567         reporting errors.
18568
18569         (Expression::MemberLookup): Accept a TypeContainer instead of a
18570         Report as the first argument.
18571
18572         (Expression::ResolvePrimary): Killed.  I still want to improve
18573         this as currently the code is just not right.
18574
18575         (Expression::ResolveMemberAccess): Simplify, but it is still
18576         wrong. 
18577
18578         (Unary::Resolve): Catch errors in AddressOf operators.
18579
18580         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18581         index to a byte for the short-version, or the compiler will choose
18582         the wrong Emit call, which generates the wrong data.
18583
18584         (ParameterReference::Emit, ::Store): same.
18585
18586         (FieldExpr::AddressOf): Implement.
18587
18588         * typemanager.cs: TypeManager: made public variable instead of
18589         property.
18590
18591         * driver.cs: document --fatal.
18592
18593         * report.cs (ErrorMessage, WarningMessage): new names for the old
18594         Error and Warning classes.
18595
18596         * cs-parser.jay (member_access): Turn built-in access to types
18597         into a normal simplename
18598
18599 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18600
18601         * expression.cs (Invocation::BetterConversion): Fix to cope
18602         with q being null, since this was introducing a bug.
18603
18604         * expression.cs (ConvertImplicit): Do built-in conversions first.
18605
18606 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18607
18608         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18609
18610 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18611
18612         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18613         I had introduced long ago (what's new ?).
18614
18615         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18616         the work of all the checking. 
18617         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18618         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18619
18620         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18621         that is the right way. 
18622
18623         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18624         overloading resolution. Use everywhere instead of cutting and pasting code.
18625
18626         (Binary::ResolveOperator): Use MakeUnionSet.
18627
18628         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18629         we have to convert to bool types. Not complete yet.
18630
18631 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * typemanager.cs (TypeManager::CSharpName): support ushort.
18634
18635         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18636         to provide an expression that performsn an implicit constant int
18637         conversion (section 6.1.6).
18638         (Expression::ConvertImplicitRequired): Reworked to include
18639         implicit constant expression conversions.
18640
18641         (Expression::ConvertNumericExplicit): Finished.
18642
18643         (Invocation::Emit): If InstanceExpression is null, then it means
18644         that we perform a call on this.
18645
18646 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18647
18648         * expression.cs (Unary::Emit): Remove some dead code.
18649         (Probe): Implement Resolve and Emit for `is'.
18650         (Expression::ConvertImplicitRequired): Attempt to do constant
18651         expression conversions here.  Maybe should be moved to
18652         ConvertImplicit, but I am not sure.
18653         (Expression::ImplicitLongConstantConversionPossible,
18654         Expression::ImplicitIntConstantConversionPossible): New functions
18655         that tell whether is it possible to apply an implicit constant
18656         expression conversion.
18657
18658         (ConvertNumericExplicit): Started work on explicit numeric
18659         conversions.
18660
18661         * cs-parser.jay: Update operator constants.
18662
18663         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18664         (Parameters::GetSignature): Hook up VerifyArgs here.
18665         (Parameters::VerifyArgs): Verifies that no two arguments have the
18666         same name. 
18667
18668         * class.cs (Operator): Update the operator names to reflect the
18669         ones that the spec expects (as we are just stringizing the
18670         operator names).
18671
18672         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18673         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18674         previous usage did only work for our methods.
18675         (Expression::ConvertImplicit): Handle decimal implicit numeric
18676         conversions as well.
18677         (Expression::InternalTypeConstructor): Used to invoke constructors
18678         on internal types for default promotions.
18679
18680         (Unary::Emit): Implement special handling for the pre/post
18681         increment/decrement for overloaded operators, as they need to have
18682         the same semantics as the other operators.
18683
18684         (Binary::ResolveOperator): ditto.
18685         (Invocation::ConversionExists): ditto.
18686         (UserImplicitCast::Resolve): ditto.
18687
18688 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18689
18690         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18691         operator, return after emitting body. Regression tests pass again !
18692
18693         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18694         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18695         (Invocation::OverloadResolve): Ditto.
18696         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18697
18698         * everywhere : update calls to the above methods accordingly.
18699
18700 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18701
18702         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18703
18704         * expression.cs (ExpressionStatement): New base class used for
18705         expressions that can appear in statements, so that we can provide
18706         an alternate path to generate expression that do not leave a value
18707         on the stack.
18708
18709         (Expression::Emit, and all the derivatives): We no longer return
18710         whether a value is left on the stack or not.  Every expression
18711         after being emitted leaves a single value on the stack.
18712
18713         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18714         facilties of ExpressionStatement if possible.
18715
18716         * cs-parser.jay: Update statement_expression.
18717
18718 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18719
18720         * driver.cs: Change the wording of message
18721
18722 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18723
18724         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18725         the type of the expression to the return type of the method if
18726         we have an overloaded operator match ! The regression tests pass again !
18727         (Unary::ResolveOperator): Ditto.
18728
18729         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18730         to find "op_Implicit", not "implicit" ;-)
18731         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18732         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18733
18734         * everywhere : Correct calls to the above accordingly.
18735
18736         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18737         (ConvertImplicit): Do user-defined conversion if it exists.
18738
18739 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18740
18741         * assign.cs: track location.
18742         (Resolve): Use implicit conversions on assignment.
18743
18744         * literal.cs: Oops.  Not good, Emit of short access values should
18745         pass (Bytes) or the wrong argument will be selected.
18746
18747         * expression.cs (Unary::Emit): Emit code for -expr.
18748
18749         (Unary::ResolveOperator): Handle `Substract' for non-constants
18750         (substract from zero from the non-constants).
18751         Deal with Doubles as well. 
18752
18753         (Expression::ConvertImplicitRequired): New routine that reports an
18754         error if no implicit conversion exists. 
18755
18756         (Invocation::OverloadResolve): Store the converted implicit
18757         expressions if we make them
18758
18759 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18760
18761         * class.cs (ConstructorInitializer): Take a Location argument.
18762         (ConstructorBaseInitializer): Same here.
18763         (ConstructorThisInitializer): Same here.
18764
18765         * cs-parser.jay : Update all calls accordingly.
18766
18767         * expression.cs (Unary, Binary, New): Take location argument.
18768         Update accordingly everywhere.
18769
18770         * cs-parser.jay : Update all calls to the above to take a location
18771         argument.
18772
18773         * class.cs : Ditto.
18774
18775 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18776
18777         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18778         (Invocation::BetterConversion): Same here
18779         (Invocation::ConversionExists): Ditto.
18780
18781         (Invocation::ConversionExists): Implement.
18782
18783 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18784
18785         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18786         Also take an additional TypeContainer argument.
18787
18788         * All over : Pass in TypeContainer as argument to OverloadResolve.
18789
18790         * typemanager.cs (CSharpName): Update to check for the string type and return
18791         that too.
18792
18793         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18794         a given method.
18795
18796 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18797
18798         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18799         (Invocation::BetterFunction): Implement.
18800         (Invocation::BetterConversion): Implement.
18801         (Invocation::ConversionExists): Skeleton, no implementation yet.
18802
18803         Okay, things work fine !
18804
18805 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18806
18807         * typemanager.cs: declare and load enum_type, delegate_type and
18808         void_type. 
18809
18810         * expression.cs (Expression::Emit): Now emit returns a value that
18811         tells whether a value is left on the stack or not.  This strategy
18812         might be reveted tomorrow with a mechanism that would address
18813         multiple assignments.
18814         (Expression::report118): Utility routine to report mismatches on
18815         the ExprClass.
18816
18817         (Unary::Report23): Report impossible type/operator combination
18818         utility function.
18819
18820         (Unary::IsIncrementableNumber): Whether the type can be
18821         incremented or decremented with add.
18822         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18823         complemented. 
18824         (Unary::ResolveOperator): Implement ++, !, ~,
18825
18826         (Invocation::Emit): Deal with new Emit convetion.
18827
18828         * All Expression derivatives: Updated their Emit method to return
18829         whether they leave values on the stack or not.
18830
18831         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18832         stack for expressions that are statements. 
18833
18834 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18835
18836         * expression.cs (LValue): New interface.  Must be implemented by
18837         LValue objects.
18838         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18839         LValue interface.
18840
18841         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18842         interface for generating code, simplifies the code.
18843
18844 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18845
18846         * expression.cs (everywhere): Comment out return statements in ::Resolve
18847         methods to avoid the warnings.
18848
18849 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * driver.cs (parse): Report error 2001 if we can not open the
18852         source file.
18853
18854         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18855         not resolve it.
18856
18857         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18858         object. 
18859
18860         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18861         otherwise nested blocks end up with the same index.
18862
18863         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18864
18865         * expression.cs:  Instead of having FIXMEs in the Resolve
18866         functions, throw exceptions so it is obvious that we are facing a
18867         bug. 
18868
18869         * cs-parser.jay (invocation_expression): Pass Location information.
18870
18871         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18872         Use a basename for those routines because .NET does not like paths
18873         on them. 
18874
18875         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18876         already defined.
18877
18878 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18879
18880         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18881         are loading the correct data types (throws an exception if not).
18882         (TypeManager::InitCoreTypes): Use CoreLookupType
18883
18884         * expression.cs (Unary::ResolveOperator): return the child
18885         expression for expressions which are just +expr.
18886         (Unary::ResolveOperator): Return negative literals for -LITERAL
18887         expressions (otherwise they are Unary {Literal}).
18888         (Invocation::Badness): Take into account `Implicit constant
18889         expression conversions'.
18890
18891         * literal.cs (LongLiteral): Implement long literal class.
18892         (IntLiteral): export the `Value' of the intliteral. 
18893
18894 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18895
18896         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18897
18898         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18899         instead of 'Operator'
18900
18901         * expression.cs (Binary::ResolveOperator): Update accordingly.
18902         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18903         and 'Minus'
18904
18905         * cs-parser.jay (unary_expression): Update to use the new names.
18906
18907         * gen-treedump.cs (GetUnary): Same here.
18908
18909         * expression.cs (Unary::Resolve): Implement.
18910         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18911         operators are found instead of making noise ;-)
18912         (Unary::ResolveOperator): New method to do precisely the same thing which
18913         Binary::ResolveOperator does for Binary expressions.
18914         (Unary.method, .Arguments): Add.
18915         (Unary::OperName): Implement.   
18916         (Unary::ForceConversion): Copy and Paste !
18917
18918         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18919         a unary operator.
18920
18921         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18922         for the inbuilt operators. Only overloading works for now ;-)
18923
18924 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18925
18926         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18927         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18928
18929         * expression.cs (This::Emit): Implement. 
18930         (This::Resolve): Implement.
18931         (TypeOf:Resolve): Implement.
18932         (Expression::ResolveSimpleName): Add an implicit this to instance
18933         field references. 
18934         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18935         Bind instance variable to Field expressions.
18936         (FieldExpr::Instance): New field used to track the expression that
18937         represents the object instance.
18938         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18939         binding 
18940         (FieldExpr::Emit): Implement.
18941
18942         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18943         the last instruction contains a return opcode to avoid generating
18944         the last `ret' instruction (this generates correct code, and it is
18945         nice to pass the peverify output).
18946
18947         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18948         initializer for static and instance variables.
18949         (Constructor::Emit): Allow initializer to be null in the case of
18950         static constructors.  Only emit initializer for instance
18951         constructors. 
18952
18953         (TypeContainer::FindMembers): Return a null array if there are no
18954         matches.
18955
18956         Also fix the code for the MemberTypes.Method branch, as it was not
18957         scanning that for operators (or tried to access null variables before).
18958
18959         * assign.cs (Assign::Emit): Handle instance and static fields. 
18960
18961         * TODO: Updated.
18962
18963         * driver.cs: Stop compilation if there are parse errors.
18964
18965         * cs-parser.jay (constructor_declaration): Provide default base
18966         initializer for non-static constructors.
18967         (constructor_declarator): Do not provide a default base
18968         initializers if none was specified.
18969         Catch the fact that constructors should not have parameters.
18970
18971         * class.cs: Do not emit parent class initializers for static
18972         constructors, that should be flagged as an error.
18973
18974 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18975
18976         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18977         Move back code into TypeContainer::Populate.
18978
18979 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18980
18981         * class.cs (TypeContainer::AddConstructor): Fix the check to
18982         compare against Name, not Basename. 
18983         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18984
18985         * cs-parser.jay : Update accordingly.
18986
18987         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18988         for methods, don't forget to look into the operators too.
18989         (RegisterMethodBuilder): Helper method to take care of this for
18990         methods, constructors and operators.
18991         (Operator::Define): Completely revamp.
18992         (Operator.OperatorMethod, MethodName): New fields.
18993         (TypeContainer::Populate): Move the registering of builders into
18994         RegisterMethodBuilder.
18995         (Operator::Emit): Re-write.
18996
18997         * expression.cs (Binary::Emit): Comment out code path to emit method
18998         invocation stuff for the case when we have a user defined operator. I am
18999         just not able to get it right !
19000
19001 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19002
19003         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19004         argument. 
19005
19006         (Expression::MemberLookup): Provide a version that allows to
19007         specify the MemberTypes and BindingFlags. 
19008
19009         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19010         so it was not fetching variable information from outer blocks.
19011
19012         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19013         Beforefieldinit as it was buggy.
19014
19015         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19016         that Ravi put here.  
19017
19018         * class.cs (Constructor::Emit): Only emit if block is not null.
19019         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19020         deal with this by semantically definining it as if the user had
19021         done it.
19022
19023         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19024         constructors as we now "emit" them at a higher level.
19025
19026         (TypeContainer::DefineDefaultConstructor): Used to define the
19027         default constructors if none was provided.
19028
19029         (ConstructorInitializer): Add methods Resolve and Emit. 
19030
19031         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19032
19033 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19034
19035         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19036         the default constructor builder with our hashtable for methodbuilders
19037         to methodcores.
19038
19039         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19040         and argument_count is 0 in which case we have a match.
19041         (Binary::ResolveOperator): More null checking and miscellaneous coding
19042         style cleanup.
19043
19044 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19045
19046         * rootcontext.cs (IsNameSpace): Compare against null.
19047
19048         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19049
19050         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19051         and Unary::Operator.
19052
19053         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19054         accordingly.
19055
19056         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19057         we have overloaded operators.
19058         (Binary::ResolveOperator): Implement the part which does the operator overload
19059         resolution.
19060
19061         * class.cs (Operator::Emit): Implement.
19062         (TypeContainer::Emit): Emit the operators we have too.
19063
19064         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19065         the case when we have a user-defined operator.
19066
19067 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19070
19071 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19072
19073         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19074         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19075         (Constructor::Emit): Implement.
19076         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19077         if we have no work to do. 
19078         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19079         Emit method.
19080
19081         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19082         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19083
19084         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19085         of parent.parent.
19086
19087 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19088
19089         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19090         in the source.
19091         (Tree::RecordNamespace): Method to do what the name says ;-)
19092         (Tree::Namespaces): Property to get at the namespaces hashtable.
19093
19094         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19095         keep track.
19096
19097         * rootcontext.cs (IsNamespace): Fixed it :-)
19098
19099 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19100
19101         * class.cs (TypeContainer::FindMembers): Add support for
19102         constructors. 
19103         (MethodCore): New class that encapsulates both the shared aspects
19104         of a Constructor and a Method.  
19105         (Method, Constructor): Factored pieces into MethodCore.
19106
19107         * driver.cs: Added --fatal which makes errors throw exceptions.
19108         Load System assembly as well as part of the standard library.
19109
19110         * report.cs: Allow throwing exceptions on errors for debugging.
19111
19112         * modifiers.cs: Do not use `parent', instead use the real type
19113         container to evaluate permission settings.
19114
19115         * class.cs: Put Ravi's patch back in.  He is right, and we will
19116         have to cope with the
19117
19118 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19119
19120         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19121         FamORAssem, not FamANDAssem.
19122
19123 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * driver.cs: Added --parse option that only parses its input files
19126         and terminates.
19127
19128         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19129         incorrect.  IsTopLevel is not used to tell whether an object is
19130         root_types or not (that can be achieved by testing this ==
19131         root_types).  But to see if this is a top-level *class* (not
19132         necessarly our "toplevel" container). 
19133
19134 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19135
19136         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19137         parent instead of a direct call to GetType.
19138
19139 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19140
19141         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19142         Modifiers.TypeAttr. This should just be a call to that method.
19143
19144         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19145         object so that we can determine if we are top-level or not.
19146
19147         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19148         TypeContainer too.
19149
19150         * enum.cs (Enum::Define): Ditto.
19151
19152         * modifiers.cs (FieldAttr): Re-write.
19153
19154         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19155         (TypeContainer::HaveStaticConstructor): New property to provide access
19156         to precisely that info.
19157
19158         * modifiers.cs (MethodAttr): Re-write.
19159         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19160
19161         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19162         of top-level types as claimed.
19163
19164 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19165
19166         * expression.cs (MemberLookup): Fruitless attempt to lookup
19167         constructors.  Maybe I need to emit default constructors?  That
19168         might be it (currently .NET emits this for me automatically).
19169         (Invocation::OverloadResolve): Cope with Arguments == null.
19170         (Invocation::EmitArguments): new function, shared by the new
19171         constructor and us.
19172         (Invocation::Emit): Handle static and instance methods.  Emit
19173         proper call instruction for virtual or non-virtual invocations.
19174         (New::Emit): Implement.
19175         (New::Resolve): Implement.
19176         (MemberAccess:Resolve): Implement.
19177         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19178         to track instances.
19179         (FieldExpr::Resolve): Set type.
19180
19181         * support.cs: Handle empty arguments.
19182                 
19183         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19184         SimpleLookup): Auxiliary routines to help parse a qualifier
19185         identifier.  
19186
19187         Update qualifier_identifier rule.
19188
19189         * codegen.cs: Removed debugging messages.
19190
19191         * class.cs: Make this a global thing, this acts just as a "key" to
19192         objects that we might have around.
19193
19194         (Populate): Only initialize method_builders_to_methods once.
19195
19196         * expression.cs (PropertyExpr): Initialize type from the
19197         PropertyType. 
19198
19199         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19200         Resolve pattern.  Attempt to implicitly convert value to boolean.
19201         Emit code.
19202
19203         * expression.cs: Set the type for the int32/int32 argument case.
19204         (Binary::ResolveOperator): Set the return type to boolean for
19205         comparission operators
19206
19207         * typemanager.cs: Remove debugging print code.
19208
19209         (Invocation::Resolve): resolve type.
19210
19211         * class.cs: Allocate a MemberInfo of the correct size, as the code
19212         elsewhere depends on the test to reflect the correct contents.
19213
19214         (Method::) Keep track of parameters, due to System.Reflection holes
19215
19216         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19217         mapping here.
19218
19219         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19220         of the exact size and return that.
19221
19222         (Class::LookupMethodByBuilder): New function that maps
19223         MethodBuilders to its methods.  Required to locate the information
19224         on methods because System.Reflection bit us again.
19225
19226         * support.cs: New file, contains an interface ParameterData and
19227         two implementations: ReflectionParameters and InternalParameters
19228         used to access Parameter information.  We will need to grow this
19229         as required.
19230
19231         * expression.cs (Invocation::GetParameterData): implement a cache
19232         and a wrapper around the ParameterData creation for methods. 
19233         (Invocation::OverloadResolve): Use new code.
19234
19235 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19236
19237         * class.cs (TypeContainer::EmitField): Remove and move into 
19238         (Field::Define): here and modify accordingly.
19239         (Field.FieldBuilder): New member.
19240         (TypeContainer::Populate): Update accordingly.
19241         (TypeContainer::FindMembers): Implement.
19242
19243 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19244
19245         * statement.cs: (VariableInfo::VariableType): New field to be
19246         initialized with the full type once it is resolved. 
19247
19248 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19249
19250         * parameter.cs (GetParameterInfo): Use a type cache to compute
19251         things only once, and to reuse this information
19252
19253         * expression.cs (LocalVariableReference::Emit): Implement.
19254         (OpcodeCast::Emit): fix.
19255
19256         (ParameterReference::Resolve): Implement.
19257         (ParameterReference::Emit): Implement.
19258
19259         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19260         that are expressions need to stay as Expressions.
19261
19262         * typemanager.cs (CSharpName): Returns the C# name of a type if
19263         possible. 
19264
19265         * expression.cs (Expression::ConvertImplicit): New function that
19266         implements implicit type conversions.
19267
19268         (Expression::ImplicitReferenceConversion): Implements implicit
19269         reference conversions.
19270
19271         (EmptyCast): New type for transparent casts.
19272
19273         (OpcodeCast): New type for casts of types that are performed with
19274         a sequence of bytecodes.
19275
19276         (BoxedCast): New type used for casting value types into reference
19277         types.  Emits a box opcode.
19278
19279         (Binary::DoNumericPromotions): Implements numeric promotions of
19280         and computation of the Binary::Type.
19281
19282         (Binary::EmitBranchable): Optimization.
19283
19284         (Binary::Emit): Implement code emission for expressions.
19285
19286         * typemanager.cs (TypeManager): Added two new core types: sbyte
19287         and byte.
19288
19289 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19290
19291         * class.cs (TypeContainer::FindMembers): Method which does exactly
19292         what Type.FindMembers does, only we don't have to use reflection. No
19293         implementation yet.
19294
19295         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19296         typecontainer objects as we need to get at them.
19297         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19298
19299         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19300         typecontainer object.
19301
19302         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19303         of just a Report object.
19304
19305 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19306
19307         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19308         "remove_"
19309         (TypeContainer::Populate): Now define the delegates of the type too.
19310         (TypeContainer.Delegates): Property to access the list of delegates defined
19311         in the type.
19312
19313         * delegates.cs (Delegate::Define): Implement partially.
19314
19315         * modifiers.cs (TypeAttr): Handle more flags.
19316
19317 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19318
19319         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19320         and not <=
19321         (Operator::Define): Re-write logic to get types by using the LookupType method
19322         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19323         (Indexer::Define): Ditto.
19324         (Event::Define): Ditto.
19325         (Property::Define): Ditto.
19326
19327 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19328
19329         * class.cs (TypeContainer::Populate): Now define operators too. 
19330         (TypeContainer.Operators): New property to access the list of operators
19331         in a type.
19332         (Operator.OperatorMethodBuilder): New member to hold the method builder
19333         for the operator we are defining.
19334         (Operator::Define): Implement.
19335
19336 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19337
19338         * class.cs (Event::Define): Make the prefixes of the accessor methods
19339         addOn_ and removeOn_ 
19340
19341         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19342         of the location being passed in too. Ideally, this should go later since all
19343         error reporting should be done through the Report object.
19344
19345         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19346         (Populate): Iterate thru the indexers we have and define them too.
19347         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19348         for the get and set accessors.
19349         (Indexer::Define): Implement.
19350
19351 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19354         my previous implementation, did not work.
19355
19356         * typemanager.cs: Add a couple of missing types (the longs).
19357
19358         * literal.cs: Use TypeManager.bool_type instead of getting it.
19359
19360         * expression.cs (EventExpr): New kind of expressions.
19361         (Expressio::ExprClassFromMemberInfo): finish
19362
19363 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19364
19365         * assign.cs: Emit stores to static fields differently.
19366
19367 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19368
19369         * Merge in changes and adjust code to tackle conflicts. Backed out my
19370         code in Assign::Resolve ;-) 
19371
19372 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19373
19374         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19375         instead Report.Error and also pass in the location.
19376         (CSharpParser::Lexer): New readonly property to return the reference
19377         to the Tokenizer object.
19378         (declare_local_variables): Use Report.Error with location instead of plain 
19379         old error.
19380         (CheckDef): Ditto.
19381
19382         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19383         (Operator.CheckBinaryOperator): Ditto.
19384
19385         * cs-parser.jay (operator_declarator): Update accordingly.
19386
19387         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19388         (CheckBinaryOperator): Same here.
19389
19390         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19391         on the name without any prefixes of namespace names etc. This is because we
19392         already might have something already fully qualified like 
19393         'System.Console.WriteLine'
19394
19395         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19396
19397 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19398
19399         * cs-tokenizer.cs (location): Return a string which also contains
19400         the file name.
19401
19402         * expression.cs (ElementAccess): New class for expressions of the
19403         type 'element access.'
19404         (BaseAccess): New class for expressions of the type 'base access.'
19405         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19406         respectively.
19407
19408         * cs-parser.jay (element_access): Implement action.
19409         (base_access): Implement actions.
19410         (checked_expression, unchecked_expression): Implement.
19411
19412         * cs-parser.jay (local_variable_type): Correct and implement.
19413         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19414
19415         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19416
19417         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19418         name and the specifiers.
19419
19420         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19421
19422         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19423         making them all public ;-)
19424
19425         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19426         class anyways.
19427
19428 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19429
19430         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19431         PropertyExprs.
19432         (FieldExpr, PropertyExprs): New resolved expressions.
19433         (SimpleName::MemberStaticCheck): Perform static checks for access
19434         to non-static fields on static methods. Maybe this should be
19435         generalized for MemberAccesses. 
19436         (SimpleName::ResolveSimpleName): More work on simple name
19437         resolution. 
19438
19439         * cs-parser.jay (primary_expression/qualified_identifier): track
19440         the parameter index.
19441
19442         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19443         (EmitContext::EmitBoolExpression): Chain to expression generation
19444         instead of temporary hack.
19445         (::EmitStatementExpression): Put generic expression code generation.
19446
19447         * assign.cs (Assign::Emit): Implement variable assignments to
19448         local variables, parameters and fields.
19449
19450 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * statement.cs (Block::GetVariableInfo): New method, returns the
19453         VariableInfo for a variable name in a block.
19454         (Block::GetVariableType): Implement in terms of GetVariableInfo
19455
19456         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19457         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19458
19459 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19460
19461         * cs-parser.jay (operator_declaration): Continue on my quest : update
19462         to take attributes argument.
19463         (event_declaration): Ditto.
19464         (enum_declaration): Ditto.
19465         (indexer_declaration): Ditto.
19466
19467         * class.cs (Operator::Operator): Update constructor accordingly.
19468         (Event::Event): Ditto.
19469
19470         * delegate.cs (Delegate::Delegate): Same here.
19471
19472         * enum.cs (Enum::Enum): Same here.
19473
19474 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19475
19476         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19477
19478         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19479
19480         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19481         being passed around as an arraylist.
19482         (Attributes::AddAttribute): Method to add attribute sections.
19483
19484         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19485         (struct_declaration): Update accordingly.
19486         (constant_declaration): Update.
19487         (field_declaration): Update.
19488         (method_header): Update.
19489         (fixed_parameter): Update.
19490         (parameter_array): Ditto.
19491         (property_declaration): Ditto.
19492         (destructor_declaration): Ditto.
19493
19494         * class.cs (Struct::Struct): Update constructors accordingly.
19495         (Class::Class): Ditto.
19496         (Field::Field): Ditto.
19497         (Method::Method): Ditto.
19498         (Property::Property): Ditto.
19499         (TypeContainer::OptAttribute): update property's return type.
19500
19501         * interface.cs (Interface.opt_attributes): New member.
19502         (Interface::Interface): Update to take the extra Attributes argument.
19503
19504         * parameter.cs (Parameter::Parameter): Ditto.
19505
19506         * constant.cs (Constant::Constant): Ditto.
19507
19508         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19509         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19510         the attributes as a parameter.
19511         (InterfaceProperty): Update constructor call.
19512         (InterfaceEvent): Ditto.
19513         (InterfaceMethod): Ditto.
19514         (InterfaceIndexer): Ditto.
19515
19516         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19517         pass the attributes too.
19518         (interface_event_declaration): Ditto.
19519         (interface_property_declaration): Ditto.
19520         (interface_method_declaration): Ditto.
19521         (interface_declaration): Ditto.
19522
19523 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * class.cs (Method::Define): Track the "static Main" definition to
19526         create an entry point. 
19527
19528         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19529         EntryPoint if we find it. 
19530
19531         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19532         (EmitContext::ig): Make this variable public.
19533
19534         * driver.cs: Make the default output file be the first file name
19535         with the .exe extension.  
19536
19537         Detect empty compilations
19538
19539         Handle various kinds of output targets.  Handle --target and
19540         rename -t to --dumper.
19541
19542         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19543         methods inherited from Expression return now an Expression.  This
19544         will is used during the tree rewriting as we resolve them during
19545         semantic analysis.
19546
19547         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19548         the spec.  Missing entirely is the information about
19549         accessability of elements of it.
19550
19551         (Expression::ExprClassFromMemberInfo): New constructor for
19552         Expressions that creates a fully initialized Expression based on
19553         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19554         a Type.
19555
19556         (Invocation::Resolve): Begin implementing resolution of invocations.
19557
19558         * literal.cs (StringLiteral):  Implement Emit.
19559
19560 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19561
19562         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19563         member.
19564
19565 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19566
19567         * cs-parser.jay (attribute_arguments): Implement actions.
19568         (attribute): Fix bug in production. Implement action.
19569         (attribute_list): Implement.
19570         (attribute_target): Implement.
19571         (attribute_target_specifier, opt_target_specifier): Implement
19572         (CheckAttributeTarget): New method to check if the attribute target
19573         is valid.
19574         (attribute_section): Implement.
19575         (opt_attributes): Implement.
19576
19577         * attribute.cs : New file to handle attributes.
19578         (Attribute): Class to hold attribute info.
19579
19580         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19581         (attribute_section): Modify production to use 2 different rules to 
19582         achieve the same thing. 1 s/r conflict down !
19583         Clean out commented, useless, non-reducing dimension_separator rules.
19584
19585         * class.cs (TypeContainer.attributes): New member to hold list
19586         of attributes for a type.
19587         (Struct::Struct): Modify to take one more argument, the attribute list.
19588         (Class::Class): Ditto.
19589         (Field::Field): Ditto.
19590         (Method::Method): Ditto.
19591         (Property::Property): Ditto.
19592
19593         * cs-parser.jay (struct_declaration): Update constructor call to
19594         pass in the attributes too.
19595         (class_declaration): Ditto.
19596         (constant_declaration): Ditto.
19597         (field_declaration): Ditto.
19598         (method_header): Ditto.
19599         (fixed_parameter): Ditto.
19600         (parameter_array): Ditto.
19601         (property_declaration): Ditto.
19602
19603         * constant.cs (Constant::Constant): Update constructor similarly.
19604         Use System.Collections.
19605
19606         * parameter.cs (Parameter::Parameter): Update as above.
19607
19608 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19609
19610         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19611         (TypeContainer.delegates): New member to hold list of delegates.
19612
19613         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19614         this time as I seem to be on crack ;-)
19615
19616 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19617
19618         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19619         tell whether an identifier represents a namespace.
19620
19621         * expression.cs (NamespaceExpr): A namespace expression, used only
19622         temporarly during expression resolution.
19623         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19624         utility functions to resolve names on expressions.
19625
19626 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19627
19628         * codegen.cs: Add hook for StatementExpressions. 
19629
19630         * class.cs: Fix inverted test for static flag in methods.
19631
19632 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19633
19634         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19635         to make it coincide with MS' number.
19636         (Operator::CheckBinaryOperator): Ditto.
19637
19638         * ../errors/errors.txt : Remove error numbers added earlier.
19639
19640         * ../errors/cs1019.cs : Test case for error # 1019
19641
19642         * ../errros/cs1020.cs : Test case for error # 1020
19643
19644         * cs-parser.jay : Clean out commented cruft.
19645         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19646         used anywhere - non-reducing rule.
19647         (namespace_declarations): Non-reducing rule - comment out.
19648
19649         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19650         with TypeContainer::AddEnum.
19651
19652         * delegate.cs : New file for delegate handling classes.
19653         (Delegate): Class for declaring delegates.
19654
19655         * makefile : Update.
19656
19657         * cs-parser.jay (delegate_declaration): Implement.
19658
19659 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19660
19661         * class.cs (Event::Define): Implement.
19662         (Event.EventBuilder): New member.
19663
19664         * class.cs (TypeContainer::Populate): Update to define all enums and events
19665         we have.
19666         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19667         readonly fields for all these cases ?
19668
19669 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19670
19671         * class.cs (Property): Revamp to use the convention of making fields readonly.
19672         Accordingly modify code elsewhere.
19673
19674         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19675         the Define method of the Property class.
19676
19677         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19678         trivial bug.
19679         (TypeContainer::Populate): Update to define all the properties we have. Also
19680         define all enumerations.
19681
19682         * enum.cs (Define): Implement.
19683
19684 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19685
19686         * cs-parser.jay (overloadable_operator): The semantic value is an
19687         enum of the Operator class.
19688         (operator_declarator): Implement actions.
19689         (operator_declaration): Implement.
19690
19691         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19692         validity of definitions.
19693         (Operator::CheckBinaryOperator): Static method to check for binary operators
19694         (TypeContainer::AddOperator): New method to add an operator to a type.
19695
19696         * cs-parser.jay (indexer_declaration): Added line to actually call the
19697         AddIndexer method so it gets added ;-)
19698
19699         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19700         already taken care of by the MS compiler ?  
19701
19702 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19703
19704         * class.cs (Operator): New class for operator declarations.
19705         (Operator::OpType): Enum for the various operators.
19706
19707 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19708
19709         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19710         ostensibly handle this in semantic analysis.
19711
19712         * cs-parser.jay (general_catch_clause): Comment out
19713         (specific_catch_clauses, specific_catch_clause): Ditto.
19714         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19715         (catch_args, opt_catch_args): New productions.
19716         (catch_clause): Rewrite to use the new productions above
19717         (catch_clauses): Modify accordingly.
19718         (opt_catch_clauses): New production to use in try_statement
19719         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19720         and re-write the code in the actions to extract the specific and
19721         general catch clauses by being a little smart ;-)
19722
19723         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19724         Hooray, try and catch statements parse fine !
19725
19726 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19727
19728         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19729         string from the hashtable of variables.
19730
19731         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19732         I end up making that mistake ;-)
19733         (catch_clauses): Fixed gross error which made Key and Value of the 
19734         DictionaryEntry the same : $1 !!
19735
19736 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19737
19738         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19739
19740         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19741         when the add and remove accessors are specified. 
19742
19743 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19744
19745         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19746         information about indexer_declarator.
19747         (indexer_declarator): Implement actions.
19748         (parsing_indexer): New local boolean used to keep track of whether
19749         we are parsing indexers or properties. This is necessary because 
19750         implicit_parameters come into picture even for the get accessor in the 
19751         case of an indexer.
19752         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19753
19754         * class.cs (Indexer): New class for indexer declarations.
19755         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19756         (TypeContainer::indexers): New member to hold list of indexers for the
19757         type.
19758
19759 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19760
19761         * cs-parser.jay (add_accessor_declaration): Implement action.
19762         (remove_accessor_declaration): Implement action.
19763         (event_accessors_declaration): Implement
19764         (variable_declarators): swap statements for first rule - trivial.
19765
19766         * class.cs (Event): New class to hold information about event
19767         declarations.
19768         (TypeContainer::AddEvent): New method to add an event to a type
19769         (TypeContainer::events): New member to hold list of events.
19770
19771         * cs-parser.jay (event_declaration): Implement actions.
19772
19773 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19774
19775         * cs-parser.jay (dim_separators): Implement. Make it a string
19776         concatenating all the commas together, just as they appear.
19777         (opt_dim_separators): Modify accordingly
19778         (rank_specifiers): Update accordingly. Basically do the same
19779         thing - instead, collect the brackets here.
19780         (opt_rank_sepcifiers): Modify accordingly.
19781         (array_type): Modify to actually return the complete type string
19782         instead of ignoring the rank_specifiers.
19783         (expression_list): Implement to collect the expressions
19784         (variable_initializer): Implement. We make it a list of expressions
19785         essentially so that we can handle the array_initializer case neatly too.
19786         (variable_initializer_list): Implement.
19787         (array_initializer): Make it a list of variable_initializers
19788         (opt_array_initializer): Modify accordingly.
19789
19790         * expression.cs (New::NType): Add enumeration to help us
19791         keep track of whether we have an object/delegate creation
19792         or an array creation.
19793         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19794         members to hold data about array creation.
19795         (New:New): Modify to update NewType
19796         (New:New): New Overloaded contructor for the array creation
19797         case.
19798
19799         * cs-parser.jay (array_creation_expression): Implement to call
19800         the overloaded New constructor.
19801
19802 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19803
19804         * class.cs (TypeContainer::Constructors): Return member
19805         constructors instead of returning null.
19806
19807 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19808
19809         * typemanager.cs (InitCoreTypes): Initialize the various core
19810         types after we have populated the type manager with the user
19811         defined types (this distinction will be important later while
19812         compiling corlib.dll)
19813
19814         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19815         on Expression Classification.  Now all expressions have a method
19816         `Resolve' and a method `Emit'.
19817
19818         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19819         generation from working.     Also add some temporary debugging
19820         code. 
19821
19822 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * codegen.cs: Lots of code generation pieces.  This is only the
19825         beginning, will continue tomorrow with more touches of polish.  We
19826         handle the fundamentals of if, while, do, for, return.  Others are
19827         trickier and I need to start working on invocations soon.
19828
19829         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19830         s.InitStatement. 
19831
19832         * codegen.cs (EmitContext): New struct, used during code
19833         emission to keep a context.   Most of the code generation will be
19834         here. 
19835
19836         * cs-parser.jay: Add embedded blocks to the list of statements of
19837         this block.  So code generation proceeds in a top down fashion.
19838
19839 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19840
19841         * statement.cs: Add support for multiple child blocks.
19842
19843 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19844
19845         * codegen.cs (EmitCode): New function, will emit the code for a
19846         Block of code given a TypeContainer and its ILGenerator. 
19847
19848         * statement.cs (Block): Standard public readonly optimization.
19849         (Block::Block constructors): Link children. 
19850         (Block::Child): Child Linker.
19851         (Block::EmitVariables): Emits IL variable declarations.
19852
19853         * class.cs: Drop support for MethodGroups here, delay until
19854         Semantic Analysis.
19855         (Method::): Applied the same simplification that I did before, and
19856         move from Properties to public readonly fields.
19857         (Method::ParameterTypes): Returns the parameter types for the
19858         function, and implements a cache that will be useful later when I
19859         do error checking and the semantic analysis on the methods is
19860         performed.
19861         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19862         and made a method, optional argument tells whether this is a class
19863         or a structure to apply the `has-this' bit.
19864         (Method::GetCallingConvention): Implement, returns the calling
19865         convention. 
19866         (Method::Define): Defines the type, a second pass is performed
19867         later to populate the methods.
19868
19869         (Constructor::ParameterTypes): implement a cache similar to the
19870         one on Method::ParameterTypes, useful later when we do semantic
19871         analysis. 
19872
19873         (TypeContainer::EmitMethod):  New method.  Emits methods.
19874
19875         * expression.cs: Removed MethodGroup class from here.
19876
19877         * parameter.cs (Parameters::GetCallingConvention): new method.
19878
19879 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19880
19881         * class.cs (TypeContainer::Populate): Drop RootContext from the
19882         argument. 
19883
19884         (Constructor::CallingConvention): Returns the calling convention.
19885         (Constructor::ParameterTypes): Returns the constructor parameter
19886         types. 
19887
19888         (TypeContainer::AddConstructor): Keep track of default constructor
19889         and the default static constructor.
19890
19891         (Constructor::) Another class that starts using `public readonly'
19892         instead of properties. 
19893
19894         (Constructor::IsDefault): Whether this is a default constructor. 
19895
19896         (Field::) use readonly public fields instead of properties also.
19897
19898         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19899         track of static constructors;  If none is used, turn on
19900         BeforeFieldInit in the TypeAttributes. 
19901
19902         * cs-parser.jay (opt_argument_list): now the return can be null
19903         for the cases where there are no arguments. 
19904
19905         (constructor_declarator): If there is no implicit `base' or
19906         `this', then invoke the default parent constructor. 
19907
19908         * modifiers.cs (MethodAttr): New static function maps a set of
19909         modifiers flags into a MethodAttributes enum
19910         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19911         MethodAttr, TypeAttr to represent the various mappings where the
19912         modifiers are used.
19913         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19914
19915 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19918         method arguments.
19919
19920         * interface.cs (PopulateIndexer): Implemented the code generator
19921         for interface indexers.
19922
19923 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19924
19925         * interface.cs (InterfaceMemberBase): Now we track the new status
19926         here.  
19927
19928         (PopulateProperty): Implement property population.  Woohoo!  Got
19929         Methods and Properties going today. 
19930
19931         Removed all the properties for interfaces, and replaced them with
19932         `public readonly' fields. 
19933
19934 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19935
19936         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19937         initialize their hashtables/arraylists only when they are needed
19938         instead of doing this always.
19939
19940         * parameter.cs: Handle refs and out parameters.
19941
19942         * cs-parser.jay: Use an ArrayList to construct the arguments
19943         instead of the ParameterCollection, and then cast that to a
19944         Parameter[] array.
19945
19946         * parameter.cs: Drop the use of ParameterCollection and use
19947         instead arrays of Parameters.
19948
19949         (GetParameterInfo): Use the Type, not the Name when resolving
19950         types. 
19951
19952 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19953
19954         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19955         and instead use public readonly fields.
19956
19957         * class.cs: Put back walking code for type containers.
19958
19959 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19960
19961         * class.cs (MakeConstant): Code to define constants.
19962
19963         * rootcontext.cs (LookupType): New function.  Used to locate types 
19964
19965
19966 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19967
19968         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19969         this System.Reflection code is.  Kudos to Microsoft
19970
19971         * typemanager.cs: Implement a type cache and avoid loading all
19972         types at boot time.  Wrap in LookupType the internals.  This made
19973         the compiler so much faster.  Wow.  I rule!
19974
19975         * driver.cs: Make sure we always load mscorlib first (for
19976         debugging purposes, nothing really important).
19977
19978         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19979         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19980
19981         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19982         on namespaces that have been imported using the `using' keyword.
19983
19984         * class.cs (TypeContainer::TypeAttr): Virtualize.
19985         (Class::TypeAttr): Return attributes suitable for this bad boy.
19986         (Struct::TypeAttr): ditto.
19987         Handle nested classes.
19988         (TypeContainer::) Remove all the type visiting code, it is now
19989         replaced with the rootcontext.cs code
19990
19991         * rootcontext.cs (GetClassBases): Added support for structs. 
19992
19993 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19994
19995         * interface.cs, statement.cs, class.cs, parameter.cs,
19996         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19997         Drop use of TypeRefs, and use strings instead.
19998
19999 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * rootcontext.cs: 
20002
20003         * class.cs (Struct::Struct): set the SEALED flags after
20004         checking the modifiers.
20005         (TypeContainer::TypeAttr): new property, returns the
20006         TypeAttributes for a class.  
20007
20008         * cs-parser.jay (type_list): Oops, list production was creating a
20009         new list of base types.
20010
20011         * rootcontext.cs (StdLib): New property.
20012         (GetInterfaceTypeByName): returns an interface by type name, and
20013         encapsulates error handling here.
20014         (GetInterfaces): simplified.
20015         (ResolveTree): Encapsulated all the tree resolution here.
20016         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20017         types. 
20018
20019         * driver.cs: Add support for --nostdlib, to avoid loading the
20020         default assemblies.
20021         (Main): Do not put tree resolution here. 
20022
20023         * rootcontext.cs: Beginning of the class resolution.
20024
20025 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20026
20027         * rootcontext.cs: Provide better error reporting. 
20028
20029         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20030
20031         * rootcontext.cs (CreateInterface): Handle the case where there
20032         are no parent interfaces.
20033
20034         (CloseTypes): Routine to flush types at the end.
20035         (CreateInterface): Track types.
20036         (GetInterfaces): Returns an array of Types from the list of
20037         defined interfaces.
20038
20039         * typemanager.c (AddUserType): Mechanism to track user types (puts
20040         the type on the global type hash, and allows us to close it at the
20041         end). 
20042
20043 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20044
20045         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20046         RecordInterface instead.
20047
20048         * cs-parser.jay: Updated to reflect changes above.
20049
20050         * decl.cs (Definition): Keep track of the TypeBuilder type that
20051         represents this type here.  Not sure we will use it in the long
20052         run, but wont hurt for now.
20053
20054         * driver.cs: Smaller changes to accomodate the new code.
20055
20056         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20057         when done. 
20058
20059         * rootcontext.cs (CreateInterface):  New method, used to create
20060         the System.TypeBuilder type for interfaces.
20061         (ResolveInterfaces): new entry point to resolve the interface
20062         hierarchy. 
20063         (CodeGen): Property, used to keep track of the code generator.
20064
20065 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20066
20067         * cs-parser.jay: Add a second production for delegate_declaration
20068         with `VOID'.
20069
20070         (enum_body): Put an opt_comma here instead of putting it on
20071         enum_body or enum_member_declarations so we can handle trailing
20072         commas on enumeration members.  Gets rid of a shift/reduce.
20073
20074         (type_list): Need a COMMA in the middle.
20075
20076         (indexer_declaration): Tell tokenizer to recognize get/set
20077
20078         * Remove old targets.
20079
20080         * Re-add the parser target.
20081
20082 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20083
20084         * cs-parser.jay: Add precendence rules for a number of operators
20085         ot reduce the number of shift/reduce conflicts in the grammar.
20086
20087 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20090         and put it here.
20091
20092         Get rid of old crufty code.
20093
20094         * rootcontext.cs: Use this to keep track of the parsed
20095         representation and the defined types available to the program. 
20096
20097         * gen-treedump.cs: adjust for new convention.
20098
20099         * type.cs: Split out the type manager, and the assembly builder
20100         from here. 
20101
20102         * typemanager.cs: the type manager will live here now.
20103
20104         * cil-codegen.cs: And the code generator here. 
20105
20106 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20107
20108         * makefile: Fixed up for easy making.
20109
20110 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20111
20112         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20113         the 
20114
20115         (unary_expression): Expand pre_increment_expression and
20116         post_decrement_expression to reduce a shift/reduce.
20117
20118 2001-07-11  Simon Cozens
20119
20120         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20121
20122         Improve allow_keyword_as_indent name.
20123
20124 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * Adjustments for Beta2. 
20127
20128 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20129
20130         * decl.cs: Added `Define' abstract method.
20131         (InTransit): new property, used to catch recursive definitions. 
20132
20133         * interface.cs: Implement `Define'. 
20134
20135         * modifiers.cs: Map Modifiers.constants to
20136         System.Reflection.TypeAttribute flags.
20137
20138         * class.cs: Keep track of types and user-defined types.
20139         (BuilderInit): New method for creating an assembly
20140         (ResolveType): New function to launch the resolution process, only
20141         used by interfaces for now.
20142
20143         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20144         that are inserted into the name space. 
20145
20146 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20147
20148         * ARGH.  I have screwed up my tree so many times due to the use of
20149         rsync rather than using CVS.  Going to fix this at once. 
20150
20151         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20152         load types.
20153
20154 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20155
20156         * Experiment successful: Use System.Type rather that our own
20157         version of Type.  
20158
20159 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20160
20161         * cs-parser.jay: Removed nsAliases from here.
20162
20163         Use new namespaces, handle `using XXX;' 
20164
20165         * namespace.cs: Reimplemented namespace handling, use a recursive
20166         definition of the class.  Now we can keep track of using clauses
20167         and catch invalid using clauses.
20168
20169 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20170
20171         * gen-treedump.cs: Adapted for all the renaming.
20172
20173         * expression.cs (Expression): this class now has a Type property
20174         which returns an expression Type.
20175
20176         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20177         `Type', as this has a different meaning now in the base
20178
20179 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20180
20181         * interface.cs, class.cs: Removed from all the sources the
20182         references to signature computation, as we can not do method
20183         signature computation during the parsing time, as we are not
20184         trying to solve at that point distinguishing:
20185
20186         class X {
20187                 void a (Blah x) {}
20188                 void a (NS.Blah x) {}
20189         }
20190
20191         Which depending on the context might be valid or not, as we do not
20192         know if Blah is the same thing as NS.Blah at that point.
20193
20194         * Redid everything so the code uses TypeRefs now instead of
20195         Types.  TypeRefs are just temporary type placeholders, that need
20196         to be resolved.  They initially have a pointer to a string and the
20197         current scope in which they are used.  This is used later by the
20198         compiler to resolve the reference to an actual Type. 
20199
20200         * DeclSpace is no longer a CIR.Type, and neither are
20201         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20202         are all DeclSpaces, but no Types. 
20203
20204         * type.cs (TypeRefManager): This implements the TypeRef manager,
20205         which keeps track of all the types that need to be resolved after
20206         the parsing has finished. 
20207
20208 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20209
20210         * ARGH.  We are going to have to store `foreach' as a class rather
20211         than resolving it, as we need to verify error 1579 after name
20212         resolution.   *OR* we could keep a flag that says `This request to
20213         IEnumerator comes from a foreach statement' which we can then use
20214         to generate the error.
20215
20216 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20217
20218         * class.cs (TypeContainer.AddMethod): we now add methods to the
20219         MethodGroup instead of the method hashtable.  
20220
20221         * expression.cs: Add MethodGroup abstraction, which gets us one
20222         step closer to the specification in the way we handle method
20223         declarations.  
20224
20225         * cs-parser.jay (primary_expression): qualified_identifier now
20226         tried to match up an identifier to a local variable reference or
20227         to a parameter reference.
20228
20229         current_local_parameters is now a parser global variable that
20230         points to the current parameters for the block, used during name
20231         lookup.
20232
20233         (property_declaration): Now creates an implicit `value' argument to
20234         the set accessor.
20235
20236 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20237
20238         * parameter.cs: Do not use `param' arguments as part of the
20239         signature, per the spec.
20240
20241 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20242
20243         * decl.cs: Base class for classes, structs and interfaces.  This
20244         is the "Declaration Space" 
20245
20246         * cs-parser.jay: Use CheckDef for checking declaration errors
20247         instead of having one on each function.
20248
20249         * class.cs: Factor out some code for handling error handling in
20250         accordance to the "Declarations" section in the "Basic Concepts"
20251         chapter in the ECMA C# spec.
20252
20253         * interface.cs: Make all interface member classes derive from
20254         InterfaceMemberBase.
20255
20256 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20257
20258         * Many things: all interfaces are parsed and generated in
20259         gen-treedump.  Support for member variables, constructors,
20260         destructors, properties, constants is there.
20261
20262         Beginning of the IL backend, but very little done, just there for
20263         testing purposes. 
20264
20265 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20266
20267         * cs-parser.jay: Fix labeled statement.
20268
20269         * cs-tokenizer.cs (escape): Escape " and ' always.
20270         ref_line, ref_name: keep track of the line/filename as instructed
20271         by #line by the compiler.
20272         Parse #line.
20273
20274 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20277         to match the values in System.CodeDOM.
20278
20279         Divid renamed to Divide.
20280
20281         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20282         statements. 
20283         (Statements.set): remove.
20284
20285         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20286         statements. 
20287
20288         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20289         falseStatements always have valid values. 
20290
20291         * cs-parser.jay: Use System.CodeDOM now.
20292